Getting Started

Python Runner lets you deploy a Python web application directly from your GitHub repository (or an S3 zip archive) and run it as a managed service in Open Source Cloud. OSC clones your repository, installs dependencies from requirements.txt, and starts your application automatically.

Prerequisites

  • An OSC account. Sign up here.
  • A Python web application in a GitHub repository (public or private) or packaged as a zip file in an S3 bucket.
  • Your application must listen on port 8000 (the default port OSC exposes).

Create a Python Runner instance

Navigate to Python Runner in the OSC web console, click Create python-runner, and fill in the fields:

Field Required Description
name Yes Unique name for this instance. Alphanumeric and underscores only.
SourceUrl Yes GitHub repository URL (e.g. https://github.com/org/repo) or S3 URL to a zip archive (e.g. s3://bucket/app.zip). Append #branch to target a specific branch.
GitHubToken No Personal access token for private GitHub repositories. Store as a service secret and reference it as {{secrets.mytoken}}.
AwsAccessKeyId No AWS access key for S3 sources.
AwsSecretAccessKey No AWS secret key for S3 sources. Use a service secret reference.
AwsRegion No AWS region for S3 access.
S3EndpointUrl No S3-compatible endpoint URL (e.g. a MinIO instance URL).
OscAccessToken No OSC personal access token, required if your application calls other OSC services.
ConfigService No Name of an Application Config Service instance used to inject environment variables at startup.

Click Create. OSC clones the repository, installs dependencies, and starts your application. Once the status shows Running, click the generated URL to reach your app.

Application requirements

OSC expects your Python application to:

  1. Include a requirements.txt at the repository root listing all dependencies.
  2. Start a web server listening on port 8000. OSC starts the app with python app.py — if your entry point has a different name, ensure app.py exists or use a Procfile.

A minimal Flask example:

# app.py
from flask import Flask
app = Flask(__name__)

@app.route('/')
def index():
    return 'Hello from Python Runner!'

if __name__ == '__main__':
    app.run(host='0.0.0.0', port=8000)
# requirements.txt
flask

Using a private GitHub repository

  1. Create a GitHub personal access token with repo scope.
  2. Go to Python RunnerService SecretsNew Secret. Name it (e.g. githubtoken) and paste the token.
  3. When creating the instance, set SourceUrl to your private repository URL and GitHubToken to {{secrets.githubtoken}}.

Using Application Config Service

To inject runtime configuration as environment variables, create an Application Config Service instance first, add your key-value pairs, and set the ConfigService field to the name of that instance when creating the Python Runner. OSC loads the config values as environment variables before starting your application.

Source code from S3

Package your project as a zip file:

cd myproject && zip -r ../myproject.zip ./

Upload to your S3 bucket, then set SourceUrl to s3://mybucket/myproject.zip and provide AwsAccessKeyId, AwsSecretAccessKey, and AwsRegion (or S3EndpointUrl for MinIO).

CLI usage

osc create eyevinn-python-runner myapp \
  -o SourceUrl="https://github.com/myorg/myapp"

With a private repository:

osc create eyevinn-python-runner myapp \
  -o SourceUrl="https://github.com/myorg/myapp" \
  -o GitHubToken="{{secrets.githubtoken}}"

Resources