Contributor Documentation
Nova components
The two main components in Nova are as follows:
Repo structure
- pkg is the place for library functions.
- cmd is the place for entry points of services/applications, which should be thin wrappers around pkg.
- manifests is the place to put k8s yaml files for deployment
- scripts contains bash scripts that are useful for manual runs, integration testing, etc.
- docs contains documentation for installing and using Nova
Local dev setup
Working with Makefile
Makefile has a help
target included, which will print all Makefile comments with descriptions
make help
Usage:
make <target>
General
help Display this help.
Build
all Build all binaries
nova-scheduler Build nova-scheduler bin
nova-jit-helper Build nova-jit-helper bin
nova-agent Build nova-agent bin
novactl Build novactl bin
novactl-docs Re-generate novactl docs, which are stored in docs/KubectlNovaReference. Use it with NOVA_VERSION=vX.Y.Z to generate help text with correct default for version tags.
codegen Generate files
clean Clean build files
Test
check Run format, lint and tests
Docker build
nova-images Build nova images
Docker push
push-nova-images Push nova images to registry
Docker release
release-nova-images Release nova images
Install
package-nova Package nova artifact
Docs
docs-prepare Prepare local env for working with Docusaurus
docs-start Start local docs server
docs-clean Clean local env after docs development
Note:
- To build and push a specific single platform build, use DOCKER_BUILD_EXTRA_ARGS, e.g.:
- DOCKER_BUILD_EXTRA_ARGS="--platform=linux/amd64" make nova-images; make push-nova-images
- To build and push a multi-platform build, use DOCKER_BUILD_EXTRA_ARGS and DOCKER_LOAD, e.g.:
- DOCKER_BUILD_EXTRA_ARGS="--platform=linux/amd64,linux/arm64" DOCKER_LOAD="--push" make nova-images
Prerequisites
- Golang
- Docker
docker buildx
needs to be setup (see docs for help)
- goimports
- Go 1.16+:
go install golang.org/x/tools/cmd/goimports
- Go version < 1.16:
go get -u golang.org/x/tools/cmd/goimports
- Go 1.16+:
- golangci-lint
- trivy in case you want to run security scan of docker images (
make scan-nova-images
andmake scan-luna-images
)
Local testing
make test
: unit testsmake check
: code format, lint, and unit tests
End to end testing
See [systest/README.md][].
To run systests via Github actions, add a comment to the pull request you want to run the systests against with the string "test nova kind". Currently, this action is restricted to members of the Elotl org.
A rocket emoji on the comment will confirm that the request is processed, after the run has completed a comment with the results and a link to the build will be posted in the pull request.
Push dev images
First log into Elotl's dockerhub account and push images Build and push images:
make nova-images
make push-nova-images
Dev workflows
Making changes to Nova CRDs
1) Update the CRD in types.go under pkg/apis/ 2) run ./hack/update-codegen.sh 3) run ./hack/update-crdgen.sh 4) run ./hack/reload_novactl.sh 5) Setup the Nova Kind env locally using this script: ./systest/nova/setup_e2e_test_novactl.sh
Releasing
Before releasing, make sure the release commit has passed the integration test.
For Nova, tag the release commit with nova-vXX.YY.ZZ
, push to remote. You should be able to monitor the build on
this github action.