Dependent Environments
Create dependent environments in Facets that inherit infrastructure, tools, and deployed resources from a base environment to cut cost and duplication.
The Dependent Environment feature in Facets introduces a new paradigm in environment management by allowing it to inherit infrastructure, tools, and any deployed resources from a designated Base Environment.
This promotes consistency, reduces duplication of efforts, and simplifies maintenance by allowing dependent environments to be updated with changes made to the base environment if needed.
When to use it
The two primary scenarios for using dependent environments are feature or non-production environments within the same project and shared non-production environments across projects. Both scenarios optimize cost and simplify infrastructure management. Read More
Create a dependent environment
Using prompt
Create a dependent environment called pr-142 in myproject, based on staging, with its own copy of service/api.or
Using command
raptor create environment pr-142 -p myproject --base-env staging \
--dedicated service/api --launch -w--base-env is what makes it dependent: the new environment inherits the base's blueprint
and its live infrastructure, and only the resources named with --dedicated KIND/NAME are
deployed fresh. Raptor writes the per-resource inherit overrides for everything else.
With no --dedicated, every resource in the project's blueprint deploys fresh.
--artifact NAME=URI registers a new image for a dedicated service; leave it out and the
inherited image is used.
The flow is idempotent, so re-running it against an environment that already exists does not create a second one.
New to the CLI? Install it first.
While launching a new environment:
- Connect your Cloud Provider:
- Under the Infrastructure Type, choose the option to Use Existing Infrastructure to create a dependent environment.
- Select the Base Environment from which the dependent environment will inherit its infrastructure and settings.
- Specify a Namespace for where this environment will be set up in the Kubernetes cluster, to organize and isolate resources effectively.
- Review Secrets and Variables: You can input the actual values for variables declared in the Blueprint either now or after the launch. However, if you prefer, you can skip the 'Secrets and Variables' tab at this time.
- Review Resources:
- It provides a comprehensive overview of all resources in your environment.
- It also allows you to enable or disable resources prior to launching the environment.
- Once you have completed these steps, click Launch Environment.
Per-branch environments
A per-branch environment is a short-lived dependent environment for one branch or pull request. Only resources your CI names with --dedicated deploy fresh.
Using prompt
Create a preview environment for branch feat/checkout from staging in myproject, with its own service/api on image IMAGE_URI, destroyed after 6 hours.The raptor skill gives your AI assistant these steps and CI workflow templates.
or
Using command
raptor create environment feat/checkout -p myproject --base-env staging \
--dedicated service/api --artifact api=IMAGE_URI \
--ephemeral --ttl 6h --launch -wNew to the CLI? Install it first.
The web UI can't create a per-branch environment.
| Flag | What it does |
|---|---|
--ephemeral --ttl 6h | After the TTL, destroys the infrastructure but keeps the environment (short-lived). Bare numbers are hours; re-runs reset the clock. |
--base-env PROJECT/NAME | Uses a base in another project. |
--namespace NAME, --no-namespace | Kubernetes namespace (default: the environment name), or none. |
--copy-config, --no-copy-config, --refresh-config | Variable and secret copying, below. |
--no-copy-overrides | Skips copying the base's overrides onto dedicated resources. |
--no-mirror-base | Skips mirroring the base's on/off state before first launch. |
--external-id | Records a CI run reference with each image. |
Names are lowercased and other characters become - (feat/checkout becomes feat-checkout). Names over 63 characters are cut and hashed, so a branch always maps to one environment.
A per-branch environment reads and writes the base's live databases and queues.
Variables and secrets are copied on first create only: by default with --dedicated, otherwise with --copy-config. --refresh-config overwrites them later. Only key names are printed. Each dedicated resource without its own settings gets the base's override once.
On a no-cloud base in the same project, the namespace comes from the reserved blueprint resource kubernetes_namespace/facets-eph-namespace. If it's missing or has no cluster wired, the command stops first and prints the fix.
Re-runs update the same environment; another repo can add its own --dedicated resources. With -w, it fails if a dedicated resource's release fails, waiting up to 30 minutes each.
To remove it entirely, destroy, then delete:
raptor destroy environment feat-checkout -p myproject --yes -w
raptor delete environment feat-checkout -p myproject --yesFor a base with dependents, see Destroying an environment.
Creating one needs Environment Write and Configure, Release Launch and Selective Release, Resource Override, and Artifacts Write or CLI Artifact Push. Teardown adds Release Destroy and Environment Delete. By default only Admin has all of them (permissions).
Static Launch (Legacy)
The legacy Facets launch flow, covering cloud and network setup, Kubernetes configuration, resource selection, and how to destroy or delete an environment.
Template Inputs
Use Facets template inputs and Mustache files to deploy per-tenant replicas of a resource in one environment, with logically isolated, centrally managed silos.