-
Notifications
You must be signed in to change notification settings - Fork 739
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(test): Add E2E tests for Kubeflow Trainer (#2470)
* Add e2e tests for Kubeflow Trainer Signed-off-by: Andrey Velichkevich <[email protected]> * Add timeout for papermill Signed-off-by: Andrey Velichkevich <[email protected]> * Add output as part of make command Signed-off-by: Andrey Velichkevich <[email protected]> * Add k8s version to setup cluster Signed-off-by: Andrey Velichkevich <[email protected]> * Fix Kind k8s version Signed-off-by: Andrey Velichkevich <[email protected]> * Fix 1.29 version Signed-off-by: Andrey Velichkevich <[email protected]> * Create script to run Notebook Signed-off-by: Andrey Velichkevich <[email protected]> * Download dataset when local_rank=0 Signed-off-by: Andrey Velichkevich <[email protected]> * Update test/e2e/e2e_test.go Co-authored-by: Yuki Iwai <[email protected]> Signed-off-by: Andrey Velichkevich <[email protected]> * Refactor Go e2e tests Signed-off-by: Andrey Velichkevich <[email protected]> * Bump k8s to 1.29.14 Signed-off-by: Andrey Velichkevich <[email protected]> * Install Kind from go mod Signed-off-by: Andrey Velichkevich <[email protected]> * Fix path for Kind package Signed-off-by: Andrey Velichkevich <[email protected]> * Fix Go e2e Signed-off-by: Andrey Velichkevich <[email protected]> * Reduce number of CPUs Export Notebook as artifact Signed-off-by: Andrey Velichkevich <[email protected]> * Print logs due to flaky test Signed-off-by: Andrey Velichkevich <[email protected]> * Fix artifact path Signed-off-by: Andrey Velichkevich <[email protected]> * docker pull image Signed-off-by: Andrey Velichkevich <[email protected]> * Fix path Signed-off-by: Andrey Velichkevich <[email protected]> * Add k8s version to output name Signed-off-by: Andrey Velichkevich <[email protected]> * Remove install Kind cmd Signed-off-by: Andrey Velichkevich <[email protected]> --------- Signed-off-by: Andrey Velichkevich <[email protected]> Co-authored-by: Yuki Iwai <[email protected]>
- Loading branch information
1 parent
3ec8f07
commit 9e78575
Showing
18 changed files
with
640 additions
and
394 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,14 +29,16 @@ help: ## Display this help. | |
|
||
##@ Development | ||
|
||
K8S_VERSION ?= 1.32.0 | ||
|
||
PROJECT_DIR := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST)))) | ||
|
||
# Tool Binaries | ||
LOCALBIN ?= $(PROJECT_DIR)/bin | ||
|
||
CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen | ||
ENVTEST ?= $(LOCALBIN)/setup-envtest | ||
|
||
ENVTEST_K8S_VERSION ?= 1.32 | ||
KIND ?= $(LOCALBIN)/kind | ||
|
||
# Instructions to download tools for development. | ||
.PHONY: envtest | ||
|
@@ -47,6 +49,10 @@ envtest: ## Download the setup-envtest binary if required. | |
controller-gen: ## Download the controller-gen binary if required. | ||
GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-tools/cmd/[email protected] | ||
|
||
.PHONY: kind | ||
kind: ## Download Kind binary if required. | ||
GOBIN=$(LOCALBIN) go install sigs.k8s.io/kind@$(shell go list -m -f '{{.Version}}' sigs.k8s.io/kind) | ||
|
||
# Download external CRDs for Go integration testings. | ||
EXTERNAL_CRDS_DIR ?= $(PROJECT_DIR)/manifests/external-crds | ||
|
||
|
@@ -106,8 +112,9 @@ test: ## Run Go unit test. | |
|
||
.PHONY: test-integration | ||
test-integration: envtest jobset-operator-crd scheduler-plugins-crd ## Run Go integration test. | ||
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" go test ./test/... -coverprofile cover.out | ||
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(K8S_VERSION) -p path)" go test ./test/integration/... -coverprofile cover.out | ||
|
||
.PHONY: test-python | ||
test-python: ## Run Python unit test. | ||
export PYTHONPATH=$(PROJECT_DIR) | ||
pip install pytest | ||
|
@@ -118,9 +125,26 @@ test-python: ## Run Python unit test. | |
pytest ./pkg/initializer/model | ||
pytest ./pkg/initializer/utils | ||
|
||
.PHONY: test-python-integration | ||
test-python-integration: ## Run Python integration test. | ||
export PYTHONPATH=$(PROJECT_DIR) | ||
pip install pytest | ||
pip install -r ./cmd/initializer/dataset/requirements.txt | ||
|
||
pytest ./test/integration/initializer | ||
|
||
.PHONY: test-e2e-setup-cluster | ||
test-e2e-setup-cluster: kind ## Setup Kind cluster for e2e test. | ||
KIND=$(KIND) K8S_VERSION=$(K8S_VERSION) ./hack/e2e-setup-cluster.sh | ||
|
||
.PHONY: test-e2e | ||
test-e2e: ## Run Go e2e test. | ||
go test ./test/e2e/... | ||
|
||
# Input and output location for Notebooks executed with Papermill. | ||
NOTEBOOK_INPUT=$(PROJECT_DIR)/examples/pytorch/image-classification/mnist.ipynb | ||
NOTEBOOK_OUTPUT=$(PROJECT_DIR)/trainer_output.ipynb | ||
PAPERMILL_TIMEOUT=900 | ||
.PHONY: test-e2e-notebook | ||
test-e2e-notebook: ## Run Jupyter Notebook with Papermill. | ||
NOTEBOOK_INPUT=$(NOTEBOOK_INPUT) NOTEBOOK_OUTPUT=$(NOTEBOOK_OUTPUT) PAPERMILL_TIMEOUT=$(PAPERMILL_TIMEOUT) ./hack/e2e-run-notebook.sh |
Oops, something went wrong.