Skip to content

Commit

Permalink
Switch to Artifact Registry (#29)
Browse files Browse the repository at this point in the history
* config.mk: use AR docker image

* build.yaml: use AR for images

* Gitignore artifacts

* fetch-image.sh: gcloud auth for AR

* image-fetcher dockerfile: base on AR

* image fetcher make file: use AR

* build-batch-worker-image-startup.sh: add gcloud auth configure-docker for AR, user AR for images

* batch worker: ue AR for public_gcr_images

* Worker dockerfile: use AR

* ci build.py: add gcloud auth configure-docker for AR, use AR base image

* Makefiles: use AR docker images

* stat-permissions.sh: fix for macOS gnu-grep

* third-party dockers: use AR

* ci dockerFile create_namespace: use AR image

* Docker hail-ubuntu: use AR image

* ci build.py: add region into the jinja render config for Dockerfiles

* CI deploy config: add region

* Python-dill: use AR image

* Auth deployment.yaml: add REGION

* Use hail-dvc default ci image pointer

* Add Artifact Registry in main.tf

* Add AR in dev-docs

* Add AR for ukbb-rg

* Add AR in more makefiles

* Fix AR usage for image-fetcher

* Specify "region" in the "hail-ubuntu-stmp" target.

* Fix zone assignment in startup script.

* Allow ci to read from Artifact Registry.

* Makefiles: parametrise `DOCKER_ROOT_IMAGE` to support both GCR and AR

* Parametrise `DOCKER_PREFIX` to support both GCR and AR

* Un-gitignore "vlad"

* Fix

* batch: pass DOCKER_PREFIX to worker

* DOCKER_PREFIX in build-batch-worker-image-startup.sh

* build.yaml: add ubuntu tags back

* ci/ci/build.py: parametrise docker prefix

* infra README: configure-docker AR

Co-authored-by: Leonhard Gruenschloss <leonhard.gruenschloss@populationgenomics.org.au>
  • Loading branch information
2 people authored and daniel-goldstein committed Apr 22, 2021
1 parent 7f7a08f commit 1e52cb4
Show file tree
Hide file tree
Showing 43 changed files with 200 additions and 97 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,7 @@ hail/python/hailtop/batch/docs/api/
web_common/web_common/static/css/
website/docs.tar.gz
website/website/static/css/
hail/prebuilt/lib/darwin/libboot.dylib
hail/prebuilt/lib/darwin/libhail.dylib
query/hail.jar
infra/.terraform.lock.hcl
4 changes: 2 additions & 2 deletions address/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
include ../config.mk

ADDRESS_LATEST = gcr.io/$(PROJECT)/address:latest
ADDRESS_IMAGE = gcr.io/$(PROJECT)/address:$(shell docker images -q --no-trunc address | sed -e 's,[^:]*:,,')
ADDRESS_LATEST = $(DOCKER_PREFIX)/address:latest
ADDRESS_IMAGE = $(DOCKER_PREFIX)/address:$(shell docker images -q --no-trunc address | sed -e 's,[^:]*:,,')

PYTHONPATH := $${PYTHONPATH:+$${PYTHONPATH}:}../hail/python:../gear:../web_common
PYTHON := PYTHONPATH=$(PYTHONPATH) python3
Expand Down
2 changes: 1 addition & 1 deletion admin-pod/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
include ../config.mk

SERVICE_BASE_IMAGE = gcr.io/$(PROJECT)/service-base:$(shell docker images -q --no-trunc service-base:latest | sed -e 's,[^:]*:,,')
SERVICE_BASE_IMAGE = $(DOCKER_PREFIX)/service-base:$(shell docker images -q --no-trunc service-base:latest | sed -e 's,[^:]*:,,')

.PHONY: deploy
deploy:
Expand Down
4 changes: 2 additions & 2 deletions auth/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
include ../config.mk

AUTH_LATEST = gcr.io/$(PROJECT)/auth:latest
AUTH_IMAGE = gcr.io/$(PROJECT)/auth:$(shell docker images -q --no-trunc auth:latest | sed -e 's,[^:]*:,,')
AUTH_LATEST = $(DOCKER_PREFIX)/auth:latest
AUTH_IMAGE = $(DOCKER_PREFIX)/auth:$(shell docker images -q --no-trunc auth:latest | sed -e 's,[^:]*:,,')

EXTRA_PYTHONPATH := ../hail/python:../gear:../web_common
PYTHON := PYTHONPATH=$${PYTHONPATH:+$${PYTHONPATH}:}$(EXTRA_PYTHONPATH) python3
Expand Down
2 changes: 1 addition & 1 deletion batch/Dockerfile.worker
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM gcr.io/{{ global.project }}/python:3.7-slim-stretch
FROM {{ global.docker_prefix }}/python:3.7-slim-stretch

COPY docker/hail-ubuntu/retry /bin/retry
COPY docker/hail-ubuntu/hail-apt-get-install /bin/hail-apt-get-install
Expand Down
12 changes: 6 additions & 6 deletions batch/Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
include ../config.mk

BATCH_LATEST = gcr.io/$(PROJECT)/batch:latest
BATCH_IMAGE = gcr.io/$(PROJECT)/batch:$(shell docker images -q --no-trunc batch | sed -e 's,[^:]*:,,')
BATCH_LATEST = $(DOCKER_PREFIX)/batch:latest
BATCH_IMAGE = $(DOCKER_PREFIX)/batch:$(shell docker images -q --no-trunc batch | sed -e 's,[^:]*:,,')

BATCH_WORKER_LATEST = gcr.io/$(PROJECT)/batch-worker:latest
BATCH_WORKER_IMAGE = gcr.io/$(PROJECT)/batch-worker:$(shell docker images -q --no-trunc batch-worker | sed -e 's,[^:]*:,,')
BATCH_WORKER_LATEST = $(DOCKER_PREFIX)/batch-worker:latest
BATCH_WORKER_IMAGE = $(DOCKER_PREFIX)/batch-worker:$(shell docker images -q --no-trunc batch-worker | sed -e 's,[^:]*:,,')

EXTRA_PYTHONPATH := ../hail/python:../gear:../web_common
PYTHON := PYTHONPATH=$${PYTHONPATH:+$${PYTHONPATH}:}$(EXTRA_PYTHONPATH) python3
Expand Down Expand Up @@ -32,7 +32,7 @@ build-worker: build-prereqs
# janky
cp ../hail/build/libs/hail-all-spark.jar ./hail.jar
-docker pull $(BATCH_WORKER_LATEST)
python3 ../ci/jinja2_render.py '{"global":{"project":"$(PROJECT)"}, "service_base_image":{"image":"service-base"}}' Dockerfile.worker Dockerfile.worker.out
python3 ../ci/jinja2_render.py '{"global":{"docker_prefix":"$(DOCKER_PREFIX)"}}}' Dockerfile.worker Dockerfile.worker.out
docker build -t batch-worker -f Dockerfile.worker.out --cache-from batch-worker,$(BATCH_WORKER_LATEST),service-base ..

.PHONY: build
Expand All @@ -49,7 +49,7 @@ push: build
docker tag batch-worker $(BATCH_WORKER_IMAGE)
docker push $(BATCH_WORKER_IMAGE)

JINJA_ENVIRONMENT = '{"code":{"sha":"$(shell git rev-parse --short=12 HEAD)"},"deploy":$(DEPLOY),"batch_image":{"image":"$(BATCH_IMAGE)"},"batch_worker_image":{"image":"$(BATCH_WORKER_IMAGE)"},"default_ns":{"name":"$(NAMESPACE)"},"batch_database":{"user_secret_name":"sql-batch-user-config"},"global":{"project":"$(PROJECT)","domain":"$(DOMAIN)","k8s_server_url":"$(KUBERNETES_SERVER_URL)"},"scope":"$(SCOPE)"}'
JINJA_ENVIRONMENT = '{"code":{"sha":"$(shell git rev-parse --short=12 HEAD)"},"deploy":$(DEPLOY),"batch_image":{"image":"$(BATCH_IMAGE)"},"batch_worker_image":{"image":"$(BATCH_WORKER_IMAGE)"},"default_ns":{"name":"$(NAMESPACE)"},"batch_database":{"user_secret_name":"sql-batch-user-config"},"global":{"project":"$(PROJECT)","domain":"$(DOMAIN)","k8s_server_url":"$(KUBERNETES_SERVER_URL)","docker_prefix":"$(DOCKER_PREFIX)"},"scope":"$(SCOPE)"}'

.PHONY: deploy
deploy: push
Expand Down
1 change: 1 addition & 0 deletions batch/batch/batch_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

GCP_REGION = os.environ['HAIL_GCP_REGION']
GCP_ZONE = os.environ['HAIL_GCP_ZONE']
DOCKER_PREFIX = os.environ['HAIL_DOCKER_PREFIX']

BATCH_GCP_REGIONS = set(json.loads(os.environ['HAIL_BATCH_GCP_REGIONS']))
BATCH_GCP_REGIONS.add(GCP_REGION)
Expand Down
7 changes: 6 additions & 1 deletion batch/batch/driver/create_instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from hailtop import aiogoogle

from ..batch_configuration import PROJECT, DEFAULT_NAMESPACE
from ..batch_configuration import PROJECT, DOCKER_PREFIX, DEFAULT_NAMESPACE
from ..inst_coll_config import machine_type_to_dict
from ..worker_config import WorkerConfig
from ..log_store import LogStore
Expand Down Expand Up @@ -186,6 +186,7 @@ async def create_instance(app, zone, machine_name, machine_type, activation_toke
ZONE=$(curl -s http://metadata.google.internal/computeMetadata/v1/instance/zone -H 'Metadata-Flavor: Google')
BATCH_WORKER_IMAGE=$(curl -s -H "Metadata-Flavor: Google" "http://metadata.google.internal/computeMetadata/v1/instance/attributes/batch_worker_image")
DOCKER_PREFIX=$(curl -s -H "Metadata-Flavor: Google" "http://metadata.google.internal/computeMetadata/v1/instance/attributes/docker_prefix")
# Setup fluentd
touch /worker.log
Expand Down Expand Up @@ -263,6 +264,7 @@ async def create_instance(app, zone, machine_name, machine_type, activation_toke
-e INSTANCE_ID=$INSTANCE_ID \
-e PROJECT=$PROJECT \
-e ZONE=$ZONE \
-e DOCKER_PREFIX=$DOCKER_PREFIX \
-e WORKER_CONFIG=$WORKER_CONFIG \
-e MAX_IDLE_TIME_MSECS=$MAX_IDLE_TIME_MSECS \
-e WORKER_DATA_DISK_MOUNT=/mnt/disks/$WORKER_DATA_DISK_NAME \
Expand Down Expand Up @@ -311,6 +313,9 @@ async def create_instance(app, zone, machine_name, machine_type, activation_toke
}, {
'key': 'batch_worker_image',
'value': BATCH_WORKER_IMAGE
}, {
'key': 'docker_prefix',
'value': DOCKER_PREFIX
}, {
'key': 'namespace',
'value': DEFAULT_NAMESPACE
Expand Down
4 changes: 2 additions & 2 deletions batch/batch/public_gcr_images.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from typing import List


def public_gcr_images(project: str) -> List[str]:
def public_gcr_images(docker_prefix: str) -> List[str]:
# the worker cannot import batch_configuration because it does not have all the environment
# variables
return [f'gcr.io/{project}/{name}' for name in ('query', 'hail', 'python-dill', 'batch-worker')]
return [f'{docker_prefix}/{name}' for name in ('query', 'hail', 'python-dill', 'batch-worker')]
4 changes: 3 additions & 1 deletion batch/batch/worker/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
PROJECT = os.environ['PROJECT']
ZONE = os.environ['ZONE'].rsplit('/', 1)[1]
PUBLIC_GCR_IMAGES = public_gcr_images(PROJECT)
DOCKER_PREFIX = os.environ['DOCKER_PREFIX']
WORKER_CONFIG = json.loads(base64.b64decode(os.environ['WORKER_CONFIG']).decode())
MAX_IDLE_TIME_MSECS = int(os.environ['MAX_IDLE_TIME_MSECS'])
WORKER_DATA_DISK_MOUNT = os.environ['WORKER_DATA_DISK_MOUNT']
Expand All @@ -84,6 +85,7 @@
log.info(f'INSTANCE_ID {INSTANCE_ID}')
log.info(f'PROJECT {PROJECT}')
log.info(f'ZONE {ZONE}')
log.info(f'DOCKER_PREFIX {DOCKER_PREFIX}')
log.info(f'WORKER_CONFIG {WORKER_CONFIG}')
log.info(f'MAX_IDLE_TIME_MSECS {MAX_IDLE_TIME_MSECS}')
log.info(f'WORKER_DATA_DISK_MOUNT {WORKER_DATA_DISK_MOUNT}')
Expand Down Expand Up @@ -270,7 +272,7 @@ def __init__(self, job, name, spec):
image_ref.tag = 'latest'

if image_ref.name() in HAIL_GENETICS_IMAGES:
image_ref.domain = 'gcr.io'
image_ref.domain = DOCKER_PREFIX.split('/', maxsplit=1)[0]
image_ref.path = f'{PROJECT}/{image_ref.name()}'

self.image_ref = image_ref
Expand Down
11 changes: 7 additions & 4 deletions batch/build-batch-worker-image-startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ rm -rf /var/lib/apt/lists/*

[ -f /etc/docker/daemon.json ] || echo "{}" > /etc/docker/daemon.json

VERSION=1.5.0
VERSION=2.0.4
OS=linux
ARCH=amd64

Expand All @@ -39,10 +39,13 @@ curl -fsSL "https://github.com/GoogleCloudPlatform/docker-credential-gcr/release

# avoid "unable to get current user home directory: os/user lookup failed"
export HOME=/root
docker-credential-gcr configure-docker

GCP_PROJECT=$(curl -s -H "Metadata-Flavor: Google" "http://metadata.google.internal/computeMetadata/v1/project/project-id")
docker pull gcr.io/$GCP_PROJECT/ubuntu:18.04
DOCKER_PREFIX=$(curl -s -H "Metadata-Flavor: Google" "http://metadata.google.internal/computeMetadata/v1/instance/attributes/docker_prefix")

docker-credential-gcr configure-docker --include-artifact-registry

docker pull ${DOCKER_PREFIX}/ubuntu:18.04
docker pull gcr.io/google.com/cloudsdktool/cloud-sdk:310.0.0-alpine

# add docker daemon debug logging
jq '.debug = true' /etc/docker/daemon.json > daemon.json.tmp
Expand Down
4 changes: 4 additions & 0 deletions batch/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ spec:
value: "{{ default_ns.name }}"
- name: PROJECT
value: "{{ global.project }}"
- name: HAIL_DOCKER_PREFIX
value: "{{ global.docker_prefix }}"
- name: HAIL_GCP_REGION
valueFrom:
secretKeyRef:
Expand Down Expand Up @@ -195,6 +197,8 @@ spec:
value: "{{ default_ns.name }}"
- name: PROJECT
value: "{{ global.project }}"
- name: HAIL_DOCKER_PREFIX
value: "{{ global.docker_prefix }}"
- name: HAIL_GCP_REGION
valueFrom:
secretKeyRef:
Expand Down
4 changes: 2 additions & 2 deletions benchmark-service/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
include ../config.mk

BENCHMARK_LATEST = gcr.io/$(PROJECT)/benchmark:latest
BENCHMARK_IMAGE = gcr.io/$(PROJECT)/benchmark:$(shell docker images -q --no-trunc benchmark:latest | sed -e 's,[^:]*:,,')
BENCHMARK_LATEST = $(DOCKER_PREFIX)/benchmark:latest
BENCHMARK_IMAGE = $(DOCKER_PREFIX)/benchmark:$(shell docker images -q --no-trunc benchmark:latest | sed -e 's,[^:]*:,,')

EXTRA_PYTHONPATH := ../hail/python:../gear:../web_common
PYTHON := PYTHONPATH=$${PYTHONPATH:+$${PYTHONPATH}:}$(EXTRA_PYTHONPATH) python3
Expand Down
2 changes: 1 addition & 1 deletion benchmark/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM gcr.io/{{ global.project }}/ubuntu:18.04
FROM {{ global.docker_prefix }}/ubuntu:18.04

ENV LANG C.UTF-8

Expand Down
5 changes: 2 additions & 3 deletions benchmark/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ cleanup_image:

PROJECT := hail-vdc
BENCHMARK_DOCKER_TAG := benchmark_$(shell whoami)
BENCHMARK_REPO_BASE = gcr.io/$(PROJECT)/$(BENCHMARK_DOCKER_TAG)
BENCHMARK_REPO_BASE = $(DOCKER_PREFIX)/$(BENCHMARK_DOCKER_TAG)

ifndef HAIL_WHEEL
image_sha:
Expand All @@ -42,7 +42,7 @@ image_sha: wheel cleanup_image
cp $(BENCHMARK_WHEEL) .
# 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":{"project":"$(PROJECT)"}}' Dockerfile Dockerfile.out
python3 ../ci/jinja2_render.py '{"global":{"docker_prefix":"$(DOCKER_PREFIX)"}' 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))
@printf $$(docker images -q --no-trunc $(BENCHMARK_DOCKER_TAG) | sed -e 's,[^:]*:,,') > image_sha
@echo Image sha is `cat image_sha`
Expand Down Expand Up @@ -72,4 +72,3 @@ clean:
rm -f $(notdir $(HAIL_WHEEL))
rm -f $(notdir $(BENCHMARK_WHEEL))
rm -f requirements.txt

4 changes: 2 additions & 2 deletions bootstrap-gateway/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ include ../config.mk

.PHONY: build push deploy

GATEWAY_LATEST = gcr.io/$(PROJECT)/gateway:latest
GATEWAY_IMAGE = gcr.io/$(PROJECT)/gateway:$(shell docker images -q --no-trunc gateway | sed -e 's,[^:]*:,,')
GATEWAY_LATEST = $(DOCKER_PREFIX)/gateway:latest
GATEWAY_IMAGE = $(DOCKER_PREFIX)/gateway:$(shell docker images -q --no-trunc gateway | sed -e 's,[^:]*:,,')

build:
$(MAKE) -C ../docker hail-ubuntu
Expand Down
8 changes: 4 additions & 4 deletions ci/Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
include ../config.mk

CI_UTILS_LATEST = gcr.io/$(PROJECT)/ci-utils:latest
CI_UTILS_IMAGE = gcr.io/$(PROJECT)/ci-utils:$(shell docker images -q --no-trunc ci-utils | sed -e 's,[^:]*:,,')
CI_UTILS_LATEST = $(DOCKER_PREFIX)/ci-utils:latest
CI_UTILS_IMAGE = $(DOCKER_PREFIX)/ci-utils:$(shell docker images -q --no-trunc ci-utils | sed -e 's,[^:]*:,,')

CI_LATEST = gcr.io/$(PROJECT)/ci:latest
CI_IMAGE = gcr.io/$(PROJECT)/ci:$(shell docker images -q --no-trunc ci | sed -e 's,[^:]*:,,')
CI_LATEST = $(DOCKER_PREFIX)/ci:latest
CI_IMAGE = $(DOCKER_PREFIX)/ci:$(shell docker images -q --no-trunc ci | sed -e 's,[^:]*:,,')

EXTRA_PYTHONPATH := ../batch:../hail/python:../gear:../web_common
PYTHON := PYTHONPATH=$${PYTHONPATH:+$${PYTHONPATH}:}$(EXTRA_PYTHONPATH) python3
Expand Down
12 changes: 8 additions & 4 deletions ci/ci/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,10 @@ def input_config(self, code, scope):
'project': GCP_PROJECT,
'zone': GCP_ZONE,
'docker_prefix': DOCKER_PREFIX,
<<<<<<< HEAD
'docker_root_image': DOCKER_ROOT_IMAGE,
=======
>>>>>>> 2cfc712c1... Switch to Artifact Registry (#29)
'domain': DOMAIN,
'ip': IP,
'k8s_server_url': KUBERNETES_SERVER_URL,
Expand Down Expand Up @@ -243,9 +246,9 @@ def __init__(self, params, dockerfile, context_path, publish_as, inputs): # pyl
self.publish_as = publish_as
self.inputs = inputs
if params.scope == 'deploy' and publish_as and not is_test_deployment:
self.base_image = f'gcr.io/{GCP_PROJECT}/{self.publish_as}'
self.base_image = f'{DOCKER_PREFIX}/{self.publish_as}'
else:
self.base_image = f'gcr.io/{GCP_PROJECT}/ci-intermediate'
self.base_image = f'{DOCKER_PREFIX}/ci-intermediate'
self.image = f'{self.base_image}:{self.token}'
self.job = None

Expand Down Expand Up @@ -296,7 +299,7 @@ def build(self, batch, code, scope):
)

if self.publish_as:
published_latest = shq(f'gcr.io/{GCP_PROJECT}/{self.publish_as}:latest')
published_latest = shq(f'{DOCKER_PREFIX}/{self.publish_as}:latest')
pull_published_latest = f'time retry docker pull {shq(published_latest)} || true'
cache_from_published_latest = f'--cache-from {shq(published_latest)}'
else:
Expand Down Expand Up @@ -327,6 +330,7 @@ def build(self, batch, code, scope):
'''
)

docker_registry = DOCKER_PREFIX.split('/')[0]
script = f'''
set -ex
date
Expand All @@ -344,7 +348,7 @@ def build(self, batch, code, scope):
time gcloud -q auth activate-service-account \
--key-file=/secrets/gcr-push-service-account-key/gcr-push-service-account-key.json
time gcloud -q auth configure-docker
time gcloud -q auth configure-docker {docker_registry}
time retry docker pull $FROM_IMAGE
{pull_published_latest}
Expand Down
1 change: 1 addition & 0 deletions ci/ci/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
DOCKER_PREFIX = os.environ.get('HAIL_DOCKER_PREFIX', f'gcr.io/{GCP_REGION}')
assert DOCKER_PREFIX != ''
DOCKER_ROOT_IMAGE = os.environ['HAIL_DOCKER_ROOT_IMAGE']
assert DOCKER_ROOT_IMAGE != ''
DOMAIN = os.environ['HAIL_DOMAIN']
assert DOMAIN != ''
IP = os.environ.get('HAIL_IP')
Expand Down
2 changes: 2 additions & 0 deletions dev-docs/development_process.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ gcloud auth login
gcloud config set project hail-vdc
gcloud container clusters get-credentials vdc --zone=us-central1-a
gcloud auth configure-docker
# If you are using the Artifact Registry:
# gcloud auth configure-docker $REGION-docker.pkg.dev
```
5. Add these lines to `~/.zshrc` or `~/.bashrc` to configure your shell and environment for Hail:
```
Expand Down
26 changes: 16 additions & 10 deletions docker/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,31 @@ include ../config.mk
.PHONY: build
build: base-stmp service-base hail-ubuntu

HAIL_UBUNTU_LATEST = gcr.io/$(PROJECT)/hail-ubuntu:latest
HAIL_UBUNTU_IMAGE = gcr.io/$(PROJECT)/hail-ubuntu:$(shell docker images -q --no-trunc hail-ubuntu:latest | sed -e 's,[^:]*:,,')
HAIL_UBUNTU_LATEST = $(DOCKER_PREFIX)/hail-ubuntu:latest
HAIL_UBUNTU_IMAGE = $(DOCKER_PREFIX)/hail-ubuntu:$(shell docker images -q --no-trunc hail-ubuntu:latest | sed -e 's,[^:]*:,,')

BASE_LATEST = gcr.io/$(PROJECT)/base:latest
BASE_IMAGE = gcr.io/$(PROJECT)/base:$(shell docker images -q --no-trunc base:latest | sed -e 's,[^:]*:,,')
BASE_LATEST = $(DOCKER_PREFIX)/base:latest
BASE_IMAGE = $(DOCKER_PREFIX)/base:$(shell docker images -q --no-trunc base:latest | sed -e 's,[^:]*:,,')

SERVICE_BASE_LATEST = gcr.io/$(PROJECT)/service-base:latest
SERVICE_BASE_IMAGE = gcr.io/$(PROJECT)/service-base:$(shell docker images -q --no-trunc service-base:latest | sed -e 's,[^:]*:,,')
SERVICE_BASE_LATEST = $(DOCKER_PREFIX)/service-base:latest
SERVICE_BASE_IMAGE = $(DOCKER_PREFIX)/service-base:$(shell docker images -q --no-trunc service-base:latest | sed -e 's,[^:]*:,,')

SERVICE_JAVA_RUN_BASE_LATEST = gcr.io/$(PROJECT)/service-java-run-base:latest
SERVICE_JAVA_RUN_BASE_IMAGE = gcr.io/$(PROJECT)/service-java-run-base:$(shell docker images -q --no-trunc service-java-run-base:latest | sed -e 's,[^:]*:,,')
SERVICE_JAVA_RUN_BASE_LATEST = $(DOCKER_PREFIX)/service-java-run-base:latest
SERVICE_JAVA_RUN_BASE_IMAGE = $(DOCKER_PREFIX)/service-java-run-base:$(shell docker images -q --no-trunc service-java-run-base:latest | sed -e 's,[^:]*:,,')

HAIL_PUBLIC_LATEST = $(DOCKER_PREFIX)/hail-public:latest
HAIL_PUBLIC_IMAGE = $(DOCKER_PREFIX)/hail-public:$(shell docker images -q --no-trunc hail-public:latest | sed -e 's,[^:]*:,,')

GENETICS_PUBLIC_LATEST = $(DOCKER_PREFIX)/genetics-public:latest
GENETICS_PUBLIC_IMAGE = $(DOCKER_PREFIX)/genetics-public:$(shell docker images -q --no-trunc genetics-public:latest | sed -e 's,[^:]*:,,')

.PHONY: hail-ubuntu
hail-ubuntu: hail-ubuntu-stmp

hail-ubuntu-stmp: hail-ubuntu/Dockerfile hail-ubuntu/hail-pip-install hail-ubuntu/pip.conf hail-ubuntu/hail-apt-get-install
-docker pull gcr.io/$(PROJECT)/ubuntu:bionic-20200921
-docker pull $(DOCKER_PREFIX)/ubuntu:bionic-20200921
-docker pull $(HAIL_UBUNTU_LATEST)
python3 ../ci/jinja2_render.py '{"global":{"project":"$(PROJECT)"}}' hail-ubuntu/Dockerfile hail-ubuntu/Dockerfile.out
python3 ../ci/jinja2_render.py '{"global":{"docker_prefix":"$(DOCKER_PREFIX)"}}' hail-ubuntu/Dockerfile hail-ubuntu/Dockerfile.out
docker build -t hail-ubuntu -f hail-ubuntu/Dockerfile.out --cache-from hail-ubuntu,$(HAIL_UBUNTU_LATEST),ubuntu:bionic-20200921 hail-ubuntu
touch hail-ubuntu-stmp

Expand Down
2 changes: 1 addition & 1 deletion docker/hail-ubuntu/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM gcr.io/{{ global.project }}/ubuntu:focal-20201106
FROM {{ global.docker_prefix }}/ubuntu:focal-20201106
ENV LANG C.UTF-8
ENV DEBIAN_FRONTEND noninteractive
COPY retry /bin/retry
Expand Down
2 changes: 1 addition & 1 deletion docker/python-dill/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include ../../config.mk

push:
PROJECT=$(PROJECT) bash push.sh
DOCKER_PREFIX=$(DOCKER_PREFIX) bash push.sh
4 changes: 2 additions & 2 deletions docker/python-dill/push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ do
sed "s/@PYTHON_VERSION@/$version/g" Dockerfile > Dockerfile.out
docker build --tag hailgenetics/python-dill:$version - <Dockerfile.out
docker push hailgenetics/python-dill:$version
docker tag hailgenetics/python-dill:$version gcr.io/$PROJECT/python-dill:$version
docker push gcr.io/$PROJECT/python-dill:$version
docker tag hailgenetics/python-dill:$version ${DOCKER_PREFIX}/python-dill:$version
docker push ${DOCKER_PREFIX}/python-dill:$version
done
2 changes: 1 addition & 1 deletion docker/stat-permissions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -e

uname=$(uname -s)

if [ $uname = "Linux" ]
if [ $uname = "Linux" ] || $(stat --help | grep -q GNU)
then
stat -c "%a" $1
elif [ $uname = "Darwin" ]
Expand Down
Loading

0 comments on commit 1e52cb4

Please sign in to comment.