Skip to content

Commit

Permalink
[benchmark] Fix makefile so we can create images again (#11825)
Browse files Browse the repository at this point in the history
  • Loading branch information
tpoterba authored May 17, 2022
1 parent aca50d6 commit 100550f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
10 changes: 8 additions & 2 deletions benchmark/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM {{ global.docker_root_image }}
FROM --platform=linux/amd64 {{ global.docker_root_image }}

ENV LANG C.UTF-8

Expand All @@ -14,13 +14,19 @@ RUN apt-get update && \
mysql-client \
xsltproc pandoc \
jq \
openjdk-8-jdk-headless \
python \
python3.8 python3-pip python3.8-dev \
liblapack3 && \
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 1 && \
rm -rf /var/lib/apt/lists/*

RUN apt-get update && \
apt-get -y install openjdk-8-jdk-headless && \
rm -rf /var/lib/apt/lists/*

RUN apt-get update && \
apt-get -y install ca-certificates-java && \
rm -rf /var/lib/apt/lists/*

COPY requirements.txt .
RUN python3 -m pip install --upgrade --no-cache-dir --upgrade pip && \
Expand Down
8 changes: 4 additions & 4 deletions benchmark/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ cleanup_image:
rm -f image_sha
rm -f pushed_image

PROJECT := hail-vdc
BENCHMARK_PROJECT ?= hail-vdc
BENCHMARK_DOCKER_TAG := benchmark_$(shell whoami)
BENCHMARK_REPO_BASE = $(DOCKER_PREFIX)/$(BENCHMARK_DOCKER_TAG)
DOCKER_ROOT_IMAGE := $(shell kubectl get secret global-config --template={{.data.docker_root_image}} | base64 --decode)
BENCHMARK_REPO_BASE = gcr.io/$(BENCHMARK_PROJECT)/$(BENCHMARK_DOCKER_TAG)
DOCKER_ROOT_IMAGE := ubuntu:20.04

ifndef HAIL_WHEEL
image_sha:
Expand All @@ -44,7 +44,7 @@ image_sha: wheel cleanup_image
# it's possible that the HAIL_WHEEL installs different dependencies, but this generally creates less work for docker
cp ../hail/python/requirements.txt .
python3 ../ci/jinja2_render.py '{"global":{"docker_root_image":"$(DOCKER_ROOT_IMAGE)"}}' Dockerfile Dockerfile.out
docker build -f Dockerfile.out -t $(BENCHMARK_DOCKER_TAG) . --build-arg HAIL_WHEEL=$(notdir $(HAIL_WHEEL)) --build-arg BENCHMARK_WHEEL=$(notdir $(BENCHMARK_WHEEL))
docker build --platform linux/amd64 -f Dockerfile.out -t $(BENCHMARK_DOCKER_TAG) . --build-arg HAIL_WHEEL=$(notdir $(HAIL_WHEEL)) --build-arg BENCHMARK_WHEEL=$(notdir $(BENCHMARK_WHEEL))
@printf $$(docker images -q --no-trunc $(BENCHMARK_DOCKER_TAG) | sed -e 's,[^:]*:,,') > image_sha
@echo Image sha is `cat image_sha`
rm $(notdir $(HAIL_WHEEL))
Expand Down

0 comments on commit 100550f

Please sign in to comment.