From 621b8a0af03aaf3110072193ef8f3d3f33ca286a Mon Sep 17 00:00:00 2001 From: Sebastian Nagel Date: Sat, 1 Feb 2025 00:49:41 +0100 Subject: [PATCH 1/8] Add a static binary and docker image flake output --- nix/outputs.nix | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/nix/outputs.nix b/nix/outputs.nix index b961ec6..be8a5cc 100644 --- a/nix/outputs.nix +++ b/nix/outputs.nix @@ -4,9 +4,30 @@ let project = repoRoot.nix.project; in [ - { + project.flake + rec { packages.hydra-explorer-web = import ../hydra-explorer/web/hydra-explorer.nix { inherit pkgs; }; + packages.hydra-explorer-static = + project.cross.musl64.cabalProject.hsPkgs.hydra-explorer.components.exes.hydra-explorer; + + packages.docker = pkgs.dockerTools.streamLayeredImage { + name = "hydra-explorer"; + tag = "latest"; + created = "now"; + config = { + Entrypoint = [ "${packages.hydra-explorer-static}/bin/hydra-explorer" ]; + WorkingDir = "/"; + }; + # Copy the static files to /static in the docker image + contents = [ + (pkgs.runCommand "hydra-explorer-static-files" { } '' + mkdir $out + ln -s ${packages.hydra-explorer-web} $out/static + '') + ]; + }; + # A place to hack on the image to see how it works. packages.qemu = inputs.nixos-generators.nixosGenerate { inherit system; @@ -27,7 +48,4 @@ in ]; }; } - ( - project.flake - ) ] From 9587e89068c15dca1d3b3c5906336dda05a4ee5c Mon Sep 17 00:00:00 2001 From: Sebastian Nagel Date: Sat, 1 Feb 2025 00:50:13 +0100 Subject: [PATCH 2/8] Minor refactor on top-level flake.nix --- flake.nix | 77 ++++++++++++++++++++++++------------------------------- 1 file changed, 33 insertions(+), 44 deletions(-) diff --git a/flake.nix b/flake.nix index 1e7bd20..1788492 100644 --- a/flake.nix +++ b/flake.nix @@ -41,53 +41,42 @@ agenix.url = "github:ryantm/agenix"; }; - outputs = inputs: - let - systems = [ - "x86_64-linux" - "x86_64-darwin" - "aarch64-darwin" - "aarch64-linux" - ]; - in - inputs.iogx.lib.mkFlake { - - nixpkgsArgs.overlays = [ - inputs.nix-npm-buildpackage.overlays.default - (final: prev: { - cardano-node = inputs.cardano-node.packages.${final.system}.cardano-node; - cardano-cli = inputs.cardano-node.packages.${final.system}.cardano-cli; - hydra-chain-observer = inputs.hydra.packages.${final.system}.hydra-chain-observer; - hydra-node = inputs.hydra.packages.${final.system}.hydra-node; - }) - ]; - - inherit inputs; - inherit systems; - - repoRoot = ./.; - - flake = _: { - nixosConfigurations.hydra-explorer = - inputs.nixpkgs.lib.nixosSystem - { - system = "x86_64-linux"; - specialArgs = inputs; - modules = [ - { - imports = [ - "${inputs.nixpkgs}/nixos/modules/virtualisation/amazon-image.nix" - (import ./nix/hydra-explorer-configuration.nix) - ]; - } - inputs.agenix.nixosModules.default - ]; - }; - }; + outputs = inputs: inputs.iogx.lib.mkFlake { + inherit inputs; + systems = [ "x86_64-linux" "x86_64-darwin" "aarch64-darwin" "aarch64-linux" ]; + repoRoot = ./.; + + nixpkgsArgs.overlays = [ + inputs.nix-npm-buildpackage.overlays.default + (final: prev: { + cardano-node = inputs.cardano-node.packages.${final.system}.cardano-node; + cardano-cli = inputs.cardano-node.packages.${final.system}.cardano-cli; + hydra-chain-observer = inputs.hydra.packages.${final.system}.hydra-chain-observer; + hydra-node = inputs.hydra.packages.${final.system}.hydra-node; + }) + ]; - outputs = import ./nix/outputs.nix; + flake = _: { + nixosConfigurations.hydra-explorer = + inputs.nixpkgs.lib.nixosSystem + { + system = "x86_64-linux"; + specialArgs = inputs; + modules = [ + { + imports = [ + "${inputs.nixpkgs}/nixos/modules/virtualisation/amazon-image.nix" + (import ./nix/hydra-explorer-configuration.nix) + ]; + } + inputs.agenix.nixosModules.default + ]; + }; }; + outputs = import ./nix/outputs.nix; + }; + nixConfig = { extra-substituters = [ "https://cache.iog.io" From 085d168e6630c47fe49de16536391e3bc40c4fc8 Mon Sep 17 00:00:00 2001 From: Sebastian Nagel Date: Wed, 5 Feb 2025 13:31:24 +0100 Subject: [PATCH 3/8] Add a docker workflow to build images in CI --- .github/workflows/docker.yaml | 91 +++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 .github/workflows/docker.yaml diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml new file mode 100644 index 0000000..3765b42 --- /dev/null +++ b/.github/workflows/docker.yaml @@ -0,0 +1,91 @@ +# This workflow builds docker images on 'master' and for all release tags. The +# 'latest' docker tag on the registry will always point to the latest pushed +# version, likely the one built from 'master', so referring to the versioned +# images is suggested. +name: Docker + +# Limit concurrent runs of this workflow within a single PR +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +on: + push: + branches: [ "master" ] + tags: [ "*.*.*" ] + workflow_dispatch: + inputs: + ref_name: + type: string + description: 'Point-in-time to build the custom docker images' + required: true + default: "master" + +permissions: + packages: write + +jobs: + docker: + runs-on: ubuntu-latest + steps: + - name: 📥 Checkout repository + uses: actions/checkout@v4 + with: + ref: ${{ github.event.inputs.ref_name || '' }} + + - name: 🐳 Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: ❄ Prepare nix + uses: cachix/install-nix-action@v30 + with: + extra_nix_config: | + accept-flake-config = true + log-lines = 1000 + + - name: ❄ Cachix cache of nix derivations + uses: cachix/cachix-action@v15 + with: + name: cardano-scaling + authToken: '${{ secrets.CACHIX_CARDANO_SCALING_AUTH_TOKEN }}' + + - name: 🔨 Build image using nix + run: | + IMAGE_NAME=ghcr.io/${{github.repository_owner}}/hydra-explorer + echo "IMAGE_NAME=${IMAGE_NAME}" >> $GITHUB_ENV + nix build .#docker + ./result | docker load + + # Determine whether we are building a tag and if yes, set a VERSION_NAME + BUILDING_TAG=${{github.ref_type == 'tag'}} + [[ ${BUILDING_TAG} = true ]] && \ + VERSION_NAME=${{github.ref_name}} + + # Use 'FROM' instruction to use docker build with --label + echo "FROM hydra-explorer" | docker build \ + --label org.opencontainers.image.source=${{github.repositoryUrl}} \ + --label org.opencontainers.image.licenses=Apache-2.0 \ + --label org.opencontainers.image.created=$(date -Is) \ + --label org.opencontainers.image.revision=${{github.sha}} \ + --label org.opencontainers.image.version=${VERSION_NAME:-unstable} \ + --tag ${IMAGE_NAME}:unstable - + + # Also tag with semver and 'latest' if we are building a tag + [[ ${BUILDING_TAG} = true ]] && \ + docker tag ${IMAGE_NAME}:unstable ${IMAGE_NAME}:${{github.ref_name}} + [[ ${BUILDING_TAG} = true ]] && \ + docker tag ${IMAGE_NAME}:unstable ${IMAGE_NAME}:latest + # Tag image with workflow dispatch ref_name + [[ ${{github.event_name == 'workflow_dispatch'}} = true ]] && \ + docker tag ${IMAGE_NAME}:unstable ${IMAGE_NAME}:${{github.event.inputs.ref_name}} + + docker images + docker inspect ${IMAGE_NAME}:unstable + + - name: 📤 Push to registry + run: | + docker push -a ${IMAGE_NAME} From 317758dd48e2a7321c1fbb892541f5227bb277ca Mon Sep 17 00:00:00 2001 From: Sebastian Nagel Date: Wed, 5 Feb 2025 14:35:06 +0100 Subject: [PATCH 4/8] Add hydra-chain-observer containers This initializes a docker network and should start two cardano-nodes and two chain observers now reporting into one explorer instance. --- nix/hydra-explorer-configuration.nix | 105 ++++++++++++++++++++++----- 1 file changed, 88 insertions(+), 17 deletions(-) diff --git a/nix/hydra-explorer-configuration.nix b/nix/hydra-explorer-configuration.nix index fa43dc8..251feb2 100644 --- a/nix/hydra-explorer-configuration.nix +++ b/nix/hydra-explorer-configuration.nix @@ -1,4 +1,4 @@ -{ pkgs, lib, inputs, ... }: +{ pkgs, lib, inputs, config, ... }: { networking = { hostName = "hydra-explorer"; @@ -57,11 +57,81 @@ virtualisation.podman.enable = true; virtualisation.podman.dockerCompat = true; - # Cardano node used by Hydra smoke tests and explorer instance - # TODO: add multiple instances of cardano-node and hydra-chain-observer + # Network between hydra-explorer and hydra-chain-observer + systemd.services."init-docker-network-explorer" = + let networkName = "hydra-explorer"; + in { + description = "Network bridge for ${networkName}."; + after = [ "network.target" ]; + wantedBy = [ "multi-user.target" ]; + + serviceConfig = { + Type = "oneshot"; + RemainAfterExit = "yes"; + }; + script = + let cli = "${config.virtualisation.podman.package}/bin/podman"; + in '' + if [[ $(${cli} network inspect ${networkName}) == "[]" ]]; then + ${cli} network create ${networkName} + else + echo "Docker network ${networkName} already exists" + fi + ''; + }; + + # Hydra explorer instance + virtualisation.oci-containers.containers.hydra-explorer = { + image = "ghcr.io/cardano-scaling/hydra-explorer:unstable"; + volumes = [ + "/data/cardano/preview:/data" + ]; + ports = [ + "80:8000" + ]; + cmd = builtins.concatLists [ + [ "--client-port" "8000" ] + [ "--observer-port" "8001" ] # not bound to host + ]; + extraOptions = [ "--network=hydra-explorer" ]; + }; + + virtualisation.oci-containers.containers."hydra-chain-observer-preview-unstable" = { + image = "ghcr.io/cardano-scaling/hydra-chain-observer:unstable"; + volumes = [ + "/data/cardano/preview:/data" + ]; + cmd = builtins.concatLists [ + [ "--node-socket" "/data/node.socket" ] + [ "--testnet-magic" "2" ] + # NOTE: Block in which 0.20.0 scripts were published + [ "--start-chain-from" "49533501.e364500a42220ea47314215679b7e42e9bbb81fa69d1366fe738d8aef900f7ee" ] + # NOTE: Reachable via bridge network + [ "--explorer" "http://hydra-explorer:8001" ] + ]; + extraOptions = [ "--network=hydra-explorer" ]; + }; + + virtualisation.oci-containers.containers."hydra-chain-observer-preprod-unstable" = { + image = "ghcr.io/cardano-scaling/hydra-chain-observer:unstable"; + volumes = [ + "/data/cardano/preprod:/data" + ]; + cmd = builtins.concatLists [ + [ "--node-socket" "/data/node.socket" ] + [ "--testnet-magic" "1" ] + # NOTE: Block in which 0.20.0 scripts were published + [ "--start-chain-from" "82913877.aa62d900ecbd6a073e1b5bb8c014413365c26a3675bd81dc567013340bf94ec3" ] + # NOTE: Reachable via bridge network + [ "--explorer" "http://hydra-explorer:8001" ] + ]; + extraOptions = [ "--network=hydra-explorer" ]; + }; + + # Cardano node used by Hydra smoke tests and hydra-chain-observers # TODO: initialize /data/cardano/preview correctly on a fresh machine virtualisation.oci-containers.containers.cardano-node-preview = { - image = "ghcr.io/intersectmbo/cardano-node:10.1.3"; + image = "ghcr.io/intersectmbo/cardano-node:10.1.4"; volumes = [ "/data/cardano/preview:/data" ]; @@ -76,21 +146,22 @@ }; }; - virtualisation.oci-containers.containers.hydra-explorer = { - image = "ghcr.io/cardano-scaling/hydra-explorer:0.19.0"; + # Cardano node used by Hydra smoke tests and hydra-chain-observers + # TODO: initialize /data/cardano/preprod correctly on a fresh machine + virtualisation.oci-containers.containers.cardano-node-preprod = { + image = "ghcr.io/intersectmbo/cardano-node:10.1.4"; volumes = [ - "/data/cardano/preview:/data" - ]; - ports = [ - "80:8080" - ]; - cmd = builtins.concatLists [ - [ "--node-socket" "/data/node.socket" ] - [ "--testnet-magic" "2" ] - [ "--api-port" "8080" ] - # NOTE: Block in which current master scripts were published - [ "--start-chain-from" "49533501.e364500a42220ea47314215679b7e42e9bbb81fa69d1366fe738d8aef900f7ee" ] + "/data/cardano/preprod:/data" ]; + cmd = [ "run" ]; + environment = { + CARDANO_CONFIG = "/data/config.json"; + CARDANO_TOPOLOGY = "/data/topology.json"; + CARDANO_DATABASE_PATH = "/data/db"; + CARDANO_SOCKET_PATH = "/data/node.socket"; # used by cardano-node + CARDANO_NODE_SOCKET_PATH = "/data/node.socket"; # used by cardano-cli + CARDANO_LOG_DIR = "/data/logs"; + }; }; services.openssh = { From 52b709d6095c9490d0823d7df0d729392d68a562 Mon Sep 17 00:00:00 2001 From: Sebastian Nagel Date: Thu, 6 Feb 2025 14:01:45 +0100 Subject: [PATCH 5/8] Switch to using docker The virtualised network and dns resolution was not working out of the box with podman? --- nix/hydra-explorer-configuration.nix | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/nix/hydra-explorer-configuration.nix b/nix/hydra-explorer-configuration.nix index 251feb2..98bde7c 100644 --- a/nix/hydra-explorer-configuration.nix +++ b/nix/hydra-explorer-configuration.nix @@ -1,7 +1,9 @@ { pkgs, lib, inputs, config, ... }: { networking = { - hostName = "hydra-explorer"; + # NOTE: This is not hydra-explorer as a container running on this host will + # use that dns name. + hostName = "explorer"; firewall = { allowedTCPPorts = [ 22 80 443 ]; enable = true; @@ -53,9 +55,9 @@ }; }; - # Use podman to manage containers - virtualisation.podman.enable = true; - virtualisation.podman.dockerCompat = true; + # Use docker to manage containers + virtualisation.docker.enable = true; + virtualisation.oci-containers.backend = "docker"; # Network between hydra-explorer and hydra-chain-observer systemd.services."init-docker-network-explorer" = @@ -70,7 +72,7 @@ RemainAfterExit = "yes"; }; script = - let cli = "${config.virtualisation.podman.package}/bin/podman"; + let cli = "${config.virtualisation.docker.package}/bin/docker"; in '' if [[ $(${cli} network inspect ${networkName}) == "[]" ]]; then ${cli} network create ${networkName} From 81927bc74f33370763761609e984b6d0abbdac1e Mon Sep 17 00:00:00 2001 From: Sebastian Nagel Date: Thu, 6 Feb 2025 14:25:40 +0100 Subject: [PATCH 6/8] Fix starting point for 0.20.0 observer --- nix/hydra-explorer-configuration.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nix/hydra-explorer-configuration.nix b/nix/hydra-explorer-configuration.nix index 98bde7c..b37adff 100644 --- a/nix/hydra-explorer-configuration.nix +++ b/nix/hydra-explorer-configuration.nix @@ -107,7 +107,7 @@ [ "--node-socket" "/data/node.socket" ] [ "--testnet-magic" "2" ] # NOTE: Block in which 0.20.0 scripts were published - [ "--start-chain-from" "49533501.e364500a42220ea47314215679b7e42e9bbb81fa69d1366fe738d8aef900f7ee" ] + [ "--start-chain-from" "71938562.2c5fc734343ad1bf8ce2df999421cca15dffdd2b8e1909dad7127b9eaacf8b9c" ] # NOTE: Reachable via bridge network [ "--explorer" "http://hydra-explorer:8001" ] ]; From d72a0fdf1e43bec9502fe88b3390e854b527268a Mon Sep 17 00:00:00 2001 From: Sebastian Nagel Date: Fri, 7 Feb 2025 20:18:45 +0100 Subject: [PATCH 7/8] Switch to using docker compose and add CD workflow --- .github/workflows/cd.yaml | 8 +- docker-compose.yaml | 86 +++++++++++++++++++++ nix/hydra-explorer-configuration.nix | 108 --------------------------- 3 files changed, 90 insertions(+), 112 deletions(-) create mode 100644 docker-compose.yaml diff --git a/.github/workflows/cd.yaml b/.github/workflows/cd.yaml index d23d1ab..ad79afa 100644 --- a/.github/workflows/cd.yaml +++ b/.github/workflows/cd.yaml @@ -3,7 +3,7 @@ name: "CD" on: workflow_run: workflows: ["Docker"] - branches: [ "master", "multi-version-explorer-deployment" ] + branches: ["master"] types: - completed workflow_dispatch: @@ -16,7 +16,7 @@ jobs: - name: 📥 Checkout repository uses: actions/checkout@v4 - - name: ⛄ Deploy with nixos + - name: 🐳 Deploy with docker compose run: | - # TODO: update nixos config to docker pull - /run/current-system/sw/bin/nixos-rebuild switch --flake . + /run/current-system/sw/bin/docker compose pull + /run/current-system/sw/bin/docker compose up -d diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..f4fa0ca --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,86 @@ +# Hydra explorer instance with it's chain observers as it is deployed to +# explorer.hydra.family +version: "3.9" + +networks: + hydra-explorer: + driver: bridge + +services: + hydra-explorer: + image: ghcr.io/cardano-scaling/hydra-explorer:unstable + ports: + - "80:8000" + command: + [ "--client-port", "8000" + , "--observer-port", "8001" # not bound to host + ] + networks: + - hydra-explorer + restart: always + + # List of hydra-chain-observers + + hydra-chain-observer-preview-unstable: + image: ghcr.io/cardano-scaling/hydra-chain-observer:unstable + volumes: + - "/data/cardano/preview:/data" + command: + [ "--node-socket", "/data/node.socket" + , "--testnet-magic", "2" + # NOTE: Block in which 0.20.0 scripts were published + , "--start-chain-from", "71938562.2c5fc734343ad1bf8ce2df999421cca15dffdd2b8e1909dad7127b9eaacf8b9c" + # NOTE: Reachable via hydra-explorer network + , "--explorer", "http://hydra-explorer:8001" + ] + networks: + - hydra-explorer + restart: always + + hydra-chain-observer-preprod-unstable: + image: ghcr.io/cardano-scaling/hydra-chain-observer:unstable + volumes: + - "/data/cardano/preprod:/data" + command: + [ "--node-socket", "/data/node.socket" + , "--testnet-magic", "1" + # NOTE: Block in which 0.20.0 scripts were published + , "--start-chain-from", "82913877.aa62d900ecbd6a073e1b5bb8c014413365c26a3675bd81dc567013340bf94ec3" + # NOTE: Reachable via hydra-explorer network + , "--explorer", "http://hydra-explorer:8001" + ] + networks: + - hydra-explorer + restart: always + + # One cardano node per network + + cardano-node-preview: + image: ghcr.io/intersectmbo/cardano-node:10.1.4 + volumes: + - /data/cardano/preview:/data + environment: + - CARDANO_CONFIG=/data/config.json + - CARDANO_TOPOLOGY=/data/topology.json + - CARDANO_DATABASE_PATH=/data/db + - CARDANO_SOCKET_PATH=/data/node.socket # used by cardano-node + - CARDANO_NODE_SOCKET_PATH=/data/node.socket # used by cardano-cli + - CARDANO_LOG_DIR=/data/logs + command: + [ "run" ] + restart: always + + cardano-node-preprod: + image: ghcr.io/intersectmbo/cardano-node:10.1.4 + volumes: + - /data/cardano/preprod:/data + environment: + - CARDANO_CONFIG=/data/config.json + - CARDANO_TOPOLOGY=/data/topology.json + - CARDANO_DATABASE_PATH=/data/db + - CARDANO_SOCKET_PATH=/data/node.socket # used by cardano-node + - CARDANO_NODE_SOCKET_PATH=/data/node.socket # used by cardano-cli + - CARDANO_LOG_DIR=/data/logs + command: + [ "run" ] + restart: always diff --git a/nix/hydra-explorer-configuration.nix b/nix/hydra-explorer-configuration.nix index b37adff..5294127 100644 --- a/nix/hydra-explorer-configuration.nix +++ b/nix/hydra-explorer-configuration.nix @@ -57,114 +57,6 @@ # Use docker to manage containers virtualisation.docker.enable = true; - virtualisation.oci-containers.backend = "docker"; - - # Network between hydra-explorer and hydra-chain-observer - systemd.services."init-docker-network-explorer" = - let networkName = "hydra-explorer"; - in { - description = "Network bridge for ${networkName}."; - after = [ "network.target" ]; - wantedBy = [ "multi-user.target" ]; - - serviceConfig = { - Type = "oneshot"; - RemainAfterExit = "yes"; - }; - script = - let cli = "${config.virtualisation.docker.package}/bin/docker"; - in '' - if [[ $(${cli} network inspect ${networkName}) == "[]" ]]; then - ${cli} network create ${networkName} - else - echo "Docker network ${networkName} already exists" - fi - ''; - }; - - # Hydra explorer instance - virtualisation.oci-containers.containers.hydra-explorer = { - image = "ghcr.io/cardano-scaling/hydra-explorer:unstable"; - volumes = [ - "/data/cardano/preview:/data" - ]; - ports = [ - "80:8000" - ]; - cmd = builtins.concatLists [ - [ "--client-port" "8000" ] - [ "--observer-port" "8001" ] # not bound to host - ]; - extraOptions = [ "--network=hydra-explorer" ]; - }; - - virtualisation.oci-containers.containers."hydra-chain-observer-preview-unstable" = { - image = "ghcr.io/cardano-scaling/hydra-chain-observer:unstable"; - volumes = [ - "/data/cardano/preview:/data" - ]; - cmd = builtins.concatLists [ - [ "--node-socket" "/data/node.socket" ] - [ "--testnet-magic" "2" ] - # NOTE: Block in which 0.20.0 scripts were published - [ "--start-chain-from" "71938562.2c5fc734343ad1bf8ce2df999421cca15dffdd2b8e1909dad7127b9eaacf8b9c" ] - # NOTE: Reachable via bridge network - [ "--explorer" "http://hydra-explorer:8001" ] - ]; - extraOptions = [ "--network=hydra-explorer" ]; - }; - - virtualisation.oci-containers.containers."hydra-chain-observer-preprod-unstable" = { - image = "ghcr.io/cardano-scaling/hydra-chain-observer:unstable"; - volumes = [ - "/data/cardano/preprod:/data" - ]; - cmd = builtins.concatLists [ - [ "--node-socket" "/data/node.socket" ] - [ "--testnet-magic" "1" ] - # NOTE: Block in which 0.20.0 scripts were published - [ "--start-chain-from" "82913877.aa62d900ecbd6a073e1b5bb8c014413365c26a3675bd81dc567013340bf94ec3" ] - # NOTE: Reachable via bridge network - [ "--explorer" "http://hydra-explorer:8001" ] - ]; - extraOptions = [ "--network=hydra-explorer" ]; - }; - - # Cardano node used by Hydra smoke tests and hydra-chain-observers - # TODO: initialize /data/cardano/preview correctly on a fresh machine - virtualisation.oci-containers.containers.cardano-node-preview = { - image = "ghcr.io/intersectmbo/cardano-node:10.1.4"; - volumes = [ - "/data/cardano/preview:/data" - ]; - cmd = [ "run" ]; - environment = { - CARDANO_CONFIG = "/data/config.json"; - CARDANO_TOPOLOGY = "/data/topology.json"; - CARDANO_DATABASE_PATH = "/data/db"; - CARDANO_SOCKET_PATH = "/data/node.socket"; # used by cardano-node - CARDANO_NODE_SOCKET_PATH = "/data/node.socket"; # used by cardano-cli - CARDANO_LOG_DIR = "/data/logs"; - }; - }; - - # Cardano node used by Hydra smoke tests and hydra-chain-observers - # TODO: initialize /data/cardano/preprod correctly on a fresh machine - virtualisation.oci-containers.containers.cardano-node-preprod = { - image = "ghcr.io/intersectmbo/cardano-node:10.1.4"; - volumes = [ - "/data/cardano/preprod:/data" - ]; - cmd = [ "run" ]; - environment = { - CARDANO_CONFIG = "/data/config.json"; - CARDANO_TOPOLOGY = "/data/topology.json"; - CARDANO_DATABASE_PATH = "/data/db"; - CARDANO_SOCKET_PATH = "/data/node.socket"; # used by cardano-node - CARDANO_NODE_SOCKET_PATH = "/data/node.socket"; # used by cardano-cli - CARDANO_LOG_DIR = "/data/logs"; - }; - }; services.openssh = { settings.PasswordAuthentication = false; From fa75e8e7297668a295d49ef14d12cb271a2dd874 Mon Sep 17 00:00:00 2001 From: Sebastian Nagel Date: Fri, 7 Feb 2025 21:16:08 +0100 Subject: [PATCH 8/8] Rename nixos configuration to match hostname --- flake.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index 1788492..7d43b55 100644 --- a/flake.nix +++ b/flake.nix @@ -57,7 +57,7 @@ ]; flake = _: { - nixosConfigurations.hydra-explorer = + nixosConfigurations.explorer = inputs.nixpkgs.lib.nixosSystem { system = "x86_64-linux";