Workloads
The Functions, Apps, Sites, Workflows and Jobs that run on funcd, and what they need to run.
funcd runs five kinds of workload. A Function is code, an App is a whole app in one resource, a Site is a static web app, a Workflow runs Functions as steps, and a Job runs code once for each of its runs. Their code and files come from bundles in an OCI registry, pinned by digest: a Function's code, a Site's static files, and the bundles of an App's parts, of a Workflow's steps and of a Job's code. All of them rely on configuration: ConfigMaps for their settings and, except for a Site, Secrets. The pages of this section cover each kind, then what a workload needs to run: its artifact, its runtime and its configuration.
Function
A Function is the code that funcd runs. An HTTP client calls it through the edge, and another Function, a Sensor, a Workflow step or an App's hook calls it from inside funcd. Every call goes through the invoke chain and the activator. A Function binds the stores, the Secrets and the other Functions that it uses. Each change to it creates an immutable Revision, and workers run that Revision, either workers of its own or a pool that it shares with other Functions.
App
An App declares a whole app in one resource: its Functions, Jobs, Workflows, Sites, Routes, stores, add-on objects, EventSources, Sensors and ConfigMaps. funcd rolls the App out as one unit, through an AppRevision for each changed spec. It calls the App's hooks around the rollout, deletes the parts that the App no longer declares, and rolls the App back through its revisions.
Site
A Site is a static web app. funcd copies its bundle into a prefix of a Bucket, and the edge serves the files from there through the Site's Route, with no worker. When a deploy fails, the previous version keeps serving.
Workflow
A Workflow runs Functions as steps, in order or as their dependencies allow, along with built-in steps and child Workflows. Each execution is a WorkflowRun, which keeps the revisions of the step Functions that it started with. The workflow engine passes each step's output to the steps that follow, retries a failed step, and keeps the run's progress in the run state.
Job
A Job is code that runs to its end. Each run is a JobRun, which pins the Job's current Revision when it starts and runs on a worker of its own. funcd calls the handler once with the run's input, keeps its answer as the run's result, and never runs a run again on its own.
Artifacts
The code of a Function or a Job reaches funcd as an OCI artifact, together with its contract and its runtime. The Revision pins the artifact's digest, so the code that was validated is the code that runs, and funcd pulls it by that digest.
Runtime
The code of a Function or a Job runs in a worker, where a shim in TypeScript or in Python loads it and gives it its context. The runtime driver runs each worker as a host process by default, or, on Linux, in a container of its own.
Configuration
Workloads take their settings from ConfigMaps and their secrets from Secrets. A Function, a Job's run and a Workflow's steps receive ConfigMap keys as environment variables and read Secret values through their local API. A Lake's engine receives both in its environment, and an add-on's engine the Secret keys that its Addon lists. A Site writes a ConfigMap's keys into a public file, and an App declares both for its parts. The Configuration page describes each of them.