Skip to content

Commit 6ec1aae

Browse files
authored
Merge pull request #1614 from mozilla-services/feat/revert-back-to-bullseye-SYNC-4363
feat: revert "feat: Revert "chore: revert back to bullseye (for now)
2 parents 715cf95 + 1b13123 commit 6ec1aae

File tree

2 files changed

+28
-32
lines changed

2 files changed

+28
-32
lines changed

Dockerfile

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# NOTE: Ensure builder's Rust version matches CI's in .circleci/config.yml # RUST_VER
2-
FROM docker.io/lukemathwalker/cargo-chef:0.1.67-rust-1.78-bookworm as chef
1+
# NOTE: Ensure builder's Rust version matches CI's in .circleci/config.yml
2+
FROM docker.io/lukemathwalker/cargo-chef:0.1.67-rust-1.78-bullseye as chef
33
WORKDIR /app
44

55
FROM chef AS planner
@@ -14,7 +14,7 @@ RUN \
1414
# Fetch and load the MySQL public key. We need to install libmysqlclient-dev to build syncstorage-rs
1515
# which wants the mariadb
1616
wget -qO- https://repo.mysql.com/RPM-GPG-KEY-mysql-2023 > /etc/apt/trusted.gpg.d/mysql.asc && \
17-
echo "deb https://repo.mysql.com/apt/debian/ bookworm mysql-8.0" >> /etc/apt/sources.list && \
17+
echo "deb https://repo.mysql.com/apt/debian/ bullseye mysql-8.0" >> /etc/apt/sources.list && \
1818
apt-get -q update && \
1919
apt-get -q install -y --no-install-recommends libmysqlclient-dev cmake
2020

@@ -31,14 +31,14 @@ COPY --from=cacher $CARGO_HOME /app/$CARGO_HOME
3131
RUN \
3232
# Fetch and load the MySQL public key
3333
wget -qO- https://repo.mysql.com/RPM-GPG-KEY-mysql-2023 > /etc/apt/trusted.gpg.d/mysql.asc && \
34-
echo "deb https://repo.mysql.com/apt/debian/ bookworm mysql-8.0" >> /etc/apt/sources.list && \
34+
echo "deb https://repo.mysql.com/apt/debian/ bullseye mysql-8.0" >> /etc/apt/sources.list && \
3535
# mysql_pubkey.asc from:
3636
# https://dev.mysql.com/doc/refman/8.0/en/checking-gpg-signature.html
3737
# related:
3838
# https://dev.mysql.com/doc/mysql-apt-repo-quick-guide/en/#repo-qg-apt-repo-manual-setup
3939
apt-get -q update && \
40-
apt-get -q install -y --no-install-recommends libmysqlclient-dev cmake golang-go pkg-config python3-dev python3-pip python3-setuptools python3-wheel && \
41-
pip3 install --break-system-packages -r /app/requirements.txt && \
40+
apt-get -q install -y --no-install-recommends libmysqlclient-dev cmake golang-go python3-dev python3-pip python3-setuptools python3-wheel && \
41+
pip3 install -r requirements.txt && \
4242
rm -rf /var/lib/apt/lists/*
4343

4444
ENV PATH=$PATH:/root/.cargo/bin
@@ -49,7 +49,7 @@ RUN \
4949
cargo install --path ./syncserver --no-default-features --features=syncstorage-db/$DATABASE_BACKEND --features=py_verifier --locked --root /app && \
5050
if [ "$DATABASE_BACKEND" = "spanner" ] ; then cargo install --path ./syncstorage-spanner --locked --root /app --bin purge_ttl ; fi
5151

52-
FROM docker.io/library/debian:bookworm-slim
52+
FROM docker.io/library/debian:bullseye-slim
5353
WORKDIR /app
5454
COPY --from=builder /app/requirements.txt /app
5555
# Due to a build error that occurs with the Python cryptography package, we
@@ -69,17 +69,17 @@ RUN \
6969
apt-get -q update && \
7070
# and ca-certificates needed for https://repo.mysql.com
7171
apt-get install -y gnupg ca-certificates wget && \
72-
echo "deb https://repo.mysql.com/apt/debian/ bookworm mysql-8.0" >> /etc/apt/sources.list && \
7372
# Fetch and load the MySQL public key
73+
echo "deb https://repo.mysql.com/apt/debian/ bullseye mysql-8.0" >> /etc/apt/sources.list && \
7474
wget -qO- https://repo.mysql.com/RPM-GPG-KEY-mysql-2023 > /etc/apt/trusted.gpg.d/mysql.asc && \
7575
# update again now that we trust repo.mysql.com
7676
apt-get -q update && \
77-
apt-get -q install -y build-essential libmysqlclient-dev libssl-dev libffi-dev libcurl4 pkg-config python3-dev python3-pip python3-setuptools python3-wheel cargo curl jq && \
77+
apt-get -q install -y build-essential libmysqlclient-dev libssl-dev libffi-dev libcurl4 python3-dev python3-pip python3-setuptools python3-wheel cargo curl jq && \
7878
# The python3-cryptography debian package installs version 2.6.1, but we
7979
# we want to use the version specified in requirements.txt. To do this,
8080
# we have to remove the python3-cryptography package here.
8181
apt-get -q remove -y python3-cryptography && \
82-
pip3 install --break-system-packages -r /app/requirements.txt && \
82+
pip3 install -r /app/requirements.txt && \
8383
rm -rf /var/lib/apt/lists/*
8484

8585
COPY --from=builder /app/bin /app/bin
@@ -92,10 +92,8 @@ COPY --from=builder /app/scripts/start_mock_fxa_server.sh /app/scripts/start_moc
9292
COPY --from=builder /app/syncstorage-spanner/src/schema.ddl /app/schema.ddl
9393

9494
RUN chmod +x /app/scripts/prepare-spanner.sh
95-
RUN \
96-
pip3 install --break-system-packages -r /app/tools/integration_tests/requirements.txt
97-
RUN \
98-
pip3 install --break-system-packages -r /app/tools/tokenserver/requirements.txt
95+
RUN pip3 install -r /app/tools/integration_tests/requirements.txt
96+
RUN pip3 install -r /app/tools/tokenserver/requirements.txt
9997

10098
USER app:app
10199

tools/tokenserver/process_account_events.py

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -115,24 +115,22 @@ def process_account_event(database, body, metrics=None):
115115
else:
116116
if email is not None:
117117
record_metric = True
118-
match event_type:
119-
case "delete":
120-
# Mark the user as retired.
121-
# Actual cleanup is done by a separate process.
122-
logger.info("Processing account delete for %r", email)
123-
database.retire_user(email)
124-
case "reset":
125-
logger.info("Processing account reset for %r", email)
126-
update_generation_number(
127-
database, email, generation, metrics=metrics)
128-
case "passwordChange":
129-
logger.info("Processing password change for %r", email)
130-
update_generation_number(
131-
database, email, generation, metrics=metrics)
132-
case _:
133-
record_metric = False
134-
logger.warning("Dropping unknown event type %r",
135-
event_type)
118+
if event_type == "delete":
119+
# Mark the user as retired.
120+
# Actual cleanup is done by a separate process.
121+
logger.info("Processing account delete for %r", email)
122+
database.retire_user(email)
123+
elif event_type == "reset":
124+
logger.info("Processing account reset for %r", email)
125+
update_generation_number(
126+
database, email, generation, metrics=metrics)
127+
elif event_type == "passwordChange":
128+
logger.info("Processing password change for %r", email)
129+
update_generation_number(
130+
database, email, generation, metrics=metrics)
131+
else:
132+
record_metric = False
133+
logger.warning("Dropping unknown event type %r", event_type)
136134
if record_metric and metrics:
137135
metrics.incr(event_type)
138136

0 commit comments

Comments
 (0)