Skip to content

Commit 89f66eb

Browse files
committed
builds: Try pushing to GHCR in parallel
Currently experiencing slow Dockerhub pulls: https://materializeinc.slack.com/archives/C01KV5PEZ9R/p1758540371320699
1 parent bab018e commit 89f66eb

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

bin/ci-builder

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,8 @@ build() {
127127
--build-arg "RUST_CPU_TARGET=$rust_cpu_target" \
128128
--build-arg "RUST_TARGET_FEATURES=$rust_target_features" \
129129
--build-arg "BAZEL_VERSION=$bazel_version" \
130-
--tag materialize/ci-builder:"$tag" \
130+
--tag docker.io/materialize/ci-builder:"$tag" \
131+
--tag ghcr.io/materialize/ci-builder:"$tag" \
131132
--tag materialize/ci-builder:"$cache_tag" \
132133
--target $docker_target \
133134
"$@" ci/builder

ci/builder/Dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,6 @@ RUN curl -fsSL https://amazon-inspector-sbomgen.s3.amazonaws.com/1.8.1/linux/$AR
354354

355355
# Hardcode some known SSH hosts, or else SSH will ask whether the host is
356356
# trustworthy on the first connection.
357-
358357
COPY ssh_known_hosts /etc/ssh/ssh_known_hosts
359358

360359
ENV LDFLAGS="-fuse-ld=lld -static-libstdc++"
@@ -365,7 +364,7 @@ ENV CARGO_INCREMENTAL=1
365364
ENV HELM_PLUGINS=/usr/local/share/helm/plugins
366365

367366
# Set up for a persistent volume to hold Cargo metadata, so that crate metadata
368-
# does not need to be refetched on every compile.
367+
# does not need to be refetched on every compilation.
369368
ENV CARGO_HOME=/cargo
370369
RUN mkdir /cargo && chmod 777 /cargo
371370
VOLUME /cargo

misc/python/materialize/mzbuild.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -983,11 +983,19 @@ def build(self, prep: dict[type[PreImage], Any], push: bool = False) -> None:
983983
"-",
984984
*(f"--build-arg={k}={v}" for k, v in build_args.items()),
985985
"-t",
986-
self.spec(),
986+
f"docker.io/{self.spec()}",
987+
"-t",
988+
f"ghcr.io/materializeinc/{self.spec()}",
987989
f"--platform=linux/{self.image.rd.arch.go_str()}",
988990
str(self.image.path),
989991
*(["--push"] if push else ["--load"]),
990992
]
993+
994+
spawn.runv(
995+
["docker", "login", "ghcr.io", "-u", "materialize-bot", "--password-stdin"],
996+
stdin=os.environ["GITHUB_GHCR_TOKEN"].encode(),
997+
)
998+
991999
spawn.runv(cmd, stdin=f, stdout=sys.stderr.buffer)
9921000

9931001
def try_pull(self, max_retries: int) -> bool:

0 commit comments

Comments
 (0)