The ROMI task runner, a luigi based task pipeline.
Project description
RomiTask
About
This repository gathers CLI and classes needed to run luigi based tasks for the ROMI project.
Alone, this library does not do much...
To run a "meaningful" task you need to install other ROMI libraries like plantdb and plant-3d-vision
or plant-imager.
Note that both plant-3d-vision & plant-imager ROMI libraries have romitask & plantdb as git submodules.
Installation
We strongly advise to create isolated environments to install the ROMI libraries.
We often use conda as an environment and python package manager.
If you do not yet have miniconda3 installed on your system, have a look here.
The romitask package is available from the romi-eu channel.
Existing conda environment
To install the romitask conda package in an existing environment, first activate it, then proceed as follows:
conda install romitask -c romi-eu
New conda environment
To install the romitask conda package in a new environment, here named romi, proceed as follows:
conda create -n romi romitask -c romi-eu
Installation from sources
To install this library, simply clone the repo and use pip to install it and the required dependencies.
Again, we strongly advise to create a conda environment.
All this can be done as follows:
git clone https://github.com/romi/romitask.git -b dev # git clone the 'dev' branch of romitask
cd romitask
conda create -n romi 'python =3.10'
conda activate romi # do not forget to activate your environment!
python -m pip install -e . # install the sources
Note that the -e option is to install the romitask sources in "developer mode".
That is, if you make changes to the source code of romitask you will not have to pip install it again.
You may want to install the plantdb sources to perform the DummyTask test example below:
conda activate romi # do not forget to activate your environment!
python -m pip install git+https://github.com/romi/plantdb.git@dev#egg=plantdb # install the `plantdb` sources from 'dev' branch
This will install the required ROMI library plantdb, but not in "developer mode".
Usage
Create a dummy database
To quickly create a dummy database, let's use the temporary folder /tmp:
mkdir -p /tmp/dummy_db/dummy_dataset # create dummy database and dataset
touch /tmp/dummy_db/romidb # add the romidb marker (empty file)
export DB_LOCATION='/tmp/dummy_db' # add database location as an environment variable, 'DB_LOCATION', to current shell
Test the CLI with DummyTask
To test the CLI romi_run_task:
romi_run_task DummyTask $DB_LOCATION/dummy_dataset
You should get a "Luigi Execution Summary" similar to this:
===== Luigi Execution Summary =====
Scheduled 1 tasks of which:
* 1 ran successfully:
- 1 DummyTask(scan_id=)
This progress looks :) because there were no failed tasks or missing dependencies
===== Luigi Execution Summary =====
As no TOML configuration file was provided, you should get a pipeline.toml with only a retcode and a version
sections at the root of the dummy_dataset/ directory.
The dummy_database tree structure should look like this:
dummy_database/
├── dummy_dataset/
│ ├── DummyTask__**********/
│ ├── files.json
│ ├── metadata/
│ │ └── DummyTask__**********.json
│ └── pipeline.toml
└── romidb
Developers & contributors
You first have to install the library from sources as explained here.
Conda packaging
Start by installing the required conda-build & anaconda-client conda packages in the base environment as follows:
conda install -n base conda-build anaconda-client
Build a conda package
To build the romitask conda package, from the root directory of the repository and the base conda environment, run:
conda build conda/recipe/ -c conda-forge --user romi-eu
If you are struggling with some of the modifications you made to the recipe, notably when using environment variables or Jinja2 stuffs, you can always render the recipe with:
conda render conda/recipe/
The official documentation for conda-render can be found here.
Upload a conda package
To upload the built packages, you need a valid account (here romi-eu) on anaconda.org & to log ONCE
with anaconda login, then:
anaconda upload ~/miniconda3/conda-bld/linux-64/romitask*.tar.bz2 --user romi-eu
Clean builds
To clean the source and build intermediates:
conda build purge
To clean ALL the built packages & build environments:
conda build purge-all
Documentation
We use mkdocs to build the documentation with mkdocs-material theme.
The API documentation is generated by mkdocstrings.
Also, we use markdown-exec to execute some code snippets to generate output parsed in Markdown.
Finally, you may want to check the pymdown-extensions documentation.
Requirements
To install the requirements for documentation edition, simply run:
python -m pip install -e .[doc]
Live edit
You can edit the documentation, mkdocs.yaml and the docs directory, and see the changes live by using:
mkdocs serve
You should see some logging and this message, indicating where to view it:
INFO - [14:39:21] Serving on http://127.0.0.1:8000/
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file romitask-0.12.1.tar.gz.
File metadata
- Download URL: romitask-0.12.1.tar.gz
- Upload date:
- Size: 35.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1144350bd3bbf61b36b2b31d096cc523dd768104f1e825270fec31dc738a66af
|
|
| MD5 |
efba081172abf275f3a4f8bc6e95a495
|
|
| BLAKE2b-256 |
9c77a2278187a4f50140f6fb83ffa805055e4acd777a9cabb041971a9f0a2cd5
|
Provenance
The following attestation bundles were made for romitask-0.12.1.tar.gz:
Publisher:
pip_build.yml on romi/romitask
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
romitask-0.12.1.tar.gz -
Subject digest:
1144350bd3bbf61b36b2b31d096cc523dd768104f1e825270fec31dc738a66af - Sigstore transparency entry: 188226909
- Sigstore integration time:
-
Permalink:
romi/romitask@90eb0d95aaaad551b2c4707b8f73bfc341dfe58c -
Branch / Tag:
refs/heads/dev - Owner: https://github.com/romi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pip_build.yml@90eb0d95aaaad551b2c4707b8f73bfc341dfe58c -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file romitask-0.12.1-py3-none-any.whl.
File metadata
- Download URL: romitask-0.12.1-py3-none-any.whl
- Upload date:
- Size: 39.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
421a8d86818e1bee4fbc12252c2036342f23c27f0e7d41f8d6dcc4f0c56ed460
|
|
| MD5 |
f1d91dd4addd8d4f86518cc215862d30
|
|
| BLAKE2b-256 |
d136bb873ac159cc441ef043a0c678e961aed70831a090c55f6c2b0e2c77d9bc
|
Provenance
The following attestation bundles were made for romitask-0.12.1-py3-none-any.whl:
Publisher:
pip_build.yml on romi/romitask
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
romitask-0.12.1-py3-none-any.whl -
Subject digest:
421a8d86818e1bee4fbc12252c2036342f23c27f0e7d41f8d6dcc4f0c56ed460 - Sigstore transparency entry: 188226910
- Sigstore integration time:
-
Permalink:
romi/romitask@90eb0d95aaaad551b2c4707b8f73bfc341dfe58c -
Branch / Tag:
refs/heads/dev - Owner: https://github.com/romi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pip_build.yml@90eb0d95aaaad551b2c4707b8f73bfc341dfe58c -
Trigger Event:
workflow_dispatch
-
Statement type: