-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
56 lines (40 loc) · 1.88 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# Local Directory for upstreams
UPSTREAMS ?= ./upstreams
# Local repository directories
UPSTREAM_K8S ?= $(UPSTREAMS)/kubernetes
UPSTREAM_COMMIT ?= "20b216738a5e9671ddf4081ed97b5565e0b1ee01"
# Remote repositories
UPSTREAM_K8S_REPO ?= https://github.com/kubernetes/kubernetes
BASH ?= /bin/bash
DOCKER ?= docker
TAG ?= latest
ARCH ?= amd64
# These are passed to build the sidecar
REGISTRY ?= ghcr.io/converged-computing
SIDECAR_IMAGE ?= fluxnetes-sidecar:latest
POSTGRES_IMAGE ?= fluxnetes-postgres:latest
SCHEDULER_IMAGE ?= fluxnetes
.PHONY: all build build-sidecar clone update push push-sidecar push-fluxnetes build-postgres
all: prepare build-sidecar build build-postgres
upstreams:
mkdir -p $(UPSTREAMS)
clone-k8s: upstreams
if [ -d "$(UPSTREAM_K8S)" ]; then echo "Kubernetes upstream is cloned"; else ./hack/clone-k8s.sh $(UPSTREAM_K8S_REPO) $(UPSTREAM_K8S) $(UPSTREAM_COMMIT); fi
prepare: clone clone-k8s
# Add fluxnetes as a new in-tree plugin
rm -rf $(UPSTREAM_K8S)/pkg/scheduler/framework/plugins/fluxnetes
cp kubernetes/cmd/kube-scheduler/scheduler.go $(UPSTREAM_K8S)/cmd/kube-scheduler/scheduler.go
cp kubernetes/pkg/scheduler/*.go $(UPSTREAM_K8S)/pkg/scheduler/
cp -R kubernetes/pkg/fluxnetes $(UPSTREAM_K8S)/pkg/scheduler/framework/plugins/fluxnetes
cp -R src/fluxnetes/pkg/fluxion-grpc $(UPSTREAM_K8S)/pkg/scheduler/framework/plugins/fluxnetes/fluxion-grpc
build: prepare
docker build -t ${REGISTRY}/${SCHEDULER_IMAGE} --build-arg ARCH=$(ARCH) --build-arg VERSION=$(VERSION) --build-arg k8s_upstream=$(UPSTREAM_K8S) .
push-sidecar:
$(DOCKER) push $(REGISTRY)/$(SIDECAR_IMAGE):$(TAG) --all-tags
push-fluxnetes:
$(DOCKER) push $(REGISTRY)/$(IMAGE):$(TAG) --all-tags
build-sidecar:
make -C ./src LOCAL_REGISTRY=${REGISTRY} LOCAL_IMAGE=${SIDECAR_IMAGE}
build-postgres:
docker build -f src/build/postgres/Dockerfile -t ${REGISTRY}/${POSTGRES_IMAGE} .
push: push-sidecar push-fluxnetes