A simple job farmer for HPC platforms
Project description
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
main
branch.
Adding a new data center and a new system
- To add a new data center, create a new python file in
job_farmer/system
with the name of the data center in the filename (use lower case). - To add a new system, add a new
System
class that inherits fromSystem
in 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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file job_farmer-0.1.8.tar.gz
.
File metadata
- Download URL: job_farmer-0.1.8.tar.gz
- Upload date:
- Size: 24.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 975beb43f7c1003d88c228213432547fc56965844da3ea2ea26e7585cbfdb672 |
|
MD5 | 8c8f33de4912095dc4b911ce2a44afa5 |
|
BLAKE2b-256 | 21cecc5fd464d6b03972722c7d6e15e50db8557c3d05bde3d1e11ce0f13ff3dd |
File details
Details for the file job_farmer-0.1.8-py3-none-any.whl
.
File metadata
- Download URL: job_farmer-0.1.8-py3-none-any.whl
- Upload date:
- Size: 25.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9842f5d26b772db4351b259dce8d2335d5f5bba6314c703d141aae07dd41b13f |
|
MD5 | 0878acb725396c3d5ff34f20512a5854 |
|
BLAKE2b-256 | 353b4b6abb5b0694aa148548c261187ed291016921944bfac5d79ccf97350c80 |