This document helps you get started developing code for HydraGen. If you follow this guide and find a problem, please take a few minutes to update this page.
HydraGen's build system is designed to run with minimal dependencies:
- kind
- docker
- git
These dependencies need to be set up before building and running the code.
To use docker to build required images you will need:
- docker tools: To download and install Docker follow these instructions.
To be able to run the hydragen-emulator container on a sample cluster, we use Kind.
- Installation: To download and install Kind follow Kind.
- Setup the clusters: To setup the clusters, you could simply run the
kind-setup-clusters.sh
script.
#
# This will create multiple Kind clusters (default 2)
# The naming of each cluster is followed by the number (ie, cluster-1, cluster-2, etc.)
# Each of the created clusters has 3 worker nodes and one control plane by default.
#
cd community
./kind-setup-clusters.sh [number of clusters (default 2)] [config of each cluster (default kind-cluster-3-nodes.yaml)]
The source image, containing code and compilers, needs to be built from the local source code.
docker build -t "$(hostname -f)/hydragen-base" .
By default, HydraGen will use a release image from GitHub Packages as the base when building your image. To use the development source image instead set this option in the input JSON configuration:
{
...
"settings": {
"development": true
},
...
}
The generated image needs to be pushed to all clusters after you have run generator.sh
.
cd community
./push-image-to-clusters.sh [number of clusters (default 2)]
To be able to have logging, simply follow the instructions here.