This doc explains how to set up a development environment, so you can get started contributing. Also, take a look at:
Before submitting a PR, see also contribution guidelines.
You need to install:
ko
- (required)docker
- (required)Go
- (required)- check go <version> for the required Go version used in this project
Java
(we recommend anopenjdk
build) - (required)- check java.version maven property for the required Java version used in this project
Requirements signaled as "optional" are not required, but it's highly recommended having them installed. If a specific version of a requirement is not explcitly defined above, any version will work during development.
- Set up a Linux Container registry for pushing images. You can use any container image registry by adjusting the authentication methods and repository paths mentioned in the sections below.
ℹ️ You'll need to be authenticated with your
KO_DOCKER_REPO
before pushing images.
To start your environment you'll need to set these environment variables (we
recommend adding them to your .bashrc
):
KO_DOCKER_REPO
: The docker repository to which developer images should be pushed.
.bashrc
example:
export GOPATH="$(go env GOPATH)"
export PATH="${PATH}:${GOPATH}/bin"
export KO_DOCKER_REPO=docker.io/<your_docker_id>
# export KO_DOCKER_REPO=gcr.io/<your_gcr_id>
To check out this repository:
- Create your own fork of this repository:
- Clone it to your machine:
mkdir -p ${GOPATH}/src/knative.dev
cd ${GOPATH}/src/knative.dev
git clone [email protected]:knative/eventing.git # clone eventing repo
git clone [email protected]:${YOUR_GITHUB_USERNAME}/eventing-kafka-broker.git
cd eventing-kafka-broker
git remote add upstream https://github.com/knative-sandbox/eventing-kafka-broker.git
git remote set-url --push upstream no_push
Adding the upstream
remote sets you up nicely for regularly
syncing your fork.
Once you reach this point you are ready to do a full build and deploy as follows.
- This guide assumes you have a Kubernetes cluster up and running. - https://kubernetes.io/docs/setup/
- Execute
source test/e2e-common.sh
- Execute
knative_setup
- This command deploys Knative Eventing.
- Execute
kubectl wait -n knative-eventing pods --all=true --for=condition=Ready
- Execute
test_setup
If something goes wrong, re-execute these steps.
- Execute
source test/e2e-common.sh
- Execute
start_knative_monitoring "${KNATIVE_MONITORING_RELEASE}"
- Run data plane verification:
./mvnw clean verify
If you are using KinD we recommend executing:
export WITH_KIND=true
export SKIP_PUSH=true
This loads images in KinD and skips the push to the remote registry pointed by
KO_DOCKER_REPO
, allowing speeding up the development cycle.
- Execute
source test/data-plane/library.sh
. - Execute
data_plane_build_push
to build and push data-plane images (SKIP_PUSH=true
will skip the push). - Execute
k8s apply --force
./test/presubmit-tests.sh --unit-tests
./test/presubmit-tests.sh --build-tests
Running E2E tests as you make changes to the code-base is pretty simple. See the test docs.
Please check contribution guidelines.
k8s delete # assume `source test/data-plane/library.sh`
kubectl delete -f --ignore-not-found config/