This repository has been archived by the owner on Nov 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile
111 lines (88 loc) · 5.01 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
GH_USERNAME := thoth-station
BRANCH := main
all: # NOOP
prepare: # Render dev kustomization.yaml interpolating GH_USERNAME and BRANCH so you can deploy from fork
BRANCH=$(BRANCH) GH_USERNAME=$(GH_USERNAME) envsubst < manifests/overlays/dev/phase_01/kustomization.yaml.tmpl > manifests/overlays/dev/phase_01/kustomization.yaml
deploy-phase_00: # Subscribes cluster to required operators
kustomize build manifests/overlays/dev/phase_00 | oc apply -f -
deploy-phase_01: prepare # Applies BYON pipelines
kustomize build manifests/overlays/dev/phase_01 | oc apply -f -
deploy: # Applies manifests on a cluster
$(MAKE) deploy-phase_00
@echo -n "Wait until CRDs are available"
@until oc get kfdefs,pipelines,tasks >/dev/null 2>/dev/null; do echo -n "."; sleep 10; done
@echo ""
$(MAKE) deploy-phase_01
undeploy: prepare # Deletes all manifests from a cluster
kustomize build manifests/overlays/dev/phase_00 | oc apply -f -
kustomize build manifests/overlays/dev/phase_01 | oc delete -f -
run: # Creates and follows execution of 1 positive and 1 negative cases of validation
tkn pipeline start byon-import-jupyterhub-image \
--showlog \
-w name=data,volumeClaimTemplateFile=manifests/overlays/dev/pvc.yaml \
-p url=quay.io/tcoufal/false \
-p name="Image does not exist" \
-p creator="some_user" \
-p desc="This image is expected to FAIL validation"
tkn pipeline start byon-import-jupyterhub-image \
--showlog \
-w name=data,volumeClaimTemplateFile=manifests/overlays/dev/pvc.yaml \
-p url=quay.io/thoth-station/s2i-minimal-py38-notebook:v0.2.2 \
-p name="Thoth Station miminal Python 3.8" \
-p creator="some_user" \
-p desc="This image is expected to PASS validation"
test: # Queues various import pipelines and asserts results
@echo -n "Queuing import pipelines..."
@tkn pipeline start byon-import-jupyterhub-image \
-w name=data,volumeClaimTemplateFile=manifests/overlays/dev/pvc.yaml \
-p url=quay.io/tcoufal/false \
-p name="Image does not exist" \
-p creator="some_user" \
-p desc="This image is expected to FAIL validation" >/dev/null
@tkn pipeline start byon-import-jupyterhub-image \
-w name=data,volumeClaimTemplateFile=manifests/overlays/dev/pvc.yaml \
-p url=quay.io/thoth-station/s2i-minimal-py38-notebook:v0.2.2 \
-p name="Thoth Station miminal Python 3.8" \
-p creator="some_user" \
-p desc="This image is expected to PASS validation" >/dev/null
@tkn pipeline start byon-import-jupyterhub-image \
-w name=data,volumeClaimTemplateFile=manifests/overlays/dev/pvc.yaml \
-p url=quay.io/thoth-station/s2i-minimal-notebook:v0.0.15 \
-p name="Thoth Station miminal Python 3.6" \
-p creator="some_user" \
-p desc="This image is expected to FAIL validation" >/dev/null
@tkn pipeline start byon-import-jupyterhub-image \
-w name=data,volumeClaimTemplateFile=manifests/overlays/dev/pvc.yaml \
-p url=quay.io/tcoufal/jh-minimal-test \
-p name="Debian based miminal Python 3.8" \
-p creator="some_user" \
-p desc="This image is expected to PASS validation" >/dev/null
@tkn pipeline start byon-import-jupyterhub-image \
-w name=data,volumeClaimTemplateFile=manifests/overlays/dev/pvc.yaml \
-p url=quay.io/guimou/s2i-minimal-data-science-optapy-notebook:latest \
-p name="Minimal DataScience notebook with OptaPy" \
-p creator="some_user" \
-p desc="This image is expected to PASS validation" >/dev/null
@tkn pipeline start byon-import-jupyterhub-image \
-w name=data,volumeClaimTemplateFile=manifests/overlays/dev/pvc.yaml \
-p url=quay.io/guimou/odh-minimal-datascience-r-notebook:latest \
-p name="Minimal DataScience notebook with R and RStudio" \
-p creator="some_user" \
-p desc="This image is expected to PASS validation" >/dev/null
@tkn pipeline start byon-import-jupyterhub-image \
-w name=data,volumeClaimTemplateFile=manifests/overlays/dev/pvc.yaml \
-p url=quay.io/os-climate/aicoe-osc-demo:latest \
-p name="OS-Climate image with Pytorch" \
-p creator="some_user" \
-p desc="This image is expected to PASS validation" >/dev/null
@echo " Done"
@echo -n "Waiting for pipelines to finish execution..."
@while tkn pipelinerun list | grep "Running" >/dev/null; do sleep 20; echo -n "."; done
@echo " Done"
@echo "Results:"
@oc get is -l app.kubernetes.io/created-by=byon -o custom-columns=NAME:.metadata.annotations.opendatahub\\.io\\/notebook-image-name,DESCRIPTION:.metadata.annotations.opendatahub\\.io\\/notebook-image-desc,PHASE:.metadata.annotations.opendatahub\\.io\\/notebook-image-phase,VISIBILITY:.metadata.labels.opendatahub\\.io\\/notebook-image,MESSAGES:.metadata.annotations.opendatahub\\.io\\/notebook-image-messages
cleanup: # Cleanup from previous runs (removes all imagestreams created from `make run` and deletes all pipelinerun resources)
oc delete is -l app.kubernetes.io/created-by=byon
oc delete prs --all
help: # Show help message
@awk 'BEGIN {FS = ":.*#"; printf "\nUsage:\n make \033[36m\033[0m\n"} /^[$$()% 0-9a-zA-Z_-]+:.*?#/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^#@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)