Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
134 changes: 0 additions & 134 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -554,114 +554,6 @@ jobs:
paths:
- /home/circleci/cache

# Auth to GCR, tag and push image
deploy-spanner-to-gar:
executor: gcp-gcr/default
parameters:
image:
type: string
default: syncstorage-rs
registry-url:
type: string
default: us-docker.pkg.dev
gar-repo:
type: string
default: sync-prod
steps:
# Auth to GCR
# https://circleci.com/developer/orbs/orb/circleci/gcp-gcr#commands-gcr-auth
- gcp-gcr/gcr-auth:
registry-url: <<parameters.registry-url>>
use_oidc: true
- restore_cache:
key: spanner-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }}
- run:
name: Restore Docker image cache
command: docker load -i /home/circleci/cache/docker.tar
- run:
name: Tag image
command: |
if [ "${CIRCLE_BRANCH}" == "master" ]; then
GAR_TAG="${CIRCLE_SHA1}"
fi

if echo "${CIRCLE_BRANCH}" | grep '^feature\..*' > /dev/null; then
GAR_TAG="${CIRCLE_BRANCH}"
fi

if [ -n "${CIRCLE_TAG}" ]; then
GAR_TAG="$CIRCLE_TAG"
fi

if [ -n "${GAR_TAG}" ]; then
echo "export GAR_TAG=${GAR_TAG}" >> $BASH_ENV
echo "export GAR_IMAGE=\"<<parameters.registry-url>>/${GOOGLE_PROJECT_ID}/<<parameters.gar-repo>>/<<parameters.image>>\"" >> $BASH_ENV
source $BASH_ENV
docker tag app:build ${GAR_IMAGE}:${GAR_TAG}
else
echo "Not pushing to gar for tag=${CIRCLE_TAG} branch=${CIRCLE_BRANCH}"
fi
# Push image
# https://circleci.com/developer/orbs/orb/circleci/gcp-gcr#commands-push-image
- gcp-gcr/push-image:
image: <<parameters.gar-repo>>/<<parameters.image>>
registry-url: <<parameters.registry-url>>
tag: $GAR_TAG

# Auth to GCR, tag and push image
deploy-postgres-to-gar:
executor: gcp-gcr/default
parameters:
image:
type: string
default: syncstorage-rs-postgres
registry-url:
type: string
default: us-docker.pkg.dev
gar-repo:
type: string
default: sync-prod
steps:
# Auth to GCR
# https://circleci.com/developer/orbs/orb/circleci/gcp-gcr#commands-gcr-auth
- gcp-gcr/gcr-auth:
registry-url: <<parameters.registry-url>>
use_oidc: true
- restore_cache:
key: postgres-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }}
- run:
name: Restore Docker image cache
command: docker load -i /home/circleci/cache/docker.tar
- run:
name: Tag image
command: |
if [ "${CIRCLE_BRANCH}" == "master" ]; then
GAR_TAG="${CIRCLE_SHA1}"
fi

if echo "${CIRCLE_BRANCH}" | grep '^feature\..*' > /dev/null; then
GAR_TAG="${CIRCLE_BRANCH}"
fi

if [ -n "${CIRCLE_TAG}" ]; then
GAR_TAG="$CIRCLE_TAG"
fi

if [ -n "${GAR_TAG}" ]; then
echo "export GAR_TAG=${GAR_TAG}" >> $BASH_ENV
echo "export GAR_IMAGE=\"<<parameters.registry-url>>/${GOOGLE_PROJECT_ID}/<<parameters.gar-repo>>/<<parameters.image>>\"" >> $BASH_ENV
source $BASH_ENV
docker tag app:build ${GAR_IMAGE}:${GAR_TAG}
else
echo "Not pushing to gar for tag=${CIRCLE_TAG} branch=${CIRCLE_BRANCH}"
fi
# Push image
# https://circleci.com/developer/orbs/orb/circleci/gcp-gcr#commands-push-image
- gcp-gcr/push-image:
image: <<parameters.gar-repo>>/<<parameters.image>>
registry-url: <<parameters.registry-url>>
tag: $GAR_TAG

