Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add native AArch64 images #3

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions native-arm/cardano-db-sync-13.1.0.0--run-as-root.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
diff --git a/nix/docker.nix b/nix/docker.nix
index 84a4687f..292ce6e3 100644
--- a/nix/docker.nix
+++ b/nix/docker.nix
@@ -80,11 +80,6 @@ let
socat # Utility for bidirectional data transfer
utillinux # System utilities for Linux
];
- runAsRoot = ''
- #!${runtimeShell}
- ${dockerTools.shadowSetup}
- mkdir -p /root
- '';
};

# The applications, without configuration, for which the target container is being built
@@ -117,6 +112,8 @@ let
'';
entry-point = writeScriptBin "entry-point" ''
#!${runtimeShell}
+ ${dockerTools.shadowSetup}
+ mkdir -p /root
mkdir -p /configuration
if [ ! -f /configuration/pgpass ]
then
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
diff --git a/cabal.project b/cabal.project
index e425f968..af748559 100644
--- a/cabal.project
+++ b/cabal.project
@@ -84,6 +84,7 @@ source-repository-package
subdir:
cardano-git-rev
cardano-node
+ cardano-submit-api
trace-dispatcher
trace-forward
trace-resources
diff --git a/flake.nix b/flake.nix
index 77fe4c44..26f8e221 100644
--- a/flake.nix
+++ b/flake.nix
@@ -63,8 +63,10 @@
};
})

- # cardano-cli, cardano-node, and friends
- (_: cardanoNodePkgs)
+ (final: prev: {
+ inherit (project.hsPkgs.cardano-node.components.exes) cardano-node;
+ inherit (project.hsPkgs.cardano-cli.components.exes) cardano-cli;
+ })

(final: prev: {
# The cardano-db-sync NixOS module (nix/nixos/cardano-db-sync-service.nix)
@@ -92,17 +94,6 @@
];
};

- # Get cardano-node-pkgs from cardano-parts
- cardanoNodePkgs = pkgs: with pkgs;
- let
- inherit (inputs.cardano-parts.cardano-parts.pkgs.special) cardano-node-pkgs;
- in
- # cardano-parts currently only supports x86_64-linux
- lib.optionalAttrs (system == "x86_64-linux") {
- inherit (cardano-node-pkgs system)
- cardano-cli cardano-node cardano-submit-api;
- };
-
# Set up and start Postgres before running database tests
preCheck = ''
echo pre-check
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
diff --git a/flake.nix b/flake.nix
index 26f8e221..111a5965 100644
--- a/flake.nix
+++ b/flake.nix
@@ -33,9 +33,7 @@
outputs = { self, ... }@inputs:
let
supportedSystems = [
- "x86_64-linux"
- "x86_64-darwin"
- "aarch64-darwin"
+ "aarch64-linux"
];
in
inputs.utils.lib.eachSystem supportedSystems (system:
@@ -344,7 +342,7 @@

legacyPackages = pkgs;

- packages = lib.optionalAttrs (system == "x86_64-linux") {
+ packages = lib.optionalAttrs (system == "aarch64-linux") {
inherit cardano-db-sync-linux cardano-db-sync-docker;
inherit project;
default = flake.packages."cardano-db-sync:exe:cardano-db-sync";
26 changes: 26 additions & 0 deletions native-arm/cardano-db-sync-sancho-4-0-0--run-as-root.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
diff --git a/nix/docker.nix b/nix/docker.nix
index fd47673e..bb92e71c 100644
--- a/nix/docker.nix
+++ b/nix/docker.nix
@@ -47,12 +47,6 @@ let
cardano-db-tool # utilities for creating database snapshots
];
};
-
- runAsRoot = ''
- #!${runtimeShell}
- ${dockerTools.shadowSetup}
- mkdir -p /root
- '';
};

# Contains cardano-db-sync binary, but no application configuration
@@ -68,6 +62,8 @@ let
# Entrypoint for the final image layer
entrypoint = writeScriptBin "entrypoint" ''
#!${runtimeShell}
+ ${dockerTools.shadowSetup}
+ mkdir -p /root
mkdir -p /configuration
if [ ! -f /configuration/pgpass ]; then
${genPgpass} /run/secrets
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
diff --git a/flake.nix b/flake.nix
index 96e419dc..d4b60ec7 100644
--- a/flake.nix
+++ b/flake.nix
@@ -32,6 +32,7 @@
"x86_64-linux"
"x86_64-darwin"
"aarch64-darwin"
+ "aarch64-linux"
];
in
inputs.utils.lib.eachSystem supportedSystems (system:
@@ -338,7 +339,7 @@
hydraJobs = callPackages inputs.iohkNix.utils.ciJobsAggregates {
ciJobs = flake.hydraJobs;
nonRequiredPaths = map lib.hasPrefix nonRequiredPaths;
- } // lib.optionalAttrs (system == "x86_64-linux") {
+ } // lib.optionalAttrs (system == "aarch64-linux") {
inherit
cardano-db-sync-linux
cardano-db-sync-docker
@@ -352,7 +353,7 @@

legacyPackages = pkgs;

- packages = lib.optionalAttrs (system == "x86_64-linux") {
+ packages = lib.optionalAttrs (system == "aarch64-linux") {
inherit
cardano-db-sync-linux
cardano-db-sync-docker
37 changes: 37 additions & 0 deletions native-arm/cardano-db-sync-sancho-4-2-1--run-as-root.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
diff --git a/nix/docker.nix b/nix/docker.nix
index 17c637f2..2ee74c8e 100644
--- a/nix/docker.nix
+++ b/nix/docker.nix
@@ -52,12 +52,6 @@ let
cardano-db-tool # utilities for creating database snapshots
];
};
-
- runAsRoot = ''
- #!${runtimeShell}
- ${dockerTools.shadowSetup}
- mkdir -p /root
- '';
};

# Contains software binaries, but no application configuration or entrypoint
@@ -129,6 +123,9 @@ let
writeScriptBin "entrypoint" ''
#!${runtimeShell}

+ ${dockerTools.shadowSetup}
+ mkdir -p /root
+
${genPgpass}
export PGPASSFILE=/configuration/pgpass

@@ -223,6 +220,9 @@ let
writeScriptBin "entrypoint" ''
#!${runtimeShell}

+ ${dockerTools.shadowSetup}
+ mkdir -p /root
+
${genPgpass}
export PGPASSFILE=/configuration/pgpass

13 changes: 13 additions & 0 deletions native-arm/cardano-node-1.35.4--expose-projectExes.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/flake.nix b/flake.nix
index 00647cc94..e35ef9ac7 100644
--- a/flake.nix
+++ b/flake.nix
@@ -373,6 +373,8 @@
internal.roots.project = windowsProject.roots;
});
};
+ } // optionalAttrs (system == "aarch64-linux") {
+ linux-arm64.projectExes = (mkPackages project).projectExes;
} // optionalAttrs (system == "x86_64-darwin") {
macos = lib.filterAttrs
(n: _:
13 changes: 13 additions & 0 deletions native-arm/cardano-node-8.9.1--expose-projectExes.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/flake.nix b/flake.nix
index 0804d9ff3..64362d27d 100644
--- a/flake.nix
+++ b/flake.nix
@@ -305,6 +305,8 @@
internal.roots.project = windowsProject.roots;
variants = mapAttrs (_: v: removeAttrs v.windows ["variants"]) ciJobsVariants;
});
+ } // optionalAttrs (system == "aarch64-linux") {
+ linux-arm64.projectExes = collectExes project;
} // optionalAttrs (system == "x86_64-darwin") {
native = lib.filterAttrs
(n: _:
Loading