Skip to content
\n

Long story short is that lot of my jobs finished working with status \"Running\". Don't know why, but in logs I see they finished.
\nSo I decided to stop them manually, and I see \"Stopping\".
\nSome jobs are being stopped but did not change status
\nSo I want to clean that and \"update the status\" manually --> let's mark them as stopped.

","upvoteCount":1,"answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"

The first thing is the check the release notes with this kind of problems, as the issue could have been solved in subsequent releases.

\n

Now going back to the solution, It's better to use client to iterate over the runs and mark them as finished:

\n
from polyaxon.client import ProjectClient\n\npclient = ProjectClient(project=\"PROJECT_NAME\")\nfor r in pclient.list_runs(query=\"status: stopping\").results:\n    print(\"cleaning {}\".format(r.uuid)\n    RunClient(\"PROJECT_NAME\", run_uuid=r.uuid).log_stopped(message=\"manual cleaning\")
","upvoteCount":1,"url":"https://github.com/orgs/polyaxon/discussions/1478#discussioncomment-2523093"}}}

Update jobs status from CLI or Client #1478

Discussion options

You must be logged in to vote

The first thing is the check the release notes with this kind of problems, as the issue could have been solved in subsequent releases.

Now going back to the solution, It's better to use client to iterate over the runs and mark them as finished:

from polyaxon.client import ProjectClient

pclient = ProjectClient(project="PROJECT_NAME")
for r in pclient.list_runs(query="status: stopping").results:
    print("cleaning {}".format(r.uuid)
    RunClient("PROJECT_NAME", run_uuid=r.uuid).log_stopped(message="manual cleaning")

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