Computing-as-a-Service API
The Computing-as-a-Service API provides a common environment for executing containerized workloads. It supports multi-tenant, CPU and GPU jobs.
Steps for bringing up CaaS API for local development
-
Generate a salt
# salt should be about 16 or more bytes from a proper source, e.g. os.urandom() import os print(os.urandom(16).hex()) # use bytes.fromhex() to convert back to bytes
-
Create a file named under the
scriptsdirectory namedset_salt.sh. Make sure to make it executable, via thechmod u+xcommand.#!/bin/bash export CAAS_API_SALT=badsalt # replace badsalt with the salt generated in Step 1
-
Initialize the database
sqlite3 app/data/caas.db < schema.sql -
In the Makefile, be sure to replace the appropriate
CAAS_API_NAMESPACEandCAAS_API_KUBERNETES_URL -
Create a virtual environment and install requirements
python3 -m venv .venv --prompt caas-api source .venv/bin/activate pip install -r requirements.txt -
Export your salt and token
bash scripts/set_salt.sh bash scripts/set_kubernetes.sh
-
Build and run
make build # Run this command only for the first time make run # Note make defaults to podman. If running on a system using docker, use: make CONTAINER_CMD=docker build make CONTAINER_CMD=docker run
-
Go to
localhost:8000/apion your browser
source .venv/bin/activate
pip install -r dev_requirements.txt
pip install -r lint_requirements.txtUse isort and black, in that order, to format your code before committing
and pushing to the repository.
make lintsource .venv/bin/activate
pip install -r test_requirements.txt
make test- Branch off
mainfor the new feature branch - Naming convention for new branches is
##-branch-name, where##is the issue number andbranch-nameis a short description - (Optional)
##can be omitted if work isn't tied to a specific issue - When done, run
git rebase mainfrom feature branch - Important: if collaborating on feature branch or it is the source for other branches, use
git merge maininstead - (Optional) resolve any conflicts
- Submit pull request into
mainwhen ready
Copyright 2026 National Technology & Engineering Solutions of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S. Government retains certain rights in this software.
Copyright 2026 National Technology & Engineering Solutions of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S. Government retains certain rights in this software.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
-
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
-
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
-
Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.