-
Notifications
You must be signed in to change notification settings - Fork 716
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Andrey Velichkevich <[email protected]>
- Loading branch information
1 parent
2d3a72a
commit 100cb5b
Showing
9 changed files
with
44 additions
and
32 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -8,41 +8,35 @@ jobs: | |
pre-commit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v3 | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
- uses: pre-commit/[email protected] | ||
|
||
python-test: | ||
test: | ||
name: Test | ||
runs-on: ubuntu-latest | ||
env: | ||
PYTHONPATH: ${{ github.workspace }}:${PYTHONPATH} | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ["3.10", "3.11"] | ||
# Python version to run unit and integration tests. | ||
python-version: ["3.11"] | ||
|
||
steps: | ||
- name: Check out code | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install dependencies | ||
- name: Run Python unit tests | ||
run: | | ||
pip install pytest python-dateutil urllib3 kubernetes | ||
pip install -U './sdk/python[huggingface]' | ||
make test-python | ||
- name: Run unit test for training sdk | ||
- name: Run Python integration tests. | ||
run: | | ||
pytest ./sdk/python/kubeflow/training/api/training_client_test.py | ||
- name: Run Python unit tests for v2 | ||
run: | | ||
pip install -U './sdk_v2' | ||
export PYTHONPATH="${{ github.workspace }}:$PYTHONPATH" | ||
pytest ./pkg/initializer_v2/model | ||
pytest ./pkg/initializer_v2/dataset | ||
pytest ./pkg/initializer_v2/utils | ||
make test-python-integration |
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 |
---|---|---|
|
@@ -31,14 +31,14 @@ help: ## Display this help. | |
|
||
PROJECT_DIR := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST)))) | ||
|
||
|
||
## Tool Binaries | ||
# Tool Binaries | ||
LOCALBIN ?= $(PROJECT_DIR)/bin | ||
CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen | ||
ENVTEST ?= $(LOCALBIN)/setup-envtest | ||
|
||
ENVTEST_K8S_VERSION ?= 1.31 | ||
|
||
# Instructions to download tools for development. | ||
.PHONY: envtest | ||
envtest: ## Download the setup-envtest binary if required. | ||
test -s $(ENVTEST) || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/[email protected] | ||
|
@@ -47,7 +47,7 @@ envtest: ## Download the setup-envtest binary if required. | |
controller-gen: ## Download the controller-gen binary if required. | ||
test -s $(CONTROLLER_GEN) || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-tools/cmd/[email protected] | ||
|
||
# Download external CRDs for the integration testings. | ||
# Download external CRDs for Go integration testings. | ||
EXTERNAL_CRDS_DIR ?= $(PROJECT_DIR)/manifests/external-crds | ||
|
||
JOBSET_ROOT = $(shell go list -m -mod=readonly -f "{{.Dir}}" sigs.k8s.io/jobset) | ||
|
@@ -62,6 +62,7 @@ scheduler-plugins-crd: ## Copy the CRDs from the Scheduler Plugins repository to | |
mkdir -p $(EXTERNAL_CRDS_DIR)/scheduler-plugins/ | ||
cp -f $(SCHEDULER_PLUGINS_ROOT)/manifests/coscheduling/* $(EXTERNAL_CRDS_DIR)/scheduler-plugins | ||
|
||
# Instructions for code generation. | ||
.PHONY: manifests | ||
manifests: controller-gen ## Generate manifests. | ||
$(CONTROLLER_GEN) "crd:generateEmbeddedObjectMeta=true" rbac:roleName=training-operator-v2 webhook \ | ||
|
@@ -80,6 +81,7 @@ generate: go-mod-download manifests ## Generate APIs and SDK. | |
go-mod-download: ## Run go mod download to download modules. | ||
go mod download | ||
|
||
# Instructions for code formatting. | ||
.PHONY: fmt | ||
fmt: ## Run go fmt against the code. | ||
go fmt ./... | ||
|
@@ -97,10 +99,27 @@ ifeq ($(GOLANGCI_LINT),) | |
endif | ||
golangci-lint run --timeout 5m --go 1.23 ./... | ||
|
||
# Instructions to run tests. | ||
.PHONY: test | ||
test: ## Run Go unit test. | ||
go test ./pkg/apis/kubeflow.org/v2alpha1/... ./pkg/controller.v2/... ./pkg/runtime.v2/... ./pkg/webhooks.v2/... ./pkg/util.v2/... -coverprofile cover.out | ||
|
||
.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 | ||
|
||
test-python: ## Run Python unit test. | ||
export PYTHONPATH=$(PROJECT_DIR) | ||
pip install pytest | ||
pip install -r ./cmd/initializer_v2/dataset/requirements.txt | ||
|
||
pytest ./pkg/initializer_v2/dataset | ||
pytest ./pkg/initializer_v2/model | ||
pytest ./pkg/initializer_v2/utils | ||
|
||
test-python-integration: ## Run Python integration test. | ||
export PYTHONPATH=$(PROJECT_DIR) | ||
pip install pytest | ||
pip install -r ./cmd/initializer_v2/dataset/requirements.txt | ||
|
||
pytest ./test/integration/initializer_v2 |
Empty file.
Empty file.
Empty file.
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 was deleted.
Oops, something went wrong.