Skip to content

[Python API] Return job_id on sky.jobs.launch #4620

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jan 29, 2025
Merged

Conversation

romilbhardwaj
Copy link
Collaborator

@romilbhardwaj romilbhardwaj commented Jan 29, 2025

User report: it's hard to get job_id after submitting job with python API, requires correlating against jobs.queue and gets even harder is submitting concurrent jobs.

This PR returns job_id and handle from sky.jobs.launch().

Tested (run the relevant ones):

  • Code formatting: bash format.sh
  • Manual python script
import sky

task = sky.Task(
    name='test',
    run='echo "Hello, World!"'
)

job_id = sky.jobs.launch(task=task)
print(job_id)

job_id = sky.jobs.launch(task=task)
print(job_id)

Copy link
Collaborator

@Michaelvll Michaelvll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @romilbhardwaj!

@romilbhardwaj romilbhardwaj merged commit bebed53 into master Jan 29, 2025
18 checks passed
@romilbhardwaj romilbhardwaj deleted the jobs_return_jobid branch January 29, 2025 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants