Skip to content

Conversation

johnalotoski
Copy link
Contributor

@johnalotoski johnalotoski commented Feb 7, 2025

Description

This PR makes improvements to the cardano-node and cardano-submit-api oci images in the following ways:

New Features

  • Additional network configs in the node image:

    • Previously, the node image only had network configuration available in the nix store at non-predictable paths, except for mainnet config and topology, copied to /opt/cardano/config/mainnet-{config,topology}.json
    • Iohk-nix generated configuration files for mainnet, preprod and preview networks are now available at /opt/cardano/config/$NETWORK/ with the tree of configuration for an example NETWORK looking like:
      /opt
      └── cardano
          ├── config
          │   ├── $NETWORK
          │   │   ├── alonzo-genesis.json
          │   │   ├── byron-genesis.json
          │   │   ├── config-bp.json
          │   │   ├── config.json
          │   │   ├── conway-genesis.json
          │   │   ├── db-sync-config.json
          │   │   ├── mithril-signer-config.json
          │   │   ├── shelley-genesis.json
          │   │   ├── submit-api-config.json
          │   │   └── topology.json
          ├── index.html
          ├── ...
          └── rest-config.json
      
    • The legacy path /opt/cardano/config/mainnet-{config,topology}.json config files are symlinked to this new config structure for backwards compatibility.
  • A new merge mode in the node image:

    • "Scripts" mode offers a fixed default config and topology to run node whereas "custom" mode offers a fully customized config and topology which require submitting full config and/or topology files.
    • For those wanting to make small changes to the base config, "merge" mode deep merges config and/or topology customization to the base config. See the nix/docker/README.md for details.

Documentation

  • Docs detailing the modes of the node image (scripts, custom, merge and cli) were improved. Docs were moved from mostly being in nix files to the nix/docker/README.md where most would expect to find them.

Inconsistencies Addressed

  • Previously, default paths varied by node image operating mode as well as image (node vs. submit-api) which has led to confusion when docker mountpoint and volume commands fail to produce expected results.
  • To improve consistency the following changes are made:
    • Node's "custom" mode has /opt/cardano/{data,ipc,logs} symlinked to root /{data,ipc,logs}
      • These symlinks make docker guest path mountpoints of /{data,ipc,logs} usable with all modes
    • All database state path defaults were updated to /data/db
    • All ipc default path mountpoints were updated to /ipc and the node socket file path to /ipc/node.socket
      • The submit-api image has /node-ipc now symlinked to /ipc for backwards compatibility.

Breaking Changes

  • With the consistency changes above, some environment variable defaults were changed. If these are problematic for a downstream consumer, they can be overridden by setting the env var back to what is desired, for example in a docker cli run command with -e ENVNAME=<...>. These breaking changes are:
For "custom" and "merge" modes:
  *  CARDANO_DATABASE_PATH env var default changed:
    * From: /opt/cardano/data
    * To: /data/db

  * CARDANO_SOCKET_PATH env var default changed:
    * From: /opt/cardano/ipc/socket
    * To: /ipc/node.socket

  * GENESIS_JSON env var default changed:
    * From: $CARDANO_CONFIG_BASE/mainnet-shelley-genesis.json
    * To: $CARDANO_CONFIG_BASE/mainnet/shelley-genesis.json

For "client" mode:
  * CARDANO_NODE_SOCKET_PATH env var default changed:
    * From: /opt/cardano/ipc/socket
    * To: /ipc/node.socket

Checklist

  • Commit sequence broadly makes sense and commits have useful messages
  • CI passes. See note on CI. The following CI checks are required:
  • Self-reviewed the diff

@johnalotoski johnalotoski requested review from a team as code owners February 7, 2025 21:05
@johnalotoski johnalotoski marked this pull request as draft February 7, 2025 21:05
@johnalotoski johnalotoski force-pushed the jl/oci-netcfg-link branch 2 times, most recently from bfd9ecd to e7dc17d Compare February 8, 2025 08:35
@johnalotoski johnalotoski marked this pull request as ready for review March 3, 2025 20:09
@johnalotoski johnalotoski added this pull request to the merge queue Mar 3, 2025
Merged via the queue into master with commit bf418ee Mar 3, 2025
23 checks passed
@johnalotoski johnalotoski deleted the jl/oci-netcfg-link branch March 3, 2025 22:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants