Skip to content

Latest commit

 

History

History
99 lines (67 loc) · 2.87 KB

local-env.md

File metadata and controls

99 lines (67 loc) · 2.87 KB

Developer guide

This guide helps you get started developing the Bacalhau project.

Dependencies

Download Bacalhau

Clone the Bacalhau repository using your preferred tool. Refer to GitHub's documentation for different options.

To clone Bacalhau repository using Git CLI:

git clone https://github.com/bacalhau-project/bacalhau.git
cd bacalhau

Create and activate Python virtual environment (optional)

We recommend using Python virtual environments to avoid version conflicts.

Create a virtual environment in the .venv folder:

python -m venv .venv

And activate it:

source .venv/bin/activate

Configure pre-commit hooks

Bacalhau uses pre-commit hooks for linting and formatting code. These checks will also be executed by Bacalhau's CI pipeline on all new pull requests. Check .golangci.yml for the linter rules.

To install the pre-commit hooks:

make install-pre-commit

To check if pre-commit passes:

make precommit

Build Bacalhau

You can check individual build targets in the Makefile or build all of them together. Refer to Key Concepts to learn more about different Bacalhau components.

To build all Bacalhau components:

make build

Run locally

You can spin up a local Bacalhau stack and interact with it. For a detailed guide, check Bacalhau documentation.

To run a local stack:

make devstack

You can run the local stack with a number of different configurations. For details, check the devstack-* targets in the Makefile.

Run tests

Bacalhau tests can be generally divided into these categories:

  • Unit tests
  • Tests against a local stack
  • Integration tests using Docker

Unit tests

To run all unit tests:

make unit-test

Tests against local stack

These tests will run a Bacalhau stack in local processes and execute tests against it. No Docker is required.

To run tests against a local stack:

make integration-test

Integration tests

These tests mimic a real-life distributed installation of Bacalhau by running node processes in Docker containers (using Testcontainers). Refer to the Integration Test guide for detailed steps.