Skip to main content

Execution modes

A template runs in one of four shapes. Decide first; everything else follows.

Long-running HTTP​

The default. Just expose your services with fibe.gg/port and they stay up until you stop them. No special settings needed.

Trick (one-shot)​

Required pieces:

  • x-fibe.gg.metadata.job_mode: true
  • A watched service. Dynamic source-backed services are watched by default in job mode unless they set fibe.gg/job_watch: "false"; static services need fibe.gg/job_watch: "true".

Trick rules Fibe enforces for you:

  • Routing labels such as fibe.gg/port, fibe.gg/visibility, and fibe.gg/subdomain are stripped before launch: a Trick isn't there to serve traffic.
  • Every service is forced to one replica and not to restart.
  • Watched services must actually exit (don't run a dev server or sleep loop).
  • The Trick succeeds when every watched service exits with status zero; non-zero on any watched service fails the run.
  • A Trick with no watched service, or with watched services that never exit, fails by timing out rather than at template validation time.
services:
test:
image: node:22
working_dir: /app
labels:
fibe.gg/repo_url: https://github.com/owner/repo
fibe.gg/start_command: npm test
fibe.gg/job_watch: "true"
fibe.gg/production: "false"

x-fibe.gg:
metadata:
description: "Run npm test against the repo"
category: "CI"
job_mode: true

Scheduled (cron)​

A Trick that fires on a recurring schedule. Add schedule_config with enabled, a cron expression, and the target Marquee.

CronMeaning
0 3 * * *daily at 03:00
*/5 * * * *every 5 minutes
0 */2 * * *every 2 hours
0 0 1 * *first of every month at midnight
30 6 * * 1-506:30, Mon-Fri

The cron field accepts standard five-field cron and plain-language schedules such as every day at 9am or every 5 minutes. Invalid expressions are rejected when the template is saved or imported. There is no minimum interval, so a schedule can run every minute.

Overlap

Jobs can overlap when they run longer than their period. Stateful (Persist Volumes) Tricks queue runs and execute them one at a time. Otherwise, use a period longer than the maximum job time or guard the job with a lock. The Tricks page covers runtime limits, result retention, and queueing.

x-fibe.gg:
metadata:
job_mode: true
description: "Nightly backup to S3"
category: "Operations"
schedule_config:
enabled: true
cron: "0 3 * * *"
marquee_id: 1

Triggered (push or pull request)​

A Trick that fires on a Git event. Add trigger_config with the event type (push or pull_request), the repo URL, branch, the Prop the source is connected through, and the target Marquee.

  • push fires when the named branch itself receives a commit.
  • pull_request fires when a PR is opened or updated whose source (head) branch matches branch; that head branch is also the code under test. Set branch to the branch PRs are made from: matching on the PR's target branch isn't supported.
  • Wildcards across many branches aren't supported: make a template per shape.
x-fibe.gg:
metadata:
job_mode: true
description: "Run tests on every push to main"
category: "CI"
trigger_config:
enabled: true
event_type: push
repo_url: https://github.com/owner/repo
branch: main
prop_id: 1
marquee_id: 1

You can combine schedules and triggers​

A Trick can be both scheduled (run every night) and triggered (run on every push). Each event fires its own run.