Development - CERIT-SC/funnel-gdi GitHub Wiki

For local development you will probably need the following tools installed on your computer:

  1. git – for version control.
  2. Go Development Tools – for compiling/linting the code, and running tests.
  3. make – for running scripts from the Makefile (in the root of the repo).
  4. node (LTS), yarn – for developing the frontend dashboard.
  5. Docker Engine, Docker Compose – for testing.
  6. Code Editor (e.g. Visual Studio Code) – for editing the source code written in GO and JavaScript.

Fetching the Source Code

If you have GitHub account and SSH-key configured:

git clone [email protected]:CERIT-SC/funnel-gdi.git
git checkout master-gdi

Otherwise:

git clone https://github.com/CERIT-SC/funnel-gdi.git
git checkout master-gdi

Building from the Source Code

Build steps are declared in the Makefile. Most common commands to remember:

  1. Build the binary (./funnel):

    make build

  2. Run unit tests:

    make test

  3. Code linting checks:

    make lint

  4. If you change ProtoBuf files (*.proto):

    make proto build

  5. If you change web dashboard files (webdash/build/):

    make webdash build

Running

Typically a custom configuration file is used while developing specific features. (Please refer to the Configuration guide for details about possible parameters). So assuming you have such a file with name my-config.yaml, you can run the locally built Funnel software as follows:

./funnel server run -f my-config.yaml

On the other terminal window, you can send commands to the running instance. For example, to list the task:

./funnel task list

Note that by default the client-commands expect the service to be running at http://localhost:8000/ but you can point to another instance using the -S parameter:

./funnel task list -S "https://tes.example.org"

If you have BASIC authentication enabled, you might also want to specify the username and password for the client commands through environment variables:

export FUNNEL_SERVER_USER="user1"
export FUNNEL_SERVER_PASSWORD="user1-pass"

or JWT Access Token:

export FUNNEL_SERVER_TOKEN="..."