Sky Port gate that provides cloud integration for Open Workload. It is a FastAPI service used by swm-core to create, query, and destroy cloud partitions (VMs) on Azure and OpenStack.
Source: github.com/openworkload/swm-cloud-gate
- Exposes HTTPS REST APIs for cloud partitions, flavors, and images
- Renders provider templates (ARM / Heat) and cloud-init for job VMs
- Talks to Azure (service principal + certificate) or OpenStack (libcloud)
- Runs with mutual TLS: the listener requires a client certificate issued by
the Sky Port cluster CA (uvicorn
ssl_cert_reqs=CERT_REQUIRED). Sky Port presentssecure/node/{cert,key}.pem. Connections without a client cert fail the TLS handshake.
Default listen address: https://<fqdn>:8444
- Python 3.12
- Sky Port TLS material under
/opt/swm/spool/secure/(node + cluster certs). Override the secure directory withSWM_GATE_SPOOLorSWM_SPOOL(uses$SWM_SPOOL/secure). - Provider credentials in
~/.swm/cloud-gate.yaml(copy fromconfig/cloud-gate.yaml)
For Azure setup (service principal, storage, registry), see HOWTO/AZURE.md. For OpenStack (Keystone HTTPS, project credentials, TLS verify), see HOWTO/OPENSTACK.md and HOWTO/SECURITY.md.
make prepare-venvCopy and edit the config:
mkdir -p ~/.swm
cp config/cloud-gate.yaml ~/.swm/cloud-gate.yaml
# fill providers.azure and/or providers.openstack credentialsPrefer the swm-core debug container so certs and Python deps match CI:
# from swm-core
make cr
# inside the container, in this repo:
./run.shMocked mode (uses test/data/responses.json, no real cloud calls):
./run-mocked.shOptional: SWM_GATE_WORKERS controls uvicorn worker count (default 2 in run.py).
swmcloudgate/
main.py # FastAPI app + routers
routers/azure/ # Azure connector, partitions, flavors, images, templates
routers/openstack/ # OpenStack / Heat connector and templates
config/cloud-gate.yaml # Config template
HOWTO/AZURE.md # Azure account and credentials guide
HOWTO/OPENSTACK.md # OpenStack Keystone and TLS settings
HOWTO/SECURITY.md # mTLS and OpenStack credential rules
test/ # Unit tests
Cloud-init for Azure job VMs lives in:
swmcloudgate/routers/azure/templates/cloud-init.yamlswmcloudgate/routers/azure/templates/cloud-init.sh
make format # autoflake, isort, black
make check # flake8, black --check, ruff, bandit
make test # unittestRun a single test module (example):
make azure_custom_data
# equivalent to: python -m unittest -v test/test_azure_custom_data.pyRegenerate pinned deps after editing requirements.in:
make requirementsBuild / publish:
make package
make uploadBug fixes can be submitted directly. For new features or larger changes, please open an issue first.
BSD-3-Clause. Contributors retain copyright on their contributions.