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?
","upvoteCount":1,"answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"To start the operation and remove the pending
state, you need to call client.approve()
.
To correct creation process with an upload should be:
\nfrom polyaxon.schemas import V1RunPending\nfrom polyaxon.constants.globals import DEFAULT_UPLOADS_PATH\nfrom polyaxon.constants.metadata import META_UPLOAD_ARTIFACTS\n\nmeta_info = {}\nmeta_info[META_UPLOAD_ARTIFACTS] = DEFAULT_UPLOADS_PATH # or a custom path if you pass a custom upload to path \n# 1. Create\nclient.create(content=operation, meta_info=meta_info, pending=V1RunPending.UPLOAD)\n# 2. Upload\nclient.upload_artifacts_dir('./')\n# 3. Approve\nclient.approve()
Programmatic upload and start an operation without CLI #1476
-
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.
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.
To start the operation and remove the
pending
state, you need to callclient.approve()
.To correct creation process with an upload should be: