Skip to content
\n

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().

\n

To correct creation process with an upload should be:

\n
from 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()
","upvoteCount":1,"url":"https://github.com/orgs/polyaxon/discussions/1476#discussioncomment-2522807"}}}

Programmatic upload and start an operation without CLI #1476

Discussion options

You must be logged in to vote

To start the operation and remove the pending state, you need to call client.approve().

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()

Replies: 1 comment

Comment options

You must be logged in to vote
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
Category
Q&A
Labels
None yet
1 participant