Skip to content

Commit

Permalink
Add CI and makefile tests for cache server (kubeflow#458)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomcli authored Feb 5, 2021
1 parent daf17b9 commit 35185d9
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 2 deletions.
22 changes: 20 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ build-release-template: ## Build KFP Tekton release deployment templates
@kustomize build manifests/kustomize/env/kfp-template -o install/$(KFP_TEKTON_RELEASE)/kfp-tekton.yaml

.PHONY: build-backend
build-backend: build-apiserver build-agent build-workflow ## Verify apiserver, agent, and workflow build
build-backend: build-apiserver build-agent build-workflow build-cacheserver ## Verify apiserver, agent, and workflow build
@echo "$@: OK"

.PHONY: build-apiserver
Expand All @@ -153,12 +153,17 @@ build-agent: ## Build agent
build-workflow: ## Build workflow
go build -o workflow ./backend/src/crd/controller/scheduledworkflow/*.go

.PHONY: build-cacheserver
build-cacheserver: ## Build cache
go build -o cache ./backend/src/cache/*.go

.PHONY: build-backend-images
build-backend-images: \
build-api-server-image \
build-persistenceagent-image \
build-metadata-writer-image \
build-scheduledworkflow-image \
build-cacheserver-image \
## Build backend docker images
@echo "$@: OK"

Expand All @@ -178,8 +183,18 @@ build-metadata-writer-image: ## Build metadata-writer docker image
build-scheduledworkflow-image: ## Build scheduledworkflow docker image
docker build -t ${DOCKER_REGISTRY}/scheduledworkflow -f backend/Dockerfile.scheduledworkflow .

.PHONY: build-cacheserver-image
build-cacheserver-image: ## Build cacheserver docker image
docker build -t ${DOCKER_REGISTRY}/cache-server -f backend/Dockerfile.cacheserver .

.PHONY: run-go-unittests
run-go-unittests: run-apiserver-unittests run-common-unittests run-crd-unittests run-persistenceagent-unittests ## Verify go backend unit tests
run-go-unittests: \
run-apiserver-unittests \
run-common-unittests \
run-crd-unittests \
run-persistenceagent-unittests \
run-cacheserver-unittests \
## Verify go backend unit tests
@echo "$@: OK"

run-apiserver-unittests: # apiserver golang unit tests
Expand All @@ -193,3 +208,6 @@ run-crd-unittests: # crd golang unit tests

run-persistenceagent-unittests: # persistence agent golang unit tests
go test -v -cover ./backend/src/agent/...

run-cacheserver-unittests: # cache golang unit tests
go test -v -cover ./backend/src/cache/...
2 changes: 2 additions & 0 deletions guides/developer_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ The KFP backend with Tekton uses a modified version of Kubeflow Pipelines api-se
go build -o apiserver ./backend/src/apiserver
go build -o agent ./backend/src/agent/persistence
go build -o workflow ./backend/src/crd/controller/scheduledworkflow/*.go
go build -o cache ./backend/src/cache/*.go
```

Note: The metadata writer is written in Python, so the code will be compiled during runtime execution.
Expand All @@ -103,6 +104,7 @@ The KFP backend with Tekton uses a modified version of Kubeflow Pipelines api-se
docker build -t ${DOCKER_REGISTRY}/persistenceagent -f backend/Dockerfile.persistenceagent .
docker build -t ${DOCKER_REGISTRY}/metadata-writer -f backend/metadata_writer/Dockerfile .
docker build -t ${DOCKER_REGISTRY}/scheduledworkflow -f backend/Dockerfile.scheduledworkflow .
docker build -t ${DOCKER_REGISTRY}/cache-server -f backend/Dockerfile.cacheserver .
```

4. Push the images to registry and modify the Kustomization to use your own built images.
Expand Down
3 changes: 3 additions & 0 deletions manifests/kustomize/base/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ images:
- name: gcr.io/ml-pipeline/scheduledworkflow
newName: docker.io/aipipeline/scheduledworkflow
newTag: latest
- name: gcr.io/ml-pipeline/cache-server
newName: docker.io/aipipeline/cache-server
newTag: latest

# Used by Kustomize
configMapGenerator:
Expand Down
2 changes: 2 additions & 0 deletions manifests/kustomize/env/kfp-template/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,5 @@ images:
newTag: 0.6.0
- name: docker.io/aipipeline/scheduledworkflow
newTag: 0.6.0
- name: docker.io/aipipeline/cache-server
newTag: 0.6.0

0 comments on commit 35185d9

Please sign in to comment.