Skip to content

Latest commit

 

History

History
129 lines (96 loc) · 3.76 KB

README.md

File metadata and controls

129 lines (96 loc) · 3.76 KB

Python bindings for swm-core REST API

Description

Sky Port is an universal bus between user software and compute resources. It can also be considered as a transportation layer between workload producers and compute resource providers. Sky Port makes it easy to connect user software to different cloud resources.

The current python package represents a wrapper around client REST API of the core component of Sky Port -- core daemon. The package provides classes and data structures that can be used in python programs in order to communicate with swm-core. Such communication is useful when Sky Port terminals are built (see JupyterLab terminal as an example).

Build

Requirements:

  1. Use swm-core dev container or install manually:
sudo apt-get install python3-all-dev
sudo apt install python3-pip

pip3 install pip-tools setuptools

Note: Python 3.12 is required.

  1. Install the project dependencies into a local virtualenv:
make prepare-venv

Run code autoformatting and validation tools:

make format
make check

Run unit tests:

make test

Run GitHub Actions locally (act + Podman):

make act
make act ARGS='--job unit_tests'
make act ARGS='--job check --rm'

Requires podman.socket (or podman system service) and act on PATH.

Build pip package and upload to pypi.org:

. .venv/bin/activate
make clean
make package
make upload

Setup

The latest stable version of the package is uploaded to PyPi.

Installation from PyPi:

python3 -m pip install --user swmclient

Remove installed package:

python3 -m pip uninstall swmclient

TLS / mTLS

SwmApi / SwmConnection use mutual TLS against Sky Port. The SSL context trusts only the cluster CA file you pass as ca_file. It does not load the system public CA store.

Typical paths:

Material Path
Client key ~/.swm/key.pem
Client cert ~/.swm/cert.pem
Cluster CA /opt/swm/spool/secure/cluster/ca-chain-cert.pem (or your spool layout)

Prefer a passphrase-protected private key. Pass the passphrase to SwmApi(..., password=...) or set environment variable SWM_KEY_PASSWORD. Unencrypted keys still work when neither is set.

Contributing

We appreciate all contributions. If you are planning to contribute back bug-fixes, please do so without any further discussion. If you plan to contribute new features, utility functions or extensions, please first open an issue and discuss the feature with us.

License

We use a shared copyright model that enables all contributors to maintain the copyright on their contributions.

This software is licensed under the BSD-3-Clause license.