.ankra/pipeline.yaml, declares the triggers and the stages. A push, a pull request or a tag starts a run, every in-cluster stage runs as a hardened Job in the ankra-ci namespace of your CI cluster, and the result lands as an Ankra pipeline check on the commit.
This page takes one repository from connected to a finished run, then covers what you need while it runs: capacity, placement, failures and limits. For a shorter first walk-through, follow Get started with Ankra CI. For how the parts fit together, read How Ankra Pipelines works. Every key of the file is in the pipeline.yaml reference.
Before your first run
Three of these stop a run before anything is dispatched. The fourth lets the run go ahead and strips every protected section out of it.-
A connected repository. The repository reaches Ankra through the Ankra GitHub App, GitLab or Bitbucket Cloud, so Ankra receives its webhooks. A Bitbucket Cloud repository starts pull request runs only once its credential grants Bitbucket’s
pullrequestscope - see Granting the pull request permission. An Application connects its repository to Ankra Pipelines by itself; a repository with no application connects with one command (step 1). -
A cluster that runs pipelines. Ankra picks the cluster for each run in this order: the cluster the repository overrides it to, a member of the organisation’s CI pool, the organisation’s pipeline cluster (
ci_cluster_id), the staging cluster the organisation nominated for AI work, a cluster a person confirmed as non-production, then the organisation’s playground. With none of them, a provider event recordsno_ci_clusterand nothing runs. -
Pipeline-step workers on that cluster. The cluster’s agent runs pipeline steps only when its
ci_worker_countis above0. An agent at0does not advertise the pipeline job names, so Ankra refuses a step for that cluster before it is dispatched (step 2). A playground starts at2. So does a new cluster of the organisation’s own when all three of these hold:- A person chose its environment when creating it, for example in the portal, or with
--environmentfrom their own CLI login or API token. - Neither the environment nor the criticality is production. With
--environment, a name of your own counts as production unless you also pass--criticality. - No other cluster of the organisation’s own has a pipeline worker count above
0when the new cluster is set up. Playgrounds do not count. Stopped clusters do.
0. That includes a cluster created without naming its environment, and one created over MCP or by a service account, because nobody confirmed what those are for (rule 5 in Where pipelines run). Confirming what a cluster is for later does not add workers. Neither does naming the environment in a file forankra cluster apply, which sets it after the import. Add them withankra cluster agent ci set(step 2). - A person chose its environment when creating it, for example in the portal, or with
-
An approved definition. A pipeline’s protected sections (its
secrets,credentials,permissions, network tier, placement, resources, timeout, caches,services, a stage’swith:, akind: deploystage’senvironmentanddeployblock,publish.promote_fromand akind: environmentstage’stest_environmentandmatrix) carry no authority until a member withpipelines.manageapproves the definition on the default branch. Until then a run executes with none of them, and the check run and the pull request comment say: “No administrator has approved any authority for this repository yet, so this run executes with none.” (step 5). -
For check runs,
checks:write. Without it the GitHub App cannot create a check run, and the run’s status goes into a comment on the pull request instead. The comment names the missing permission. -
Permissions. Connecting a repository, storing a definition and approving it need
pipelines.manage. Running, cancelling and re-running needpipelines.operate. Changing the organisation’s CI settings needs an organisation owner or admin: the Builds and clusters page tells everyone else “Your role in <organisation> can look at these settings but not change them. Owners and admins can.”
scan stage’s reports, the findings a gate reads, the complete step log and every declared artifact are objects, and an organisation with no ready backup vault of its own keeps them in an Ankra-managed default vault, under a key prefix of its own, with the same retention and the same download links. A ready vault of your own takes over from the next step onward; register one when the objects must live in a bucket you own, and see Backups for how.
Connect a repository, push, see the run
1
Connect the repository
An Ankra Application connects its repository when you create it, and its setup pull request commits For a GitHub repository, Ankra reads the committed
.ankra/pipeline.yaml unless the repository already carries an Ankra-authored workflow or you asked for github_actions. A monorepo gets one file, with each component’s stages suffixed by its name. To connect an existing application, or a repository with no application:- Portal
- CLI
- API
- Open Applications → <your application> → Pipelines.
- In Connect this repository to pipelines, choose the Source connection that reads the repository and press Review pipeline connection.
- In Connect pipeline repository, press Confirm pipeline connection.
.ankra/pipeline.yaml and reports whether it is ready to run; it does not run a pipeline..ankra/pipeline.yaml on the default branch in the same call and stores a valid file as the definition of record. GitLab and Bitbucket Cloud repositories connect with no definition; store one with ankra pipeline definition put (step 4). Connecting a repository the organisation already connected answers 409 with the existing repository’s id. ankra pipeline repositories disconnect <repository-id> removes it, and is refused while a run is live.Check: ankra pipeline repositories list lists the repository. A repository with no application has its own page at /next/pipelines/<repository-id>.2
Choose the cluster that runs pipelines and turn on its workers
- Portal
- CLI
- Open Build & delivery → Builds and clusters.
- Under Where pipelines run, choose the Cluster, set Runs at the same time and Steps at the same time, in one run, and press Save changes. The page says “Saved. The next pipeline run uses these settings. Runs already going finish where they are.”
- If the cluster’s agent runs no pipeline workers, Ankra turns two on when you save. The cluster’s row in CI clusters says Starting until its agent reports them.
ankra cluster agent ci set says which happened. Never helm upgrade the agent to set it, because the next reconcile overwrites a hand-set value. The agent creates the ankra-ci and ankra-ci-build namespaces on first use, with their Pod Security labels, a ResourceQuota and a LimitRange; see the agent Helm values.Check: ankra cluster agent ci get --cluster my-cluster shows a worker count above 0, and the cluster’s row in CI clusters shows its build slots.3
Write and validate .ankra/pipeline.yaml
A pipeline for a Go service that tests, builds, scans, gates and publishes.
build produces a digest in a rootless BuildKit pod, scan runs Trivy, Semgrep and Checkov against that digest and your source, gate judges what they found against your organisation’s policy, and publish re-tags the one digest gate approved into your real repository. For the file Ankra writes for an application, see Generated pipelines.fail_on reads per scanner and only tightens the gate: semgrep: "error" raises Semgrep’s floor to error. Nothing a pull request writes there can loosen the organisation’s ci_image_gate policy.validate reads .ankra/pipeline.yaml from the current directory (or the file you name), plans it for a synthetic push and a synthetic pull request, and prints the steps that would run, the stages that would be skipped and why, and every diagnostic. --repository <repository-id> validates for a repository with no application. Ankra AI’s cicd_validate_pipeline_yaml tool, in chat or through the MCP server, answers the same way.Check: the output’s Severity: line reads ok, advice or warn. The fourth severity, fatal, means the file cannot be planned: the command ends with “the pipeline definition has fatal violations”, so fix it before you commit. advice never blocks a run. A warn is worth reading: a stage whose kind has no executor reports one, and that stage will be skipped.4
Store the definition, commit and push
definition put needs pipelines.manage and stores the definition in Ankra; it does not touch the repository. On GitHub, a run plans its logic from .ankra/pipeline.yaml at its own head commit, so editing the file in a pull request takes effect on that pull request’s next run. On GitLab and Bitbucket Cloud the stored definition is what runs, so keep it identical to the committed file. Either way the run’s authority comes from the default branch’s approved definition, never from the head file (see Logic is open, authority is closed).Check: ankra pipeline definition get --application my-service prints the file you stored.5
Approve the definition's protected authority
Do this once per definition, and again whenever a protected section changes on the default branch. A run whose definition asks for protected settings nobody approved raises an authority request.Approving needs
- Portal
- CLI
- Open Build & delivery → Builds and clusters, on the Approvals tab. Pipeline settings waiting for approval lists every request, with the Repository and who asked.
- Press Review on the request. The dialog compares each protected setting under Approved now and Asks for. Above that table, when any of the request can be said in plain words, a list says it: one line for each secret, stage or service it adds, changes or removes, such as “Adds the secret
deploy_token, read from the organisation variableDEPLOY_TOKEN.” On the application’s Pipelines page, the Configuration tab shows the newest request waiting for approval with the first three of those lines, or all four when there are four, and says how many more there are. A request that changes one setting is said in one sentence instead. A setting with no plain wording is listed as written, and a value Ankra withholds is never shown. - Press Approve these settings, or Dismiss with a reason under Why these settings should not be used.
pipelines.manage and a human actor: a token of an organisation service account is refused with 403 “A pipeline definition’s authority can only be approved by a human administrator”, and so is Ankra AI or any automation acting through one, because approving grants the permissions, credentials, secrets, network tier and compute the definition declares. The CLI signed in as you approves as you. Only the repository’s current default-branch definition can be approved, and only once; a definition the default branch has moved past, or one already approved, answers 409. A run does not wait for an approval: until one lands it runs without the protected sections. Approving re-runs the newest such run of each open pull request and each branch, never a merge train car’s run. A definition that declares no protected section needs no approval.Check: the request leaves Pipeline settings waiting for approval, and ankra pipeline get <run-id> prints Authority: approved for the next run.6
Watch the run
The push you made starts a run. To start one by hand:Ankra resolves the reference through the repository’s own host before writing anything, and accepts a commit only when it is that reference’s current tip or, on GitHub, a provable ancestor of it. GitLab and Bitbucket Cloud have no compare read, so a commit you name there must be the exact tip.
- Portal
- CLI
Open Applications → <your application> → Pipelines, press Run pipeline, enter the Branch or reference (and, under Commit and inputs, an optional Commit SHA (optional)), press Review pipeline run and confirm. The run appears at the top of Runs; open it for its steps, logs, tests and evidence.
ankra pipeline logs prints a concluded step’s complete log in one shot, from its archive or else from the platform’s retained log stream. A running step is followed live; --follow reconnects through a dropped stream, and --replay prints what the step already produced before following it.Check: on GitHub the commit carries an Ankra pipeline check with a step table and a Cancel button, and on a pull request the run fills the pipeline section of Ankra’s status comment. A repository with no application shows the run at /next/pipelines/<repository-id>/runs/<run-id>.7
Wait on a run a push or pull request started
A push or pull request webhook starts most runs, so a CI job that waits for the result holds no run id.
ankra pipeline get selects the run by what the job does know: --head-sha (the full sha), --branch and --trigger narrow it, and --latest takes the newest match. Several matches without --latest are refused and listed (exit 2); no match is exit 3.--wait blocks until the run concludes and prints its final detail. Under --wait or --watch a selection that matches nothing yet waits for the run to appear, up to --timeout or ten minutes. On GitHub Actions, a pull_request job’s checkout is a merge commit, so pass ${{ github.event.pull_request.head.sha }} there instead of git rev-parse HEAD.--watch prints each run and step state change until the run concludes; with -o json that is one JSON object per line (event, observed_at, pipeline_run_id, run_number, step_key, status, previous_status, outcome, and the whole run or step object), and the run’s conclusion is always the last line.Check: with --wait or --watch the exit code is the verdict: 0 when the run succeeded, 1 when it concluded any other way or the platform could not be read, 5 when --timeout ran out. A plain get exits 0 whatever the outcome; add --exit-code to branch on it without waiting.publish produced after a merge, follow Deploy on merge from an Ankra pipeline.
How a run happens
- Trigger. A verified delivery from GitHub, GitLab or Bitbucket Cloud, or a dispatch from the portal, the CLI, the API or an agent, is decided in a fixed order: is the repository connected, is the head trusted, is there a cluster, is there a definition, does
on:accept the event. Every answer is recorded, so a push that started nothing still says why (the reason tokens). - Plan. On GitHub the planner reads
.ankra/pipeline.yamlat the run’s head commit for the run’s logic, and falls back to the stored definition with a diagnostic if the read fails; on GitLab and Bitbucket Cloud the stored definition runs. A dispatch that carries its own definition (--spec-file) outranks both. Protected authority is resolved separately, never from the head file or an override. The planner then builds the step graph: which stages survive the filters, how a matrix fans out (at most 64 legs per stage), what each step needs. A filtered stage is recorded with its reason, and a run whose every stage is filtered out concludesskipped. - Dispatch. Steps are claimed fairly across organisations, never first in, first out (see Capacity and concurrency). Dispatch evaluates a step’s deferred
if:and interpolates its${{ steps.<key>.outputs.<name> }}andneeds.<stage>.*references; a false condition concludes the stepskippedand an unresolvable reference concludes itinfra_error, both before any secret is revealed. Declared secrets and credentials become one-time, per-step reveal grants, never part of the payload. - Run. The agent renders the step’s own Kubernetes objects from the signed payload and runs a hardened Job. Output streams live; the complete log and the declared artifacts are uploaded when the step concludes, to the organisation’s oldest ready backup vault or the Ankra-managed default vault.
- Settle. The settle loop records the verdict, unblocks what waited and concludes the run. Only Ankra’s own failures are retried, once. A concluded
buildstep’s digest becomes the application’s build observation, so push-to-deploy and previews read a pipeline-built image.gatereads the run’s persisted findings against your policy and records the digest it judged;publishre-tags that digest assha-<7>and refuses if the build’s digest differs or the gate recorded none. - Report. The
Ankra pipelinecheck run (or commit status) is updated on every change. On Bitbucket Cloud each kind of run keeps its own commit status key:ankra/pipelinefor a push,ankra/pipeline/pull-request,ankra/pipeline/tag,ankra/pipeline/dispatchandankra/pipeline/schedule.pipeline_run_failed,pipeline_run_succeeded,image_gate_blocked,preview_readyandpreview_failedare notification kinds your routing rules can send anywhere.
A build you start by hand does not go through the gate. A pipeline build stages the digest under
ankra-ci/<application>/<component>, and publish re-tags it into <application>/<component> only after gate has judged it. ankra application build start publishes straight to <application>/<component>, with no scan and no gate. Use it as the recovery route when the pipeline itself is broken, and let the pipeline publish anything you intend to keep.Which component a build belongs to
Akind: build stage of an application’s pipeline belongs to one of the application’s components, and that decides where it pushes and where publish re-tags it. Ankra reads it in this order:
build.component, when the stage declares it. The value is the name of a component the application records.- The stage name, otherwise: a stage called
build-<component>belongs to that component. - The application’s one component, for a single-component application, whatever the stage is called.
build.component when one component has more than one build, or when you want to name a stage for what it builds. A typical case is a component that ships both a container image and a release bundle:
sha-<7> tag:
An image has to belong to a component, because a deploy of the application only reads component repositories. In a repository with no linked application,
build.component has no effect, and every stage publishes as <repository>/<stage suffix>.
ankra pipeline validate checks the stages against the application before a run. It reports a stage that belongs to no component, a build.component the application does not record, and two stages that would publish to the same repository: fatal when both always run, a warning when one runs only under a condition. The components come from the application’s .ankra/ankra.yaml when it declares them. A run that reaches a stage it cannot attribute concludes the step step_refused, listing the components the application records.
Monorepo: PR-only checks, full builds on push
A monorepo usually wants a pull request to check only the components it touches, while a push to the default branch builds everything. Write one stage per component, and give each stage an event-scopedwhen block: the pull request filters on paths, and the push does not.
web/ runs checkout and test-web; test-api is skipped as path_filter. A push to main runs every stage. Put the pipeline file (.ankra/**) in each list so a change to the pipeline checks everything.
- A pull request’s changed files are read from your provider when the run is triggered, up to 300 paths. When they cannot be read, or the change is larger, no stage is skipped for its paths, and the run’s
paths_unverifiedsays why. - A stage that needs a skipped stage is skipped too. To run it anyway, name the skipped stage in
skippable_needs, or give it anif:with a status function such asalways(), soneeds.test-api.resultreadsskipped. ankra pipeline validate --changed-file web/app.tsprints each stage against push and pull request for that change.- Write each list once under
path_sets:and use{set: <name>}where the list was.
Affected-only stages: skip what a change did not touch
A stage withpaths: is affected-only: when no changed file matches, it is skipped as path_filter and the stages that need it run without it, waiting on what it waited on. A change to web/ then skips the API’s tests and still builds, scans, gates and, on a push, publishes.
paths:orwhen.paths.when.pathsalso skips the stages behind the stage it leaves out, which suits a component’s whole chain (build, scan, gate and publish together).paths:is for a stage whose absence should hold nothing back. A stage declares one of them, never both.- Every event.
paths:applies to pushes as well as pull requests. For “pull requests check what they touch, pushes check everything”, use the event-scopedwhenrecipe. - What it refuses.
ankra pipeline validaterefuses (pipeline_paths:)paths:on a stage whose outputs another reads, on abuildanother stage needs, on acheckout,gateorapproval, and on a scan a gate names inrequire_stages. It warns about an affected-only scan and an affected-onlydeploy,publishorpreviewthat another stage needs. - When the change cannot be seen (no change list, or more than 300 files), no stage is left out, and
paths_unverifiedsays why.
ankra pipeline time-saved. See Fast CI for the other ways to shorten a run.
Affected from the dependency graph: affected:
Path globs miss a package a stage’s tests import from elsewhere in the repository. affected: names the packages instead of the files, and Ankra follows their imports.
affected: runs when a changed file is in the dependency graph of what it names, its tests included, or matches its paths:. Otherwise it is skipped as not affected, and the stages that need it run without it.
gonames Go packages the way the stage’s owngo testdoes:./...and./internal/apiare read from the stage’sworking_directory, and an import path such asexample.com/shop/libs/...works too. Ankra reads everygo.modin the repository, so a module another pulls in through a localreplacedirective counts. A change togo.mod,go.sumorvendor/reaches every package of that module.pnpmnames workspace packages by name (@acme/web) or by directory (./apps/web). A dependency on another workspace package, by name,workspace:alias orfile:path, is followed. A change to a root file such aspnpm-lock.yaml, the rootpackage.jsonorpnpm-workspace.yaml, or to a pnpm patch (any file underpatches/and any.patchfile), reaches every pnpm stage. These root files do not:*.md, any file whose name starts withLICENSE,LICENCEorCHANGELOGin any case,.gitignore,.gitattributes,*.go,go.mod,go.sum,go.workandgo.work.sum.paths:besideaffected:adds files no import graph sees: migrations, fixtures a test opens by path, a script the stage runs.- Where the graph comes from. The run’s checkout step reads the graph of the exact commit it checked out and records an answer for each stage. The planner decides only what it can without the code: a change list it could not read in full, a change to
.ankra/pipeline.yamlor a matchingpaths:glob runs the stage. - A skip needs an answer. No answer (a pattern that names nothing, an analysis that failed or took over two minutes) runs the stage, and the checkout’s log says why. A pipeline with no checkout stage never reads the graph: its
affected:stages run on every change, andankra pipeline validatewarns (pipeline_paths:). - A skip never waits for capacity. A not-affected stage concludes as soon as the checkout has answered, and the time it saved is recorded with reason
not_affected. - Promotion. A merge that promotes the pull request run’s image counts a stage that run skipped as not affected, when the merge changes no file that run’s graph was not asked about.
- The same refusals as
paths:.affected:makes a stage affected-only, so it is refused where a skip would be unsafe. - Inside your checkout,
ankra pipeline validate --changed-file libs/auth/token.goreads the same graph from your working tree and shows which stages the change reaches.
Newest commit wins
Aconcurrency.group decides which runs serialise. cancel_in_progress decides what happens when a newer one arrives: with it, the new commit supersedes the run it replaces; without it, the new run waits for the older one to finish.
A definition with no concurrency block runs under a group Ankra gives it, one per repository and reference, so two pushes to one branch run one after the other while runs on different branches never wait on each other. Declaring a group replaces that default.
ankra pipeline validatereportspipeline_concurrency_queues_behind:at severityadvice, naming the group and the line that changes it.- A queued run whose
Waiting:line names an older run of the same branch or pull request carries the same recommendation. - A pipeline converted from a GitHub Actions workflow keeps the workflow’s own queueing, with a conversion note recommending the flag.
cancel_in_progress: "${{ event.kind != 'push' }}" with cancel_queued: "${{ event.kind == 'push' }}". See A concurrency policy per event.
Superseding is a soft stop. The older run concludes as cancelled and shows as Superseded, the commit status it leaves is neutral rather than failed, and no failure notification is raised for it.
What a pull request gets
A connected pull request carries one comment from Ankra, withpipeline, preview and review sections that each update in place: the run’s own state (plus the authority sentence whenever the run executed under anything but the plainly approved definition), the throwaway environment deployed from the run’s digest, and Ankra AI’s verdict on the diff. See AI in pull requests.
The review reads your pipeline, not just GitHub Actions
Ankra’s pull request review reads the newest pipeline run of the reviewed commit first, and falls back to GitHub’s own check runs only for an application whose build authority is its own CI or the generated workflow, or for a head no pipeline run has touched. From a pipeline run, the review reads:- the failing step’s name, kind and error message, when the run is failing (not its log, which stays behind
ankra pipeline logs) - the run’s scan findings, by tool and severity, with the highest-severity findings named
- the
gatestep’s verdict and blocking count, once one has concluded - the
buildstep’s image digest, once one has concluded - the authority sentence, when the run executed under anything other than the plainly approved definition
A human can say “merge when green”
Mention@ankraai merge when green in a pull request comment, ask Ankra AI in chat, or call the API, and Ankra watches the pull request and squash-merges it the moment every condition holds:
- the requester is an active member holding
pipelines.operate, and the binding’s AI mode is Agent; in Ask mode the request is refused, naming the setting - the GitHub login that commented is linked to that member through an OAuth-verified identity; a login claimed by hand, or filled in from an Auth0 GitHub sign-in, does not count, and a service principal is refused
- the requester still holds
pipelines.operate, is still a member and still verified when the merge happens, not only when the comment was written - the pull request’s head is not a fork
- the newest pipeline run for the head succeeded, and its
gatestep, if the definition declares one, passed - the run executed under plainly approved authority
- Ankra’s own review has not requested changes on that commit
- no human reviewer’s most recent review is Changes requested, on any earlier push too, until that reviewer clears it
The merge train: test every pull request as it will merge
The merge train tests each pull request as the commit its merge will produce, on top of everything ahead of it, and then merges it through GitHub’s own squash merge. Turn it on and add a pull request:on.pull_request must match the base branch, and push-only publish and deploy stages do not run on it. A publish that declares promote_from: pull_request re-tags the car’s tested image on the merge instead of building again. Ankra posts an Ankra merge train check on every pull request it holds; make it required on the base branch so every merge goes through the train. The train works on GitHub only.
The merge train is the canonical page: cars and batches, what happens when a car fails or someone merges around the train, auto-admit, stacked pull requests, moving a pull request to the front, and merges GitHub declines.
Chat watches a run, and a failed build gets a fix
Ask Ankra AI to watch a run, or to dispatch one, and thewatch_pipeline_run tool wakes the same conversation when the run concludes, with the failing step, a bounded tail of its log, the findings and the gate verdict. Separately, a failed build step (a genuine script failure, not infra_error, a stranded step or a policy refusal) on a direct push to the tracked branch, in Agent mode, dispatches an auto-fix mission with a log excerpt as evidence. A failed build on a pull request never gets an unattended commit: its diagnosis goes into the status comment’s pipeline section, pointing at Agent mode’s Propose a fix on the pull request review.
A red run is not always a verdict on the change. A run can be stopped before any step tests it: no node had room for a step, the build cluster’s agent had stopped checking in, or Ankra ended a step before it ran. Ankra AI is then told so, with the step and the cause, and asked to commit nothing: no fix, and no change to the pipeline definition to get past it. It tells you the checks could not run and why. Run the same commit again once the cause is cleared.
An agent run that watches a run waits for it. It gets no new turn until the run concludes, and its next turn starts with the result. When the newest run for its commit tested nothing, the agent run is told to stop and report what stopped the checks, so a person can clear the cause.
What is in place today
These stage kinds execute:checkout, run, build, scan, gate, publish, deploy and environment. Every other kind validates with a warning (severity warn) and is skipped with reason kind_unavailable, so a run that declares one still concludes:
Not available on any surface:
uses:- anyuses:reference is fatal at validate time: “Reusable steps are not available yet; write the step asrun:”.- A step’s own
retry:block is validated and stored, and never applied. Only Ankra’s own failure classes retry (see When something fails). - Dynamic matrices that fan out over a previous step’s output; write every axis in the file.
- A per-run identity from
permissions, so a step cannot call theankraCLI with the run’s own authority, andcloudandobject_storagecredentials are refused by name.secrets: [{from: credential}]validates and is not delivered. - Attestations on the deployed digest.
build’sprovenanceandsbomattest the digest it pushes to the CI staging repository;publishcopies the image manifest only. Trivy’s SBOM is an artifact in the vault, not an OCI referrer. ::ankra::annotations and metrics in step output are not read.$ANKRA_OUTPUTkey=value lines are, and so are test reports.- On GitLab and Bitbucket Cloud: a run plans from the stored definition, never from the committed file at its own commit, and merge when green and the merge train are refused.
When a run does not fit: the CI playground
When a run’s largest step fits no node of its CI cluster, or a stage of the same repository failed on that cluster in the last seven days because it had no room (never scheduled, or killed at its memory limit) and has not succeeded there since, Ankra moves the run to a CI playground: a short-lived Ankra Cloud cluster it builds for the organisation’s pipelines. Every run that needs one shares the organisation’s one playground and queues for room on it like on any CI cluster.-
What stays put. A playground is one plain amd64 node with no runtime class. A run is never moved when one of its stages selects a node label the playground does not carry (
runs_on.node_selector, such as a node pool of your own cluster, orruns_on.arch: "arm64") or names aruns_on.runtime_class. That stage could never be scheduled there. - What it costs. A run whose largest step fits Ankra Cloud’s trial plan goes to the organisation’s free trial playground, one already running or a new one for an account that cannot pay but still has a trial; a trial is left to its own expiry. Otherwise, when the organisation’s Ankra Cloud account can pay, it gets a billed playground at the smallest plan whose node fits the largest step, billed at that plan’s price for as long as it exists and never more in a month than the plan’s monthly price, and grows by one plan when a step still cannot be scheduled. When Ankra Cloud refuses the playground, such as an account with no card and no trial left, the run stays on its own cluster.
-
When it goes away. A billed playground is torn down once no run has used it for
ci_playground_idle_minutes(default 5, 0 to 1440). -
Turning it off.
ci_auto_playgroundis on by default. Turn it off withankra org ci-settings set --auto-playground=false(CLI 0.78.0 or later), or set it tofalsewithPUT /api/v1/org/ci-settings, to keep every run on the cluster it resolved to.--playground-idle-minutessets the idle time the same way. The portal has no field for either setting.
Test results
A stage that runs tests can declare the reports its test command writes, and Ankra reads every test’s outcome from them:ankra-tests.<n>.<format> in the run’s artifact list), and Ankra parses it. The step’s exit code stays its verdict: a report Ankra cannot read never fails or passes the step.
- Your command writes the report.
test_resultsonly names where it is:gotestsum --jsonfile test-results.json -- ./...,pytest --junitxml=reports/junit.xml,vitest run --reporter=junit --outputFile=reports/junit.xml. A path is relative to the workspace, not to the stage’sworking_directory. - List the same path under
artifacts:. Ankra uploads a declared report only when the stage also lists its path underartifacts:, as above. A report declared only undertest_resultsis not uploaded, and the run’s test summary says so. - Flaky tests. A test that failed and then passed on a retry is recorded as
flaky, with its attempts. Ankra reads retries from Playwright’s JSON reporter, from Surefire’sflakyFailure/rerunFailureelements, and from a test that appears more than once in one report (gotestsum --rerun-fails). Playwright’sjunitreporter writes retries only withincludeRetries: true.
ankra pipeline tests <run> prints the same summary, ankra pipeline tests history one test’s outcomes on the default branch with its flaky rate, and ankra pipeline tests timings each file’s or test’s mean duration, for balancing shards.
Limits. A report is at most 32 MiB, and a directory at most 256 report files and 64 MiB unpacked. At most 100,000 tests are read from one report, and 20,000 per report and 50,000 per run are stored, failed and flaky ones first. Failure messages are kept to 2,000 characters, and anything that looks like a credential is redacted. A report with a DOCTYPE is refused. Test results are kept as long as their run.
Quarantining a flaky test
A quarantined test still runs and is still reported; a step whose only failed tests are quarantined passes. Quarantine is off on every repository until you turn it on, and only a member withpipelines.manage can change it.
A failing step passes because of the quarantine only when all of these hold:
- It is a
kind: runstep that failed on its own (step_failed). A timeout, an infrastructure error, a refusal, and any build, scan, publish, deploy or verify step fail as before. - Quarantine is on for the repository.
- The step declared at least one test report, and every one was uploaded and read whole.
- The reports hold at least one failed test, and every failed test is quarantined.
; instead of &&) fails the step on its own.
A test qualifies when, over your default branch’s runs in the last 30 days, it ran in at least min_samples runs and was flaky in at least min_flaky_rate of them. It is released by hand, or on its own after release_after_passes default-branch passes in a row.
Organisation CI settings
Every pipeline runs under the organisation’s CI settings. Every member can read them; changing them needs an organisation owner or admin. Change them on Build & delivery → Builds and clusters, withankra org ci-settings set, or with PUT /api/v1/org/ci-settings, which changes only the members you send.
ankra pipeline policy get|set, pipelines.manage) is the ceiling above these: allowed network tiers, credentials, node selectors, tolerations and runtime classes, the most CPU, memory and GPU per step, the largest cache a stage may declare (max_cache_size), the hosts a webhook stage may post to, and the external CI providers a pipeline may wait on.
Capacity and concurrency
Two organisation limits and one property of the cluster decide how much pipeline work runs at once. The narrowest one wins.
Past 64 runs. Runs at the same time in the web app takes up to 64;
ankra org ci-settings set --max-parallel-runs N sets up to 256. While the value is above 64, the web app cannot save Where pipelines run, so change its pipeline cluster and Steps at the same time, in one run with ankra org ci-settings set as well.
The run limit caps throughput: every run past it waits as queued. The step limit only shapes how wide one run fans out, so raising it never drains a queue of other runs.
Which queued run starts next. When a run under Runs at the same time finishes, pushes to a repository’s default branch and merge train cars start first, oldest first. Every other queued run takes its turn by repository: the repository with the fewest runs in flight goes next, so one repository’s burst of pull request runs takes one slot at a time while another repository’s run gets the next. Within a turn the oldest run goes first. A re-run waits by the queue time of the run it repeats, in its repository’s turn: a re-run of a default-branch push or a merge train car does not start first. queued_ahead counts the runs that start before this one in that order, so it can grow when a default-branch push is queued or another repository’s runs finish.
A CI slot is not a node. A slot is one step the agent watches at once, from creating its Job until it concludes. Nodes come from the cluster’s node-group autoscaler, which adds nodes up to the group’s maximum when steps ask for more CPU and memory than the nodes have free. A cluster with plenty of slots and a node group at its maximum still queues, and so does a large node group behind a small slot count.
Ankra does not over-fill a cluster. Ankra stops handing a cluster steps once its agent has as many in flight as it has slots; the rest wait in Ankra’s queue, where organisations are served fairly. A step’s timeout and its duration count from when the agent begins it; the wait shows separately as the step’s queue wait.
Steps of one run share a node. A run’s workspace is one rwo volume, so every step of one run, and the helpers that restore caches and upload artifacts, is pinned to the node that volume is attached to. A step that cannot fit there waits for its siblings to finish. When the node is gone, cordoned or not Ready the pin is dropped and the step log says so. After a minute waiting on a full node, the agent gives the slot back and the step returns to the queue; the run page and ankra pipeline get count how often.
A pipeline can give every step a workspace of its own. workspace.mode: per_step asks for one workspace claim per step: before a step runs its workspace is filled from the checkout and from what earlier stages handed on, so a run can spread over many nodes. Turn it on per cluster with ankra cluster agent ci set --step-workspaces on --cluster <name> (shadow records the mode each run would have taken; off is the default). It needs an agent that advertises step workspaces and a vault to carry the files between steps, its own or the Ankra-managed default. A run that cannot get per-step workspaces runs on the shared volume and is still correct. workspace.handoff: declared with a stage’s produces: narrows what a stage hands on, and workspace_from: picks what it restores.
What a step reserves. A step reserves half of its resources.cpu and all of its resources.memory (250m and 1Gi when the stage sets no resources), and may use CPU up to its declared figure while the node has it free. An image build that declares no resources gets a ceiling of 2 CPU and 6Gi, held under what the cluster and policy allow. Memory is set aside in full, so on most nodes it decides how many steps fit: padded memory costs a step’s worth of concurrency, and too little is killed with exit status 137.
Sizing a stage from what it used. ankra pipeline get <run> -o json carries each step’s requests and usage (memory_peak_bytes, cpu_usage_usec, memory_request_bytes, cpu_request_millicores and more). ankra pipeline resource-suggestions <run> turns them into one suggestion per stage from its latest 20 successful attempts under the same definition: the 95th percentile plus 25% headroom, once a stage has at least 5 attempts. A stage whose memory peak reached its limit is reported at_limit with no suggestion, because page cache fills whatever room a step has. Nothing is applied for you.
A run can reserve its room before it starts. With ankra cluster agent ci set --run-reservation on --cluster <name>, Ankra works out from the plan how much CPU and memory the run’s steps need side by side at their peak, and holds that room on one node with a placeholder pod before the first step starts. While a reserved run is in progress it keeps that room between steps, which can add a node or keep one from scaling down. shadow records each run’s reservation without holding room; off reserves nothing. The run page shows it under Reservation.
A step that can never be scheduled fails fast. If no node the step may use is large enough, and the autoscaler cannot add one, the step fails after about two minutes with the scheduler’s reason. Lower the stage’s resources, add a node group with larger nodes, or let the CI playground take the run. A stage whose runs_on.arch no node in the cluster has fails the same way, and the message names the architecture it asks for and the ones the cluster’s nodes have.
Admit runs by capacity
Runs at the same time is a number you choose, and it knows nothing about how busy your CI clusters are. Set low, runs queue while CI slots are free. Set high, Ankra starts runs whose steps then wait for a slot, and every run takes longer.ci_run_admission decides what a queued run waits for:
With
capacity, the runs already started get the CI slots they need first, and a new run starts only in a slot they leave over. Ankra works it out for each CI cluster that can run steps:
- The cluster’s capacity is its CI slots (
ci_worker_count). - A run already started is expected to use as many slots as it has steps left, up to
ci_max_parallel_steps. - A queued run starts while a slot is left that no started run is expected to use and no step that is ready to start is about to take. A started run that has no cluster yet counts against all of them.
- Once the newest started run is two minutes old, a queued run also starts while a slot is free that no ready step is about to take. Runs whose steps mostly wait for one another therefore leave no slot idle.
capacity never holds:
- A push to a repository’s default branch, or a merge train car. Only
ci_max_parallel_runsbounds those. - Any run while the organisation has no run in flight.
- Any run while the capacity cannot be measured: no CI cluster can run steps, or a CI cluster has 0 CI slots. Runs then start as they do under
fixed.
ci_max_parallel_runs stays the ceiling under every value. capacity can start fewer runs than it allows, never more.
Read it. ankra org ci-settings get prints the value on its Run admission: line, and -o json carries ci_run_admission. A run that capacity holds is queued with the queue_reason waiting_on_run_cap. Its message names ci_run_admission and the number of runs in flight, here 12:
ankra cluster agent ci set --workers N --cluster <name>, or add a cluster to the CI pool.
Try it first. shadow starts runs exactly as fixed does. While the organisation has fewer runs going than Runs at the same time allows, each time Ankra looks for its next run it counts what capacity would have decided: admits, holds, not_measured when the capacity could not be measured, or unreadable when reading it failed. The share of holds is how often capacity would have kept a run queued. The count is the Ankra platform’s own metric, ankra_pipeline_run_capacity_verdicts_total, with the labels organisation_id, run_admission and verdict. Only Ankra can read it today: no page, command or API returns it, and it is not a metric of your cluster, so ankra cluster metrics query does not return it either. Ask Ankra support for your organisation’s share of holds before you switch to capacity.
Turn it on and off. Changing it needs an organisation owner or admin. It decides which queued run starts next; runs already in flight are not touched. fixed puts back the default.
Why a run is waiting
A queued run says which limit it is behind: on the run page under its status, on theWaiting: line of ankra pipeline get, and as queue_reason with a sentence in queue_reason_message.
Once a run’s first step has started, the one wait it still shows this way is
waiting_on_run_node. A run that is waiting for a node with room for its reservation is already admitted, so it carries reservation_wait instead, and the run page shows Waiting for a node with room for this run with the room it needs and what the autoscaler is doing. If no node has room within 10 minutes, the first step goes back to the queue (returned_to_queue). The step carries the diagnosis run_reservation_pending (see Diagnosis codes).
A step that waits for the node of its run
All steps of one run share one workspace volume, so a later step can only run on the node that holds it. When that node has no room, Ankra keeps the step off the cluster instead of leaving a pod pending there, and the step’s row on the run page says what it needs, which node it has to run on and what ends the wait:- The run’s own steps fill the node. The step starts when one of them finishes. Lower the stage’s
resourcesto fit more steps on one node. - Other runs’ steps fill the node, and none of this run’s steps is running. The step starts when they leave room. The row names the time, 15 minutes after the step became ready, when Ankra sends it to the node anyway.
- The cluster’s own workloads fill the node. No step finishing would make room, so Ankra does not hold the step at all. It is sent at once, and if the node really has no room for it the step fails about a minute later as one that can never be scheduled, naming what it asks for and what the node has left. Lower the stage’s
resources, or move some of those workloads off that node.
The way out of a wait for room
When a step waits for room that one more node of its cluster’s kind would give (run_node_full, insufficient_capacity or node_group_at_max, see Diagnosis codes), the run page offers what ends the wait under the diagnosis. The organisation’s pipeline page offers the same beside the CI clusters table, once per cluster. What it offers depends on the cluster:
- Your playground. The page names a cluster of your own only where Ankra would place pipelines itself: online, with an environment label someone chose that is not production, and a criticality of staging, development or disposable. Run pipelines on that cluster makes it the organisation’s pipeline cluster (
ci_cluster_id) once you confirm. The confirmation says how many steps its agent runs at once, and turns on 2 pipeline workers if it runs none. New runs go there. Runs already going finish on the playground, and a repository set to run on a cluster of its own keeps running there. This needs permission to manage the organisation; an organisation with a CI pool chooses under Where pipelines run instead. When no cluster qualifies, the page offers Choose where pipelines run and Create a cluster, or Create a cluster and Connect one you have when you have no other cluster. - A cluster whose nodes Ankra runs. Add a node asks you to confirm one more node in a node group pipeline steps can be placed on, naming the cluster, the group, its size and its monthly price. A dedicated pool counts when the agent’s CI placement selects it and tolerates its taints. Nothing changes before you confirm, and when the price cannot be read the offer links to the cluster’s Nodes page instead. A group that autoscales says it adds room by itself. A step held for its run’s node (
run_node_full) stays on that node, because its workspace is there, so the new node is room for your other runs. - An imported cluster. Ankra does not run its machines. Add room with its provider, or add another cluster to share the runs.
no_node_group_fits and stage_exceeds_node_size need a larger node type; deadline_exceeded_waiting and run_reservation_pending can have several causes, which the diagnosis names; and a provider limit (provider_quota_exceeded) has to be raised before any node can be added. Clusters Ankra builds for pipelines, such as a billed CI playground, get no offer either: Ankra sizes them.
Seeing and raising capacity
Build & delivery → Builds and clusters, on the Capacity tab, shows, under Where pipelines run, the CI clusters table with each cluster’s Build slots, CPU on CI nodes and Memory on CI nodes, and CI usage over time below it.ankra org ci-settings get -o json carries, per pool member, scale_up_blockers: what stops the cluster running your waiting steps, as a code from Diagnosis codes, with scale_up_blockers_state saying whether an empty list means nothing is wrong (none_observed) or the events could not be read (unknown).
To raise capacity, change the limit that is full:
- Runs queue as
waiting_on_run_cap. Raise Runs at the same time (up to 64). When the message namesci_run_admission, that number is not what holds the run: add CI slots or a cluster, as in the next line. - Runs queue as
waiting_on_ci_slots.ankra cluster agent ci set --workers N --cluster <name>(up to 128 on current agents), or Add a cluster to the CI pool. - Steps are slow to start although slots are free. The cluster has no room for the pods: raise the node group’s autoscaling maximum (
ankra cluster node-group autoscaling getshows it), or use larger nodes.
Step placement
By default a pipeline pod runs on any node of the CI cluster that will take it. To keep CI on nodes of its own, such as a tainted node group, give the cluster a step placement. The portal has no field for it; use the CLI:ankra-ci-build. On a cluster Ankra built, naming a node group is enough: the pods select the group’s nodes by the ankra.cloud/node-group label and tolerate every taint the group has. A group the cluster does not have is refused, with the groups it does have. On a cluster without Ankra node groups, name the nodes yourself:
--node-selector key=value and --toleration key[=value]:Effect repeat, and add to --node-group. The effect is NoSchedule, PreferNoSchedule or NoExecute.
Set the mode with
--placement required|preferred, and remove the placement with --clear-placement. A placement flag replaces the whole placement and leaves the worker count and storage class alone. The change applies to the next step, with no agent restart. ankra cluster agent ci get prints the placement and how many Ready nodes it admits.
The placement is set by whoever may manage the cluster’s agent, outside any pipeline definition, so it needs no authority approval. A stage’s runs_on applies on top of it: its node selector is merged with a required placement’s, and a stage asking for a different value of a key the placement sets is refused before it runs. To create such a group, ankra cluster node-group add <cluster> --name pipelines --instance-type <type> --taints dedicated=ci:NoSchedule taints it from its first node. An agent older than the placement ignores it, so upgrade it (ankra cluster agent upgrade) before relying on it.
CPU architecture
Pipelines run on amd64 and arm64 nodes. A step runs on the architecture of the node it is placed on, so a CI cluster of arm64 nodes (AWS Graviton, Ampere, Apple silicon) runs arm64 steps and builds arm64 images, and a cluster with node groups of both runs either.- A
buildwith noplatformsbuilds for its node. The image islinux/arm64on an arm64 node andlinux/amd64on an amd64 node, with no emulation. Pipelines Ankra generates declare no platform for this reason. The step records the platform it built, and thescanstep’s Trivy leg scans that platform. runs_on.archchooses the node.arch: "arm64"orarch: "amd64"on a stage,buildincluded, adds akubernetes.io/archnode selector to the step’s pods. Unlike the rest ofruns_on, it is not protected: a pull request may set or change it, because naming an architecture reaches no node the protected placement does not already allow. A stage whosearchno node of the cluster has fails within about two minutes, naming the architecture it asked for and the ones the cluster’s nodes have.- A run’s steps share their node’s architecture. With the default shared workspace, every step of a run is held to the node the run’s workspace is on, so on a cluster with both architectures put the same
runs_on.archon every stage,checkoutincluded. To run stages of both architectures in one run, useworkspace.mode: per_stepon a CI cluster with step workspaces on, which gives each step a workspace of its own. Abuildalready works in a volume of its own, shared only with the run’s other builds, so an arm64buildcan follow tests that ran on amd64. - One declared platform.
platforms: ["linux/arm64"]builds for that platform wherever the step runs. A node of another architecture can build it only through a QEMU emulator registered in the node’sbinfmt_misc: the rootless builder uses an emulator the node already has, and cannot register one. Without one the step fails asbuild_emulation_missing, naming the platform and the node’s architecture, and is not retried. With one, the build takes several times as long as a native build. - More than one platform in one
build(["linux/amd64", "linux/arm64"]) is refused before the build starts. Declare one platform, or none. - Step and service images need a build for the node’s platform. One without fails on the first try, naming the image and the platform (see When something fails).
- The CI playground is amd64. A run with a stage that asks for
arch: "arm64"stays on its own cluster (see the CI playground).
build on an arm64 node and declare no platform:
Workspace storage
Every run takes a new workspace volume. Which StorageClass it comes from is decided for each CI cluster, in this order:- The class you named with
ankra cluster agent ci set --storage-class <class>. It is used as named. - The cluster’s default StorageClass, when its provisioner creates volumes.
- The disk of the node the run is placed on, when the cluster has neither. Each run’s workspace is then a directory on that node, so pipelines run on a cluster with no storage driver and no StorageClass.
ankra-ci-node-local and a StorageClass of the same name. You install and configure nothing. What to know:
- The class is for pipelines only. An admission policy refuses a PersistentVolumeClaim that names
ankra-ci-node-localoutside the pipeline namespaces, so nothing else can fill a node’s disk through it. The policy needs Kubernetes 1.30 or later; on an older cluster the agent installs nothing and the run fails withnode_local_storage_not_ready. - A workspace lives on one node, under
/var/lib/ankra-ci-node-local, and every step that uses it runs on that node. The directory is removed when the workspace’s volume is deleted. - Ankra keeps 15% of the node’s disk free. A step whose workspace would leave less waits for room, and fails with
node_local_disk_fullwhen none comes in time. A workspace larger than the node’s disk can ever give fails withnode_local_volume_refused. - Caches are not kept on the nodes. A step’s caches run without a volume and the step reports
cache_volume_fallback, unless the organisation’s pipelines have a ready backup vault and the agent keeps caches there as archives.
ankra cluster agent upgrade), then run the pipeline again. To keep workspaces off the nodes, or caches between runs, install a storage driver and name its class. See Set up storage on a cluster you connect, and Node-local storage is not ready when the setup fails.
Ankra platform builders
Ankra platform builders are the Ankra-operated build lane abuild step falls back to when the pipeline cluster cannot build. The fallback covers two causes:
- The cluster’s agent does not run pipeline steps.
buildruns on Ankra platform builders, thecheckoutin front of it is settled for that build, and the run’sscanstages run on Ankra’s platform scanner. Stages that need your cluster, such as your own tests, are refused with a sentence naming the agent to upgrade. - The cluster’s node runtime confines the rootless image builder. Typical for AppArmor on k3s or Ubuntu nodes, and a kubelet that defaults seccomp to
RuntimeDefault. Onlybuildis routed away; seebuild_runtime_confined.
ci_build_fallback: platform_builders (the default, Build on Ankra when your cluster cannot under Build rules), platform builds allowed for the organisation (the default), and a stage the lane can accept. With platform builds switched off, the step concludes build_fallback_none. ankra org ci-settings get prints Platform builds enabled: yes or no; if it reads no, open a support ticket naming the organisation and the pipeline cluster.
- Sharing the pool. One organisation runs at most three builds on Ankra platform builders at a time; a fourth waits in order and is not failed. See Waiting for a builder.
- What you see. The step’s
executorrecordsplatform_builders. There is no live log stream, because the step was never sent to an agent; the archived log appears when the build concludes. The image is pushed by digest to the organisation’s CI staging repository, so your pipeline’s ownscan,gateandpublishstill decide whether it is promoted. - When Ankra cannot see its builders. A build waits in the queue while Ankra cannot read whether its builders are running, during a brief platform outage for example, and is not failed for it; the step’s own time limit still applies. A build is concluded for lack of a builder only when Ankra reads that none is running. The step of a queued build then says “None of Ankra’s platform builders was running to take this build.” A build stopped before it was queued says instead why it went to the builders and that none is running. Scans on Ankra’s platform scanner are treated the same way.
- Scans of a run handed to the builders. Each scanner runs the same pinned image and script on Ankra’s platform scanner, against the commit and the image the builders built, and the
gatejudges the reports under the same policy. A scan the platform scanner cannot run concludesinfra_error(platform_scanner_unavailable), so nothing unscanned is published. - What the lane refuses. In a multi-component application, a build stage must belong to a component the application records (which component a build belongs to), or it is refused as
platform_build_unavailable; a repository with no linked application is refused the same way. Everybuild_argsentry must carry a literal value,NAME=value; a bareNAMEis refused asbuild_fallback_unsupported. BuildKit’s own platform arguments (TARGETOS,TARGETARCH,TARGETPLATFORM,TARGETVARIANTand the fourBUILDones) are the exception: the builder sets them itself, so a bare one is left out and the stage builds.
Logic is open, authority is closed
Anyone who can push can change what a pipeline does: add stages, rewrite scripts, pick any image the organisation’s policy allows, change conditions, matrices,needs and artifacts. What a run may touch is not the pull request’s to decide. These sections are protected - they come from the organisation’s policy and the definition on the default branch, never from a pull request’s copy of the file:
permissions- the API scopes the run identity is minted with.secretsandcredentials- each declared binding, by name, source and key.on.pull_request.fork_policy.defaults.networkand a stage’snetworkwhen it is aboveegress-https.runs_onon every stage - cluster, node selector, tolerations, runtime class - and the whole ofresources:gpu,cpuandmemory.- A stage’s
timeout. - A stage’s
cacheblock -key,paths,size,restore_keysandfallback. - A stage’s
with:block, which is where agatestage’s scan-tool configuration lives. - The
servicesblock - each sidecar’s image, environment and ports. - A
gatestage’s approval roles and required stages, anapprovalstage’s roles and minimum approvals, anagentstage inagentmode and its tool profile, awebhookstage’s URL, anexternalstage’s provider and workflow. - The
environmentsblock - data policy, verification, rollout and gate per environment. - A
kind: deploystage’senvironmentand itsdeployblock - whichpublishstage’s image rolls out, as which release, to which of the environment’s targets. - A
publishstage’spublish.promote_from- whether a merge may publish the image its pull request run already tested, without building it again. - A
kind: environmentstage’stest_environmentblock and itsmatrix- the clusters a run builds, which your organisation pays for, how many of them, and what runs on them. On every other kind of stage thematrixis logic.
approved- the head declares exactly the trusted authority. An ordinary pull request that changed no protected section reads this way.unapproved- a push to the default branch changed a protected section nobody has approved; the run executes under the last approved authority (or none) until someone does.changed_on_head- a pull request added a credential, widened its egress, or moved a step onto another node pool. The change is ignored for this run and surfaced.
approved, naming what changed and what to do. The commit status leads with it too, except on a run that went ahead while its approval waits, where it names the waiting approval after the run’s state. Approve as in step 5: from Pipeline settings waiting for approval on Build & delivery → Builds and clusters, on the Approvals tab, from Review authority for approval on an application’s run (a repository’s run links to Review in Builds and clusters), with Approve authority on the GitHub check run, or with ankra pipeline definitions approve <definition-id>. On the API it is POST /api/v1/org/pipelines/definitions/{definition_id}/approve, and POST /org/applications/{id}/pipeline/approve-definition is the same act addressed by the application, with the same checks. Narrowing the image allow-list afterwards does not invalidate an approval, because the policy is applied at plan time and is not part of the hash.
The scan takes its settings from the platform
The gate judges what the platform scanned, not what the repository allowed it to see. So thescan stage’s Trivy leg ignores any Trivy settings the repository carries:
- a
.trivyignore,trivy.yamlortrivy-secret.yamlcommitted anywhere in the checkout - any
TRIVY_*variable a stage’senvor secrets declare
[scan] ignoring TRIVY_SEVERITY: Trivy takes no settings from the pipeline.
To stop a finding blocking a run:
- Trivy: fix it, by upgrading the package or the base image. How strict the gate is belongs to the organisation’s
ci_image_gateandci_ignore_unfixedsettings. - Semgrep: the repository’s
.semgrepignoreand inlinenosemgrepcomments still apply, because a reviewer sees them in the diff. - Semgrep or Checkov, without changing the code: record a code finding disposition with
ankra security code-dispositions create. It covers one rule in one file, is audited, and an accepted risk expires. A CRITICAL finding is never waived.
What a step runs as
Every step is a hardened batch/v1 Job in theankra-ci namespace, which enforces the Pod Security Standards’ Restricted profile: uid and gid 65532, the RuntimeDefault seccomp profile, no privilege escalation, a read-only root filesystem, every capability dropped, no service account token, one attempt, an explicit deadline and a TTL. A pipeline cannot ask for host privilege, host namespaces, host paths or control-plane placement. The one relaxation is the rootless BuildKit pod a build stage runs, in its own ankra-ci-build namespace under the Baseline profile - never privileged, never root, and no pipeline can name its own build or checkout image: both are Ankra’s own, pinned by digest.
With the root filesystem read-only, a step can write to three places:
/workspaceis the run’s shared volume: the checkout lands there, and it carries files from one step to the next./tmpis a 256 MiB memory-backed tmpfs, private to the step and counted against its memory. PointTMPDIRinto the workspace for big temporary files:export TMPDIR=/workspace/.tmp && mkdir -p "$TMPDIR"at the top of the step’srunscript./dev/shmis 64 MiB unless the stage setsshm_size.
USER and LOGNAME set to ankra, and HOME is /tmp. HOME and TMPDIR cannot be set in a stage’s env, so export them in the run script when a tool needs them elsewhere.
- Network tiers.
nonedenies all egress, and is what a stage gets when neither it nordefaultsnames a tier - exceptcheckout,buildandscan, which default toegress-https(the tier a stage gets by default).egress-httpspermits DNS to the cluster’s own resolver (thekube-systemnamespace, plus169.254.0.0/16for NodeLocal DNSCache) and 443/TCP to public addresses only: RFC1918,169.254.0.0/16,100.64.0.0/10,fd00::/8,fe80::/10and AWS’sfd00:ec2::254are excluded, so a step reaches neither your private networks nor a cloud metadata endpoint. Abuildstep on the tier also reaches the same public addresses on 80/TCP, with the same exclusions, so a Dockerfile’sapt-get updatefrom a plain-HTTP mirror works;ci_egress_allowed_cidrsreopens private ranges on 443 only.servicesis deny-all plus the run’s own pods and the same DNS rule. - Image policy. A
runorscanstage’s image, and a named service’s image, are checked againstci_allowed_image_prefixeson the platform and again by the agent before anything runs; a sidecar outside the policy refuses the whole step.checkoutandbuildalways run Ankra’s own pinned images. - Resources. A stage’s
cpuandmemoryare the step’s limits. It may ask for at most 8 CPU cores, 32 GiB of memory and 4 GPU devices, and a GPU step must name aruns_on.node_selector. - Reserved names. A step or a service it names may not set environment variables beginning
ANKRA_, the loader andPATHvariables,HOME,TMPDIR,XDG_RUNTIME_DIRandXDG_CACHE_HOME, or the image builder’sBUILDKIT*,BUILDCTL,ROOTLESSKITandDOCKER_CONFIG. - Secrets and credentials. A declared binding is revealed once, to a file under
/run/agent-secretsnamed after the binding, by the agent calling back with its own session token - never written into the step’s payload, and never logged by Ankra. If the step itself prints a value, the agent replaces it with[redacted]before the line is streamed or uploaded, but only an exact copy of a value at least 8 characters long: a shorter value, or one printed encoded (base64, URL-escaped) or split across lines, reaches the log as printed. Acheckoutstep’s git credential is read by a credential helper that answers only for the host it was minted for. - Forks. A pull request whose head lives in a fork, or whose provenance the delivery could not establish, runs with no secrets, no credentials and no identity beyond reading itself (
fork_policy: read_only, the default).checkoutandbuildclone the fork’s head anonymously;buildrenders with no push target, so nothing it produces reaches a registry. Every stage butcheckout,buildandscanruns with no network at all. Such a run is also budgeted: at most 8 matrix legs per stage, a 60-minute step timeout, 2 CPU and 4Gi per step, no sidecar services, no shared cache, and 256 MiB of artifacts and logs for the whole run. Aplan_fork_budget:diagnostic names the ceilings. - Permissions.
pipelines.readcovers reading runs, logs, artifacts, the stored definition, schedules and validation;pipelines.operatecovers dispatch, cancel and re-run;pipelines.managecovers connecting a repository, replacing the stored definition, schedules, the pipeline policy and its approvals, and a dispatch with a--spec-fileoverride.
When something fails
Every failed step carries an error class, and the class decides whose failure it is.- Yours, never retried.
step_failed(the script exited non-zero),step_refused(the definition asked for something the policy or the renderer refuses - an image outside the allow-list, a missing script, too much compute, or abuildwhose push target cannot be resolved), andtimeout. A non-zero exit is final. - An image with no build for your nodes. When the step’s image, or a service’s, has no variant for the node’s platform (the runtime says
no matching manifest for linux/arm64/v8), the step fails on the first try, naming the image and the platform, and is not retried. Use an image published for that platform, or run on a cluster whose nodes match. build_emulation_missing: a build for a platform its node does not run. Thebuilddeclares a platform its node can neither run nor emulate, so it stops before the image build starts and is not retried. Place the stage on a node of that architecture withruns_on.archand dropplatforms; see CPU architecture.- Ankra’s, retried once.
agent_infra(the cluster could not create the namespace, bind the volume or pull the image, or the step’s pod ended before its container started, so none of the step’s commands ran: the message starts “This step never ran”),worker_lost,result_malformed,agent_offline,agent_never_started(no agent claimed the step inside its timeout - check that the cluster is connected andci_worker_countis above zero),build_runtime_confined,execution_vanishedandstranded. The second failure concludes the step asinfra_error, and the check run settles asaction_requirednaming the class. - No room on the cluster, sent twice. When no node takes a step’s pod within 15 minutes, the step goes back to the queue, once, unless it had already gone back before. It is sent again at once, or, while the run’s workspace or its other steps hold a node, when that node has room for it. It never ran, so nothing is lost. If no node takes it the second time either, it concludes
timed_outwith the classnever_scheduled. A step too large for the plan of its run’s CI playground makes the playground grow instead, or concludes the first time on a trial or past the largest plan. Add nodes, raise the node group’s maximum, or lower the stage’sresources. build_runtime_confined: your nodes confine the image builder. Unless the cluster names an AppArmor profile for it, the build pod names no seccomp or AppArmor profile, because the Baseline profile theankra-ci-buildnamespace enforces forbidsUnconfined. On a node whose runtime turns that into a confining profile (containerd’s default AppArmor profile on Ubuntu, or a kubelet defaulting seccomp toRuntimeDefault), rootlesskit cannot start and the builder dies before your Dockerfile is read. Withci_build_fallback: platform_buildersand platform builds allowed, the retry and every later build on that cluster go to Ankra platform builders. The verdict is remembered per cluster against the agent version and builder image, so a cluster pays this failure once. With the fallback set tononethe build is refused, naming the containment. To keep builds in your cluster on AppArmor nodes,ankra cluster agent ci set --build-apparmor-profile ankra-managedhas Ankra load a profile for the builder on your nodes, or you install one yourself and name it: see The build step fails before the Dockerfile is read.- Ankra’s, never retried.
step_stranded- a step stillpendingafter its run outlived the sum of every step’stimeout(capped at 6 hours plus a grace window) - concludes asinfra_error. Its message names what the run was still waiting on: the cluster’s agent when nothing could claim the step (no agent, an agent that stopped checking in, or no pipeline workers), CI capacity when every worker was busy with other runs or the organisation was atci_max_parallel_runs, and both when Ankra cannot tell. See Why a run is waiting.report_unreadable- ascanstep that succeeded but whose report Ankra could not download or parse - is revised toinfra_errorwith “Ankra could not read the<report>report this step produced, so its findings were not recorded.” With no ready vault on either side, ascanstep is refused before it runs withartifact_store_unavailable. - Timeouts. A stage runs under its
timeout, ordefaults.timeout, or 30 minutes; the ceiling is 6 hours and a longer value is clamped. The agent stops a step at its deadline with a 60-second grace. - Cancel. Cancel run on the run (or Force cancel),
ankra pipeline cancel <run>, or the Cancel button on the check run. A cancelled run concludes with outcomecancelled. - Re-run. Re-run → Re-run failed steps or Re-run all steps on the run,
ankra pipeline rerun <run>(add--failed-only), or GitHub’s Re-run button on the check. A re-run is a new run withrerun_of_run_idpointing at the old one, and re-plans from the original run’s own definition. A re-run of a push is planned as that push, so its push-only stages such aspublishrun again and the image it publishes can still become the application’s deployment candidate. - Failed-only re-runs start from an empty workspace.
--failed-onlyre-runs the checkout and every upstream step whose output a repeated step reads, together with the failed steps and their dependents. Steps that succeeded and that nothing repeated needs are not repeated.
What a failed run shows
A run’s page opens on how the run ended. A failed run’s card is titled with the step that stopped it, or with how many did (3 steps failed), and says why: a reason several steps share is said once, with each of those steps under it, and clicking a step opens its output. Under that come who started the run, its branch, its commit, when it started, how long it took, and Re-run. A run of a repository no application builds from has the same card. Resource suggestions, under the steps, gives each stage one row with its memory and CPU verdicts beside the figures behind them, and the declaration to change for a stage that has a suggestion. The stages with a suggestion come first, and a label that needs explaining, such as Peak at its limit, is explained once under the list.Diagnosis codes
A step that failed for a reason Ankra recognises, or that has waited more than two minutes for its pod to start, carries adiagnosis: a stable code, a title, a next_step and, where there is one, the cluster’s or provider’s own words in detail (cleaned of anything that looks like a credential, cut to 300 characters). The run carries the one to act on first, and the run page shows it above the steps. A step that failed in its own script has no diagnosis, because its log is the answer. Ankra reads only evidence it already has: the step’s error class, the Kubernetes events on its pod and volume, the Cluster Autoscaler’s events, and its own record of node creates a provider refused.
Why a step, or a CI cluster, is waiting
How long a refusal stays the reason. A failed or refused request for a node (
scale_up_failed, provider_quota_exceeded or provider_volume_quota_exceeded) stays a waiting step’s reason for 30 minutes, or until a later request for a node of the same group is accepted (for a node Ankra’s own create failed, until a later create succeeds). On a cluster where Ankra autoscales a node group, the autoscaler asking again does not clear the reason, because that request can be refused too. A provider_server_type_unavailable that Ankra recorded itself counts while Ankra confirmed it in the last hour and the group still uses that server type in that location: moving the group to another type ends it at once. On a cluster where no node group can grow for that reason, a build stage that declares no resources is sized to the room the cluster’s nodes have left, rather than to a new node that will not come.
Why a step or run failed
A notice on a passing step
The codes are a fixed vocabulary that monitoring and scripts can key on; the sentences may be reworded. For symptoms and fixes, see Troubleshoot Ankra CI.
Status is the lifecycle, outcome is the verdict
A run and each of its steps carry two fields.status is where the work is in its life; outcome is how it finished, and it is null until status is concluded. A monitor that filters steps on status == "failure" matches nothing: read outcome.
A run’s outcome is
success when every step succeeded or was skipped, otherwise the worst of what its steps reported. A run also records the authority it executed under, as authority_state (the Authority: line in ankra pipeline get):
Limits and defaults
Bring your own CI (GitHub Actions)
You do not have to delete your existing CI to try Ankra Pipelines. The generated GitHub Actions workflow keeps building and publishing, and a pipeline run on the same commit is a second check,Ankra pipeline, beside the workflow’s own. Connecting is not inert: once .ankra/pipeline.yaml is the definition of record and the organisation has a CI cluster, the application’s pull request previews deploy the pipeline’s digest. A merge to the default branch is more forgiving, because your own CI’s build observation outranks the pipeline’s, so the workflow stays what deploys production until you retire it. Ankra never deletes a workflow for you.
Review what to check after conversion and watch the pipeline publish correctly a few times before you retire the workflow. Migrate from GitHub Actions explains the conversion, including how to move an application already on Ankra.
Commands and API
Every command addresses one pipeline with--application <name-or-id> or --repository <repository-id>; inside a checkout both are optional. ankra application pipeline … is the same set with a leading <application-id> argument. Every flag is in the CLI reference.
The same operations are on the API under
/api/v1/org/applications/{application_id}/pipeline-runs, /api/v1/org/pipeline-repositories/{repository_id}/pipeline-runs and /api/v1/org/pipelines/repositories, with a bearer token. Creating a run answers 202 with the run id and its number.
Next steps
pipeline.yaml reference
Every key, the expression language, the trigger table and the diagnostics the validator reports.
Deploy on merge
Build once, promote the tested image and get it onto a cluster when a pull request merges.
Migrate from GitHub Actions
Convert a workflow, GitLab CI file, Bitbucket pipeline or CircleCI config and review what changed.
Backup vaults
Optional: where pipeline logs, artifacts and scan reports live when you bring your own bucket.