Development Guide

This document is intended to provide contributors with an introduction to developing the control plane of the Sedna project. There are two components in our control plane: GM(Global Manager) and LC(Local Controller).

Overview

Sedna provides various utilities for development wrapped in make.

Most scripts require more or less only make + bash on the host, and generally stick to POSIX utilities. Some scripts use docker e.g. for image building or to use docker images containing special tools.

Read Conventions Before Coding

Building

Before continuing, you need to follow the prerequisites installation guide if you haven’t done it yet.

Building Code

# build GM
make WHAT=gm

# build LC
make WHAT=lc

# build GM/LC both
make

_output/bin will contain the freshly built binaries sedna-gm and sedna-lc upon a successful build.

Add or Update API

If you add or update APIs in pkg/apis/, you need to run:

  1. run bash hack/update-codegen.sh to update client-go code in pkg/client. ..

    Note: you need to checkout the code to $GOPATH/src/github.com/kubeedge/sedna.

  2. run make crds to update the api definition.

  3. run kubectl replace -f build/crds/ to update your kubernetes environment.

Add or Update Dependencies

Run the following commands to update Go Modules:

go mod tidy
go mod vendor

# Or: hack/update-vendor.sh

Run hack/update-vendor-licenses.sh to update vendor licenses.

Running Sedna

Building Images

To build the GM/LC base images:

# build GM
make gmimage

# build LC
make lcimage

Run verification

You need to run the verification tests locally to give your pull request the best chance of being accepted.

To run all verification tests, use this command:

make verify

Debugging

TBD

Testing

TBD

E2E Testing

TBD

Linting

You can run all of our lints at once with make lint.

Lints include:

CI

We use GitHub Actions which are configured in .github/workflows in the Sedna repo.