Bacalhau Docs
GithubSlackBlogEnterprise
v1.5.x
  • Documentation
  • Use Cases
  • CLI & API
  • References
  • Community
v1.5.x
  • Welcome
  • Getting Started
    • How Bacalhau Works
    • Installation
    • Create Network
    • Hardware Setup
    • Container Onboarding
      • Docker Workloads
      • WebAssembly (Wasm) Workloads
  • Setting Up
    • Running Nodes
      • Node Onboarding
      • GPU Installation
      • Job selection policy
      • Access Management
      • Node persistence
      • Connect Storage
      • Configuring Transport Level Security
      • Limits and Timeouts
      • Test Network Locally
      • Bacalhau WebUI
      • Private IPFS Network Setup
    • Workload Onboarding
      • Container
        • Docker Workload Onboarding
        • WebAssembly (Wasm) Workloads
        • Bacalhau Docker Image
        • How To Work With Custom Containers in Bacalhau
      • Python
        • Building and Running Custom Python Container
        • Running Pandas on Bacalhau
        • Running a Python Script
        • Running Jupyter Notebooks on Bacalhau
        • Scripting Bacalhau with Python
      • R (language)
        • Building and Running your Custom R Containers on Bacalhau
        • Running a Simple R Script on Bacalhau
      • Run CUDA programs on Bacalhau
      • Running a Prolog Script
      • Reading Data from Multiple S3 Buckets using Bacalhau
      • Running Rust programs as WebAssembly (WASM)
      • Generate Synthetic Data using Sparkov Data Generation technique
    • Data Ingestion
      • Copy Data from URL to Public Storage
      • Pinning Data
      • Running a Job over S3 data
    • Networking Instructions
      • Accessing the Internet from Jobs
      • Utilizing NATS.io within Bacalhau
    • GPU Workloads Setup
    • Automatic Update Checking
    • Marketplace Deployments
      • Google Cloud Marketplace
  • Guides
    • (Updated) Configuration Management
    • Write a config.yaml
    • Write a SpecConfig
  • Examples
    • Data Engineering
      • Using Bacalhau with DuckDB
      • Ethereum Blockchain Analysis with Ethereum-ETL and Bacalhau
      • Convert CSV To Parquet Or Avro
      • Simple Image Processing
      • Oceanography - Data Conversion
      • Video Processing
    • Model Inference
      • EasyOCR (Optical Character Recognition) on Bacalhau
      • Running Inference on Dolly 2.0 Model with Hugging Face
      • Speech Recognition using Whisper
      • Stable Diffusion on a GPU
      • Stable Diffusion on a CPU
      • Object Detection with YOLOv5 on Bacalhau
      • Generate Realistic Images using StyleGAN3 and Bacalhau
      • Stable Diffusion Checkpoint Inference
      • Running Inference on a Model stored on S3
    • Model Training
      • Training Pytorch Model with Bacalhau
      • Training Tensorflow Model
      • Stable Diffusion Dreambooth (Finetuning)
    • Molecular Dynamics
      • Running BIDS Apps on Bacalhau
      • Coresets On Bacalhau
      • Genomics Data Generation
      • Gromacs for Analysis
      • Molecular Simulation with OpenMM and Bacalhau
  • References
    • Jobs Guide
      • Job Specification
        • Job Types
        • Task Specification
          • Engines
            • Docker Engine Specification
            • WebAssembly (WASM) Engine Specification
          • Publishers
            • IPFS Publisher Specification
            • Local Publisher Specification
            • S3 Publisher Specification
          • Sources
            • IPFS Source Specification
            • Local Source Specification
            • S3 Source Specification
            • URL Source Specification
          • Network Specification
          • Input Source Specification
          • Resources Specification
          • ResultPath Specification
        • Constraint Specification
        • Labels Specification
        • Meta Specification
      • Job Templates
      • Queuing & Timeouts
        • Job Queuing
        • Timeouts Specification
      • Job Results
        • State
    • CLI Guide
      • Single CLI commands
        • Agent
          • Agent Overview
          • Agent Alive
          • Agent Node
          • Agent Version
        • Config
          • Config Overview
          • Config Auto-Resources
          • Config Default
          • Config List
          • Config Set
        • Job
          • Job Overview
          • Job Describe
          • Job Exec
          • Job Executions
          • Job History
          • Job List
          • Job Logs
          • Job Run
          • Job Stop
        • Node
          • Node Overview
          • Node Approve
          • Node Delete
          • Node List
          • Node Describe
          • Node Reject
      • Command Migration
    • API Guide
      • Bacalhau API overview
      • Best Practices
      • Agent Endpoint
      • Orchestrator Endpoint
      • Migration API
    • Node Management
    • Authentication & Authorization
    • Database Integration
    • Debugging
      • Debugging Failed Jobs
      • Debugging Locally
    • Running Locally In Devstack
    • Setting up Dev Environment
  • Help & FAQ
    • Bacalhau FAQs
    • Glossary
    • Release Notes
      • v1.5.0 Release Notes
      • v1.4.0 Release Notes
  • Integrations
    • Apache Airflow Provider for Bacalhau
    • Lilypad
    • Bacalhau Python SDK
    • Observability for WebAssembly Workloads
  • Community
    • Social Media
    • Style Guide
    • Ways to Contribute
