Skip to content
CAI
Software that uses CAICheck a score

openworkload/swm-core

60.3

Adequate · 15 November 2026

26.8k

lines of production code

Erlang

with C++

4

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

Features

Add PMIx server integration for cross-node MPI coordination

Introduces a new C++ PMIx server helper (swm-pmix) that communicates with the Erlang runtime via stdio to manage MPI process lifecycles and enable cross-node fencing. The implementation includes a Makefile that bundles the libpmix.so.2 library to ensure workers can run without system-level PMIx dependencies, and implements the fence mechanism to synchronize state across nodes.

_c\src/pmix · high confidence

Add Prometheus job metrics integration and migrate entity API

The accounting service now exposes job metrics (CPU, memory, GPU utilization) via a Prometheus-compatible HTTP endpoint on port 9568, allowing users to scrape real-time resource usage data. This is supported by a new \wm\_job\_metrics\ module that handles gauge declaration, observation, and PromQL querying. Additionally, the codebase has migrated from the legacy \wm\_entity:get\_attr/2\ and \set\_attr/2\ functions to the newer \wm\_entity:get/2\ and \set/2\ APIs across the accounting and partition services, ensuring consistent entity access patterns.

src/srv/accounting · high confidence

Added MPI multi-node example with build support

Users can now build and run a multi-node MPI example using the new \c\_src/examples/mpi\ directory. This includes an \mpi\_hello.c\ source file that prints rank and processor information, and a \Makefile\ that compiles the binary into the user's home directory using Open MPI (defaulting to \/opt/openmpi\). The build process validates that \gcc\ and \mpicc\ are available before compiling.

_c\src/examples · high confidence

New Podman-based debug container environment

Added a new debug container setup for local development, migrating from Docker to Podman pods. This includes a new Containerfile (renamed from Dockerfile) based on Ubuntu 24.04 that installs Erlang/OTP 29.1, Python 3.12, and various development tools, along with supervisord configurations to manage the core service and cloud gate processes within the container environment.

priv/container/debug · high confidence

New SSH tunneling and TCP proxying capabilities with improved SSL security

The networking layer now supports creating SSH tunnels and TCP proxies to facilitate secure communication between nodes. New modules wm\_ssh\_client and wm\_ssh\_server allow establishing SSH connections and opening TCP/IP tunnels, while wm\_tcp\_proxy provides a generic TCP proxy listener. Additionally, the SSL client (wm\_tcp\_client) has been updated to enforce TLS 1.3, improve certificate path validation, and use more robust connection handling, while the TCP server (wm\_tcp\_server) now handles SSL handshakes asynchronously to prevent connection stalls.

src/net · high confidence

New container build, debug, and release management scripts

Added a suite of shell scripts to streamline the development and deployment lifecycle: \build-debug-container.sh\ and \build-release-container.sh\ automate the creation of Docker images for development and production environments respectively, with the release build integrating the cloud-gate package version. \run-in-dev-container.sh\ and \start-debug-container.sh\ provide a consistent environment for local development, exposing the user API port (8443) and mounting the host's Podman socket to support rootless container jobs. \start-release-container.sh\ handles the startup of the production container, while \ci-podman-smoke.sh\ offers a dedicated smoke test for the rootless Podman runtime used by the job scheduler. Additional scripts include \setup-skyport.sh\ and \setup-swm-core.py\ for initial configuration, \run-swm-in-container.sh\ for foreground execution, \format-cpp.sh\ for C++ code formatting, \install-openmpi.sh\ for building Open MPI with PMIx support, and \ping.escript\ for SSL-based connectivity verification.

scripts · high confidence

New example job scripts for container, MPI, and multi-node workloads

The examples directory now includes new shell-based job scripts for common HPC patterns: \hpc-container.sh\ and \local.sh\ for single-node container jobs (using Ubuntu 24.04 images), \mpi-azure.sh\ and \mpi-local.sh\ for Open MPI/HPC-X multi-node and local execution, \multi-node.sh\ for requesting multiple nodes, \multiple-tasks-azure.sh\ for running tasks per node, and \netcat.sh\ for port-forwarding examples. These replace the older \.job\ files (\simple-quick.job\, \simple-sleep.job\) and rename \simple-transfer.job\ to \data-transfer.sh\, providing updated, ready-to-run templates for users.

