Skip to content

Commit 33a1520

Browse files
authored
Merge branch 'master' into chore/cargo-upgrade-stor-436
2 parents 6480198 + 33d41fb commit 33a1520

27 files changed

Lines changed: 10272 additions & 4797 deletions

File tree

.circleci/config.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,11 @@ commands:
4646
name: Setup python
4747
command: |
4848
sudo apt-get update && sudo apt-get install -y python3-dev python3-pip python3-venv
49-
pip3 install hawkauthlib konfig pyramid pyramid_hawkauth requests simplejson unittest2 WebTest WSGIProxy2 poetry
49+
pip3 install hawkauthlib konfig pyramid pyramid_hawkauth requests simplejson unittest2 WebTest WSGIProxy2 poetry poetry-plugin-export
5050
# NOTE: Python3.12 requires `--break-system-packages`.
5151
# This command is run on the cimg/rust image, which is running python 3.10
5252
python3 -mvenv venv
5353
. venv/bin/activate
54-
poetry self add poetry-plugin-export
5554
poetry install --with tokenserver-unit-tests,dev --no-interaction --no-ansi
5655
rust-check:
5756
steps:
@@ -202,6 +201,7 @@ commands:
202201
environment:
203202
SYNC_SYNCSTORAGE__DATABASE_URL: spanner://projects/test-project/instances/test-instance/databases/test-database
204203
SYNC_SYNCSTORAGE__SPANNER_EMULATOR_HOST: 127.0.0.1:9010
204+
SYNC_TOKENSERVER__DATABASE_URL: mysql://test:test@127.0.0.1/tokenserver
205205
RUST_TEST_THREADS: 1
206206
command: make spanner_test_with_coverage
207207

@@ -412,11 +412,22 @@ jobs:
412412
# XXX: begin_test_transaction doesn't play nice over threaded tests
413413
RUST_TEST_THREADS: 1
414414
- image: gcr.io/cloud-spanner-emulator/emulator
415+
- image: cimg/mysql:8.0
416+
auth:
417+
username: $DOCKER_USER
418+
password: $DOCKER_PASS
419+
environment:
420+
MYSQL_ROOT_PASSWORD: password
421+
MYSQL_USER: test
422+
MYSQL_PASSWORD: test
423+
MYSQL_DATABASE: syncstorage
415424
resource_class: xlarge
416425
steps:
417426
- checkout
418427
- display-versions
419428
- setup-python
429+
- setup-mysql
430+
- create-tokenserver-database-mysql
420431
# XXX: currently the time needed to setup-sccache negates its savings
421432
# - setup-sccache
422433
# - restore-sccache-cache

.github/workflows/mozcloud-publish.yaml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ on:
1818
workflow_dispatch: {}
1919

2020
jobs:
21+
# Note: we are moving towards renaming all images `syncserver`, the union of sync and tokenserver.
22+
# This presently remains for the time being to simplify deploys by maintaining `image_name: syncstorage-rs`.
23+
# Historical context: <https://github.com/mozilla-services/syncstorage-rs/pull/1306>
2124
build-and-push-syncstorage-rs:
2225
if: >
2326
github.event_name == 'workflow_dispatch' ||
@@ -44,7 +47,7 @@ jobs:
4447
MYSQLCLIENT_PKG=libmysqlclient-dev
4548
should_tag_ghcr: true
4649

