Skip to content

About

Sky Port console user terminal written in python

Resources

Stars

1 star

Watchers

1 watching

Forks

Repository files navigation

Sky Port terminal implemented as a console script written in Python

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. This is a part of Open Workload project.

The current project represents a console program that uses swmclient python package to utilize client API of the Sky Port core daemon. The source code of this package can be found here.

How to run

Requirements:

  • Python >= 3.12 is required.
  • The following command setups all requirements in a local virtualenv directory:
make prepare-venv

Install from pypi:

pip install swmconsole

Run:

swmconsole --help

Main commands

Connection uses mutual TLS by default:

  • URL: https://<fqdn>:8443
  • Key / cert: ~/.swm/key.pem, ~/.swm/cert.pem
  • CA: /opt/swm/spool/secure/cluster/ca-chain-cert.pem

Jobs

# List all jobs for the authenticated user
swmconsole --job-list

# Show details for one job
swmconsole --job-show <job-id>

# Submit a job script
swmconsole --job-submit /path/to/script.job

# Cancel a running or queued job
swmconsole --job-cancel <job-id>

# Requeue a job
swmconsole --job-requeue <job-id>

# Permanently purge non-running jobs (queued/finished/canceled/etc.); running jobs are kept
# (asks for confirmation)
swmconsole --job-purge

Overview (TUI)

With no command options, swmconsole opens an interactive htop-style overview (default refresh every 5s):

swmconsole
swmconsole --interval 2

Keys: ↑/↓ or j/k or click select a job; right-click opens Cancel/Resubmit menu; Enter or double-click open details; footer buttons (Quit / Details / Cancel / Refresh / Help, or Back in details) are clickable; ?/h open the help modal; Del cancel, Esc/q back or quit, r refresh. Mouse wheel scrolls the selection when the terminal reports it.

Top pane: cloud partitions (created swm-*-main partition managers), active jobs count, cloud nodes (swm-*). Bottom pane: all jobs (active first by newest submit time, then inactive F/C/E by newest submit time).

Resources

# List remote sites / partitions
swmconsole --remote-list
# List nodes
swmconsole --node-list

# List available flavors
swmconsole --flavor-list

# List available images
swmconsole --image-list

Options

# Omit table headers
swmconsole --job-list --no-header

# Print connection debug info
swmconsole --job-list --debug

# Print any command output as YAML (includes version: 1)
swmconsole --job-list --yaml
swmconsole --job-show <job-id> --yaml

Development

Tools

Code autoformatting and validation tools start with the following commands:

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.

Update swmclient

The current project uses swmclient python package heavily. That package is updated frequently, thus to update swmclient from local machine one can use pip to update from wheel package:

pip install /path/to/swmclient/wheel/package

Or install from a local checkout in editable mode:

pip install -e /path/to/swm-python-client

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.

About

Sky Port console user terminal written in python

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages