Programmatic upload and start an operation without CLI #1476
Answered
by
polyaxon-team
polyaxon-team
asked this question in
Q&A
-
I am using the python run client and am trying to use 'pending' correctly. Here is an example of my code: client = RunClient(owner="owner", project="project")
client.create(content=operation, pending='upload')
client.upload_artifacts_dir('./') I can see in the UI a new job is created, the artifacts have been uploaded correctly but in the info panel pending is still in the 'upload' state and the status remains as 'created'.How do I progress the job / remove the pending status after the upload has occurred? |
Beta Was this translation helpful? Give feedback.
Answered by
polyaxon-team
Apr 7, 2022
Replies: 1 comment
-
To start the operation and remove the To correct creation process with an upload should be: from polyaxon.schemas import V1RunPending
from polyaxon.constants.globals import DEFAULT_UPLOADS_PATH
from polyaxon.constants.metadata import META_UPLOAD_ARTIFACTS
meta_info = {}
meta_info[META_UPLOAD_ARTIFACTS] = DEFAULT_UPLOADS_PATH # or a custom path if you pass a custom upload to path
# 1. Create
client.create(content=operation, meta_info=meta_info, pending=V1RunPending.UPLOAD)
# 2. Upload
client.upload_artifacts_dir('./')
# 3. Approve
client.approve() |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
polyaxon-team
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To start the operation and remove the
pending
state, you need to callclient.approve()
.To correct creation process with an upload should be: