Skip to main content

Interactive and scriptable CLI for managing Wikimedia Toolforge tools, webservices, and Kubernetes jobs.

Project description

Deployr

Deployr is an interactive and scriptable CLI for managing Wikimedia Toolforge tools.

PyPI version Python 3.9+ License: MIT


Features

  • 🔐 SSH session management — connect to the bastion or drop into a tool shell
  • 🌐 Webservice control — start, stop, restart your Toolforge webservice
  • 🚀 Guided Flask deployment — bundle, upload, venv-build, and restart in one command
  • ⚙️ Kubernetes jobs — run, list, delete, and tail logs of Toolforge jobs
  • 📁 File uploads — securely transfer files via the two-step SCP handshake
  • 🔌 SSH DB tunnels — forward Wikimedia database ports to your local machine

Installation

pip install deployr

Prerequisites:


Usage

Interactive Console (default)

deployr

Scriptable Subcommands

# SSH
deployr ssh                          # Connect to bastion
deployr shell                        # Switch to tool shell (become)

# Webservice
deployr webservice status
deployr webservice start --type python3.11
deployr webservice stop
deployr webservice restart
deployr webservice deploy app.py --python python3.11

# Kubernetes Jobs
deployr jobs list
deployr jobs run my-job "python3 script.py" --image python3.11
deployr jobs run daily-job "python3 report.py" --image python3.11 --schedule "0 0 * * *"
deployr jobs delete my-job
deployr jobs logs my-job              # stdout log
deployr jobs logs my-job --err        # stderr log

# File Transfer
deployr upload ./my-project .

# Database Tunnel
deployr tunnel --local-port 3306 --remote-host tools.db.svc.wikimedia.cloud

# Configuration
deployr configure

First-Time Setup

On first run, Deployr will prompt you for:

Field Example
Wikimedia Username your-username
Default Tool Name my-tool (without tools. prefix)
Path to SSH Key ~/.ssh/id_ed25519
Bastion Host login.toolforge.org

Config is saved to ~/.toolforge_config.json.


Deploying a Flask App

deployr webservice deploy ./app.py --app-var app --python python3.11

This will:

  1. Bundle your project (excluding .git, .venv, __pycache__)
  2. Generate an app.py wrapper if your entry point is non-standard
  3. SCP the bundle to remote staging
  4. Launch a Kubernetes job to build the virtual environment
  5. Install requirements.txt inside the Toolforge Python container
  6. Restart the webservice

License

MIT © Harikrishna T P

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

deployr-1.1.1.tar.gz (14.6 kB view details)

Uploaded Source

Built Distribution

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

deployr-1.1.1-py3-none-any.whl (13.4 kB view details)

Uploaded Python 3

File details

Details for the file deployr-1.1.1.tar.gz.

File metadata

  • Download URL: deployr-1.1.1.tar.gz
  • Upload date:
  • Size: 14.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for deployr-1.1.1.tar.gz
Algorithm Hash digest
SHA256 748dd4010faeb67f69a022d1cb88fab040e657c8744b12a393338386a53ee710
MD5 53b404e2b61290fbedd23d047ecea50a
BLAKE2b-256 188dbe984aa49d0623e7bac49c6bd975866e6bdf9287d5469fb762cd78932596

See more details on using hashes here.

File details

Details for the file deployr-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: deployr-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 13.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for deployr-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5050db1d208a9caf716e6168074b6b6f778d385f4da9f52311883bb906e15b14
MD5 e2f0d7d97a0a20be17c36f0701e03e06
BLAKE2b-256 f9f436e9cc25224d96b64d9d4b454770849af62d7b2652208fc2383ba78c6911

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