-
Notifications
You must be signed in to change notification settings - Fork 80
Developers Guide
Please refer to the following guides for setting up a developer environment
OSX
Linux
To start a local environment, after following the above guides, start by installing/updating your dependencies by running
npm install
npm run build
from the project root.
This will bring the new npm deps, will build the native code and will call the gulp build task for the frontend component.
Make sure mongod is running or run it manually by
npm run db
then start the system by running each of the components on its own (if you choose this way, preferably in different shells)
npm run web
npm run bg
npm run hosted_agents
sudo npm run s3
Note that the s3rver listens on port 80 and needs to be run with a privileged user
Please refer to Directory Structure for better understanding of the project's directory structure
On your local env, you can build the various components in the following way:
npm install
gulp build
NooBaa operator is a Kubernetes controller that manages NooBaa resource in Kubernetes. There are 2 options to build and run NooBaa operator.
-
You can build and run the operator locally without building and deploying a docker image. This is useful for testing changes during the development and debugging of the operator.
- Before running locally, you first need to deploy NooBaa CRD and RBAC resources. Use This yaml file but first comment out the deployment document in the yaml (at the bottom of the file). From the project core dir run
kubectl apply -f ./gocode/src/noobaa-operator/deploy/noobaa-operator.yaml
- To build and run the operator run:
This will build and run the operator on your machine, but the controller will handle NooBaa CRD on the Kubernetes cluster which is configured in your current context (./src/deploy/build_operator.sh run
kubectl config current-context
) -
- To build a docker image of NooBaa operator run
you can also build and push with:./src/deploy/build_operator.sh
./src/deploy/build_operator.sh push TARGET_IMAGE[:TAG]
- Update the Deployment in noobaa-operator.yaml to point to the image you just built. Deploy by running
kubectl apply -f ./gocode/src/noobaa-operator/deploy/noobaa-operator.yaml
The tests in the project are divided into four categories:
These are tests which can ran at any location which satisfies the developer environment requirements. They do not require a NooBaa installation to run on.
NooBaa is using mocha as its unit test framework and they are located in src/tests/unit_tests
Running unit tests on your code is as easy as running
npm test
You can also run a single test by providing its name, for example
mocha src/test/unit_tests/test_semaphore.js
would run the test_semaphore unit test
These are tests which involve several components or end ot end flows in the system. They require a running NooBaa system (can be a local dev system) to run on.
They are located in src/tests/system_tests and can be run one after the other using the src/test/framework/runner component
For example, running
These are tests which ran on more complex environments, combine several flows in the system and run at higher capacities than system tests.
They are being run each night on the latest successful build by the CI orchestration (Jenkins). They are located at src/test/qa
The tests sometimes require specific utils (manipulating agents or server status, creating certain bucket policies etc.) These utils can be found at src/test/utils