Skip to content

Latest commit

 

History

History
124 lines (79 loc) · 3.85 KB

DEVELOPMENT.md

File metadata and controls

124 lines (79 loc) · 3.85 KB

Development

We use kubebuilder to scaffold the kubernetes controllers. The Kubebuilder Book is a good introduction to the topic and we recommend reading it before proceeding.

Set up the development environment

Install Go by following the instructions on the website.

We use asdf to set up the development environment. Install it it following the Getting Started Guide. Install all tool versions as follows:

asdf install

Many commands in this guide will run against your current kubernetes context; make sure that it is set accordingly. Minikube provides a local Kubernetes cluster ideal for development.

Run unit tests

make test

Note: on first execution, the test environment will get downloaded and the command will therefore take longer to complete.

Building and Publishing

Building and publishing container images

Build the operator's container images as follows:

make docker-build docker-build-argo

Push to the container registry:

CONTAINER_REPOSITORIES=<YOUR_CONTAINER_REPOSITORY> make docker-push docker-push-argo

For example, to push to Google Artifact Registry:

CONTAINER_REPOSITORIES=europe-docker.pkg.dev/<PROJECT_NAME>/images make docker-push docker-push-argo

Building and publishing the Helm chart

Build the Helm chart as follows:

make helm-package

Push the Helm chart using one of the following options:

  1. OCI Image
HELM_REPOSITORIES=oci://<YOUR_CHART_REPOSITORY> make helm-publish

For example, to push to Google Artifact Registry::

HELM_REPOSITORIES=oci://europe-docker.pkg.dev/<PROJECT_NAME>/charts make helm-publish

  1. .tar.gz archive
HELM_REPOSITORIES=https://<YOUR_CHART_REPOSITORY> NETRC_FILE=<YOUR_NETRC_FILE> make helm-publish

Provide an optional .netrc file for credentials:

Running locally

Configure the controller to your environment in controller_manager_config.yaml replacing the placeholders (see docs).

Next install Custom Resource Definitions and run the controller:

make install
make run

CRDs will be installed into an existing Kubernetes cluster. A running instance of Kubeflow is required on that cluster. The controller will run locally, interacting with the remote Kubernetes API.

Please refer to the quickstart tutorial for instructions on creating a sample pipeline resource.

Run Argo integration tests

To run integration tests, we currently require a one-off setup of the Kubernetes cluster:

make integration-test-up

You can now run the integration tests as follows (this can take several minutes to complete):

make integration-test

Finally, bring down the environment after your tests:

make integration-test-down

Coding Guidelines

Logging

We use the zap implementation of logr via the zapr module.

Verbosity levels are set according to the following rules:

Zap Level Description Example
0, error, info Will always be logged. Appropriate for all major actions. state transitions, errors
1, debug Appropriate for high-level technical information. resource creation/update/deletion
2 Appropriate for low-level technical information. resource retrieval, finalizers, profiling, expected errors
3 Appropriate for verbose debug statements. printing resources