Skip to content

Commit

Permalink
feat(tekton-catalog): Move kfp-tekton v2 driver to master branch (#1391)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomcli authored Oct 19, 2023
1 parent f3e6a8e commit 01f1d11
Show file tree
Hide file tree
Showing 12 changed files with 3,152 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .tekton/listener.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ spec:
default: "api-server persistenceagent metadata-writer scheduledworkflow cache-server frontend pipelineloop-controller pipelineloop-webhook kubeclient"
- name: v2-images
description: a v2 image list for publishing
default: "tekton-kfptask-controller tekton-kfptask-webhook tekton-exithandler-controller tekton-exithandler-webhook"
default: "tekton-kfptask-controller tekton-kfptask-webhook tekton-exithandler-controller tekton-exithandler-webhook tekton-driver"
- name: many-edge-duration
description: duration threshold for many edge pipeline
value: "7"
Expand Down
33 changes: 32 additions & 1 deletion .tekton/pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ spec:
default: "api-server persistenceagent metadata-writer scheduledworkflow cache-server frontend pipelineloop-controller pipelineloop-webhook kubeclient"
- name: v2-images
description: a v2 image list for publishing
default: "tekton-kfptask-controller tekton-kfptask-webhook tekton-exithandler-controller tekton-exithandler-webhook"
default: "tekton-kfptask-controller tekton-kfptask-webhook tekton-exithandler-controller tekton-exithandler-webhook tekton-driver"
- name: many-edge-duration
description: duration threshold for many edge pipeline
value: "7"
Expand Down Expand Up @@ -503,6 +503,37 @@ spec:
workspaces:
- name: task-pvc
workspace: pipeline-pvc
- name: containerize-tekton-driver
runAfter:
- test
- build-images-api-server
- build-images-persistenceagent
- build-images-cacheserver
- build-images-scheduledworkflow
taskRef:
name: build-images-dnd
params:
- name: apikey
value: $(params.apikey)
- name: image-name
value: tekton-driver
- name: docker-root
value: tekton-catalog/tekton-driver
- name: docker-file
value: tekton-catalog/tekton-driver/Dockerfile.tektondriver
- name: registry-url
value: $(params.registry-url)
- name: registry-namespace
value: $(params.registry-namespace)
- name: docker-username
value: iamapikey
- name: docker-password
value: $(params.docker-password)
- name: run-task
value: image
workspaces:
- name: task-pvc
workspace: pipeline-pvc
- name: containerize-pipelineloop-webhook
runAfter:
- build-pipeline-loops-binaries
Expand Down
11 changes: 10 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ build-v2-custom-controller-images: \
build-tekton-exithandler-webhook-image \
build-tekton-kfptask-controller-image \
build-tekton-kfptask-webhook-image \
build-tekton-driver-image \
## Build V2 Tekton custom task controller images
@echo "$@: OK"

Expand Down Expand Up @@ -242,6 +243,10 @@ build-tekton-kfptask-controller-image: ## Build tekton-kfptask-controller docker
build-tekton-kfptask-webhook-image: ## Build tekton-kfptask-webhook docker image
@cd tekton-catalog/tekton-kfptask/ && docker build -t ${DOCKER_REGISTRY}/tekton-kfptask-webhook -f Dockerfile.tekton-kfptask.webhook .

.PHONY: build-tekton-driver-image
build-tekton-driver-image: ## Build tekton-driver docker image
@cd tekton-catalog/tekton-driver/ && docker build -t ${DOCKER_REGISTRY}/tekton-driver -f Dockerfile.tektondriver .

.PHONY: run-go-unittests
run-go-unittests: \
run-apiserver-unittests \
Expand All @@ -251,6 +256,7 @@ run-go-unittests: \
run-cacheserver-unittests \
run-tekton-exithandler-unittests \
run-tekton-kfptask-unittests \
run-tekton-driver-unittests \
## Verify go backend unit tests
@echo "$@: OK"

Expand All @@ -273,4 +279,7 @@ run-tekton-exithandler-unittests: # tekton-exithandler golang unit tests
@cd tekton-catalog/tekton-exithandler/ && go test -v -cover ./...

run-tekton-kfptask-unittests: # tekton-kfptask golang unit tests
@cd tekton-catalog/tekton-kfptask/ && go test -v -cover ./...
@cd tekton-catalog/tekton-kfptask/ && go test -v -cover ./...

run-tekton-driver-unittests: # tekton-driver golang unit tests
@cd tekton-catalog/tekton-driver/ && go test -v -cover ./...
34 changes: 34 additions & 0 deletions tekton-catalog/tekton-driver/Dockerfile.tektondriver
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Copyright 2021 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.

FROM golang:1.20.4-alpine3.17 as builder

WORKDIR /go/src/github.com/kubeflow/kfp-tekton/tekton-catalog/tekton-driver
COPY . .

# Needed musl-dev for github.com/mattn/go-sqlite3
RUN apk update && apk upgrade && \
apk add --no-cache bash git openssh gcc musl-dev patch

RUN go mod vendor && patch -u vendor/k8s.io/klog/v2/klog.go pkg/controller/klog.patch
RUN CGO_ENABLED=0 GO111MODULE=on go build -mod=vendor -o /bin/controller cmd/controller/*.go && rm -rf vendor

FROM alpine:3.17
WORKDIR /bin

COPY --from=builder /bin/controller /bin/controller
RUN chmod +x /bin/controller
RUN apk --no-cache add tzdata

CMD /bin/controller
1 change: 1 addition & 0 deletions tekton-catalog/tekton-driver/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.0.2
26 changes: 26 additions & 0 deletions tekton-catalog/tekton-driver/cmd/controller/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
// Copyright 2023 kubeflow.org
//
// 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
//
// https://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

import (
"github.com/kubeflow/kfp-tekton/tekton-catalog/tekton-driver/pkg/controller"
"knative.dev/pkg/injection/sharedmain"
)

func main() {
sharedmain.Main(controller.ControllerName, controller.NewController)
}
Loading

0 comments on commit 01f1d11

Please sign in to comment.