priv/examples · high confidence

New release container setup for production deployment

Added a new Containerfile and associated configuration files to support running swm-core and the cloud gate in a production environment using Podman. The setup installs Python 3.12, supervisor, and necessary dependencies, exposing ports 10001, 10002, 8443, and 8444. It configures supervisor to manage swm-core and swm-gate as separate processes, with the gate running in a sibling container within a pod. A README provides instructions for building the image, initializing the spool, and running the daemon.

priv/container/release · high confidence

User API client scripts now use home-directory certificates and updated defaults

The scripts in scripts/api have been updated to locate TLS certificates in the user's home directory (\~/.swm/) rather than the system path (/opt/swm/), allowing examples to run without elevated privileges. Several new scripts were added to expose user-facing capabilities: canceling jobs, retrieving job details, listing available flavors and nodes, fetching stdout/stderr, requeuing jobs, and submitting jobs (including a Jupyter example). The submit-job workflow was refactored to support passing a script path, and default container images were updated to Ubuntu 24.04.

scripts/api · high confidence

Removals

Removal of legacy job management CLI modules

The \wm\_job\ and \wm\_job\_cli\ modules, which provided the command-line interface for submitting, listing, canceling, and showing job status, have been removed from the system. This change eliminates the legacy job management functionality previously accessible via these specific CLI handlers.

src/usr · high confidence

Behavioural changes

Admin service removes simulation controls and adds user account creation

The admin service no longer exposes commands to start or stop node simulations, removing the associated \wm\_sim\ integration code. It now automatically creates a default account when a new user is created, linking the user ID to the account's admin list. Additionally, the service validates that incoming JSON schema updates are maps before processing them, returning an error for invalid payloads, and switches internal entity attribute access to use the new \get\/\set\ API.

src/srv/admin · high confidence

CLI refactoring: unified 'set' syntax and removal of simulation/job modes

The \wm\_ctl\ command-line interface has been refactored to support a unified attribute-setting syntax across all entity types (remote, global, grid, cluster, partition, node, user, queue, scheduler, image). Users can now use the pattern \\<entity\> \<name\> set \<attr\> \<value\>\ in addition to the existing \\<entity\> set \<attr\> \<value\>\ form. The interface also removes the legacy \wmjob\ mode and Erlang node simulation commands (\startsim\, \stopsim\, \sim\), simplifying the shell prompt and command structure. Additionally, the \tree\ output format has been improved to display attributes as \Name: Value\ pairs instead of raw tuples, and the \user\ list view no longer displays Groups or Projects columns.

src/ctl · high confidence

Cloud gate API no longer requires explicit credentials; SSH tunneling and state machine improvements

The cloud gate interface (wm\_gate) has been refactored to remove the credential parameter from all partition and resource management calls (create, delete, list, get), as the gate now manages its own credentials internally. This change is accompanied by the addition of an SSH tunnel server and client module to support secure port forwarding for jobs, and the virtual resources manager (wm\_virtres) has been migrated from gen\_fsm to gen\_statem to improve state handling and reliability.

src/srv/cloud · high confidence

Expanded User API with new endpoints and job script parsing updates

The user-facing HTTP API now exposes additional endpoints for managing resources and job details, including GET /user/flavor, /user/image, /user/remote, and specific job stdout/stderr retrieval at /user/job/:id/stdout and /user/job/:id/stderr. Job submission now accepts an IP address parameter to ensure a submission address is set, and job scripts support new directives for ports, cloud-image, submission-address, and keep-resources. The API response format for nodes and flavors has been updated to include roles, resources, and remote IDs, and the API version is now exposed via a dedicated endpoint.

src/srv/user · high confidence

HTTP server upgrades to TLS 1.3 and adds access logging

The HTTP server now negotiates TLS 1.3 (in addition to 1.2) for secure connections, replacing the previous support for TLS 1.1 and 1.2. Additionally, the server now logs API access details—including method, path, status code, peer IP, and authenticated user identity derived from client certificates—providing visibility into request activity that was previously unlogged.

