Observation statistics demo service.
Requirements:
- Local:
- Docker or
uv
- Docker or
- Deploying to OpenShift:
ocgh
Note:
- Caching can be enabled/disabled in env var
CACHING_ON. Visit /flush/{cache_secret} to flush the cache.
Copy .env.example to .env.local (local development) and .env.openshift (production), and fill in values.
docker compose up --buildThen open: http://localhost:8080
From the repo root, install dependencies into .venv and start Gunicorn with variables from .env.local:
uv sync
uv run --env-file .env.local -- sh -c 'gunicorn --bind "0.0.0.0:${PORT:-8080}" --workers "${GUNICORN_WORKERS:-1}" --reload wsgi:app'Then open: http://localhost:8080
-
Push to
main. GitHub Actions builds and pushes the image to GHCR. -
Wait for the workflow to finish: https://github.com/luomus/mittari/actions
-
Log in to OpenShift (command from the Rahti web UI) and select the project:
oc project mittari- Deploy the newest image (this also syncs
.env.openshiftto the cluster by default):
./scripts/deploy-openshift.sh- Verify rollout and running image:
oc rollout status deployment/mittari
oc get pods
oc get deployment mittari -o jsonpath='{.spec.template.spec.containers[0].image}{"\n"}'The app is served at: https://mittari.2.rahtiapp.fi
- Select the OpenShift project:
oc project mittari- Create a GHCR pull secret (needed if the image is private):
oc create secret docker-registry ghcr-pull-secret \
--docker-server=ghcr.io \
--docker-username=<github-username> \
--docker-password=<github-token-with-read-packages> \
--docker-email=<email> \
--dry-run=client -o yaml | oc apply -f -Use a GitHub token with read:packages.
- Create app resources from the template:
oc process -f openshift/mittari-app.yaml | oc apply -f -- Put production values in
.env.openshift, then sync them to the cluster:
./scripts/sync-openshift-env.sh- After the first successful workflow run on
main, point the deployment at a real image (the template starts fromghcr.io/luomus/mittari:latest):
./scripts/deploy-openshift.sh- Verify:
oc rollout status deployment/mittari
oc get pods
oc get route mittari./scripts/deploy-openshift.sh