Add script to submit slices of runs for a proposal
Description
CLI tool that submits calibration jobs for runs in a proposal by their run number, so you don't have to look up the IDs on mymdc. Originally in its own package but copied over here instead.
Uses configs and some code from the webservice file, which is not installed as a package so there can't be an entry point for it. To run the script you need to be in the webservice directory. Help strings describe usage:
python3 ./manual_launch.py --help
usage: manual_launch.py [-h] --proposal PROPOSAL [--delay DELAY] [--noconfirm] [--really] slices [slices ...]
Manually submit calibration jobs.
positional arguments:
slices slices (or single numbers) of runs to process, inclusive range, starting at 1 (e.g. 1:3 parsed to {1, 2, 3}, 10 parsed to
{10}, :10 parsed to {1, 2, ..., 10})
optional arguments:
-h, --help show this help message and exit
--proposal PROPOSAL proposal number
--delay DELAY delay in seconds between submissions
--noconfirm skip confirmation
--really actually submit jobs instead of just printing them
To run in the background use `nohup PYTHONUNBUFFERED=1 python manual_launch.py ... &` followed by `disown`.
Slices inclusive, so 1:10
would mean runs 1 to 10 inclusive of 1 and 10. The 'slice' can also be a single number.
Example of usage would be python3 ./manual_launch.py 1 10:12 160:-1 --delay 60 --proposal 2222
to submit runs 1, 10 to 12, and 160+ for calibration, for proposal 2222, with a 60 second delay between submissions.
As mentioned in the CLI help output, you can use nohup and disown to run it in the background with a longer delay.
How Has This Been Tested?
Manually
Types of changes
- New feature (non-breaking change which adds functionality)
Checklist:
- My code follows the code style of this project.
- My change requires a change to the documentation.
-
I have updated the documentation accordingly.
Reviewers
Using my own calls with httpx to mymdc instead of the client is not ideal, but I already had that code lying around and couldn't figure out how to get the metadata client to give me all pages of the runs.
Run results are paginated to 100 runs per response, MetadataClient.get_proposal_runs
returns just the first page, same with Proposal.get_runs_by_proposal_number
, there are some get_all_runs...
methods but they don't seem to actually get all the runs as they require a run number(?) and I stopped digging into it after that point.
There was some code in this file already, should it be kept around somewhere else for reference? @ahmedk @danilevc