kfp-tekton
IBM Cloud Toolchain forWe use the "Develop a Kubernetes app" toolchain to enable CI/CD testing for kfp-tekton.
The toolchain is bound to an IBM Cloud Kubernetes Service (IKS) cluster and runs the following in a delivery pipeline:
- Pull the latest commit from github
- Run unit tests
- Build docker images and push to IBM Cloud Registry
- Deploy tekton and kfp-tekton to IKS
- Run e2e tests (submit a pipeline, check endpoints, etc)
- Remove tekton and kfp-tekton
Custom Docker Image
In order to build, test, deploy, etc... within the pipeline, we use a Custom Docker Image
to package all the requisite build and runtime dependencies. The pipeline takes as input the Dockerfile, which contains:
- Node.js
- Go
- kubectl
- kustomize
- helm2
- heml3
- jq
- ibmcloud
Run the following command to build the image:
docker build -t pipeline-base-image -f Dockerfile .
Or you can build and push the image to ibm cloud container registry:
ibmcloud cr build -f Dockerfile --tag <registry_url>/<namespace>/pipeline-base-image:<image tag> .
Replace the registry url
, namespace
, image tag
, and even the image name
as needed.
Note:
You can also use docker arguments to specify the version of Node.js
, Go
, kubectl
, heml2
, heml3
, etc. Check the ARG
in Dockerfile to see the details.
Scripts
When running jobs in a pipeline, you can source
an external shell script. For example:
source <(curl -sSL "https://raw.githubusercontent.com/yhwang/kfp-tekton-toolchain/main/scripts/run-test.sh")
The following scripts are used within the pipeline:
run-test.sh
- Runs
kfp-tekton
's unit tests.
- Runs
build-image.sh
- Cleans up kfp-tekton docker images in the container registry and builds the kfp-tekton docker images:
api-server
,persistenceagent
,metadata-writer
, andscheduledworkflow
. - The environment variables
DOCKER_FILE
,DOCKER_ROOT
,IMAGE_NAME
must be specified properly. For example, useDOCKER_FILE=backend/Dockerfile
andIMAGE_NAME=api-server
to build theapi-server
image. It also needs some variables fromrun-test.sh
script. The script only builds one image according to theDOCKER_FILE
andIMAGE_NAME
specified. In order to build all the images, you need to create multiple jobs and assign different values for those environment variables.
- Cleans up kfp-tekton docker images in the container registry and builds the kfp-tekton docker images:
deploy-tekton.sh
- Deploys
tekton
to the cluster.
- Deploys
deploy-kfp-tekton.sh
- Creates the
kubeflow
namespace and deployskfp-tekton
to the cluster.
- Creates the
e2e.sh
- Runs an "end-to-end" test. The
flip coin
pipeline is used. The pipeline is uploaded to kubeflow, executed, and checked for a passing result.
- Runs an "end-to-end" test. The
undeploy-kubeflow.sh
- Deletes the kubeflow deployment and cleans up any related resources.
undeploy-tekton.sh
- Deletes the tekton deployment and cleans up any related resources.
These scripts store variables into ${ARCHIVE_DIR}/build.properties which could be used
by the subsequent jobs in the next stage. You need to specify build.properties
as a
property file in the Environment properties
tab.
Status
WIP-
The toolchain is bound to XXX cluster.
The toolchain executes every XXX.
The toolchain outputs job updates to this slack channel.