Powered by GitBook
LogoLogo

Use Cases

  • Distributed ETL
  • Edge ML
  • Distributed Data Warehousing
  • Fleet Management

About Us

  • Who we are
  • What we value

News & Blog

  • Blog

Get Support

  • Request Enterprise Solutions

Expanso (2025). All Rights Reserved.

On this page
  • Introduction
  • Inspecting the Current Configuration of Bacalhau
  • Making Changes to the Default Config File
  • Using a Non-Default Config File.
  • Bacalhau Configuration Keys
  • Using Keys With config set, config list and --config
  • Example Interaction With the Bacalhau Configuration System
  • Usage of the --config Flag
  • Configuration Options
  • Precedence
  • Examples
  • Usage of the bacalhau completion Command
  • Support

Was this helpful?

Export as PDF
  1. Guides

(Updated) Configuration Management

PreviousGoogle Cloud MarketplaceNextWrite a config.yaml

Last updated 7 months ago

Was this helpful?

Introduction

There have been some changes made to how Bacalhau handles configuration:

  1. The bacalhau repo ~/.bacalhau no longer contains a config file.

  2. Bacalhau no longer looks in the repo ~/.bacalhau for a config file.

  3. Bacalhau never writes a config file to disk unless instructed by a user to do so.

  4. A config file is not required to operate Bacalhau.

  5. Bacalhau searches for a default config file. The location is OS-dependent:

    1. Linux: ~/.config/bacalhau/config.yaml

    2. OSX: ~/.config/Application\ Support/bacalhau/config.yaml

    3. Windows: $AppData\bacalhau\config.yaml. Usually, this is something like C:\Users\username\bacalhau\config.yaml

Summary

Bacalhau no longer relies on the ~/.bacalhau directory for configuration and only creates a config file when instructed. While not required, it will look for a default config file in OS-specific locations.

Inspecting the Current Configuration of Bacalhau

To view the configuration that bacalhau will receive when a command is executed against it, users can run the command. Users who wish to see Bacalhau’s config represented as YAML may run bacalhau config list --output=yaml.

Making Changes to the Default Config File

As described above, bacalhau still has the concept of a default config file, which, for the sake of simplicity, we’ll say lives in ~/.config/bacalhau/config.yaml. There are two ways this file can be modified:

  1. A text editor vim ~/.config/bacalhau/config.yaml.

Using a Non-Default Config File.

Bacalhau Configuration Keys

In Bacalhau, configuration keys are structured identifiers used to configure and customize the behavior of the application. They represent specific settings that control various aspects of Bacalhau's functionality, such as network parameters, API endpoints, node operations, and user interface options. The configuration file is organized in a tree-like structure using nested mappings (dictionaries) in YAML format. Each level of indentation represents a deeper level in the hierarchy.

Example: part of the config file

API:
  Host: 0.0.0.0
  Port: 1234
  Auth:
    Methods:
      ClientKey:
      Type: challenge
NameProvider: puuid
DataDir: /home/frrist/.bacalhau
Orchestrator:
  Host: 0.0.0.0
  Port: 4222
  NodeManager:
    DisconnectTimeout: 1m0s

