Skip to content

Commit

Permalink
Merge branch 'kubeflow:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
shivas1516 committed Sep 5, 2024
2 parents d1c2983 + 00eef58 commit 17591d1
Show file tree
Hide file tree
Showing 52 changed files with 24,300 additions and 661 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/build-and-publish-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ on:
required: false
type: string
default: .
tag-prefix:
required: false
type: string
default: v1
secrets:
DOCKERHUB_USERNAME:
required: false
Expand Down Expand Up @@ -57,6 +61,7 @@ jobs:
platforms: ${{ inputs.platforms }}
context: ${{ inputs.context }}
push: true
tag-prefix: ${{ inputs.tag-prefix }}

- name: Test Build For Component ${{ inputs.component-name }}
if: steps.publish.outcome == 'skipped'
Expand All @@ -67,3 +72,4 @@ jobs:
platforms: ${{ inputs.platforms }}
context: ${{ inputs.context }}
push: false
tag-prefix: ${{ inputs.tag-prefix }}
9 changes: 9 additions & 0 deletions .github/workflows/publish-core-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ jobs:
platforms: ${{ matrix.platforms }}
dockerfile: ${{ matrix.dockerfile }}
context: ${{ matrix.context }}
tag-prefix: ${{ matrix.tag-prefix }}
secrets:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
Expand All @@ -24,14 +25,22 @@ jobs:
- component-name: training-operator
dockerfile: build/images/training-operator/Dockerfile
platforms: linux/amd64,linux/arm64,linux/ppc64le
tag-prefix: v1
- component-name: training-operator
dockerfile: cmd/training-operator.v2alpha1/Dockerfile
platforms: linux/amd64,linux/arm64,linux/ppc64le
tag-prefix: v2alpha1
- component-name: kubectl-delivery
dockerfile: build/images/kubectl-delivery/Dockerfile
platforms: linux/amd64,linux/arm64,linux/ppc64le
tag-prefix: v1
- component-name: storage-initializer
dockerfile: sdk/python/kubeflow/storage_initializer/Dockerfile
context: sdk/python/kubeflow/storage_initializer
platforms: linux/amd64,linux/arm64
tag-prefix: v1
- component-name: trainer-huggingface
dockerfile: sdk/python/kubeflow/trainer/Dockerfile
context: sdk/python/kubeflow/trainer
platforms: linux/amd64,linux/arm64
tag-prefix: v1
6 changes: 5 additions & 1 deletion .github/workflows/template-publish-image/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ inputs:
push:
required: true
description: whether to push container images or not
tag-prefix:
required: false
default: v1
description: Prefix for the image tag, e.g. v1 or v2alpha1

runs:
using: composite
Expand All @@ -38,7 +42,7 @@ runs:
images: ${{ inputs.image }}
tags: |
type=raw,latest
type=sha,prefix=v1-
type=sha,prefix=${{ inputs.tag-prefix }}-
- name: Build and Push
uses: docker/build-push-action@v5
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-go.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:

- name: Check Go modules
run: |
go mod tidy && git add go.* &&
go mod tidy && pushd hack/swagger && go mod tidy && popd && git add go.* &&
git diff --cached --exit-code || (echo 'Please run "go mod tidy" to sync Go modules' && exit 1);
- name: Check manifests
run: |
Expand Down
38 changes: 26 additions & 12 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,35 @@ repos:
hooks:
- id: isort
name: isort
entry: isort --profile google
entry: isort --profile black
- repo: https://github.com/psf/black
rev: 24.2.0
hooks:
- id: black
files: (sdk|examples)/.*
exclude: |
(?x)^(
/*kubeflow_org_v1*|
__init__.py|
api_client.py|
configuration.py|
exceptions.py|
rest.py
)$
- id: black
files: (sdk|examples)/.*
exclude: |
(?x)^(
/*kubeflow_org_v1*|
__init__.py|
api_client.py|
configuration.py|
exceptions.py|
rest.py
)$
- repo: https://github.com/pycqa/flake8
rev: 7.1.1
hooks:
- id: flake8
files: ^(sdk|examples)/.*$
exclude: |
(?x)^(
.*kubeflow_org_v1.*|
__init__\.py|
api_client\.py|
configuration\.py|
exceptions\.py|
rest\.py
)$
exclude: |
(?x)^(
pkg/apis/kubeflow.org/v1/openapi_generated.go|
Expand Down
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,12 @@ help: ## Display this help.
##@ Development

manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
$(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=training-operator webhook paths="./pkg/..." \
$(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=training-operator webhook paths="./pkg/apis/kubeflow.org/v1/..." \
output:crd:artifacts:config=manifests/base/crds \
output:rbac:artifacts:config=manifests/base/rbac \
output:webhook:artifacts:config=manifests/base/webhook
$(CONTROLLER_GEN) "crd:generateEmbeddedObjectMeta=true" paths="./pkg/apis/kubeflow.org/v2alpha1/..." \
output:crd:artifacts:config=manifests/v2/base/crds

generate: controller-gen ## Generate apidoc, sdk and code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate/boilerplate.go.txt" paths="./pkg/apis/..."
Expand Down
20 changes: 20 additions & 0 deletions cmd/training-operator.v2alpha1/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Build the manager binary
FROM golang:1.22 AS builder

WORKDIR /workspace

# Build
RUN --mount=type=cache,target=/go/pkg/mod/,sharing=locked \
--mount=type=bind,source=go.sum,target=go.sum \
--mount=type=bind,source=go.mod,target=go.mod \
go mod download
RUN --mount=type=cache,target=/go/pkg/mod/ \
--mount=type=bind,target=. \
CGO_ENABLED=0 GOOS=linux GO111MODULE=on go build -a -o /bin/manager cmd/training-operator.v2alpha1/main.go

# Use distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
FROM gcr.io/distroless/static:nonroot
WORKDIR /
COPY --from=builder /bin/manager .
ENTRYPOINT ["/manager"]
21 changes: 21 additions & 0 deletions cmd/training-operator.v2alpha1/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
Copyright 2024 The Kubeflow Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package main

func main() {

}
Loading

0 comments on commit 17591d1

Please sign in to comment.