Replies: 1 comment 1 reply
-
To upload artifacts to a newly created run, you can use a snippet like this one: ...
# upload_to should be a value like `path/code`
upload_to = upload_to or DEFAULT_UPLOADS_PATH
meta_info = {META_UPLOAD_ARTIFACTS: upload_to}
client = RunClient(owner=owner, project=project_name)
run_instance = client.create(
name=name,
description=description,
tags=tags,
content=op_spec,
is_managed=True,
meta_info=meta_info,
pending=V1RunPending.UPLOAD, # Very important to tell the server to wait for the upload to finish
)
...
# If path from then check if file otherwise it's local directory
is_file = os.path.isfile(path_from) if path_from else False
client = RunClient(owner=owner, project=project_name, run_uuid=run_instance.uuid)
if is_file:
response = client.upload_artifact(filepath=path_from, path=path_to, overwrite=True)
else:
response = client.upload_artifacts_dir(dirpath=path_from, path=path_to, overwrite=True, relative_to=path_from) |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
How to use the client to upload data/artifacts to the s3 bucket?
Beta Was this translation helpful? Give feedback.
All reactions