Skip to content

Commit 0475efe

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

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

bin/ci-builder

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ build() {
125125
--build-arg "RUST_CPU_TARGET=$rust_cpu_target" \
126126
--build-arg "RUST_TARGET_FEATURES=$rust_target_features" \
127127
--tag materialize/ci-builder:"$tag" \
128+
--tag ghcr.io/materialize/ci-builder:"$tag" \
128129
--tag materialize/ci-builder:"$cache_tag" \
129130
--target $docker_target \
130131
"$@" ci/builder

ci/builder/Dockerfile

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

346346
# Hardcode some known SSH hosts, or else SSH will ask whether the host is
347347
# trustworthy on the first connection.
348-
349348
COPY ssh_known_hosts /etc/ssh/ssh_known_hosts
350349

351350
ENV LDFLAGS="-fuse-ld=lld -static-libstdc++"
@@ -356,7 +355,7 @@ ENV CARGO_INCREMENTAL=1
356355
ENV HELM_PLUGINS=/usr/local/share/helm/plugins
357356

358357
# Set up for a persistent volume to hold Cargo metadata, so that crate metadata
359-
# does not need to be refetched on every compile.
358+
# does not need to be refetched on every compilation.
360359
ENV CARGO_HOME=/cargo
361360
RUN mkdir /cargo && chmod 777 /cargo
362361
VOLUME /cargo

misc/python/materialize/mzbuild.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -786,11 +786,19 @@ def build(self, prep: dict[type[PreImage], Any], push: bool = False) -> None:
786786
"-",
787787
*(f"--build-arg={k}={v}" for k, v in build_args.items()),
788788
"-t",
789-
self.spec(),
789+
f"docker.io/{self.spec()}",
790+
"-t",
791+
f"ghcr.io/materializeinc/{self.spec()}",
790792
f"--platform=linux/{self.image.rd.arch.go_str()}",
791793
str(self.image.path),
792794
*(["--push"] if push else ["--load"]),
793795
]
796+
797+
spawn.runv(
798+
["docker", "login", "ghcr.io", "-u", "materialize-bot", "--password-stdin"],
799+
stdin=os.environ["GITHUB_GHCR_TOKEN"].encode(),
800+
)
801+
794802
spawn.runv(cmd, stdin=f, stdout=sys.stderr.buffer)
795803

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

0 commit comments

Comments
 (0)