Skip to content

Commit

Permalink
Update the naming conventions for Kubeflow Trainer (#2415)
Browse files Browse the repository at this point in the history
* Update the naming conventions for Kubeflow Trainer

Signed-off-by: Andrey Velichkevich <[email protected]>

* Fix webhooks

Signed-off-by: Andrey Velichkevich <[email protected]>

* Fix paths for webhooks

Signed-off-by: Andrey Velichkevich <[email protected]>

* Update go test cmd

Signed-off-by: Andrey Velichkevich <[email protected]>

* Rename kubeflowv1 to trainer pkg

Signed-off-by: Andrey Velichkevich <[email protected]>

---------

Signed-off-by: Andrey Velichkevich <[email protected]>
  • Loading branch information
andreyvelich authored Feb 6, 2025
1 parent 62e958f commit 3060332
Show file tree
Hide file tree
Showing 244 changed files with 2,251 additions and 2,454 deletions.
8 changes: 4 additions & 4 deletions .github/ISSUE_TEMPLATE/bug_report.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ body:
$ kubectl version
```
Training Operator version:
Kubeflow Trainer version:
```bash
$ kubectl get pods -n kubeflow -l control-plane=kubeflow-training-operator -o jsonpath="{.items[*].spec.containers[*].image}"
$ kubectl get pods -n kubeflow -l app.kubernetes.io/name=trainer -o jsonpath="{.items[*].spec.containers[*].image}"
```
Training Operator Python SDK version:
Kubeflow Python SDK version:
```bash
$ pip show kubeflow-training
$ pip show kubeflow
```
validations:
Expand Down
4 changes: 2 additions & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- Thanks for sending a pull request! Here are some tips for you:
1. If this is your first time, check our contributor guidelines: https://www.kubeflow.org/docs/about/contributing
2. To know more about Training Operator, check the developer guide:
https://github.com/kubeflow/training-operator/blob/master/CONTRIBUTING.md
2. To know more about Kubeflow Trainer, check the developer guide:
https://github.com/kubeflow/trainer/blob/master/CONTRIBUTING.md
3. If you want *faster* PR reviews, check how: https://git.k8s.io/community/contributors/guide/pull-requests.md#best-practices-for-faster-reviews
-->

Expand Down
25 changes: 10 additions & 15 deletions .github/workflows/build-and-push-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,37 +13,34 @@ jobs:
fail-fast: false
matrix:
include:
- component-name: training-operator-v2
dockerfile: cmd/training-operator.v2alpha1/Dockerfile
- component-name: trainer-controller-manager
dockerfile: cmd/trainer-controller-manager/Dockerfile
platforms: linux/amd64,linux/arm64,linux/ppc64le
tag-prefix: v2alpha1
- component-name: model-initializer-v2
dockerfile: cmd/initializer_v2/model/Dockerfile
- component-name: model-initializer
dockerfile: cmd/initializer/model/Dockerfile
platforms: linux/amd64,linux/arm64
tag-prefix: v2
- component-name: dataset-initializer-v2
dockerfile: cmd/initializer_v2/dataset/Dockerfile
- component-name: dataset-initializer
dockerfile: cmd/initializer/dataset/Dockerfile
platforms: linux/amd64,linux/arm64
tag-prefix: v2

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Docker Login
# Trigger workflow only for kubeflow/training-operator repository with specific branch (master, release-*) or tag (v.*).
# Trigger workflow only for kubeflow/trainer repository with specific branch (master, release-*) or tag (v.*).
if: >-
github.repository == 'kubeflow/training-operator' &&
github.repository == 'kubeflow/trainer' &&
(github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release-') || startsWith(github.ref, 'refs/tags/v'))
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Publish Component ${{ matrix.component-name }}
# Trigger workflow only for kubeflow/training-operator repository with specific branch (master, release-*) or tag (v.*).
# Trigger workflow only for kubeflow/trainer repository with specific branch (master, release-*) or tag (v.*).
if: >-
github.repository == 'kubeflow/training-operator' &&
github.repository == 'kubeflow/trainer' &&
(github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release-') || startsWith(github.ref, 'refs/tags/v'))
id: publish
uses: ./.github/workflows/template-publish-image
Expand All @@ -52,7 +49,6 @@ jobs:
dockerfile: ${{ matrix.dockerfile }}
platforms: ${{ matrix.platforms }}
context: ${{ matrix.context }}
tag-prefix: ${{ matrix.tag-prefix }}
push: true

- name: Test Build For Component ${{ matrix.component-name }}
Expand All @@ -63,5 +59,4 @@ jobs:
dockerfile: ${{ matrix.dockerfile }}
platforms: ${{ matrix.platforms }}
context: ${{ matrix.context }}
tag-prefix: ${{ matrix.tag-prefix }}
push: false
6 changes: 1 addition & 5 deletions .github/workflows/template-publish-image/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ inputs:
push:
required: true
description: whether to push container images or not
tag-prefix:
required: false
default: v2alpha1
description: Prefix for the image tag, e.g. v2alpha1

runs:
using: composite
Expand Down Expand Up @@ -86,7 +82,7 @@ runs:
images: ${{ inputs.image }}
tags: |
type=raw,latest
type=sha,prefix=${{ inputs.tag-prefix }}-
type=sha
- name: Build and Push
uses: docker/build-push-action@v5
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ jobs:
- name: Install dependencies
run: |
echo "TODO (andreyvelich): Implement E2E Tests"
# pip install -U './sdk_v2'
# pip install -U './sdk'
14 changes: 7 additions & 7 deletions .github/workflows/test-go.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@ jobs:
GOPATH: ${{ github.workspace }}/go
defaults:
run:
working-directory: ${{ env.GOPATH }}/src/github.com/kubeflow/training-operator
working-directory: ${{ env.GOPATH }}/src/github.com/kubeflow/trainer

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
path: ${{ env.GOPATH }}/src/github.com/kubeflow/training-operator
path: ${{ env.GOPATH }}/src/github.com/kubeflow/trainer

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: ${{ env.GOPATH }}/src/github.com/kubeflow/training-operator/go.mod
go-version-file: ${{ env.GOPATH }}/src/github.com/kubeflow/trainer/go.mod

- name: Check Go modules
run: |
Expand Down Expand Up @@ -51,7 +51,7 @@ jobs:
GOPATH: ${{ github.workspace }}/go
defaults:
run:
working-directory: ${{ env.GOPATH }}/src/github.com/kubeflow/training-operator
working-directory: ${{ env.GOPATH }}/src/github.com/kubeflow/trainer

strategy:
fail-fast: false
Expand All @@ -63,12 +63,12 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4
with:
path: ${{ env.GOPATH }}/src/github.com/kubeflow/training-operator
path: ${{ env.GOPATH }}/src/github.com/kubeflow/trainer

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: ${{ env.GOPATH }}/src/github.com/kubeflow/training-operator/go.mod
go-version-file: ${{ env.GOPATH }}/src/github.com/kubeflow/trainer/go.mod

- name: Run Go unit tests
run: |
Expand All @@ -82,5 +82,5 @@ jobs:
uses: shogo82148/actions-goveralls@v1
with:
path-to-profile: cover.out
working-directory: ${{ env.GOPATH }}/src/github.com/kubeflow/training-operator
working-directory: ${{ env.GOPATH }}/src/github.com/kubeflow/trainer
parallel: true
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ __pycache__/
*.egg-info/

# OpenAPI Generator CLI JAR file
hack/python-sdk-v2/openapi-generator-cli.jar
hack/python-sdk/openapi-generator-cli.jar

# Coverage
cover.out
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ exclude: |
(?x)^(
docs/images/.*|
pkg/client/.*|
sdk_v2/kubeflow/training/[^/]*.py|
sdk_v2/kubeflow/training/models/.*|
sdk_v2/docs/.*
sdk/kubeflow/trainer/[^/]*.py|
sdk/kubeflow/trainer/models/.*|
sdk/docs/.*
)$
28 changes: 14 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,17 @@ scheduler-plugins-crd: ## Copy the CRDs from the Scheduler Plugins repository to
# Instructions for code generation.
.PHONY: manifests
manifests: controller-gen ## Generate manifests.
$(CONTROLLER_GEN) "crd:generateEmbeddedObjectMeta=true" rbac:roleName=training-operator-v2 webhook \
paths="./pkg/apis/trainer/v2alpha1/...;./pkg/controller.v2/...;./pkg/runtime.v2/...;./pkg/webhooks.v2/...;./pkg/cert/..." \
output:crd:artifacts:config=manifests/v2/base/crds \
output:rbac:artifacts:config=manifests/v2/base/rbac \
output:webhook:artifacts:config=manifests/v2/base/webhook
$(CONTROLLER_GEN) "crd:generateEmbeddedObjectMeta=true" rbac:roleName=kubeflow-trainer-controller-manager webhook \
paths="./pkg/apis/trainer/v1alpha1/...;./pkg/controller/...;./pkg/runtime/...;./pkg/webhooks/...;./pkg/util/cert/..." \
output:crd:artifacts:config=manifests/base/crds \
output:rbac:artifacts:config=manifests/base/rbac \
output:webhook:artifacts:config=manifests/base/webhook

.PHONY: generate
generate: go-mod-download manifests ## Generate APIs and SDK.
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate/boilerplate.go.txt" paths="./pkg/apis/..."
hack/update-codegen.sh
hack/python-sdk-v2/gen-sdk.sh
hack/python-sdk/gen-sdk.sh

.PHONY: go-mod-download
go-mod-download: ## Run go mod download to download modules.
Expand All @@ -102,7 +102,7 @@ endif
# Instructions to run tests.
.PHONY: test
test: ## Run Go unit test.
go test ./pkg/apis/trainer/v2alpha1/... ./pkg/controller.v2/... ./pkg/runtime.v2/... ./pkg/webhooks.v2/... ./pkg/util.v2/... -coverprofile cover.out
go test $(shell go list ./... | grep -v '/test/') -coverprofile cover.out

.PHONY: test-integration
test-integration: envtest jobset-operator-crd scheduler-plugins-crd ## Run Go integration test.
Expand All @@ -111,16 +111,16 @@ test-integration: envtest jobset-operator-crd scheduler-plugins-crd ## Run Go in
test-python: ## Run Python unit test.
export PYTHONPATH=$(PROJECT_DIR)
pip install pytest
pip install -r ./cmd/initializer_v2/dataset/requirements.txt
pip install ./sdk_v2
pip install -r ./cmd/initializer/dataset/requirements.txt
pip install ./sdk

pytest ./pkg/initializer_v2/dataset
pytest ./pkg/initializer_v2/model
pytest ./pkg/initializer_v2/utils
pytest ./pkg/initializer/dataset
pytest ./pkg/initializer/model
pytest ./pkg/initializer/utils

test-python-integration: ## Run Python integration test.
export PYTHONPATH=$(PROJECT_DIR)
pip install pytest
pip install -r ./cmd/initializer_v2/dataset/requirements.txt
pip install -r ./cmd/initializer/dataset/requirements.txt

pytest ./test/integration/initializer_v2
pytest ./test/integration/initializer
4 changes: 2 additions & 2 deletions api.v2/openapi-spec/README.md → api/openapi-spec/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Kubeflow Training V2 OpenAPI Specification
# Kubeflow Trainer OpenAPI Specification

This folder contains an [OpenAPI specification](https://github.com/OAI/OpenAPI-Specification)
for Training V2 API.
for the Kubeflow Trainer APIs.
Loading

0 comments on commit 3060332

Please sign in to comment.