diff --git a/configuration/cardano/mainnet-config.json b/configuration/cardano/mainnet-config.json index 388d0c43722..75d872ae24e 100644 --- a/configuration/cardano/mainnet-config.json +++ b/configuration/cardano/mainnet-config.json @@ -60,6 +60,7 @@ "TracingVerbosity": "NormalVerbosity", "TurnOnLogMetrics": true, "TurnOnLogging": true, + "UseTraceDispatcher": false, "defaultBackends": [ "KatipBK" ], diff --git a/configuration/cardano/mainnet-config.yaml b/configuration/cardano/mainnet-config.yaml index ef803181d62..3427468ed8f 100644 --- a/configuration/cardano/mainnet-config.yaml +++ b/configuration/cardano/mainnet-config.yaml @@ -54,6 +54,9 @@ TurnOnLogging: True # be directed to the logs or monitoring backends. TurnOnLogMetrics: True +# Use legacy tracing +UseTraceDispatcher: False + # Global logging severity filter. Messages must have at least this severity to # pass. Typical values would be Warning, Notice, Info or Debug. minSeverity: Info diff --git a/docker-compose.yml b/docker-compose.yml index 1ccce6237ea..900ace6b9ed 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,7 +2,7 @@ version: "3.5" services: cardano-node: - image: inputoutput/cardano-node:${CARDANO_NODE_VERSION:-8.0.0} + image: ghcr.io/intersectmbo/cardano-node:${CARDANO_NODE_VERSION:-10.1.2} environment: - NETWORK=${NETWORK:-mainnet} volumes: @@ -15,7 +15,7 @@ services: max-file: "10" cardano-submit-api: - image: inputoutput/cardano-submit-api:${CARDANO_SUBMIT_API_VERSION:-8.0.0} + image: ghcr.io/intersectmbo/cardano-submit-api:${CARDANO_SUBMIT_API_VERSION:-10.1.2} environment: - NETWORK=${NETWORK:-mainnet} depends_on: diff --git a/flake.lock b/flake.lock index 82e94186fda..78df0b9e78e 100644 --- a/flake.lock +++ b/flake.lock @@ -839,11 +839,11 @@ "sodium": "sodium" }, "locked": { - "lastModified": 1728687575, - "narHash": "sha256-38uD8SqT557eh5yyRYuthKm1yTtiWzAN0FH7L/01QKM=", + "lastModified": 1732287300, + "narHash": "sha256-lURsE6HdJX0alscWhbzCWyLRK8GpAgKuXeIgX31Kfqg=", "owner": "input-output-hk", "repo": "iohk-nix", - "rev": "86c2bd46e8a08f62ea38ffe77cb4e9c337b42217", + "rev": "262cb2aec2ddd914124bab90b06fe24a1a74d02c", "type": "github" }, "original": { diff --git a/nix/docker/README.md b/nix/docker/README.md index c0229096a36..047f813fee9 100644 --- a/nix/docker/README.md +++ b/nix/docker/README.md @@ -7,22 +7,24 @@ https://github.com/input-output-hk/cardano-node-wiki/wiki/building-the-node-usin # Build + Install the cardano node nix build .#mainnet/node -o ~/bin/cardano-node -# Build + Install the cardano Docker image -nix run .#dockerImage/node/load \ - && GITHASH=`git log -n1 --pretty='%H'` \ - && docker tag inputoutput/cardano-node:$GITHASH inputoutput/cardano-node:dev \ - && docker rmi inputoutput/cardano-node:$GITHASH - -GITTAG=`git describe --exact-match --tags $GITHASH` +# Build + Install the cardano Docker image from bash shell +nix build .#dockerImage/node \ + && RES=$(docker load -i result) \ + && LOADED="${RES##Loaded image: }" \ + && GITHASH=$(git log -n1 --pretty='%H') \ + && docker tag "$LOADED" ghcr.io/intersectmbo/cardano-node:dev \ + && docker rmi "$LOADED" + +GITTAG=$(git describe --exact-match --tags $GITHASH) if [ $? -eq 0 ]; then echo "Current tag: $GITTAG" - docker tag inputoutput/cardano-node:dev inputoutput/cardano-node:$GITTAG + docker tag ghcr.io/intersectmbo/cardano-node:dev "ghcr.io/intersectmbo/cardano-node:$GITTAG" fi # Bash into the node to look around docker run --rm -it --entrypoint=bash \ -v node-data:/opt/cardano/data \ - inputoutput/cardano-node:dev + ghcr.io/intersectmbo/cardano-node:dev cardano-node run \ --config /opt/cardano/config/mainnet-config.json \ @@ -50,7 +52,7 @@ docker run --rm -it \ -p 3001:3001 \ -e NETWORK=mainnet \ -v node-data:/data/db \ - inputoutput/cardano-node:dev + ghcr.io/intersectmbo/cardano-node:dev ``` Run -e NETWORK=mainnet and check graceful shutdown SIGTERM with --detach @@ -62,7 +64,7 @@ docker run --detach \ -p 3001:3001 \ -e NETWORK=mainnet \ -v node-data:/data/db \ - inputoutput/cardano-node:dev + ghcr.io/intersectmbo/cardano-node:dev docker logs -f relay ``` @@ -75,7 +77,7 @@ Check graceful shutdown SIGINT with -it docker run --rm -it \ -p 3001:3001 \ -v node-data:/opt/cardano/data \ - inputoutput/cardano-node:dev run + ghcr.io/intersectmbo/cardano-node:dev run ``` Check graceful shutdown SIGTERM with --detach @@ -87,7 +89,7 @@ docker run --detach \ -p 3001:3001 \ -v node-data:/opt/cardano/data \ -v node-ipc:/opt/cardano/ipc \ - inputoutput/cardano-node:dev run + ghcr.io/intersectmbo/cardano-node:dev run docker logs -f relay ``` @@ -97,7 +99,7 @@ docker logs -f relay ``` alias cardano-cli="docker run --rm -it \ -v node-ipc:/opt/cardano/ipc \ - inputoutput/cardano-node:dev cli" + ghcr.io/intersectmbo/cardano-node:dev cli" cardano-cli query tip --mainnet ``` diff --git a/nix/docker/default.nix b/nix/docker/default.nix index 03b4ea12d4c..3bc5f39c331 100644 --- a/nix/docker/default.nix +++ b/nix/docker/default.nix @@ -3,25 +3,26 @@ # # To build and load into the Docker engine: # -# nix run .#dockerImage/node/load +# nix build .#dockerImage/node +# docker load -i result # # To launch with pre-loaded configuration, using the NETWORK env. # An example using a docker volume to persist state: # -# docker run -v /data -e NETWORK=mainnet inputoutput/cardano-node +# docker run -v /data -e NETWORK=mainnet ghcr.io/intersectmbo/cardano-node # # Provide a complete command otherwise: # -# docker run -v $PWD/configuration/defaults/byron-mainnet:/configuration \ -# inputoutput/cardano-node run \ -# --config /configuration/configuration.yaml \ -# --topology /configuration/topology.json \ +# docker run -v $PWD/configuration/cardano:/configuration \ +# ghcr.io/intersectmbo/cardano-node run \ +# --config /configuration/mainnet-config.yaml \ +# --topology /configuration/mainnet-topology.json \ # --database-path /db # # Mount a volume into /ipc for establishing cross-container communication via node.socket # -# docker run -v node-ipc:/ipc inputoutput/cardano-node -# docker run -v node-ipc:/ipc inputoutput/some-node-client +# docker run -v node-ipc:/ipc -e NETWORK=mainnet ghcr.io/intersectmbo/cardano-node +# docker run -v node-ipc:/ipc -e NETWORK=mainnet ghcr.io/intersectmbo/some-node-client ############################################################################ { pkgs @@ -38,7 +39,6 @@ # Other things to include in the image. , bashInteractive -, buildPackages , cacert , coreutils , curl @@ -48,12 +48,10 @@ , iputils , socat , utillinux -, writeScriptBin -, runtimeShell , lib , exe , script -, repoName ? "inputoutput/${exe}" +, repoName ? "ghcr.io/intersectmbo/${exe}" }: let @@ -83,6 +81,7 @@ let mkdir -m 0777 tmp ''; }; + # Image with all iohk-nix network configs or utilizes a configuration volume mount # To choose a network, use `-e NETWORK testnet` clusterStatements = lib.concatStringsSep "\n" (lib.mapAttrsToList (env: scripts: let @@ -109,7 +108,7 @@ let # Mainnet configuration used by the 'run' option mainnetConfigFile = builtins.toFile "mainnet-config.json" (builtins.toJSON commonLib.environments.mainnet.nodeConfig); - mainnetTopologyFile = commonLib.mkEdgeTopology { edgeNodes = [ commonLib.environments.mainnet.relaysNew ]; valency = 2; }; + mainnetTopologyFile = commonLib.mkTopology commonLib.environments.mainnet; in dockerTools.buildImage { @@ -135,6 +134,7 @@ in ln -s ${cardano-node}/bin/cardano-node usr/local/bin/cardano-node ln -s ${cardano-cli}/bin/cardano-cli usr/local/bin/cardano-cli ''; + config = { EntryPoint = [ "entrypoint" ]; }; diff --git a/nix/docker/submit-api.nix b/nix/docker/submit-api.nix index e06cc29172b..85808a85c8f 100644 --- a/nix/docker/submit-api.nix +++ b/nix/docker/submit-api.nix @@ -3,23 +3,24 @@ # # To build and load into the Docker engine: # -# nix run .#DockerImage/submit-api/load +# nix run .#dockerImage/submit-api +# docker load -i result # # cardano-submit-api # To launch with provided mainnet configuration # -# docker run -e NETWORK=mainnet inputoutput/cardano-submit-api: +# docker run -e NETWORK=mainnet ghcr.io/intersectmbo/cardano-submit-api: # -# To launch with provided testnet configuration +# To launch with provided testnet configuration # -# docker run -e NETWORK=testnet inputoutput/cardano-submit-api: +# docker run -e NETWORK=testnet ghcr.io/intersectmbo/cardano-submit-api: # # Provide a complete command otherwise: # -# docker run -v $PWD/config.yaml:/config.yaml inputoutput/cardano-submit-api: \ -# --config /config.yaml --mainnet --socket-path /node-ipc/node.socket +# docker run -v $PWD/config.yaml:/config.yaml ghcr.io/intersectmbo/cardano-submit-api: \ +# --config /config.yaml --mainnet --socket-path /node-ipc/node.socket # -# See the docker-compose.yml for demonstration of using Docker secrets instead of mounting a pgpass +# See the docker-compose.yml for demonstration of using Docker secrets instead of mounting a pgpass # ############################################################################ @@ -50,7 +51,7 @@ , lib , exe , script -, repoName ? "inputoutput/${exe}" +, repoName ? "ghcr.io/intersectmbo/${exe}" }: let @@ -79,6 +80,7 @@ let mkdir -m 0777 tmp ''; }; + # Image with all iohk-nix network configs or utilizes a configuration volume mount # To choose a network, use `-e NETWORK testnet` clusterStatements = lib.concatStringsSep "\n" (lib.mapAttrsToList (env: scripts: let @@ -87,6 +89,7 @@ let elif [[ "$NETWORK" == "${env}" ]]; then exec ${scriptBin}/bin/${scriptBin.name} $@ '') scripts); + nodeDockerImage = let entry-point = writeScriptBin "entry-point" '' #!${runtimeShell} @@ -97,16 +100,19 @@ let echo "Managed configuration for network "$NETWORK" does not exist" fi ''; + in dockerTools.buildImage { name = "${repoName}"; fromImage = baseImage; tag = "${gitrev}"; created = "now"; # Set creation date to build time. Breaks reproducibility + copyToRoot = pkgs.buildEnv { name = "image-root"; pathsToLink = ["/"]; paths = [entry-point]; }; + config = { EntryPoint = [ "${entry-point}/bin/entry-point" ]; ExposedPorts = { diff --git a/nix/nixos/cardano-node-service.nix b/nix/nixos/cardano-node-service.nix index fde7665170f..c96eacd747d 100644 --- a/nix/nixos/cardano-node-service.nix +++ b/nix/nixos/cardano-node-service.nix @@ -89,6 +89,9 @@ let options = {}; } else baseConfig // + { + UseTraceDispatcher = false; + } // (optionalAttrs (baseConfig ? hasEKG) { hasEKG = baseConfig.hasEKG + i; }) //