| substitutions: | |
| _BASE_REGISTRY_URI: us-docker.pkg.dev/chromeos-partner-moblab/base-containers | |
| _COMMON_CORE_URI: gcr.io/chromeos-partner-moblab | |
| _REGISTRY_URI: us-docker.pkg.dev/chromeos-partner-moblab/satlab | |
| _SFP_REGISTRY_URI: us-docker.pkg.dev/chromeos-partner-moblab/satlab-for-partners | |
| _INTERNAL_REGISTRY_URI: us-docker.pkg.dev/chromeos-partner-moblab/satlab-internal | |
| _SSH_PORT: "22" | |
| _WATCHTOWER_CMD: --enable-lifecycle-hooks --interval 60 --include-restarting --label-enable | |
| _COMMON_CORE_LABEL: autopush | |
| __LABEL: autopush | |
| __BUILD_VERSION: "stable" | |
| __SHARED_IMAGES_TAG: "stable" | |
| steps: | |
| - id: docker-compose | |
| name: "gcr.io/cloud-builders/docker" | |
| args: ["pull", "${_BASE_REGISTRY_URI}/docker/compose:alpine-1.27.4"] | |
| waitFor: ['-'] | |
| - id: moblab-common | |
| name: "gcr.io/cloud-builders/docker" | |
| args: ["pull", "${_COMMON_CORE_URI}/moblab_common:${_COMMON_CORE_LABEL}"] | |
| waitFor: ['-'] | |
| - id: remote-access | |
| name: "gcr.io/cloud-builders/docker" | |
| args: ["pull", "${_COMMON_CORE_URI}/remote_access:${_COMMON_CORE_LABEL}"] | |
| waitFor: ['-'] | |
| - id: envoyproxy | |
| name: "gcr.io/cloud-builders/docker" | |
| args: ["pull", "${_BASE_REGISTRY_URI}/envoyproxy/envoy:v1.15.2"] | |
| - id: alpine-3.17 | |
| name: "gcr.io/cloud-builders/docker" | |
| args: [ "pull", "${_BASE_REGISTRY_URI}/alpine:3.17_alpha20220715-edge" ] | |
| waitFor: [ '-' ] | |
| - id: blacklabelops-logrotate | |
| name: "gcr.io/cloud-builders/docker" | |
| args: ["pull", "${_BASE_REGISTRY_URI}/blacklabelops/logrotate:latest"] | |
| waitFor: ['-'] | |
| - id: opentelemetry-collector-contrib | |
| name: "gcr.io/cloud-builders/docker" | |
| args: ["pull", "${_BASE_REGISTRY_URI}/opentelemetry-collector-contrib:0.116.1"] | |
| waitFor: ['-'] | |
| - id: ubuntu | |
| name: "gcr.io/cloud-builders/docker" | |
| args: ["pull", "ubuntu:18.04"] | |
| waitFor: ['-'] | |
| ########################################################################### Satlab images | |
| - id: compose | |
| name: "gcr.io/cloud-builders/docker" | |
| dir: src | |
| args: | |
| [ | |
| "build", | |
| "--build-arg", "REGISTRY_URI=${_REGISTRY_URI}", | |
| "--build-arg", "LABEL=${__LABEL}", | |
| "--build-arg", "COMMON_CORE_LABEL=${_COMMON_CORE_LABEL}", | |
| "--build-arg", "COMMON_CORE_URI=${_COMMON_CORE_URI}", | |
| "--build-arg", "BASE_REGISTRY_URI=${_BASE_REGISTRY_URI}", | |
| "--build-arg", "SFP_REGISTRY_URI=${_SFP_REGISTRY_URI}", | |
| "--build-arg", "BUILD_VERSION=${__BUILD_VERSION}", | |
| "--label=version=${__BUILD_VERSION}", | |
| "-t", "${_REGISTRY_URI}/satlab-compose:${__BUILD_VERSION}", | |
| "-t", "${_REGISTRY_URI}/satlab-compose:${__LABEL}", | |
| "-f", "dockerfiles/compose/Dockerfile", | |
| "." | |
| ] | |
| env: | |
| - "DOCKER_BUILDKIT=1" | |
| - "WATCHTOWER_CMD=${_WATCHTOWER_CMD}" | |
| waitFor: | |
| - "docker-compose" | |
| - "moblab-common" | |
| - id: dns | |
| name: "gcr.io/cloud-builders/docker" | |
| dir: src | |
| args: | |
| [ | |
| "build", | |
| "--build-arg", "REGISTRY_URI=${_REGISTRY_URI}", | |
| "--build-arg", "LABEL=${__LABEL}", | |
| "-t", "${_REGISTRY_URI}/satlab-dns:${__BUILD_VERSION}", | |
| "-t", "${_REGISTRY_URI}/satlab-dns:${__LABEL}", | |
| "-f", "dockerfiles/dns/Dockerfile", | |
| "." | |
| ] | |
| env: | |
| - "DOCKER_BUILDKIT=1" | |
| waitFor: | |
| - "alpine-3.17" | |
| - id: satlab-remote-access | |
| name: "gcr.io/cloud-builders/docker" | |
| dir: src | |
| args: | |
| [ | |
| "build", | |
| "--build-arg", "REGISTRY_URI=${_REGISTRY_URI}", | |
| "--build-arg", "LABEL=${__LABEL}", | |
| "--build-arg", "COMMON_CORE_LABEL=${_COMMON_CORE_LABEL}", | |
| "--build-arg", "COMMON_CORE_URI=${_COMMON_CORE_URI}", | |
| "--build-arg", "BASE_REGISTRY_URI=${_BASE_REGISTRY_URI}", | |
| "--build-arg", "BUILD_VERSION=${__BUILD_VERSION}", | |
| "-t", "${_REGISTRY_URI}/satlab_remote_access:${__BUILD_VERSION}", | |
| "-t", "${_REGISTRY_URI}/satlab_remote_access:${__LABEL}", | |
| "-f", "dockerfiles/satlab_remote_access/Dockerfile", | |
| "." | |
| ] | |
| env: | |
| - "DOCKER_BUILDKIT=1" | |
| - "SSH_PORT=${_SSH_PORT}" | |
| waitFor: | |
| - "remote-access" | |
| - id: satlab-rpcserver | |
| name: "gcr.io/cloud-builders/docker" | |
| dir: src | |
| args: | |
| [ | |
| "build", | |
| "--build-arg", "REGISTRY_URI=${_REGISTRY_URI}", | |
| "--build-arg", "LABEL=${__LABEL}", | |
| "--build-arg", "COMMON_CORE_LABEL=${_COMMON_CORE_LABEL}", | |
| "--build-arg", "COMMON_CORE_URI=${_COMMON_CORE_URI}", | |
| "--build-arg", "BASE_REGISTRY_URI=${_BASE_REGISTRY_URI}", | |
| "--build-arg", "BUILD_VERSION=${__BUILD_VERSION}", | |
| "-t", "${_REGISTRY_URI}/satlab-rpcserver:${__BUILD_VERSION}", | |
| "-t", "${_REGISTRY_URI}/satlab-rpcserver:${__LABEL}", | |
| "-f", "dockerfiles/satlab-rpcserver/Dockerfile", | |
| "." | |
| ] | |
| env: | |
| - "DOCKER_BUILDKIT=1" | |
| waitFor: | |
| - "moblab-common" | |
| - "satlab-remote-access" | |
| - id: envoy | |
| name: "gcr.io/cloud-builders/docker" | |
| dir: src | |
| args: | |
| [ | |
| "build", | |
| "--build-arg", "REGISTRY_URI=${_REGISTRY_URI}", | |
| "--build-arg", "LABEL=${__LABEL}", | |
| "-t", "${_REGISTRY_URI}/envoy-proxy:${__BUILD_VERSION}", | |
| "-t", "${_REGISTRY_URI}/envoy-proxy:${__LABEL}", | |
| "-f", "/workspace/src/dockerfiles/envoy/Dockerfile", | |
| "." | |
| ] | |
| env: | |
| - "DOCKER_BUILDKIT=1" | |
| waitFor: | |
| - "envoyproxy" | |
| - id: logrotate | |
| name: "gcr.io/cloud-builders/docker" | |
| dir: src | |
| args: | |
| [ | |
| "build", | |
| "--build-arg", "REGISTRY_URI=${_REGISTRY_URI}", | |
| "--build-arg", "LABEL=${__LABEL}", | |
| "--build-arg", "BUILD_VERSION=${__BUILD_VERSION}", | |
| "-t", "${_REGISTRY_URI}/logrotate:${__BUILD_VERSION}", | |
| "-t", "${_REGISTRY_URI}/logrotate:${__LABEL}", | |
| "-f", "/workspace/src/dockerfiles/utilities/Dockerfile.logrotate", | |
| "." | |
| ] | |
| env: | |
| - "DOCKER_BUILDKIT=1" | |
| waitFor: | |
| - "blacklabelops-logrotate" | |
| - id: protoc | |
| name: "gcr.io/cloud-builders/docker" | |
| args: | |
| [ | |
| "build", | |
| "--build-arg", "REGISTRY_URI=${_REGISTRY_URI}", | |
| "--build-arg", "LABEL=${__LABEL}", | |
| "-t", "${_REGISTRY_URI}/protoc:${__BUILD_VERSION}", | |
| "-t", "${_REGISTRY_URI}/protoc:${__LABEL}", | |
| "-f", "/workspace/src/dockerfiles/utilities/Dockerfile.protoc", | |
| "." | |
| ] | |
| - id: protogen-ui | |
| name: "${_REGISTRY_URI}/protoc:${__LABEL}" | |
| entrypoint: bash | |
| args: ["/workspace/src/satlab-ui/protogen_ui.sh"] | |
| waitFor: | |
| - "protoc" | |
| - id: satlab-ui | |
| name: "gcr.io/cloud-builders/docker" | |
| dir: src | |
| args: | |
| [ | |
| "build", | |
| "--build-arg", "REGISTRY_URI=${_REGISTRY_URI}", | |
| "--build-arg", "LABEL=${__LABEL}", | |
| "-t", "${_REGISTRY_URI}/satlab-ui:${__BUILD_VERSION}", | |
| "-t", "${_REGISTRY_URI}/satlab-ui:${__LABEL}", | |
| "-f", "/workspace/src/dockerfiles/ui/Dockerfile", | |
| "." | |
| ] | |
| waitFor: | |
| - "protogen-ui" | |
| - id: opentelemetry-collector | |
| name: "gcr.io/cloud-builders/docker" | |
| dir: src | |
| args: | |
| [ | |
| "build", | |
| "--build-arg", "REGISTRY_URI=${_REGISTRY_URI}", | |
| "--build-arg", "LABEL=${__LABEL}", | |
| "--build-arg", "BASE_REGISTRY_URI=${_BASE_REGISTRY_URI}", | |
| "-t", "${_REGISTRY_URI}/opentelemetry-collector:${__BUILD_VERSION}", | |
| "-t", "${_REGISTRY_URI}/opentelemetry-collector:${__LABEL}", | |
| "-f", "dockerfiles/opentelemetry-collector/Dockerfile", | |
| "." | |
| ] | |
| env: | |
| - "DOCKER_BUILDKIT=1" | |
| waitFor: | |
| - "opentelemetry-collector-contrib" | |
| - id: conf_creator | |
| name: "gcr.io/cloud-builders/docker" | |
| dir: src | |
| args: | |
| [ | |
| "build", | |
| "-t", "${_SFP_REGISTRY_URI}/conf_creator:${__BUILD_VERSION}", | |
| "-t", "${_SFP_REGISTRY_URI}/conf_creator:${__LABEL}", | |
| "-f", "dockerfiles/conf_creator/Dockerfile", | |
| "." | |
| ] | |
| env: | |
| - "DOCKER_BUILDKIT=1" | |
| waitFor: | |
| - "ubuntu" | |
| ########################################################################### Shared images | |
| - id: ats-pull | |
| name: "gcr.io/cloud-builders/docker" | |
| args: | |
| [ | |
| "pull", | |
| "${_INTERNAL_REGISTRY_URI}/ats:${__SHARED_IMAGES_TAG}", | |
| ] | |
| waitFor: ['-'] | |
| - id: ats | |
| name: "gcr.io/cloud-builders/docker" | |
| args: | |
| [ | |
| "tag", | |
| "${_INTERNAL_REGISTRY_URI}/ats:${__SHARED_IMAGES_TAG}", | |
| "${_INTERNAL_REGISTRY_URI}/ats:${__BUILD_VERSION}" | |
| ] | |
| waitFor: | |
| - "ats-pull" | |
| - id: ats-partner-pull | |
| name: "gcr.io/cloud-builders/docker" | |
| args: | |
| [ | |
| "pull", | |
| "${_SFP_REGISTRY_URI}/ats:${__SHARED_IMAGES_TAG}", | |
| ] | |
| waitFor: ['-'] | |
| - id: ats-partner | |
| name: "gcr.io/cloud-builders/docker" | |
| args: | |
| [ | |
| "tag", | |
| "${_SFP_REGISTRY_URI}/ats:${__SHARED_IMAGES_TAG}", | |
| "${_SFP_REGISTRY_URI}/ats:${__BUILD_VERSION}" | |
| ] | |
| waitFor: | |
| - "ats-partner-pull" | |
| - id: bols-pull | |
| name: "gcr.io/cloud-builders/docker" | |
| args: | |
| [ | |
| "pull", | |
| "${_REGISTRY_URI}/satlab-bols:${__SHARED_IMAGES_TAG}", | |
| ] | |
| waitFor: ['-'] | |
| - id: bols | |
| name: "gcr.io/cloud-builders/docker" | |
| args: | |
| [ | |
| "tag", | |
| "${_REGISTRY_URI}/satlab-bols:${__SHARED_IMAGES_TAG}", | |
| "${_REGISTRY_URI}/satlab-bols:${__BUILD_VERSION}" | |
| ] | |
| waitFor: | |
| - "bols-pull" | |
| - id: downloader-pull | |
| name: "gcr.io/cloud-builders/docker" | |
| args: | |
| [ | |
| "pull", | |
| "${_SFP_REGISTRY_URI}/downloader:${__SHARED_IMAGES_TAG}", | |
| ] | |
| waitFor: ['-'] | |
| - id: downloader | |
| name: "gcr.io/cloud-builders/docker" | |
| args: | |
| [ | |
| "tag", | |
| "${_SFP_REGISTRY_URI}/downloader:${__SHARED_IMAGES_TAG}", | |
| "${_SFP_REGISTRY_URI}/downloader:${__BUILD_VERSION}" | |
| ] | |
| waitFor: | |
| - "downloader-pull" | |
| - id: drone-pull | |
| name: "gcr.io/cloud-builders/docker" | |
| args: | |
| [ | |
| "pull", | |
| "${_SFP_REGISTRY_URI}/drone:${__SHARED_IMAGES_TAG}", | |
| ] | |
| waitFor: ['-'] | |
| - id: drone | |
| name: "gcr.io/cloud-builders/docker" | |
| args: | |
| [ | |
| "tag", | |
| "${_SFP_REGISTRY_URI}/drone:${__SHARED_IMAGES_TAG}", | |
| "${_SFP_REGISTRY_URI}/drone:${__BUILD_VERSION}" | |
| ] | |
| waitFor: | |
| - "drone-pull" | |
| - id: dualconduit-pull | |
| name: "gcr.io/cloud-builders/docker" | |
| args: | |
| [ | |
| "pull", | |
| "${_SFP_REGISTRY_URI}/dualconduit:${__SHARED_IMAGES_TAG}", | |
| ] | |
| waitFor: ['-'] | |
| - id: dualconduit | |
| name: "gcr.io/cloud-builders/docker" | |
| args: | |
| [ | |
| "tag", | |
| "${_SFP_REGISTRY_URI}/dualconduit:${__SHARED_IMAGES_TAG}", | |
| "${_SFP_REGISTRY_URI}/dualconduit:${__BUILD_VERSION}" | |
| ] | |
| waitFor: | |
| - "dualconduit-pull" | |
| - id: labservice-pull | |
| name: "gcr.io/cloud-builders/docker" | |
| args: | |
| [ | |
| "pull", | |
| "${_REGISTRY_URI}/labservice:${__SHARED_IMAGES_TAG}", | |
| ] | |
| waitFor: ['-'] | |
| - id: labservice | |
| name: "gcr.io/cloud-builders/docker" | |
| args: | |
| [ | |
| "tag", | |
| "${_REGISTRY_URI}/labservice:${__SHARED_IMAGES_TAG}", | |
| "${_REGISTRY_URI}/labservice:${__BUILD_VERSION}" | |
| ] | |
| waitFor: | |
| - "labservice-pull" | |
| - id: nginx-pull | |
| name: "gcr.io/cloud-builders/docker" | |
| args: | |
| [ | |
| "pull", | |
| "${_SFP_REGISTRY_URI}/nginx:${__SHARED_IMAGES_TAG}", | |
| ] | |
| waitFor: ['-'] | |
| - id: nginx | |
| name: "gcr.io/cloud-builders/docker" | |
| args: | |
| [ | |
| "tag", | |
| "${_SFP_REGISTRY_URI}/nginx:${__SHARED_IMAGES_TAG}", | |
| "${_SFP_REGISTRY_URI}/nginx:${__BUILD_VERSION}" | |
| ] | |
| waitFor: | |
| - nginx-pull | |
| # NOTE: Testing a new tagging approach on `passport` first. | |
| # Why: `passport:stable` is pushed as a multi-arch OCI Image Index | |
| # (`application/vnd.oci.image.index.v1+json` with linux/amd64 + linux/arm64). | |
| # Using `docker pull` + `docker tag` + `docker push` (via `images:`) on an | |
| # amd64 Cloud Build worker pulls only the amd64 image and re-serializes it as | |
| # a single-arch Docker V2 manifest (`application/vnd.docker.distribution.manifest.v2+json`), | |
| # which changes the SHA-256 digest so the version tag is not attached to `:stable`. | |
| # `gcloud container images add-tag` copies the raw manifest/index directly in | |
| # Artifact Registry without pulling layers, preserving the exact `:stable` digest | |
| # and multi-arch index. | |
| # Action plan: | |
| # - In case of any issues, delete/revert this step. | |
| # - If successful, propagate this approach to all other Shared images above | |
| # (which will also skip downloading/uploading several GBs of layers during build). | |
| - id: passport | |
| name: "gcr.io/cloud-builders/gcloud" | |
| args: | |
| [ | |
| "container", "images", "add-tag", "--quiet", | |
| "${_SFP_REGISTRY_URI}/passport:${__SHARED_IMAGES_TAG}", | |
| "${_SFP_REGISTRY_URI}/passport:${__BUILD_VERSION}" | |
| ] | |
| waitFor: ['-'] | |
| images: | |
| [ | |
| # Satlab images | |
| "${_REGISTRY_URI}/satlab-compose:${__BUILD_VERSION}", | |
| "${_REGISTRY_URI}/satlab-compose:${__LABEL}", | |
| "${_REGISTRY_URI}/satlab-dns:${__BUILD_VERSION}", | |
| "${_REGISTRY_URI}/satlab-dns:${__LABEL}", | |
| "${_REGISTRY_URI}/satlab_remote_access:${__BUILD_VERSION}", | |
| "${_REGISTRY_URI}/satlab_remote_access:${__LABEL}", | |
| "${_REGISTRY_URI}/satlab-rpcserver:${__BUILD_VERSION}", | |
| "${_REGISTRY_URI}/satlab-rpcserver:${__LABEL}", | |
| "${_REGISTRY_URI}/envoy-proxy:${__BUILD_VERSION}", | |
| "${_REGISTRY_URI}/envoy-proxy:${__LABEL}", | |
| "${_REGISTRY_URI}/logrotate:${__BUILD_VERSION}", | |
| "${_REGISTRY_URI}/logrotate:${__LABEL}", | |
| "${_REGISTRY_URI}/protoc:${__BUILD_VERSION}", | |
| "${_REGISTRY_URI}/protoc:${__LABEL}", | |
| "${_REGISTRY_URI}/satlab-ui:${__BUILD_VERSION}", | |
| "${_REGISTRY_URI}/satlab-ui:${__LABEL}", | |
| "${_REGISTRY_URI}/opentelemetry-collector:${__BUILD_VERSION}", | |
| "${_REGISTRY_URI}/opentelemetry-collector:${__LABEL}", | |
| # Shared images | |
| "${_INTERNAL_REGISTRY_URI}/ats:${__BUILD_VERSION}", | |
| "${_SFP_REGISTRY_URI}/ats:${__BUILD_VERSION}", | |
| "${_REGISTRY_URI}/labservice:${__BUILD_VERSION}", | |
| "${_REGISTRY_URI}/satlab-bols:${__BUILD_VERSION}", | |
| "${_SFP_REGISTRY_URI}/conf_creator:${__BUILD_VERSION}", | |
| "${_SFP_REGISTRY_URI}/downloader:${__BUILD_VERSION}", | |
| "${_SFP_REGISTRY_URI}/drone:${__BUILD_VERSION}", | |
| "${_SFP_REGISTRY_URI}/dualconduit:${__BUILD_VERSION}", | |
| "${_SFP_REGISTRY_URI}/nginx:${__BUILD_VERSION}", | |
| # NOTE: `passport` is intentionally omitted from `images:` because it is | |
| # tagged directly in Artifact Registry via `gcloud container images add-tag` | |
| # above (no local image to `docker push`). | |
| ] | |
| options: | |
| # Use higher CPU machines so the caching and build steps are faster. | |
| machineType: "N1_HIGHCPU_32" | |
| substitution_option: "ALLOW_LOOSE" | |
| timeout: 18000s |