Skip to main content

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
  • kubectl configured

Running the experiments:

  1. 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
  2. Create a configuration file with all the required parameters. For more information on this please refer to the official documentation
  3. 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:

  1. Validate the provided arguments
  2. 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
  3. 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:

  1. Validate the provided arguments
  2. Start monitoring the status of the provided jobs
  3. 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
  4. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

seaquest-0.0.1.tar.gz (23.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

seaquest-0.0.1-py3-none-any.whl (20.5 kB view details)

Uploaded Python 3

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

Hashes for seaquest-0.0.1.tar.gz
Algorithm Hash digest
SHA256 e2dd1b6a6660f2edfa8358d3aac6e9442da5b885923460cbbca648209d212eb0
MD5 7fbb3349088b6d28ac3def3cf0b20932
BLAKE2b-256 ea7ec62aa4ed749311905a9f324d7c1dc6475b91f76ce2b8f0156c317746e99d

See more details on using hashes here.

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

Hashes for seaquest-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7b2b70383f83d26cd4e5b475460ea53f86a4caadadd9cf1eddc59a40ee190273
MD5 592b27756db9a9cdf8280b47ef82e0aa
BLAKE2b-256 4273da4729ce31712fb8cd042a6828432c7d5da075b917ddea7bca67eef23a5f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page