src/srv/http · high confidence

Migrate C++ entity serialization from erl\_interface to ei library

The C++ entity layer in c\_src/lib has been rewritten to use the Erlang ei library for binary serialization instead of the erl\_interface ETERM API. This change updates entity constructors and parsing functions (e.g., SwmAccount, SwmCluster, SwmBootInfo) to decode directly from character buffers, removes the erl\_interface dependency from the build, and upgrades the C++ standard from C++14 to C++17. Additionally, the generated code now uses a bytes buffer for tuple properties instead of ETERM, and the job state constant for cancellation has been renamed from 'CANCELLED' to 'CANCELED'.

_c\src/lib · high confidence

Migrate JSON handling to stdlib and add Porter protocol support

The internal \mochijson2\ JSON library has been removed in favor of Erlang's standard library JSON module, simplifying dependencies. A new \wm\_porter\_protocol\ module has been added to handle shared Porter stdin framing and job enrichment, including encoding job and user data for the Porter process. Additionally, \wm\_resource\_utils\ now provides utilities for extracting ingress ports and submission addresses from job resources, supporting the new port forwarding and ephemeral port requirements.

src/lib · high confidence

Migrate container runtime from Docker to Podman

The container backend has switched from Docker to Podman, replacing the deleted wm\_docker and wm\_docker\_client modules with new wm\_podman and wm\_podman\_client implementations that communicate via the Podman libpod REST API over a Unix socket. Configuration is now managed by wm\_container\_cfg, which defaults to the Podman socket and supports environment variables for runtime settings, while wm\_container\_log provides per-job logging. The wm\_container orchestrator now delegates to the Podman backend via the wm\_container\_runtime behavior, enabling features like NVIDIA CDI detection and explicit crun requirements.

src/srv/container · high confidence

Monitoring service initialization and REST API typing improvements

The monitoring service (wm\_mon) now initializes its state by checking for the existence of the HTTP server (wm\_http) and processing the http\_started event if available, ensuring proper state setup upon startup. Additionally, the export\_data function now uses gen\_server:call directly instead of a protected call wrapper, and the REST API handler (wm\_mon\_rest) has added type specifications for its init, content\_types\_provided, and json\_handler functions to improve code clarity and tooling support.

src/srv/mon · high confidence

PMIx integration and multi-node job reliability improvements

The compute service now supports PMIx-based coordination for multi-node jobs via a new wm\_pmix module, which manages the PMIx session lifecycle, environment bootstrapping, and a distributed fence mechanism to synchronize ranks across nodes. This change also refactors entity attribute access to use the new get/set API, adds explicit handling for job cancellation to ensure proper cleanup and state updates, and improves the reliability of job start and completion logic, including fixes for distributed commits and container management.

src/srv/compute · high confidence

Porter rewritten to use the ei library and C++17

The Porter control plane has been rewritten to replace the erl\_interface library with the lighter ei library for Erlang external term encoding/decoding, and the build standard has been upgraded from C++14 to C++17. This change introduces a new UNIX-domain socket control channel for job spawning, adds NVML-based GPU metrics collection with batched reporting, and improves security by dropping privileges to the job user and hardening file descriptor handling.

_c\src/porter · high confidence

Refactor entity attribute access and simplify parent discovery logic

The core service now uses the unified wm\_entity:get/2 API instead of the legacy get\_attr/2, standardizing how node and service properties are retrieved across the system. Parent node discovery has been simplified: the find\_my\_parents function no longer accepts or processes short names (sname) for parent resolution, relying solely on host and port arguments, and the concept of a grid management node has been expanded to include cluster management nodes. Additionally, the start\_slave capability has been replaced by start\_peer to reflect the new peer-based node model, and the has\_malfunction simulation feature has been removed.

src/srv/core · high confidence

Scheduler reliability and job lifecycle improvements

