👍🎉 First off, thank you for taking the time to contribute to Liqo! 🎉👍
The following is a set of guidelines for contributing to Liqo, which are hosted in the liqotech Organization on GitHub.
Unsure where to begin contributing to Liqo? You can start by looking through the help-wanted issues.
The liqo repository structure follows the Golang standard layout.
Liqo leverages heinrichreimer/github-changelog-generator-action
to create the changelog of a certain version.
PRs with the following labels applied will be considered for the changelog:
Liqo components can be developed locally. We provide a deployment script to spawn multiple kubernetes clusters by using Kind with Liqo installed. This script can be used as a starting point to improve/replace one Liqo component:
describe
the pod running the component you wish to replace, and copy its command-line flags;scale --replicas=0
the component;Liqo relies on two major test suites:
In this section, you can find how you can execute on your systems those test suites.
To run on your local environment the E2E tests, you should:
fs.inotify.max_user_watches
and fs.inotify.max_user_instances
to correctly create the 4 clusters:sudo sysctl fs.inotify.max_user_watches=52428899
sudo sysctl fs.inotify.max_user_instances=2048
Alternatively, you can persist them through the sysctl.conf
file, in order to have them always set:
echo fs.inotify.max_user_watches=52428899 | sudo tee -a /etc/sysctl.conf
echo fs.inotify.max_user_instances=2048 | sudo tee -a /etc/sysctl.conf
sudo sysctl -p
export CLUSTER_NUMBER=4
export K8S_VERSION=v1.21.1
export CNI=kindnet
export TMPDIR=$(mktemp -d)
export BINDIR=${TMPDIR}/bin
export TEMPLATE_DIR=${PWD}/test/e2e/pipeline/infra/kind
export NAMESPACE=liqo
export KUBECONFIGDIR=${TMPDIR}/kubeconfigs
export LIQO_VERSION=<YOUR_COMMIT_ID>
export INFRA=kind
export LIQOCTL=${BINDIR}/liqoctl
export POD_CIDR_OVERLAPPING=false
export TEMPLATE_FILE=cluster-templates.yaml.tmpl
export DOCKER_USERNAME=<your-username>
export DOCKER_PASSWORD=<your-password>
make e2e
Most tests can be run “directly” using ginkgo
, which in turn supports the standard testing API (go test
, IDE features, …). Some tests however require an isolated environment, for which you can use the liqo-test
Docker image (in build/liqo-test
). Just mount the repository in /go/src/github.com/liqotech/liqo
inside the container:
docker run --name=liqo-test -v $PATH_TO_LIQO:/go/src/github.com/liqotech/liqo liqo-test
# To run a specific test
docker run --name=liqo-test -v $PATH_TO_LIQO:/go/src/github.com/liqotech/liqo liqo-test --entrypoint="" go test $PACKAGE
If you want to debug tests, you can use Delve for remote debugging:
docker run --name=liqo-test -d -p 2345:2345 -v $PATH_TO_LIQO:/go/src/github.com/liqotech/liqo --entrypoint="" liqo-test tail -f /dev/null
docker exec -it liqo-test bash
go install github.com/go-delve/delve/cmd/dlv@latest
$TEST_PATH
must refer to a directory)dlv test --headless --listen=:2345 --api-version=2 --accept-multiclient ./$TEST_PATH
localhost:2345
with your remote debugging client of choice (e.g. GoLand).The process described here has several goals:
Atom Contributing Guidelines inspired us when writing this document. Many thanks!