|
| 1 | +# Job preparation |
| 2 | + |
| 3 | +Using the cli directly isn't recommended, the supported way is through docker's entrypoint. |
| 4 | + |
| 5 | +The job preparation cli allows the user to run the secure job. It will gather the necessary informations using the info files before connecting to the supercomputer to run a template-generated sbatch file. |
| 6 | + |
| 7 | +``` |
| 8 | +usage: prepare_job.py [-h] --config CONFIG [--job-name JOB_NAME] --nodes NODES --partition PARTITION --time TIME --account ACCOUNT --nodelist NODELIST --workdir WORKDIR --application-info APPLICATION_INFO --data-info |
| 9 | + DATA_INFO --supplementary-input-scripts SUPPLEMENTARY_INPUT_SCRIPTS --supplementary-output-scripts SUPPLEMENTARY_OUTPUT_SCRIPTS |
| 10 | + [--singularity-supplementary-flags SINGULARITY_SUPPLEMENTARY_FLAGS] [--arguments ARGUMENTS] [--follow] |
| 11 | +
|
| 12 | +CLI Options |
| 13 | +
|
| 14 | +options: |
| 15 | + -h, --help show this help message and exit |
| 16 | + --config CONFIG Configuration file (INI Format) (default: /tmp/hpcs-client.conf) |
| 17 | + --job-name JOB_NAME, -J JOB_NAME |
| 18 | + name of the job |
| 19 | + --nodes NODES, -N NODES |
| 20 | + count of nodes on which to run |
| 21 | + --partition PARTITION, -p PARTITION |
| 22 | + partition requested |
| 23 | + --time TIME, -t TIME time limit |
| 24 | + --account ACCOUNT, -A ACCOUNT |
| 25 | + account to bill the job to |
| 26 | + --nodelist NODELIST, -w NODELIST |
| 27 | + request a specific list of hosts |
| 28 | + --workdir WORKDIR, -s WORKDIR |
| 29 | + directory to work in (LUMI-SD specific -> different from chdir) |
| 30 | + --application-info APPLICATION_INFO, -ai APPLICATION_INFO |
| 31 | + path to the info file for the image to run on supercomputer |
| 32 | + --data-info DATA_INFO, -di DATA_INFO |
| 33 | + path to the info file for the dataset to use on supercomputer |
| 34 | + --supplementary-input-scripts SUPPLEMENTARY_INPUT_SCRIPTS, -i SUPPLEMENTARY_INPUT_SCRIPTS |
| 35 | + path to your input verification scripts directory |
| 36 | + --supplementary-output-scripts SUPPLEMENTARY_OUTPUT_SCRIPTS, -o SUPPLEMENTARY_OUTPUT_SCRIPTS |
| 37 | + path to your output verification scripts directory |
| 38 | + --singularity-supplementary-flags SINGULARITY_SUPPLEMENTARY_FLAGS, -flags SINGULARITY_SUPPLEMENTARY_FLAGS |
| 39 | + supplementary arguments to pass to singularity |
| 40 | + --arguments ARGUMENTS, -args ARGUMENTS |
| 41 | + supplementary arguments to pass to the application |
| 42 | + --follow, -f Follow job's output (default : False) |
| 43 | +``` |
| 44 | + |
| 45 | +The standard command format would be like this : |
| 46 | + |
| 47 | +```bash |
| 48 | +python3 ./client/job_preparation/prepare_job.py [SLURM OPTIONS] --workdir [WORKDIR] --application-info [PATH TO INFO FILE] --data-info [PATH TO INFO FILE] --supplementary-input-scripts [PATH TO SUPPLEMENTARY SCRIPTS TO RUN BEFORE APPLICATION] --supplementary-output-scripts [PATH TO SUPPLEMENTARY SCRIPTS TO RUN AFTER APPLICATION] --singularity-supplementary-flags [FLAGS TO MANUALLY PASS TO SINGULARITY] --arguments [ARGUMENTS FOR THE FINAL APPLICATION] |
| 49 | +``` |
| 50 | + |
| 51 | +I.e : |
| 52 | + |
| 53 | +```bash |
| 54 | +python3 ./prepare_job.py -u etellier -N 1 -p standard -t "00:60:00" -A project_462000031 --nodelist nid001791 --workdir /scratch/project_462000031/etellier -ai /pfs/lustrep4/scratch/project_462000031/etellier/encrypted_prepared_jp2a.sif.info.yaml -di /pfs/lustrep4/scratch/project_462000031/etellier/encrypted_jp2a_input.tgz.info.yaml -args "\" /sd-container/encrypted/jp2a_input/image.png --width=100 --output=/sd-container/output/result \"" -i /pfs/lustrep4/scratch/project_462000031/etellier/verification_scripts -o /pfs/lustrep4/scratch/project_462000031/etellier/verification_scripts -flags "--env TERM=xterm-256color" -f |
| 55 | +``` |
| 56 | + |
| 57 | +Will create a slurm job with the following configuration : |
| 58 | +- 1 node (nid001791) |
| 59 | +- On partition "standard" |
| 60 | +- As etellier |
| 61 | +- for an hour |
| 62 | + |
| 63 | +Also : |
| 64 | +- HPCS will run the job using `/scratch/project_462000031/etellier` as its workdir |
| 65 | +- The application will be handled using info file at `/pfs/lustrep4/scratch/project_462000031/etellier/encrypted_prepared_jp2a.sif.info.yaml` |
| 66 | +- The application will be handled using info file at `/pfs/lustrep4/scratch/project_462000031/etellier/encrypted_jp2a_input.tgz.info.yaml` |
| 67 | +- "`--env TERM=xterm-256color`" will be passed to `singularity run` when creating the final container |
| 68 | +- The scripts available under the `/pfs/lustrep4/scratch/project_462000031/etellier/verification_scripts` directory will be mounted in the final container in order to run them before and after the container's application |
| 69 | +- `\" /sd-container/encrypted/jp2a_input/image.png --width=100 --output=/sd-container/output/result \"` will be passed to the `singularity run` command, i.e : `singularity run prepared_jp2a.sif -- \" /sd-container/encrypted/jp2a_input/image.png --width=100 --output=/sd-container/output/result \"` |
| 70 | +- The client will follow the output of the job, because of the `-f` flag |
| 71 | + |
| 72 | +For more information about the server configuration, see the [associated documentation](https://github.com/CSCfi/HPCS/tree/doc/readme_and_sequence_diagrams/docs/configuration/hpcs-client.md). |
0 commit comments