The scheduler now supports immediate scheduling via a new force\_schedule API, reducing job start latency by bypassing the periodic timer wait. Relocation logic has been refactored to better handle job cancellations and finished states, ensuring that relocation entities are correctly cleaned up and that pinging stops appropriately. Additionally, the scheduler includes improved error handling for subdivision lookups and retry logic for transient topology unavailability, along with a migration from wm\_entity get/set\_attr to get/set for consistency.

src/srv/scheduler · high confidence

Sky Workload Manager rebranded to Sky Port Core Daemon with simplified node startup

The application description has been updated from 'Sky Workload Manager' to 'Sky Port Core Daemon'. The startup logic in swm\_app.erl no longer reads the SWM\_PARENT\_SNAME environment variable, removing the parent short name from the application arguments. Additionally, the default value for the parent port (SWM\_PARENT\_PORT) has changed from 'none' to 0, and the SSL application dependency has been added to the app source file while json\_rec, jsx, and meck have been removed.

src · high confidence

Standardize configuration constants and update job state codes

The system now centralizes default configuration values for network ports (API, SSH, data transfer), certificate directories, and credential paths in wm\_general.hrl, while moving Porter command definitions to wm\_porter.hrl. Additionally, the job state code for 'running' has been updated from 'E' to 'R', and the 'cancelled' state has been renamed to 'canceled' to align with standard spelling conventions.

include · high confidence

Support for local development jobs and simplified systemd service configuration

The setup configuration has been updated to enable running jobs locally within the development environment. A new \skyport-openstack.config\ file introduces a dedicated localhost partition and node with a 'localhost' flavor, allowing Jupyter and other jobs to run via Docker on the local machine. The existing \skyport.config\ has been refactored to remove the legacy grid structure, replace the demo user with a localhost account, and add remote definitions for Azure and localhost. Additionally, the \systemd-service.linux\ unit file now runs the service in the foreground (\Type=simple\) with explicit timeout and kill signal settings to prevent startup hangs caused by TLS RPC handshake issues.

priv/setup · high confidence

User API expansion and job execution model update

The system now exposes a broader set of user-facing endpoints for managing images, remote sites, nodes, and flavors, alongside new capabilities to purge all user jobs and update job states. Job submission has shifted to accept script content directly via multipart form data, and the execution model has moved from Docker to a generic container method (defaulting to Podman+crun) with configurable timeouts and synchronization intervals. Additionally, the database schema has been cleaned up by removing obsolete entities like 'malfunction', 'project', and 'group', while introducing new fields for job state details, relocation limits, and resource retention policies.

priv · high confidence

swm-task now spawns commands on all allocated nodes by default

The swm-task utility has changed its default behavior to always request that the command be spawned on every node allocated to the job, regardless of whether the --pmix flag is provided. Previously, this multi-node spawning was likely conditional or required specific flags; now it is the standard operation, with --pmix serving only to additionally enable PMIx support and environment injection.

_c\src/task · high confidence

Fixes

Fix SSL certificate path and update config file extensions

The SSL client CA certificate path in the VM arguments configuration has been corrected from a hardcoded absolute path to a variable reference, ensuring the correct certificate is used in different environments. Additionally, the configuration files have been renamed from .tmpl to .src to reflect their role as source templates for the release build process.

config · high confidence

Test coverage

Added C++ unit tests for entity parsing; Expanded test coverage for accounting, container, and gate parsing modules; Updated porter test suite to use new entity API and export environment variables.

Dependencies

Sky Port core dependency upgrades and build system modernization

The project upgrades core Erlang dependencies to gun 2.2.0, cowboy 2.13.0, and parse\_trans 3.4.2, while removing the jsx dependency in favor of the Erlang standard library JSON module. The build system is modernized by adding targets for swm-task, swm-pmix, and MPI examples, and by switching the development container workflow from Docker to Podman. Additionally, the minimum supported Erlang/OTP version is raised to 29, and the release package now includes swm-task and swm-pmix binaries.

(repo-wide) · high confidence

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 60 → 60 (+0.0)
  • Rubric changed (rubric-2026.10.5 → rubric-2026.11.4) — scores are not directly comparable.

