Skip to content

Commit

Permalink
[many] put shared make config in config.mk file (hail-is#9339)
Browse files Browse the repository at this point in the history
* [many] put shared make config in config.mk file

* fix more Makefiles
  • Loading branch information
cseed authored Aug 25, 2020
1 parent 7bd1864 commit 0f9b01f
Show file tree
Hide file tree
Showing 20 changed files with 41 additions and 46 deletions.
2 changes: 1 addition & 1 deletion address/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PROJECT := $(shell gcloud config get-value project)
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,[^:]*:,,')
Expand Down
2 changes: 1 addition & 1 deletion admin-pod/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PROJECT := $(shell gcloud config get-value project)
include ../config.mk

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

Expand Down
3 changes: 1 addition & 2 deletions auth/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
PROJECT = $(shell gcloud config get-value project)
DOMAIN ?= hail.is
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,[^:]*:,,')
Expand Down
4 changes: 1 addition & 3 deletions batch/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
PROJECT := $(shell gcloud config get-value project)
ZONE := us-central1-a
KUBERNETES_SERVER_URL := https://104.198.230.143
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,[^:]*:,,')
Expand Down
3 changes: 1 addition & 2 deletions benchmark-service/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
PROJECT = $(shell gcloud config get-value project)
DOMAIN ?= hail.is
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,[^:]*:,,')
Expand Down
3 changes: 2 additions & 1 deletion benchmark/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
include ../config.mk

ifndef HAIL_WHEEL
$(error HAIL_WHEEL is not set!)
endif
Expand Down Expand Up @@ -27,7 +29,6 @@ cleanup_image:
rm -f pushed_image

BENCHMARK_DOCKER_TAG := benchmark_$(shell whoami)
PROJECT = $(shell gcloud config get-value project)
BENCHMARK_REPO_BASE = gcr.io/$(PROJECT)/$(BENCHMARK_DOCKER_TAG)

ifndef HAIL_WHEEL
Expand Down
8 changes: 1 addition & 7 deletions ci/Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
ZONE := us-central1-a
PROJECT := $(shell gcloud config get-value project)
DOMAIN ?= hail.is
IP ?= 35.224.105.117
KUBERNETES_SERVER_URL ?= https://104.198.230.143

PROJECT := $(shell gcloud config get-value project)
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,[^:]*:,,')
Expand Down
8 changes: 8 additions & 0 deletions config.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
DOCKER_ROOT_IMAGE := ubuntu:18.04
DOMAIN := hail.is
INTERNAL_IP := 10.128.0.57
IP := 35.188.91.25
KUBERNETES_SERVER_URL := https://104.198.230.143
PROJECT := hail-vdc
REGION := us-central1
ZONE := us-central1-a
4 changes: 2 additions & 2 deletions docker/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
include ../config.mk

.PHONY: build
build: base-stmp service-base

PROJECT := $(shell gcloud config get-value project)

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

Expand Down
5 changes: 2 additions & 3 deletions gateway/Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
include ../config.mk

.PHONY: build push deploy

PROJECT = $(shell gcloud config get-value project)
GATEWAY_LATEST = gcr.io/$(PROJECT)/gateway:latest
GATEWAY_IMAGE = gcr.io/$(PROJECT)/gateway:$(shell docker images -q --no-trunc gateway | sed -e 's,[^:]*:,,')
DOMAIN ?= hail.is
IP ?= 35.188.91.25

build:
docker pull ubuntu:18.04
Expand Down
4 changes: 2 additions & 2 deletions image-fetcher/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.PHONY: build push deploy
include ../config.mk

PROJECT = $(shell gcloud config get-value project)
.PHONY: build push deploy

FETCH_LATEST = gcr.io/$(PROJECT)/image-fetcher:latest
FETCH_IMAGE = gcr.io/$(PROJECT)/image-fetcher:$(shell docker images -q --no-trunc image-fetcher | sed -e 's,[^:]*:,,')
Expand Down
5 changes: 2 additions & 3 deletions internal-gateway/Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
include ../config.mk

.PHONY: build push deploy

PROJECT = $(shell gcloud config get-value project)
INTERNAL_GATEWAY_LATEST = gcr.io/$(PROJECT)/internal-gateway:latest
INTERNAL_GATEWAY_IMAGE = gcr.io/$(PROJECT)/internal-gateway:$(shell docker images -q --no-trunc internal-gateway | sed -e 's,[^:]*:,,')
DOMAIN ?= hail.is
INTERNAL_IP ?= 10.128.0.57

build:
docker pull ubuntu:18.04
Expand Down
5 changes: 2 additions & 3 deletions letsencrypt/Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
include ../config.mk

STATIC_CONFIG = letsencrypt-pod.yaml letsencrypt.sh

.PHONY: $(STATIC_CONFIG) build push start-service run clean

PROJECT := $(shell gcloud config get-value project)
DOMAIN ?= hail.is

$(STATIC_CONFIG): %: %.in
sed -e "s,@project@,$(PROJECT),g" \
-e "s;@domains@;$(shell paste -s -d, domains.txt);g" \
Expand Down
2 changes: 1 addition & 1 deletion query/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PROJECT := $(shell gcloud config get-value project)
include ../config.mk

PYTHONPATH := $${PYTHONPATH:+$${PYTHONPATH}:}../hail/python:../gear
PYTHON := PYTHONPATH=$(PYTHONPATH) python3
Expand Down
3 changes: 1 addition & 2 deletions router-resolver/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
PROJECT = $(shell gcloud config get-value project)
DOMAIN ?= hail.is
include ../config.mk

ROUTER_RESOLVER_LATEST = gcr.io/$(PROJECT)/router-resolver:latest
ROUTER_RESOLVER_IMAGE = gcr.io/$(PROJECT)/router-resolver:$(shell docker images -q --no-trunc router-resolver:latest | sed -e 's,[^:]*:,,')
Expand Down
4 changes: 2 additions & 2 deletions router/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PROJECT = $(shell gcloud config get-value project)
include ../config.mk

ROUTER_LATEST = gcr.io/$(PROJECT)/router:latest
ROUTER_IMAGE = gcr.io/$(PROJECT)/router:$(shell docker images -q --no-trunc router | sed -e 's,[^:]*:,,')
DOMAIN ?= hail.is

.PHONY: build
build:
Expand Down
4 changes: 1 addition & 3 deletions shuffler/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
PROJECT := $(shell gcloud config get-value project)
ZONE := us-central1-a
KUBERNETES_SERVER_URL := https://104.198.230.143
include ../config.mk

SHUFFLER_LATEST = gcr.io/$(PROJECT)/shuffler:latest
SHUFFLER_IMAGE = gcr.io/$(PROJECT)/shuffler:$(shell docker images -q --no-trunc shuffler | sed -e 's,[^:]*:,,')
Expand Down
4 changes: 2 additions & 2 deletions site/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.PHONY: deployment.yaml build push deploy clean test
include ../config.mk

PROJECT = $(shell gcloud config get-value project)
.PHONY: deployment.yaml build push deploy clean test

IMAGE = gcr.io/$(PROJECT)/site:$(shell docker images -q --no-trunc site | sed -e 's,[^:]*:,,')

Expand Down
2 changes: 1 addition & 1 deletion ukbb-rg/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PROJECT := $(shell gcloud config get-value project)
include ../config.mk

UKBB_RG_STATIC_LATEST = gcr.io/$(PROJECT)/ukbb-rg-static:latest
UKBB_RG_STATIC_IMAGE = gcr.io/$(PROJECT)/ukbb-rg-static:$(shell docker images -q --no-trunc ukbb-rg-static | sed -e 's,[^:]*:,,')
Expand Down
12 changes: 7 additions & 5 deletions vdc/Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
include ../config.mk

.PHONY: echo-ip gcloud-config build-out create-deployment build-out-k8s create-k8s-secrets create-k8s-certs-volume deploy-k8s \
delete-deployment tear-down create-address

export PROJECT ?= hail-vdc-staging
export REGION ?= us-central1
export ZONE ?= $(REGION)-a
export DOMAIN ?= staging.hail.is
export IP ?= $(shell gcloud --project $(PROJECT) compute addresses describe --region $(REGION) site --format='value(address)')
export PROJECT
export REGION
export ZONE
export DOMAIN
export IP

# run letsencrypt, or take from letsencrypt-config.yaml
RUN_LETSENCRYPT = 1
Expand Down

0 comments on commit 0f9b01f

Please sign in to comment.