In this YAML configuration file:

  1. Top-Level Keys (Categories): API, Orchestrator

  2. Sub-Level Keys (Subcategories): Under API, we have Host and Port; Under Orchestrator we have Host, Port and NodeManager

  3. Leaf Nodes (Settings): Host, Port, NameProvider, DataDir, DisconnectTimeout — these contain the actual configuration values.

Config keys use dot notation to represent the path from the root of the configuration hierarchy down to a specific leaf node. Each segment in the key corresponds to a level in the hierarchy. Syntax is Category.Subcategory(s)...LeafNode

Using Keys With config set, config list and --config

The bacalhau config list returns all keys and their corresponding value. The bacalhau config set command accepts a key and a value to set it to. The --config flag accepts a key and a value that will be applied to Bacalhau when it runs.

Example Interaction With the Bacalhau Configuration System

How to Modify the API Host Using bacalhau config set in the Default Config File:

  1. Run bacalhau config list to find the appropriate key

bacalhau config list
 KEY VALUE DESCRIPTION
 ... ... ...
 api.host 0.0.0.0 Host specifies the hostname or IP address o
 ... ... ...
  1. Run the bacalhau config set command

bacalhau config set api.host 192.186.0.1
  1. Observe how bacalhau config list reflects the new setting

bacalhau config list
 KEY VALUE DESCRIPTION
 ... ... ...
 api.host 192.168.0.1 Host specifies the hostname or IP address
 ... ... ...
  1. Observe the change has been reflected in the default config file

cat ~/.config/bacalhau/config.yaml
api:
    host: 192.168.0.1

How to Modify the API Host Using bacalhau config set a Custom Config File

  1. Run the config set command with the flag

bacalhau config set --config=custom.yaml api.host 10.0.0.1
  1. Observe the created config file

cat custom.yaml
api:
 host: 10.0.0.1

Observe the default config and output of bacalhau config list does not reflect this change.

How to Start Bacalhau With a Custom Config File

bacalhau --config=custom.yaml serve

Usage of the --config Flag

The --config (or -c) flag allows flexible configuration of bacalhau through various methods. You can use this flag multiple times to combine different configuration sources.

Usage

bacalhau [command] --config <option> [--config <option> ...] 

or using the short form:

bacalhau [command] -c <option> [-c <option> ...]

Configuration Options

  1. YAML Config Files: Specify paths to YAML configuration files. Example:

--config path/to/config.yaml
  1. Key-Value Pairs: Set specific configuration values using dot notation. Example:

--config WebUI.Enabled=true
  1. Boolean Flags: Enable boolean options by specifying the key alone. Example:

--config WebUI.Enabled

Precedence

When multiple configuration options are provided, they are applied in the following order of precedence (highest to lowest):

  1. Command-line key-value pairs and boolean flags

  2. YAML configuration files

  3. Default values

Within each category, options specified later override earlier ones.

Examples

Using a single config file:

bacalhau serve --config my-config.yaml

Merging multiple config files:

bacalhau serve -c base-config.yaml -c override-config.yaml

Overriding specific values:

bacalhau serve \
-c config.yaml \
-c WebUI.Listen=0.0.0.0:9999 \
-c NameProvider=hostname

Combining file and multiple overrides:

bacalhau serve \
-c config.yaml \
-c WebUI.Enabled \
-c API.Host=192.168.1.5

In the last example, WebUI.Enabled will be set to true, API.Host will be 192.168.1.5, and other values will be loaded from config.yaml if present.

Remember, later options override earlier ones, allowing for flexible configuration management.

Usage of the bacalhau completion Command

The bacalhau completion command will generate shell completion for your shell. You can use the command like:

bacalhau completion <bash|fish|powershell|zsh> > /tmp/bacalhau_completion && source /tmp/bacalhau_completion 

After running the above command, commands like bacalhau config set and bacalhau --config will have auto-completion for all possible configuration values along with their descriptions

Support

The command.

The --config (or -c ) flag allows flexible configuration of bacalhau through various methods. You can use this flag multiple times to combine different configuration sources. To specify a config file to bacalhau, users may use the --config flag, passing a path to a config file for bacalhau to use. When this flag is provided bacalhau will not search for a default config, and will instead use the configuration provided to it by the .

If you have questions or need support or guidance, please reach out to the (#general channel).

bacalhau config list
bacalhau config set
Bacalhau team via Slack
--config flag