Job Farmer
Description
Job Farmer is a python API designed to prepare jobs for HPC platforms supporting SLURM. It collects the job configurations of the associated tasks and prepares the task list and slurm configuration files based on the system constraints and the required resources.
Installation
From PyPI
pip install job-farmer
From sources
git clone git@gitlab.com:riffard/job_farmer.git
cd job_farmer
pip install .
Usage
Job configuration
In the file test/simple_job.py, we are showing a simple job submission.
First, you import the job-farmer:
import job_farmer
Then you create the System object (NERSC/CORI-Haswell in this example) and the Farmer object
system = job_farmer.CoriHaswell()
farmer = job_farmer.Farmer(system)
The nex step consists on creation the JobConfiguration and add it to the Farmer:
job_configuration = job_farmer.JobConfiguration(name='test_job',
account='your_account',
queue='queue',
duration='xx:xx:xx')
farmer.add_global_job_configuration(job_configuration)
You add the Tasks to the Farmer and you link them to the job_configuration
task = job_farmer.Task(commands=[f'export MY_MESSAGE="Hello World!"',
'echo "${MY_MESSAGE}"'],
n_threads=1)
farmer.add_task(job_configuration.name, task)
And it builds the task list and the slurm configuration file:
farmer.build()
Finally, you can submit the jobs to the batch system using:
farmer.submit(dry_run = False)
(by default, dry_run = True).
Note: By default, the job-farmer logs are not displayed.
To display them, you need to import the logging package and set the log level to logging.INFO such as:**
logging.basicConfig(level=logging.INFO)
Running jobs
Job runner
Batch submission
Support
If you are encountering any issue, please open a git issue: here
Contributing
Any contribution is more than welcome. To add any new feature, please follow this procedure:
- Create a git issue here
- Create a new branch with the following format:
[initials]_[feature title]_issue_[issue number]. - Once the development is nearly completed, push the branch to the repository and create a merge request with the following guideline:
- The MR title must contain a short feature/bugfix description
- The MR description must contain a detailed description of the feature/bug fix. Add here any relevant resources.
- After reviewing the merge request, it will be merged to the
mainbranch.
Adding a new data center and a new system
- To add a new data center, create a new python file in
job_farmer/systemwith the name of the data center in the filename (use lower case). - To add a new system, add a new
Systemclass that inherits fromSystemin the correct data center file. To see an example, take a look atjob_farmer/system/nersc.py
License
This software is licenced under: GNU Affero General Public License v3.0
Metadata
Release files for job-farmer 0.1.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| job_farmer-0.1.8.tar.gz | 24.7 kB | Without provenance | Details for job_farmer-0.1.8.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| job_farmer-0.1.8-py3-none-any.whl | Python 3 | none | any | Details for job_farmer-0.1.8-py3-none-any.whl |
Total release size: 50.4 kB
Release files / job_farmer-0.1.8.tar.gz
| Download URL | job_farmer-0.1.8.tar.gz |
|---|---|
| Size | 24.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
975beb43f7c1003d88c228213432547fc56965844da3ea2ea26e7585cbfdb672
|
|
BLAKE2b-256 checksum How to use checksums |
21cecc5fd464d6b03972722c7d6e15e50db8557c3d05bde3d1e11ce0f13ff3dd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.5
|
Release files / job_farmer-0.1.8-py3-none-any.whl
| Download URL | job_farmer-0.1.8-py3-none-any.whl |
|---|---|
| Size | 25.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9842f5d26b772db4351b259dce8d2335d5f5bba6314c703d141aae07dd41b13f
|
|
BLAKE2b-256 checksum How to use checksums |
353b4b6abb5b0694aa148548c261187ed291016921944bfac5d79ccf97350c80
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.5
|
Security for job-farmer 0.1.8
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.