Skip to main content

Nuvla Job Engine

UnitTests and Build Docker Dev. Image

This repository contains the code and configuration for the Job engine, packaged as a Docker container.

Nuvla job engine use cimi job resource and zookeeper as a locking queue. It's done in a way to be horizontally scalled on different nodes.

Artifacts

  • nuvla/job:<version>. A Docker container that can be obtained from the nuvla/job repository in Docker Hub. The tags indicate the release number.

Contributing

Source Code Changes

To contribute code to this repository, please follow these steps:

  1. Create a branch from main with a descriptive, kebab-cased name to hold all your changes.

  2. Follow the developer guidelines concerning formatting, etc. when modifying the code.

  3. Once the changes are ready to be reviewed, create a GitHub pull request. With the pull request, provide a description of the changes and links to any relevant issues (in this repository or others).

  4. Ensure that the triggered CI checks all pass. These are triggered automatically with the results shown directly in the pull request.

  5. Once the checks pass, assign the pull request to the repository coordinator (who may then assign it to someone else).

  6. Interact with the reviewer to address any comments.

When the reviewer is happy with the pull request, he/she will "squash & merge" the pull request and delete the corresponding branch.

Code Formatting

The bulk of the code in this repository is written in Python.

The formatting follows the coding style in defined in PEP 8.

Job engine behavior

  • Each action should be distributed by a standalone distributor
  • More than one distributor for the same action can be started but only one will be elected to distribute the job
  • Executor load actions dynamically at startup time
  • Zookeeper is used as a Locking queue containing only job uuid in /job/entries
  • Running jobs are put in zookeeper under /job/taken
  • If executor is unable to communicate with CIMI, the job in running state is released (put back in zookeeper queue).
  • The action implementation should take care to continue or to make the cleanup of a running interrupted job
  • If the connection break with zookeeper, job in exection will be released automatically. This is because /job/taken entries are ephemeral nodes.
  • Stopping the executor will try to make a proper shuttdown by waiting 2 minutes before killing the process. Each thread that terminate his running action will not take a new one.

Running unit tests

Before running unit tests with tox you need to generate requirements file out. To do so, we first need to generate the test requirements file. This is done using poetry requirements exporter which can be installed as follows:

pip install poetry poetry-plugin-export

Then run export command:

poetry export -f requirements.txt -o requirements.test.txt --without-hashes --without-urls --with test --with server

Then run the unit tests with:

tox

Locally Building Job Engine

Before running docker build you need to generate requirements file and the wheel package. To do, install poetry and poetry-plugin-export as described above and then run:

poetry build --format=wheel
poetry export -f requirements.txt -o dist/requirements.txt --without-hashes --without-urls --with server

The order of the commands might be important since the requirements file output goes into dist/ directory which is created by the first command.

Then building the image requires the following command:

export JOB_ENGINE_VERSION=$(poetry version -s)
docker build --build-arg="PACKAGE_TAG=${JOB_ENGINE_VERSION}" -t local/job:${JOB_ENGINE_VERSION} .

Copyright © 2019-2024, SixSq SA

License

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Metadata

Release files for nuvla-job-engine 5.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nuvla-job-engine 5.1.4
File Size Uploaded Provenance
nuvla_job_engine-5.1.4.tar.gz 82.9 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for nuvla-job-engine 5.1.4
File Interpreter ABI Platform
nuvla_job_engine-5.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 211.9 kB

Release files / nuvla_job_engine-5.1.4.tar.gz

Download URL nuvla_job_engine-5.1.4.tar.gz
Size 82.9 kB
Tags Source
SHA-256 checksum
How to use checksums
42bc90eb2e0155c970b575441e4f43875393d24d73b46342baefa6d159d1e767
BLAKE2b-256 checksum
How to use checksums
f71c2389f0df78ecc5181763718099729384a7e88fb5311cfc745a8b762b8f31
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.4 CPython/3.11.13 Linux/6.11.0-1018-azure

Release files / nuvla_job_engine-5.1.4-py3-none-any.whl

Download URL nuvla_job_engine-5.1.4-py3-none-any.whl
Size 129.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c3cac903da3738a924569a00a0ed21047c3c3c23d045e5c02c10b25a2a5d6bb6
BLAKE2b-256 checksum
How to use checksums
ed27bfc18755b80b07b9dad304a933c8303832ed04f44614fbea1ea5754ce0d6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.4 CPython/3.11.13 Linux/6.11.0-1018-azure

Security for nuvla-job-engine 5.1.4

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.

Release history Release notifications | RSS feed

This release

5.1.4 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page