Skip to content

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