Services
Crow provides a services: section in the pipeline config file for “service” containers.
These are static daemon services like databases or APIs which are then used/consumed by other containers within the pipeline.
To illustrate possible use cases, the below examples uses a “database” and a “cache” service.
Hostnames
Section titled “Hostnames”Services are accessed via DNS using their assigned hostnames.
In the example below, the MySQL service is assigned the hostname database and is subsequently available at database:3306.
Ports and Protocol
Section titled “Ports and Protocol”Defining ports and their protocol is supported:
Configuration
Section titled “Configuration”Service containers allow exposing environment variables to customize their startup.
Service containers like databases benefit greatly from tmpfs mounts, which store data in RAM instead of on disk. This can significantly speed up test pipelines.
See the tmpfs section in the workflow syntax for more details on size limits and mount options.
Detachment
Section titled “Detachment”Services always start at the beginning of a workflow, asynchronously to any other step.
With the detach option, the execution order can be controlled in a more granular way.
This setting allows using normal steps as implicit “service” steps which honor the specified execution order.
These steps will also terminate at the end of the workflow.
Initialization
Section titled “Initialization”Service containers require time to initialize and begin accepting connections.
If the service is not yet available when the first step tries to connect and using detach is not an option, adding a short sleep command can help: