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.
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:
- A Wikitech developer account
- Your SSH public key registered in Wikitech Preferences
- A registered Toolforge tool account
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:
- Bundle your project (excluding
.git,.venv,__pycache__) - Generate an
app.pywrapper if your entry point is non-standard - SCP the bundle to remote staging
- Launch a Kubernetes job to build the virtual environment
- Install
requirements.txtinside the Toolforge Python container - Restart the webservice
License
MIT © Harikrishna T P
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 deployr-1.1.0.tar.gz.
File metadata
- Download URL: deployr-1.1.0.tar.gz
- Upload date:
- Size: 14.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3abdccef318e52ae1baa667fe67d194fc6d1cbda28539f24c342e5262846e3fa
|
|
| MD5 |
e25056d4f09bb35feb3fd11945e7dcd3
|
|
| BLAKE2b-256 |
72ac1d341f66e549aeca3108d10b5bf1e638ab996bc674f21798a73d41a05c69
|
File details
Details for the file deployr-1.1.0-py3-none-any.whl.
File metadata
- Download URL: deployr-1.1.0-py3-none-any.whl
- Upload date:
- Size: 13.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
70487079cf0db472a29decd580687f01f7fd21393ee416d0508fdc1caad745cf
|
|
| MD5 |
8d740ed48ec192e105855d2c5201dd09
|
|
| BLAKE2b-256 |
dece80e105d6389acf84413c1d0fc842b221eb54728f7209d1ea1c41f1f1e4be
|