Skip to main content

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

Release files for deployr 1.1.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 deployr 1.1.1
File Size Uploaded
deployr-1.1.1.tar.gz 14.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for deployr 1.1.1
File Interpreter ABI Platform
deployr-1.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 28.0 kB

Release files / deployr-1.1.1.tar.gz

Download URL deployr-1.1.1.tar.gz
Size 14.6 kB
Tags Source
SHA-256 checksum
How to use checksums
748dd4010faeb67f69a022d1cb88fab040e657c8744b12a393338386a53ee710
BLAKE2b-256 checksum
How to use checksums
188dbe984aa49d0623e7bac49c6bd975866e6bdf9287d5469fb762cd78932596
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.7

Release files / deployr-1.1.1-py3-none-any.whl

Download URL deployr-1.1.1-py3-none-any.whl
Size 13.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5050db1d208a9caf716e6168074b6b6f778d385f4da9f52311883bb906e15b14
BLAKE2b-256 checksum
How to use checksums
f9f436e9cc25224d96b64d9d4b454770849af62d7b2652208fc2383ba78c6911
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.7

Release history Release notifications | RSS feed

This release

1.1.1 This release

2 release files

1.1.0

2 release files

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