Development

Getting started

To get started with development, you need to set up a Python environment with Poetry.

First of all, you need to launch the gateway locally:

cd gateway
docker compose up

Then from the root of the project, you can launch the CLI:

cd cli
poetry shell
poetry install

Inside your poetry shell, you can generate the config and launch the integration tests locally:

scwgw dev config
make test-int

Updating the gateway

After making changes to the underlying containers, you can run the following to update your deployment:

scwgw dev update-containers

Observability

The settings for metrics collection can be configured using the following environment variables on your containers:

Variable

Description

Default

METRICS_SCRAPE_INTERVAL

Time interval to scrape metrics.

15s

COCKPIT_METRICS_PUSH_URL

Cockpit push metrics endpoint.
Can be found on the Cockpit console page.

COCKPIT_METRICS_TOKEN

Cockpit metrics push token.
Requires the write_metrics scope.

Releasing

To release a new version of the CLI and gateway, we need to create an push a new tag. To do this:

# Bump the version
cd cli
poetry version patch

# Commit and push

# Create and push the tag
cd ..
./scripts/tag.sh

This will trigger the Github Actions build that will build and push the container and the PyPI package.