mysql-e2e-tests:
docker:
- image: cimg/base:2025.04
Expand Down Expand Up @@ -941,32 +833,6 @@ workflows:
only: /.*/
branches:
only: master
- deploy-spanner-to-gar:
registry-url: us-docker.pkg.dev
gar-repo: sync-prod
image: syncstorage-rs
requires:
- mysql-e2e-tests
- postgres-e2e-tests
- spanner-e2e-tests
filters:
tags:
only: /.*/
branches:
only: master
- deploy-postgres-to-gar:
registry-url: us-docker.pkg.dev
gar-repo: sync-prod
image: syncstorage-rs-postgres
requires:
- mysql-e2e-tests
- postgres-e2e-tests
- spanner-e2e-tests
filters:
tags:
only: /.*/
branches:
only: master
- deploy-spanner-python-utils:
requires:
- spanner-e2e-tests
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/mozcloud-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,21 @@ on:
types: [opened, labeled, unlabeled, synchronize]
# paths:
# - '**/sync*/**'
push:
branches:
- master
tags:
- '**'
workflow_dispatch: {}

jobs:
build-and-push-syncstorage-rs:
if: >
github.event_name == 'workflow_dispatch' ||
(
github.event_name == 'push' &&
(github.ref_name == 'master' || startsWith(github.ref, 'refs/tags/'))
) ||
(
github.event_name == 'pull_request' &&
contains(github.event.pull_request.labels.*.name, 'preview') &&
Expand All @@ -19,6 +28,7 @@ jobs:
permissions:
contents: read
id-token: write
packages: write
uses: mozilla-it/deploy-actions/.github/workflows/build-and-push.yml@1b87069d293273436a84dff04954a8950d3ff9ca # v6.1.0
with:
image_name: syncstorage-rs
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't add a '-spanner' postfix here, but I'm not against it. afaict we only need to update a couple of values in webservices-infra if we do make the change.

Copy link
Collaborator

@taddes taddes Jan 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly, I think the intention will be to flip that in webservices-infra when we push our next deploy if we've moved to using -spanner. Doesn't hurt to leave it as is for now. I intentionally kept the GAR one without the postfix, like you are doing here, specifically so that we'd not have to depend on an infra change were we to need to deploy/sync with argo.

Expand All @@ -27,10 +37,15 @@ jobs:
docker_build_args: |
SYNCSTORAGE_DATABASE_BACKEND=spanner
MYSQLCLIENT_PKG=libmysqlclient-dev
should_tag_ghcr: true

build-and-push-syncstorage-rs-postgres:
if: >
github.event_name == 'workflow_dispatch' ||
(
github.event_name == 'push' &&
(github.ref_name == 'master' || startsWith(github.ref, 'refs/tags/'))
) ||
(
github.event_name == 'pull_request' &&
contains(github.event.pull_request.labels.*.name, 'preview') &&
Expand All @@ -39,6 +54,7 @@ jobs:
permissions:
contents: read
id-token: write
packages: write
uses: mozilla-it/deploy-actions/.github/workflows/build-and-push.yml@1b87069d293273436a84dff04954a8950d3ff9ca # v6.1.0
with:
image_name: syncstorage-rs-postgres
Expand All @@ -47,3 +63,29 @@ jobs:
docker_build_args: |
SYNCSTORAGE_DATABASE_BACKEND=postgres
TOKENSERVER_DATABASE_BACKEND=postgres
should_tag_ghcr: true

build-and-push-syncstorage-rs-spanner-python-utils:
if: >
github.event_name == 'workflow_dispatch' ||
(
github.event_name == 'push' &&
startsWith(github.ref, 'refs/tags/')
) ||
(
github.event_name == 'pull_request' &&
contains(github.event.pull_request.labels.*.name, 'preview') &&
github.event.pull_request.head.repo.full_name == github.repository
)
permissions:
contents: read
id-token: write
packages: write
uses: mozilla-it/deploy-actions/.github/workflows/build-and-push.yml@1b87069d293273436a84dff04954a8950d3ff9ca # v6.1.0
with:
image_name: syncstorage-rs-spanner-python-utils
gar_name: sync-prod
project_id: moz-fx-sync-prod
dockerfile_path: tools/spanner/Dockerfile
image_build_context: tools/spanner
should_tag_ghcr: true