forked from fybrik/fybrik
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
143 lines (124 loc) · 4.81 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
include Makefile.env
export DOCKER_TAGNAME ?= master
export KUBE_NAMESPACE ?= fybrik-system
.PHONY: license
license: $(TOOLBIN)/license_finder
$(call license_go,.)
.PHONY: docker-mirror-read
docker-mirror-read:
$(TOOLS_DIR)/docker_mirror.sh $(TOOLS_DIR)/docker_mirror.conf
.PHONY: deploy
deploy: export VALUES_FILE?=charts/fybrik/values.yaml
deploy: $(TOOLBIN)/kubectl $(TOOLBIN)/helm
$(TOOLBIN)/kubectl create namespace $(KUBE_NAMESPACE) || true
$(TOOLBIN)/helm install fybrik-crd charts/fybrik-crd \
--namespace $(KUBE_NAMESPACE) --wait --timeout 120s
$(TOOLBIN)/helm install fybrik charts/fybrik --values $(VALUES_FILE) \
--namespace $(KUBE_NAMESPACE) --wait --timeout 120s
.PHONY: test
test:
$(MAKE) -C manager pre-test
go test -v ./...
# The tests for connectors/egeria are dropped because there are none
.PHONY: run-integration-tests
run-integration-tests: export DOCKER_HOSTNAME?=localhost:5000
run-integration-tests: export DOCKER_NAMESPACE?=fybrik-system
run-integration-tests: export VALUES_FILE=charts/fybrik/integration-tests.values.yaml
run-integration-tests:
$(MAKE) kind
$(MAKE) cluster-prepare
$(MAKE) docker-build docker-push
$(MAKE) -C test/services docker-build docker-push
$(MAKE) cluster-prepare-wait
$(MAKE) deploy
$(MAKE) configure-vault
$(MAKE) -C modules helm
$(MAKE) -C modules helm-uninstall # Uninstalls the deployed tests from previous command
$(MAKE) -C pkg/helm test
$(MAKE) -C manager run-integration-tests
$(MAKE) -C modules test
.PHONY: run-notebook-tests
run-notebook-tests: export DOCKER_HOSTNAME?=localhost:5000
run-notebook-tests: export DOCKER_NAMESPACE?=fybrik-system
run-notebook-tests: export VALUES_FILE=charts/fybrik/notebook-tests.values.yaml
run-notebook-tests:
$(MAKE) kind
$(MAKE) cluster-prepare
$(MAKE) docker-build docker-push
$(MAKE) -C test/services docker-build docker-push
$(MAKE) cluster-prepare-wait
$(MAKE) deploy
$(MAKE) configure-vault
$(MAKE) -C modules helm
$(MAKE) -C modules helm-uninstall # Uninstalls the deployed tests from previous command
$(MAKE) -C pkg/helm test
$(MAKE) -C manager run-notebook-tests
$(MAKE) -C modules test
.PHONY: run-deploy-tests
run-deploy-tests:
$(MAKE) kind
$(MAKE) cluster-prepare
kubectl config set-context --current --namespace=$(KUBE_NAMESPACE)
$(MAKE) -C third_party/opa deploy
kubectl apply -f ./manager/config/prod/deployment_configmap.yaml
$(MAKE) -C connectors deploy
kubectl get pod --all-namespaces
kubectl wait --for=condition=ready pod --all-namespaces --all --timeout=120s
$(MAKE) configure-vault
.PHONY: cluster-prepare
cluster-prepare:
$(MAKE) -C third_party/cert-manager deploy
$(MAKE) -C third_party/vault deploy
$(MAKE) -C third_party/datashim deploy
.PHONY: cluster-prepare-wait
cluster-prepare-wait:
$(MAKE) -C third_party/datashim deploy-wait
$(MAKE) -C third_party/vault deploy-wait
# Build only the docker images needed for integration testing
.PHONY: docker-minimal-it
docker-minimal-it:
$(MAKE) -C manager docker-build docker-push
$(MAKE) -C test/dummy-mover docker-build docker-push
$(MAKE) -C test/services docker-build docker-push
.PHONY: docker-build
docker-build:
$(MAKE) -C manager docker-build
$(MAKE) -C connectors docker-build
$(MAKE) -C test/dummy-mover docker-build
.PHONY: docker-push
docker-push:
$(MAKE) -C manager docker-push
$(MAKE) -C connectors docker-push
$(MAKE) -C test/dummy-mover docker-push
DOCKER_PUBLIC_HOSTNAME ?= ghcr.io
DOCKER_PUBLIC_NAMESPACE ?= fybrik
DOCKER_PUBLIC_TAGNAME ?= master
DOCKER_PUBLIC_NAMES := \
manager \
dummy-mover \
egr-connector \
katalog-connector \
opa-connector
define do-docker-retag-and-push-public
for name in ${DOCKER_PUBLIC_NAMES}; do \
docker tag ${DOCKER_HOSTNAME}/${DOCKER_NAMESPACE}/$$name:${DOCKER_TAGNAME} ${DOCKER_PUBLIC_HOSTNAME}/${DOCKER_PUBLIC_NAMESPACE}/$$name:${DOCKER_PUBLIC_TAGNAME}; \
done
DOCKER_HOSTNAME=${DOCKER_PUBLIC_HOSTNAME} DOCKER_NAMESPACE=${DOCKER_PUBLIC_NAMESPACE} DOCKER_TAGNAME=${DOCKER_PUBLIC_TAGNAME} $(MAKE) docker-push
endef
.PHONY: docker-retag-and-push-public
docker-retag-and-push-public:
$(call do-docker-retag-and-push-public)
.PHONY: helm-push-public
helm-push-public:
DOCKER_HOSTNAME=${DOCKER_PUBLIC_HOSTNAME} DOCKER_NAMESPACE=${DOCKER_PUBLIC_NAMESPACE} DOCKER_TAGNAME=${DOCKER_PUBLIC_TAGNAME} make -C modules helm-chart-push
.PHONY: save-images
save-images:
docker save -o images.tar ${DOCKER_HOSTNAME}/${DOCKER_NAMESPACE}/manager:${DOCKER_TAGNAME} \
${DOCKER_HOSTNAME}/${DOCKER_NAMESPACE}/dummy-mover:${DOCKER_TAGNAME} \
${DOCKER_HOSTNAME}/${DOCKER_NAMESPACE}/egr-connector:${DOCKER_TAGNAME} \
${DOCKER_HOSTNAME}/${DOCKER_NAMESPACE}/katalog-connector:${DOCKER_TAGNAME} \
${DOCKER_HOSTNAME}/${DOCKER_NAMESPACE}/opa-connector:${DOCKER_TAGNAME}
include hack/make-rules/tools.mk
include hack/make-rules/verify.mk
include hack/make-rules/cluster.mk
include hack/make-rules/vault.mk