Skip to main content

Racetrack CLI client

racetrack-client is a CLI client tool for deploying and managing workloads in Racetrack.

Racetrack system allows to deploy jobs in a one step. It transforms your code to in-operation workloads, e.g. Kubernetes workloads. You write some code according to a set of coventions, you include the manifest file which explains the code, and you submit it to Racetrack. A short while after, the service calling your code is in operation.

Quickstart

# Install racetrack-client
python3 -m pip install --upgrade racetrack-client

# Set current remote
racetrack set remote https://racetrack.platform.example.com

# Log in with token
racetrack login T0k3n.g0es.H3r3
# Or log in with username
racetrack login --username admin

# Deploy a Job
racetrack deploy

Installation

Install racetrack-client using pip:

python3 -m pip install --upgrade racetrack-client

Python 3.8 (or higher) is required.

This will install racetrack CLI tool. Verify installation by running racetrack command.

Usage

Run racetrack --help to see usage.

Adding a remote

Assuming your Racetrack server is running on https://racetrack.platform.example.com/lifecycle, you can add this remote as an alias:

racetrack set alias my-dev https://racetrack.platform.example.com/lifecycle

Alias is a short, friendly name for the URL of your Racetrack server, which is also known as "remote". From now on, you can refer to your remote with an alias.

Switching remotes

Set your current remote with:

racetrack set remote my-dev

This will set up a "remote" context for later use.

Checking current remote

You can check your current remote with racetrack get remote.

A command racetrack get remote -q (with flag -q or --quiet) prints only the current address of Lifecycle (without other logs), which makes it usable for scripts. Likewise, a command racetrack get pub -q (with flag -q or --quiet) prints the current address of Pub service. "Quiet" mode is automatically applied when not in a TTY.

Logging in

Log in to Racetrack with your user account (you can get your token from the Dashboard's profile page):

racetrack login T0k3n.g0es.H3r3

Alternatively, command racetrack login --username <username> allows you to log in with your username and password (entered into the standard input) and saves the auth token without having to visit the Dashboard page.

In case you're going to use a private repository, provide your git credentials so the job can be built from your code:

racetrack set credentials https://github.com/YourUser/YourRepository USERNAME TOKEN

Installing plugins

Extend Racetrack's possibilities by installing a bunch of plugins:

# This plugin allows you to deploy jobs written in Python
racetrack plugin install github.com/TheRacetrack/plugin-python-job-type

# This plugin allows you to deploy jobs to a local Docker infrastructure
racetrack plugin install github.com/TheRacetrack/plugin-docker-infrastructure

Plugins can only be installed by admin users.

Deploying a job

When your code is ready and you pushed your changes to a repository, it's time to deploy it; that means, upload it to Racetrack so it can become a proper running Job.

To deploy a job, just run it in the place where job.yaml is located:

cd MuffinDestroyer
racetrack deploy 

You will see the URL of your deployed job in the output.

Listing jobs

You can see the list of all deployed jobs with a command:

racetrack list

Checking runtime logs

Check the logs of a running job by means of:

racetrack logs MuffinDestroyer

Deleting a job

Delete your running job with:

racetrack delete MuffinDestroyer

Extra vars

Manifest values can be overriden with key-value pairs coming from a command line. It doesn't modify actual file, but its one-time, in-memory version before submitting it. Racetrack client has --extra-vars KEY=VALUE parameter (or -e in short) that overwrites values found in YAML manifest.

  • KEY is the name of field and it can contain dots to refer to a nested field, for example git.branch=master
  • VALUE can be any YAML or JSON object.

Extra vars parameters can be used multiple times in one command.

Example:

racetrack deploy -e secret_runtime_env_file=.env.local -e git.branch=$(git rev-parse --abbrev-ref HEAD)

It makes CLI commands more script-friendly, so you can overwrite manifest without tracking changes in job.yaml file.
Tip: Use racetrack validate command beforehand to make sure your final manifest is what you expected.

Getting auth token

Command racetrack get auth-token prints out current auth token. It can be used in CLI scripts: curl -H "X-Racetrack-Auth: $(racetrack get auth-token)"

Metadata

Release files for racetrack-client 2.35.1

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

Source distribution (sdist)

Source distribution for racetrack-client 2.35.1
File Size Uploaded Provenance Actions
racetrack_client-2.35.1.tar.gz 45.6 kB Without provenance Details for racetrack_client-2.35.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for racetrack-client 2.35.1
File Interpreter ABI Platform Actions
racetrack_client-2.35.1-py3-none-any.whl Python 3 none any Details for racetrack_client-2.35.1-py3-none-any.whl

Total release size: 103.6 kB

Release files / racetrack_client-2.35.1.tar.gz

Download URL racetrack_client-2.35.1.tar.gz
Size 45.6 kB
Tags Source
SHA-256 checksum
How to use checksums
55959a96a710b083e8637e66e21073fd3feffcebe69b436c5abe5dae265bc2ec
BLAKE2b-256 checksum
How to use checksums
e252aaf480d2f26cd9688136238a4023c339a23009cb250f5839935996ff74f5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.5

Release files / racetrack_client-2.35.1-py3-none-any.whl

Download URL racetrack_client-2.35.1-py3-none-any.whl
Size 58.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bf30f3d973d1de352d93d20d0bbfd5ea2cab9b0702e34f2836d3a5de647070f6
BLAKE2b-256 checksum
How to use checksums
769aff8e1b95ce279f438208f9f2077bcfa1d9f11b12c54cab7c59cc8a5f8e3a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.5

Security for racetrack-client 2.35.1

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2.35.1 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