Skip to content

Commit

Permalink
Update contributing guideline (#135)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmendesky authored Jun 28, 2022
1 parent e8796fc commit ea240ed
Show file tree
Hide file tree
Showing 4 changed files with 140 additions and 81 deletions.
26 changes: 26 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior.

**Expected behavior**
A clear and concise description of what you expected to happen.

**Version and configuration**
If applicable, add configuration details to help explain your problem.

**Logs**
If applicable, add logs of the component to help explain your problem.

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
88 changes: 7 additions & 81 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,87 +1,13 @@
# Contributing and Development
# Contributing Guide

We use [kubebuilder](https://github.com/kubernetes-sigs/kubebuilder) to scaffold the kubernetes controllers.
The [Kubebuilder Book](https://book.kubebuilder.io/) is a good introduction to the topic and we recommend reading it before proceeding.
## Raising Issues

## Set up the development environment
If you want to report a bug, please create a [bug report](https://github.com/sky-uk/kfp-operator/issues/new?template=bug_report.md).

Install Go by following the instructions on the [website](https://golang.org/doc/install).
If you want to propose a new feature, please raise a [feature request](https://github.com/sky-uk/kfp-operator/issues/new?template=feature_request.md).

We use [asdf](http://asdf-vm.com) to set up the development environment. Install it it following the [Getting Started Guide](http://asdf-vm.com/guide/getting-started.html).
Install all tool versions as follows:
## Contributing

```bash
asdf install
```
If you want to submit a change, please fork this repository and submit a pull request to merge your changes.

Many commands in this guide will run *against your current kubernetes context*; make sure that it is set accordingly. [Minikube](https://minikube.sigs.k8s.io/docs/start/) provides a local Kubernetes cluster ideal for development.

## Run unit tests

```sh
make test
```

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

## Running locally

Build all images as follows:

```sh
make docker-build-argo
```

Push to the container registry used by the Kubernetes cluster:

```sh
export CONTAINER_REGISTRY_HOSTS=host:port # <- replace this
make docker-push-argo
```

Configure the controller to your environment in [controller_manager_config.yaml](../../config/manager/controller_manager_config.yaml) replacing the placeholders (see [docs](../README.md#configuration)).

Next install Custom Resource Defitions and run the controller:

```sh
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](../quickstart) 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:

```sh
make integration-test-up
```

You can now run the integration tests as follows:
```sh
make integration-test
```

Finally, bring down the environment after your tests:

```sh
make integration-test-down
```

## Coding Guidelines

### Logging

We use the [zap](https://github.com/uber-go/zap) implementation of [logr](https://github.com/go-logr/logr) via the [zapr](https://github.com/go-logr/zapr) module.

[Verbosity levels](https://github.com/go-logr/logr#why-v-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 |
Please refer to the [development guide](DEVELOPMENT.md) to get started.
87 changes: 87 additions & 0 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# Development

We use [kubebuilder](https://github.com/kubernetes-sigs/kubebuilder) to scaffold the kubernetes controllers.
The [Kubebuilder Book](https://book.kubebuilder.io/) 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](https://golang.org/doc/install).

We use [asdf](http://asdf-vm.com) to set up the development environment. Install it it following the [Getting Started Guide](http://asdf-vm.com/guide/getting-started.html).
Install all tool versions as follows:

```bash
asdf install
```

Many commands in this guide will run *against your current kubernetes context*; make sure that it is set accordingly. [Minikube](https://minikube.sigs.k8s.io/docs/start/) provides a local Kubernetes cluster ideal for development.

## Run unit tests

```sh
make test
```

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

## Running locally

Build all images as follows:

```sh
make docker-build-argo
```

Push to the container registry used by the Kubernetes cluster:

```sh
export CONTAINER_REGISTRY_HOSTS=host:port # <- replace this
make docker-push-argo
```

Configure the controller to your environment in [controller_manager_config.yaml](../../config/manager/controller_manager_config.yaml) replacing the placeholders (see [docs](../README.md#configuration)).

Next install Custom Resource Defitions and run the controller:

```sh
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](../quickstart) 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:

```sh
make integration-test-up
```

You can now run the integration tests as follows:
```sh
make integration-test
```

Finally, bring down the environment after your tests:

```sh
make integration-test-down
```

## Coding Guidelines

### Logging

We use the [zap](https://github.com/uber-go/zap) implementation of [logr](https://github.com/go-logr/logr) via the [zapr](https://github.com/go-logr/zapr) module.

[Verbosity levels](https://github.com/go-logr/logr#why-v-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 |

0 comments on commit ea240ed

Please sign in to comment.