Skip to content

Commit

Permalink
KEP-2170: Add directories for the V2 APIs
Browse files Browse the repository at this point in the history
Signed-off-by: Andrey Velichkevich <[email protected]>
  • Loading branch information
andreyvelich committed Aug 15, 2024
1 parent ff19a10 commit c8689dc
Show file tree
Hide file tree
Showing 9 changed files with 117 additions and 1 deletion.
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: .
prefix:
required: true
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
prefix: ${{ inputs.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
prefix: ${{ inputs.prefix }}
5 changes: 5 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 }}
prefix: ${{matrix.prefix}}
secrets:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
Expand All @@ -24,6 +25,10 @@ jobs:
- component-name: training-operator
dockerfile: build/images/training-operator/Dockerfile
platforms: linux/amd64,linux/arm64,linux/ppc64le
- component-name: training-operator
dockerfile: cmd/training-operator.v2alpha1/Dockerfile
platforms: linux/amd64,linux/arm64,linux/ppc64le
prefix: v2alpha1
- component-name: kubectl-delivery
dockerfile: build/images/kubectl-delivery/Dockerfile
platforms: linux/amd64,linux/arm64,linux/ppc64le
Expand Down
5 changes: 4 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,9 @@ inputs:
push:
required: true
description: whether to push container images or not
prefix:
required: true
description: Prefix for image tag, e.g. v1 or v2alpha1

runs:
using: composite
Expand All @@ -38,7 +41,7 @@ runs:
images: ${{ inputs.image }}
tags: |
type=raw,latest
type=sha,prefix=v1-
type=sha,prefix=${{ inputs.prefix }}-
- name: Build and Push
uses: docker/build-push-action@v5
Expand Down
13 changes: 13 additions & 0 deletions cmd/training-operator.v2alpha1/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Build the manager binary
FROM golang:1.22 as builder

WORKDIR /workspace
# Build
RUN --mount=type=bind,target=. CGO_ENABLED=0 GOOS=linux GO111MODULE=on go build -a -o 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 /workspace/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() {

}
17 changes: 17 additions & 0 deletions pkg/apis/kubeflow.org/v2alpha1/trainingruntime_types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
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 v2alpha1
17 changes: 17 additions & 0 deletions pkg/apis/kubeflow.org/v2alpha1/trainjob_types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
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 v2alpha1
17 changes: 17 additions & 0 deletions pkg/controller.v2/trainjob_controller.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
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 controllerv2
17 changes: 17 additions & 0 deletions pkg/webhook.v2/trainjob_webhook.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
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 webhookv2

0 comments on commit c8689dc

Please sign in to comment.