Python package that facilitates ML model training and inference on Nautilus platform and other kubernetes clusters.
Project description
seaQuest
seaQuest is a python package that automates the process of executing machine learning experiments on a kubernetes cluster.
Usage
Install the module and it's dependencies via PyPI.
python -m pip install seaquest
Or install from source:
git clone https://github.com/IancuOnescu/seaQuest.git
cd seaquest
pip install -e .
Requirements
- Python 3.9+
- Access to a Kubernetes cluster
kubectlconfigured
Running the experiments:
- Define a model that inherits the NautPipelineModel class. This means that the model needs to define two functions: train and infer. The one not used for the experiments can be left empty. Make sure that all file saving is done using the OutputContext context switch
- Create a configuration file with all the required parameters. For more information on this please refer to the official documentation
- Call the experiment module
python -m seaquest.experiment -cf config_file.yaml --other_params
Pulling the outputs:
After the job launching is done you can pull the output of the experiments by calling the monitor module
python -m seaquest.monitor -cf config_file.yaml -od path/to/output_dir --other_params
Workflow
seaQuest takes as input a number of command line arguments as well as a configuration file. These specify the details that control the creation of kubernetes resources. With these arguments in mind the seaQuest pipeline follows the next steps:
- Validate the provided arguments
- Upload the specified model and data files to the k8s cluster. 2.0. Generate an additional config used for the cluster side runner. 2.1. Create a Persistent Volume Claim (PVC) with the specified name. (skip creation if it already exists) 2.2. Launch a Pod. 3.2. Copy the files to the PVC through the created Pod 3.3. Delete the launched Pod
- Launch jobs that execute the specified model function (train or infer)
When calling the monitor module of the package the pipeline follows the next steps:
- Validate the provided arguments
- Start monitoring the status of the provided jobs
- If a job reaches the Finished status attempt to pull the output files 3.1. Launch a Pod. 3.2. Copy the files from the output directory to the user's local machine 3.3. Delete the Pod
- Delete the jobs that have reached the Finished status and wait for the others.
The monitor module looks for the output files in a directory on the PVC mount created by the job. This means that the model must use the OutputContext context switch in order to ensure that all of the files are correctly pulled.
Targeted ML Frameworks
The Docker Image used currently provides a PyTorch + Huggingface environment. A user can specify additional depdencies through a requirements.txt file, placed in the root of the directory where the model used for experiments is located.
Logging
The package uses extensive logging both on and off the server. Logging is not overwritten, but appended.
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 seaquest-0.0.1.tar.gz.
File metadata
- Download URL: seaquest-0.0.1.tar.gz
- Upload date:
- Size: 23.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e2dd1b6a6660f2edfa8358d3aac6e9442da5b885923460cbbca648209d212eb0
|
|
| MD5 |
7fbb3349088b6d28ac3def3cf0b20932
|
|
| BLAKE2b-256 |
ea7ec62aa4ed749311905a9f324d7c1dc6475b91f76ce2b8f0156c317746e99d
|
File details
Details for the file seaquest-0.0.1-py3-none-any.whl.
File metadata
- Download URL: seaquest-0.0.1-py3-none-any.whl
- Upload date:
- Size: 20.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7b2b70383f83d26cd4e5b475460ea53f86a4caadadd9cf1eddc59a40ee190273
|
|
| MD5 |
592b27756db9a9cdf8280b47ef82e0aa
|
|
| BLAKE2b-256 |
4273da4729ce31712fb8cd042a6828432c7d5da075b917ddea7bca67eef23a5f
|