47-
build-and-push-syncstorage-rs-postgres:
50+
build-and-push-syncserver-postgres:
4851
if: >
4952
github.event_name == 'workflow_dispatch' ||
5053
(
@@ -62,14 +65,17 @@ jobs:
6265
packages: write
6366
uses: mozilla-it/deploy-actions/.github/workflows/build-and-push.yml@4784cb70739a4f32ce010921f60fb1ebbc791a38 # v6.2.2
6467
with:
65-
image_name: syncstorage-rs-postgres
68+
image_name: syncserver-postgres
6669
gar_name: sync-prod
6770
project_id: moz-fx-sync-prod
6871
docker_build_args: |
6972
SYNCSTORAGE_DATABASE_BACKEND=postgres
7073
TOKENSERVER_DATABASE_BACKEND=postgres
7174
should_tag_ghcr: true
7275

76+
# Note: we are moving towards renaming all images `syncserver`, the union of sync and tokenserver.
77+
# This presently remains for the time being to simplify deploys by maintaining `image_name: syncstorage-rs-spanner-python-utils`.
78+
# Historical context: <https://github.com/mozilla-services/syncstorage-rs/pull/1306>
7379
build-and-push-syncstorage-rs-spanner-python-utils:
7480
if: >
7581
github.event_name == 'workflow_dispatch' ||
@@ -95,7 +101,7 @@ jobs:
95101
image_build_context: tools/spanner
96102
should_tag_ghcr: true
97103

98-
build-and-push-syncstorage-rs-postgres-python-utils:
104+
build-and-push-syncserver-postgres-python-utils:
99105
if: >
100106
github.event_name == 'workflow_dispatch' ||
101107
(
@@ -113,14 +119,14 @@ jobs:
113119
packages: write
114120
uses: mozilla-it/deploy-actions/.github/workflows/build-and-push.yml@4784cb70739a4f32ce010921f60fb1ebbc791a38 # v6.2.2
115121
with:
116-
image_name: syncstorage-rs-postgres-python-utils
122+
image_name: syncserver-postgres-python-utils
117123
gar_name: sync-prod
118124
project_id: moz-fx-sync-prod
119125
dockerfile_path: tools/postgres/Dockerfile
120126
image_build_context: tools/postgres
121127
should_tag_ghcr: true
122128

123-
build-and-push-syncstorage-rs-mysql:
129+
build-and-push-syncserver-mysql:
124130
if: >
125131
github.event_name == 'workflow_dispatch' ||
126132
(
@@ -138,7 +144,7 @@ jobs:
138144
packages: write
139145
uses: mozilla-it/deploy-actions/.github/workflows/build-and-push.yml@4784cb70739a4f32ce010921f60fb1ebbc791a38 # v6.2.2
140146
with:
141-
image_name: syncstorage-rs-mysql
147+
image_name: syncserver-mysql
142148
gar_name: sync-prod
143149
project_id: moz-fx-sync-prod
144150
docker_build_args: |

.github/workflows/spanner.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,21 @@ jobs:
2525
- 9010:9010
2626
- 9020:9020
2727

28+
mysql:
29+
image: mysql:8.0
30+
env:
31+
MYSQL_ROOT_PASSWORD: password
32+
MYSQL_USER: test
33+
MYSQL_PASSWORD: test
34+
MYSQL_DATABASE: syncstorage
35+
ports:
36+
- 3306:3306
37+
options: >-
38+
--health-cmd="mysqladmin ping"
39+
--health-interval=10s
40+
--health-timeout=5s
41+
--health-retries=3
42+
2843
env:
2944
# The code expects a spanner URL like:
3045
SYNC_SYNCSTORAGE__DATABASE_URL: spanner://projects/test-project/instances/test-instance/databases/test-database
@@ -86,10 +101,16 @@ jobs:
86101
# prepare-spanner.sh uses the REST API (port 9020)
87102
scripts/prepare-spanner.sh
88103
104+
- name: Create Tokenserver database
105+
run: |
106+
mysql -u root -ppassword -h 127.0.0.1 -e 'CREATE DATABASE tokenserver;'
107+
mysql -u root -ppassword -h 127.0.0.1 -e "GRANT ALL ON tokenserver.* to 'test'@'%';"
108+
89109
- name: Run Spanner unit tests with coverage
90110
env:
91111
SYNC_SYNCSTORAGE__DATABASE_URL: spanner://projects/test-project/instances/test-instance/databases/test-database
92112
SYNC_SYNCSTORAGE__SPANNER_EMULATOR_HOST: localhost:9010
113+
SYNC_TOKENSERVER__DATABASE_URL: mysql://test:test@127.0.0.1/tokenserver
93114
RUST_TEST_THREADS: 1
94115
run: make spanner_test_with_coverage
95116

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ test_with_coverage:
163163
.ONESHELL:
164164
spanner_test_with_coverage:
165165
cargo llvm-cov --summary-only --json --output-path ${SPANNER_COVERAGE_JSON} \
166-
nextest --workspace --no-default-features --features=syncstorage-db/spanner --features=py_verifier --profile ${TEST_PROFILE} || true; exit_code=$$?
166+
nextest --workspace --no-default-features --features=syncstorage-db/spanner --features=py_verifier --profile ${TEST_PROFILE}; exit_code=$$?
167167
mv target/nextest/${TEST_PROFILE}/junit.xml ${SPANNER_UNIT_JUNIT_XML}
168168
exit $$exit_code
169169

0 commit comments

Comments
 (0)