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.0.tar.gz (14.2 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.0-py3-none-any.whl (13.1 kB view details)

Uploaded Python 3

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

Hashes for deployr-1.1.0.tar.gz
Algorithm Hash digest
SHA256 3abdccef318e52ae1baa667fe67d194fc6d1cbda28539f24c342e5262846e3fa
MD5 e25056d4f09bb35feb3fd11945e7dcd3
BLAKE2b-256 72ac1d341f66e549aeca3108d10b5bf1e638ab996bc674f21798a73d41a05c69

See more details on using hashes here.

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

Hashes for deployr-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 70487079cf0db472a29decd580687f01f7fd21393ee416d0508fdc1caad745cf
MD5 8d740ed48ec192e105855d2c5201dd09
BLAKE2b-256 dece80e105d6389acf84413c1d0fc842b221eb54728f7209d1ea1c41f1f1e4be

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