Developer guide

Create a brick

This documentation is under construction. Please give us your feedbacks by contacting us at hub@gencovery.com.

Creation of a brick

The skeleton brick is provided to ease the creation of new Constellab brick.
To create a new brick, please open your codelab.
In the launch section, search for Create brick launcher. Provide you brick name and its done !
You can also call this manually if this is not working of the launcher doesn't exist. Run the following commande :
python3 /lab/.sys/bricks/gws_core/utils/create_brick.py --name [brick_name]
A new folder (with the same name as our brick) will be created in the /lab/user/bricks folder. This is your brick ! You can start writing your tasks, resources under the src/[brick_name] folder.
The brick is created with some tasks, resources and tests example. If you are used to thoses, you can simply delete them.
Once the brick create we recommend you to commit and push the new brick a a git repository.
You can restart you lab and check in the monitoring section that your brick is loaded. You should also see the example objects in the playground.
All the folders under /lab/user/bricks are considered as brick and loaded by the system in the dev environment. You can simply add bricks here.

Source folder

Your brick must contain a src folder containing a sub folder named after your brick. This is required because all the files under sur /src/[brick_name] folder are loaded on lab start so your object are available.
You can remove a file from the auto loading by adding an underscore in front of the file name. This tells the system that the file is private and will not be loaded.

Brick structure

The structure of your new brick should be

    ├── LICENSE
    ├── README.md
    ├── manage.py
    ├── settings.json
    ├── src
    │   └── [brick_name]
    │       ├── __init__.py
    ├── tests
    │   ├── __init__.py

Please check that the folder foo exists in the ./src directory.

Brick description and publication

It is highly recommended to describe your brick before publishing it. To describe your brick, you only need to fill the file README.md.
To allow Constellab to deploy and install a user brick in a lab, this bricks must be published on a public or private remote git or pip server.

Git versioning and publication

It is currently recommended to version and publish your brick using git. Any remote git server such as Github or Gitlab is compatible with Constellab.

PIP publication

In the next future, it will be possible to publish brick using pip.

Work on an existing brick

To work on an existing brick you will need to clone it on your codelab in the /lab/user/bricks folder. If the brick already exist in your lab, don't worry the folder /lab/user/bricks is used in priority and the other will be ignored.