LaunchFlow YAML
launchflow.yaml
contains the default configuration for your project. A basic launchflow.yaml
file looks like this:
1project: my-project
2environment: dev
This yaml config sets defaults for LaunchFlow CLI commands such as launchflow create
or launchflow deploy
- In this case it will use the my-project
project and dev
environment by default. You can override these commands at any time by using the --project
and --environment
flags. For example:
1launchflow create --environment prod
will create a new environment using the prod
environment in the my-project
project.
The yaml configuration also describes what services are connected, this is what launchflow deploy
will use to deploy your services. An basic example of a launchflow.yaml
file with services looks like this:
1project: my-project
2environment: dev
3services:
4 - name: my-service1
5 product: gcp_cloud_run
6 dockerfile: service1/Dockerfile
7 - name: my-service2
8 product: gcp_cloud_run
9 dockerfile: service2/Dockerfile
When you run launchflow deploy
it will look up what services you have defined to initiate the deployment for each one.
Schema
project
The project name that you want to use for all commands.
- Required: Yes
- Type: string
- Pattern:
^[a-z0-9-]+$
- Min Length: 3
- Max Length: 63
environment
The environment name that you want to use for all commands.
- Required: Yes
- Type: string
- Pattern:
^[a-z0-9-]+$
- Min Length: 3
- Max Length: 15
services
Your configured services. You can have multiple services configured in one yaml file.
services.name
The name of the service.
- Required: Yes
- Type: string
- Pattern:
^[a-z0-9-]+$
- Min Length: 3
- Max Length: 63
services.product
The product that you want to use for the service.
- Required: Yes
- Type: string
- Pattern:
^(gcp_cloud_run|aws_ecs_fargate)$
services.build_directory
The directory to initiate building your service from. This is the directory that will be zipped up and sent to the build engine on your cloud provider (GCP Cloud Build or AWS Code Build). The dockerfile for the service should be in this directory.
- Required: No
- Type: string
- Default:
.
services.dockerfile
The path to the Dockerfile for the service. This path is relative to the build_directory
path.
- Required: No
- Type: string
- Default:
Dockerfile
services.build_ignore
A list of files or directories to ignore when building the service. This is useful for ignoring files that you don't want to be included in the build. These files will not be included in the zip file that is sent to your build engine.
- Required: No
- Type: array<string>
- Default: []
services.product_configs
Configurations for the specific product that you are using. For example, if you are using GCP Cloud Run you can define the min number of instances, cpu, memory, and other configuration for the service. You can have a different configuration for each environment that you deploy your service to.
- Required: No
- Type: array<object>
- Default: []
services.product_configs.base
The base configuration that all environments will inherit from.
- Required: No
- Type: object
- Default: {}
services.product_configs.<environment_name>
The configuration for the specific environment. This will extend and override the base configuration you provide.
- Required: No
- Type: object
- Default: {}
Each type of product has it's own configuration type:
The GCP Cloud run config allows you to configure GCP cloud run services. An example of a GCP Cloud Run configuration looks like this:
1project: gcp-examples
2environment: dev
3services:
4 - name: fastapi-service
5 product: gcp_cloud_run
6 product_configs:
7 dev:
8 region: us-central1
9 cpu: 1
10 memory: 4Gi
11 port: 8080
12 publicly_accessible: false
13 min_instance_count: 0
14 max_instance_count: 10
15 max_instance_request_concurrency: 80
16 invokers:
17 - user:caleb@launchflow.com
region
The region to deploy the service to
- Required: No
- Type: string
- Default: null
cpu
The number of CPUs to allocate for each instance
- Required: No
- Type: number (1, 2, 4, etc..)
- Default: null
memory
The amount of memory to allocate for each instance
- Required: No
- Type: string (256Mi, 512Mi, 1Gi, etc..)
- Default: null
port
The port that the service will listen on
- Required: No
- Type: number
- Default: 8080
publicly_accessible
Whether the service should be publicly accessible
- Required: No
- Type: boolean
- Default: true
min_instance_count
The minimum number of instances cloud run should scale down to
- Required: No
- Type: number
- Default: 0
max_instance_count
The maximum number of instances cloud run should scale up to
- Required: No
- Type: number
- Default: 100
invokers
IAM permissions for who is allowed to invoke the service. This should be in the standard IAM format.
- Required: No
- Type: array<string> (e.g: user:me@gmail.com, allUsers, serviceAccount:sa@sa.com)
- Default: []
custom_audiences
A list of custom audiences that can access the service. See: https://cloud.google.com/run/docs/configuring/custom-audiences.
- Required: No
- Type: array<string>
- Default: []
ingress
The ingress settings for the service. See: https://cloud.google.com/run/docs/securing/ingress.
- Required: No
- Type: "INGRESS_TRAFFIC_ALL" | "INGRESS_TRAFFIC_INTERNAL_ONLY" | "INGRESS_TRAFFIC_INTERNAL_LOAD_BALANCER"
- Default: null