Jetset launcher for Python services — OpenTelemetry + typed config with local/k8s parity
Project description
jetpack-launcher-py
One-line launcher for Python services on the Jetset platform. Wires OpenTelemetry (traces + metrics + logs), typed configuration, structured logging, and graceful shutdown — with the same code path locally and in Kubernetes.
pip install jetpack-launcher-py
from jetpack import init_jetpack
init_jetpack()
That's it. Whatever framework you're using, whatever cloud you're on, whatever backend the platform team picked — the service code never has to know.
What it does at v0.1
- Detects runtime: local (laptop, docker) vs Kubernetes
- Loads
.env.localand.env.local-{flavor}when running locally - In k8s, reads env vars populated by ConfigMap + ExternalSecret — no filesystem reads
- Validates a typed
Config(Pydantic) and fails fast on missing keys - Builds an OpenTelemetry
Resourcewithservice.*,deployment.*, andk8s.*attributes - Initializes Tracer / Meter / Logger providers with OTLP exporters
- Bridges stdlib
loggingto structured JSON + OTel Logs withtrace_id/span_idauto-injection - Registers SIGTERM + atexit handlers that flush telemetry before exit
The env model — one mental model, two backends
LOCAL KUBERNETES
──────────────── ───────────────────────────
.env.local ←─ optional ConfigMap (literals + ${param:…})
.env.local-{flavor} ←─ optional ExternalSecret (${secret:…})
│ │
▼ ▼
os.environ
│
▼
Config(BaseSettings)
│
▼
your service code
The service reads Config. The launcher decides where the values came from.
Detection rules
JETPACK_RUNTIME=local|k8soverrides everythingKUBERNETES_SERVICE_HOSTset → k8s (set by kubelet)- otherwise → local
Local env files (gitignored)
.env.local— universal local overrides (often committed if it contains only non-secret defaults; otherwise gitignored).env.local-{flavor}— flavor-specific, picked byJETPACK_ENV(defaultdev). Always gitignored.
JETPACK_ENV=dev python -m src.main # loads .env.local + .env.local-dev
JETPACK_ENV=prod python -m src.main # loads .env.local + .env.local-prod
In k8s, .env.local* files are never read — the deployment supplies env
vars via envFrom: [configMapRef, secretRef] and the launcher detects k8s.
Quick start
pip install jetpack-launcher-py
# src/configs/loader.py — your service's typed config
from jetpack import JetpackConfig
class Config(JetpackConfig):
DB_HOST: str | None = None
DB_PORT: int | None = None
# add more — Pydantic validates at startup
# src/main.py
from jetpack import init_jetpack, get_tracer
from src.configs import Config
handle = init_jetpack(config_class=Config)
tracer = get_tracer(__name__)
with tracer.start_as_current_span("startup"):
... # your service main loop
Public API (stable)
from jetpack import (
init_jetpack, # the one entry point
JetpackConfig, # base Config class — subclass for your service
JetpackHandle, # what init_jetpack returns
Runtime, # enum: LOCAL | K8S
RuntimeInfo, # detection result
get_tracer, # opentelemetry.trace.get_tracer
get_meter, # opentelemetry.metrics.get_meter
)
Roadmap
- v0.2 — Flask & FastAPI adapters; resource detectors for ECS / GKE / Cloud Run
- v0.3 — Secret resolver plugin; PII redaction policy;
--dry-runmode - v0.4 — OpenFeature feature flag bootstrap
- v0.5 — HTTP client factory + JWT auth plugin
- v0.6 — AI cost / token tracking for OpenAI, Anthropic
See CHANGELOG.md for shipped releases.
Contributing
See CONTRIBUTING.md. Security reports go to security@getjetpack.cloud — see SECURITY.md.
Releasing (maintainers only)
Releases are automated via GitHub Actions and PyPI Trusted Publishing:
- Bump
versioninpyproject.tomland add a## [x.y.z]section inCHANGELOG.mddescribing the changes. - Commit and merge to
main. - Tag and push:
git tag v0.1.0 git push origin v0.1.0
- The
release.ymlworkflow builds the distribution, publishes to TestPyPI for sanity-check, then publishes to PyPI and cuts a GitHub Release with auto-generated notes.
The first release requires a maintainer to configure PyPI Trusted
Publishing on both pypi.org
and test.pypi.org
pointing at this repo / release.yml / environments pypi and testpypi.
License
Licensed under the Apache License, Version 2.0 — see LICENSE and NOTICE. All contributions are accepted under the same terms.
Copyright © 2026 Jetset.
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 jetpack_launcher_py-0.1.0.tar.gz.
File metadata
- Download URL: jetpack_launcher_py-0.1.0.tar.gz
- Upload date:
- Size: 23.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e74ac6703e46a5915b4841e36b36517489fd225f555019dd36480a05bcfeaf39
|
|
| MD5 |
b8f7b50145a9e75cf78e31339687fa56
|
|
| BLAKE2b-256 |
b5cd42c90b7bad17957106906cdab9abb7710b343bb5bfb75ac73dd2445f23f2
|
Provenance
The following attestation bundles were made for jetpack_launcher_py-0.1.0.tar.gz:
Publisher:
release.yml on getjetpack/jetpack-launcher-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
jetpack_launcher_py-0.1.0.tar.gz -
Subject digest:
e74ac6703e46a5915b4841e36b36517489fd225f555019dd36480a05bcfeaf39 - Sigstore transparency entry: 1688568321
- Sigstore integration time:
-
Permalink:
getjetpack/jetpack-launcher-py@582b0426ccf640071e7f3f0bac652d1bc9eaffb4 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/getjetpack
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@582b0426ccf640071e7f3f0bac652d1bc9eaffb4 -
Trigger Event:
push
-
Statement type:
File details
Details for the file jetpack_launcher_py-0.1.0-py3-none-any.whl.
File metadata
- Download URL: jetpack_launcher_py-0.1.0-py3-none-any.whl
- Upload date:
- Size: 21.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f9ec67ddc849df886562b3cb9147a0cdf0c43cd1ac7a5f8ec932dbd850b16be5
|
|
| MD5 |
ec9efca1c34003980bca0a825903ab0a
|
|
| BLAKE2b-256 |
04c5017fd67521abe3d9026648e29e25334d7998721e8e48e0187db68ed889b2
|
Provenance
The following attestation bundles were made for jetpack_launcher_py-0.1.0-py3-none-any.whl:
Publisher:
release.yml on getjetpack/jetpack-launcher-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
jetpack_launcher_py-0.1.0-py3-none-any.whl -
Subject digest:
f9ec67ddc849df886562b3cb9147a0cdf0c43cd1ac7a5f8ec932dbd850b16be5 - Sigstore transparency entry: 1688568766
- Sigstore integration time:
-
Permalink:
getjetpack/jetpack-launcher-py@582b0426ccf640071e7f3f0bac652d1bc9eaffb4 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/getjetpack
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@582b0426ccf640071e7f3f0bac652d1bc9eaffb4 -
Trigger Event:
push
-
Statement type: