Configuration#
Environment variables#
The library uses environment variables to configure the behavior. The following variables are available:
Offline runs#
This section is related to partial or full offline mode without actually calling GCP services.
WANNA_GCP_ACCESS_ALLOWEDallows communication with GCP.- Default true.
- Disable for running tests without access to the internet and off-line validations or dry-runs.
WANNA_GCP_ENABLE_REMOTE_VALIDATIONallows validation of GCP resources like region, machine type, etc.- Default true.
- Disable for quick validation without querying GCP for list of regions or machine types.
WANNA_GCP_CLOUD_BUILD_ACCESS_ALLOWEDallows using cloud build instead of local docker build.- Default true.
- Disable for local docker build if you can't or don't want to use the cloud build.
WANNA_OVERWRITE_DOCKER_IMAGEoverwrites the docker image name in the repository.- Default true.
- Disable for docker image repositories which don't allow overwriting the image.
WANNA_ALWAYS_OVERWRITE_DOCKER_TAGSsets which tags should be overwritten every time. Useful for e.g.latesttag, which usually can be overwritten even when other tags can not. Set them as comma-separated list. This variable is used only whenWANNA_OVERWRITE_DOCKER_IMAGEis set to false.- Default
latest.
Docker push configuration#
This section covers configuration of docker image name, including repository.
Following env vars are available. They all are optional and don't have default:
WANNA_DOCKER_REGISTRY_SUFFIXoptional path in the registryWANNA_DOCKER_REGISTRYoverridesdocker.registryandgcp_profile.docker_registryinwanna.yaml- if none are specified, the registry
{gcp_profiles.region}-docker.pkg.devis used. WANNA_DOCKER_REGISTRY_REPOSITORYoverridesdocker.repositoryandgcp_profile.docker_repositoryinwanna.yamlWANNA_DOCKER_REGISTRY_PROJECT_IDoverridesgcp_profiles.project_idinwanna.yaml
The whole algorithm is a bit complex and can be seen in docker.py, but if all variables are specified, the final image name is:
WANNA_DOCKER_REGISTRY / WANNA_DOCKER_REGISTRY_SUFFIX / WANNA_DOCKER_REGISTRY_PROJECT_ID / WANNA_DOCKER_REGISTRY_REPOSITORY / wanna_project.name / docker.images.name
Others#
WANNA_IMPERSONATE_ACCOUNTsets SA for impersonation- Required in some CI environments if the automated mechanism for impersonation does not work.
WANNA_GCP_PROFILE_PATHcan be used to load GCP profiles from outside ofwanna.yamlfile.