Set up team workspaces, Git and functions¶
Use this guide to get a teammate from sign-in to a reproducible, event-driven application. It covers four tasks:
- Provision a teammate's workspace with services and a resource profile.
- Connect a project to Git.
- Sync a project into a workspace.
- Deploy a function and compose functions into a pipeline.
Before you begin¶
| Task | Who can do it |
|---|---|
| Provision a teammate | admin or operator |
| Connect a project to Git | admin, operator or engineer, or a normal user with the git service and access to the project |
| Sync a project into a workspace | Anyone who can open a workspace and see the project |
| Deploy or invoke a function | admin, operator or engineer, or a normal user with the functions service and access to the project |
Functions also need an OpenFaaS gateway that an operator connects to Kionga (see Deploy a function).
Provision a teammate's workspace¶
An administrator gives each person a role, the services they may use, the projects they may see, and a resource profile that bounds their compute.
- Open Users & access and click + Provision user.
- Under Identity, enter the Identity subject. With single sign-on, it
must match the identity provider's
subclaim exactly; with local sign-in, it is the username. Choose a Role. - Under Services and projects, select only the services the person needs
(for example
projects,pipelines,workbench,ide) and enter any Assigned project IDs. People always see the projects they own. -
Under Resource allocation, choose a Resource profile:
Profile CPU cores Memory GPUs Storage Projects Concurrent runs Functions Starter 2 4 GB 0 25 GB 2 1 3 Team 4 8 GB 0 100 GB 5 3 10 Power 8 16 GB 0 250 GB 10 6 25 GPU 8 32 GB 1 500 GB 10 4 15 Choose Custom only when no preset fits, and then set each limit. Memory in the grant is a whole number of GB.
-
Click Save access.
On Kubernetes, Kionga then creates a workspace for the person: a persistent volume claim sized from the storage grant, a pod with only the JupyterLab and IDE containers they are assigned, CPU and memory from the profile (and any GPU on the JupyterLab container), an internal service and a generated workspace credential. Suspending the person scales the workspace to zero. Revoking access removes the workspace and its workloads.
On Compose, everyone shares one JupyterLab volume, which suits a laptop or a single-user server. Per-user workspaces need Kubernetes.
The gateway enforces project, service, run, function and bucket limits on every API request, whether the person uses the console or the API.
Verify: the person appears under Users with the role, services and compute you set. On Kubernetes, their workspace exists:
kubectl get kiongaworkspaces -A
kubectl get deployment,pvc,service -l app.kubernetes.io/component=workspace -A
Connect a project to Git¶
Kionga stores the repository URL, provider, default branch and sync metadata. Credentials stay in the Git credential helper of each workspace. Kionga rejects URLs that contain credentials.
- Open Projects and select the project.
- Click Connect Git repository (or Update repository to change it).
- Enter the Repository URL (HTTPS or SSH) and the Default branch.
- Click Connect repository.
You can also set the repository when you create the project.
Verify: the project's Repository field shows the URL and the branch.
Sync a project into a workspace¶
kionga project sync clones a project's connected repository into your
workspace, or fast-forwards an existing clone.
- Open a terminal in JupyterLab or the browser IDE. Inside a workspace,
kiongacalls Kionga as you, with no API key. -
Sync into the folder that the console's Open in Jupyter and Open in IDE buttons open:
Without the variable, the clone goes to
/workspace/<namespace>. -
Optional: from a machine outside Kionga, set the gateway address and a personal API key with the
projectsscope first:
An existing clone is updated with git fetch, a checkout of the default branch,
and git pull --ff-only. The command stops without changes when the folder's
origin points somewhere else, or when the folder has files but is not a Git
clone. Private-repository credentials come from your workspace Git credential
helper and never reach Kionga.
Verify: the command prints Cloned ... or Updated ... with the folder and
branch.
To start a new application in the same workspace instead, generate a starter:
See Scaffold a project.
Deploy a function¶
A function is any OCI image that serves HTTP. Kionga deploys it to OpenFaaS with the CPU and memory you set, checks it against your function quota, and records its owner and project.
Operator setup: set OPENFAAS_URL, OPENFAAS_USER and OPENFAAS_PASSWORD
on the gateway. Kionga works with a Kubernetes OpenFaaS gateway or a faasd
gateway on a single server. Until OPENFAAS_URL is set, deploys return
OPENFAAS_URL is not configured.
- Build and push your image, preferably pinned by digest.
-
Deploy it:
- Open Functions and click + Deploy function.
- Choose the Project, a Function name (lowercase letters, digits and hyphens) and the OCI image.
- Set CPU and Memory as Kubernetes quantities, such as
500mand512Mi, and optional Environment as a JSON object. - Choose a Trigger:
- HTTP / webhook: invoke synchronously.
- Asynchronous queue: queue work and get an OpenFaaS call ID.
- Cron schedule: a five-field cron expression, run by the OpenFaaS cron connector.
- Kafka topic: every message on the topic, forwarded by the OpenFaaS Kafka connector.
- Click Deploy function.
-
Invoke it:
Cron and Kafka triggers depend on OpenFaaS connectors that you install and license separately. See the OpenFaaS documentation on triggers, asynchronous calls and cron.
Verify: the function card under Functions shows its image, resources and trigger, and Invoke returns the function's response.
Compose functions into a pipeline¶
A pipeline in functions mode runs deployed functions as the nodes of a DAG. Ready nodes run in parallel, and each node receives its dependencies' output.
apiVersion: kionga.dev/v1
kind: Pipeline
metadata: {name: event-score, project: prj-123, version: "4"}
spec:
executionMode: functions
nodes:
- {id: extract, type: function, function: extract-events,
retry: {max: 2}}
- {id: score, type: function, function: score-events, dependsOn: [extract],
retry: {max: 1}}
Save it from Pipelines > + Define flow with Execution set to
Functions · OpenFaaS, or with mlaiops pipeline apply. Kionga rejects a
flow that references a function that is not deployed in the same project. See
Define and run pipelines.
Next steps¶
- Define and run pipelines.
- Manage users, groups and policies.
- Review the production readiness checklist before you onboard a team.