Lenses

  • Code Health 63 → 62 (-0.8)
  • Architecture 87 → 100 (+12.2)
  • Maturity 67 → 68 (+1.8)
  • Readiness 63 → 63 (+0.0)
  • Security 75 → 70 (-5.4)
  • Event-Driven 54 → 54 (+0.0)
  • Event Sourcing 100 → 100 (+0.0)

Resolved (14)

  • FileTooLong: scripts/setup-swm-core.py (scripts/setup-swm-core.py)
  • Hotspot: src/lib/wm_commit.erl (src/lib/wm_commit.erl)
  • Hotspot: src/lib/wm_topology.erl (src/lib/wm_topology.erl)
  • Hotspot: src/srv/compute/wm_pmix.erl (src/srv/compute/wm_pmix.erl)
  • Hotspot: src/srv/container/wm_podman_client.erl (src/srv/container/wm_podman_client.erl)
  • No ADRs found
  • Projects may be oversized for their cohesion
  • setup-swm-core.get_setup_options (cognitive 42) (scripts/setup-swm-core.py)
  • setup-swm-core.get_setup_options (cyclomatic 26) (scripts/setup-swm-core.py)
  • setup-swm-core.prune_worker_release (cognitive 25) (scripts/setup-swm-core.py)
  • skyport-container-prompt.ensure_worker_exists (cognitive 17) (scripts/skyport-container-prompt.py)
  • skyport-container-prompt.main (cognitive 22) (scripts/skyport-container-prompt.py)
  • skyport-container-prompt.run_supervisord (cognitive 19) (scripts/skyport-container-prompt.py)
  • skyport-container-prompt.run_supervisord (cyclomatic 16) (scripts/skyport-container-prompt.py)

New (51)

  • Edited copies of one member (3 members, 10+ corresponding lines) (src/ctl/wm_shell.erl)
  • Edited copies of one member (3 members, 13+ corresponding lines) (src/srv/user/wm_user_rest.erl)
  • Edited copies of one member (3 members, 16+ corresponding lines) (src/lib/wm_cert.erl)
  • Edited copies of one member (3 members, 4+ corresponding lines) (src/lib/wm_data.erl)
  • Edited copies of one member (3 members, 8+ corresponding lines) (src/lib/wm_commit.erl)
  • Edited copies of one member (3 members, 9+ corresponding lines) (src/ctl/wm_ctl.erl)
  • Edited copies of one member (4 members, 15+ corresponding lines) (src/srv/user/wm_user_rest.erl)
  • Edited copies of one member (4 members, 19+ corresponding lines) (src/srv/cloud/wm_gate.erl)
  • Edited copies of one member (4 members, 21+ corresponding lines) (src/net/wm_file_transfer.erl)
  • Edited copies of one member (5 members, 16+ corresponding lines) (src/lib/wm_state.erl)
  • Edited copies of one member (5 members, 24+ corresponding lines) (src/ctl/wm_ctl.erl)
  • Edited copies of one member (5 members, 8+ corresponding lines) (src/lib/wm_log.erl)
  • Edited copies of one member (7 members, 4+ corresponding lines) (src/lib/wm_latency.erl)
  • Edited copies of one member (8 members, 22+ corresponding lines) (src/ctl/wm_ctl.erl)
  • Edited copy of a member (10 corresponding lines) (src/srv/cloud/wm_virtres.erl)
  • Edited copy of a member (10 corresponding lines) (src/srv/compute/wm_pmix.erl)
  • Edited copy of a member (11 corresponding lines) (src/srv/container/wm_podman.erl)
  • Edited copy of a member (11 corresponding lines) (src/srv/grid/wm_grid.erl)
  • Edited copy of a member (12 corresponding lines) (src/lib/wm_factory.erl)
  • Edited copy of a member (12 corresponding lines) (src/net/wm_ssh_key_cb.erl)
  • …and 31 more

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

openworkload/swm-core was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 15 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 5de4363a0532fa552c859e819eb04988410227b0 — the exact code this score is about.
  • Scored under rubric-2026.11.4 — the same rubric and the same method as every other entry in this index.
  • Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.65+preprod-3c33c1882dc1.