Skip to content

Commit

Permalink
Update (#72)
Browse files Browse the repository at this point in the history
  • Loading branch information
henrywong-crypto authored Aug 23, 2024
1 parent d953a97 commit 8c0091f
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 17 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ concurrency:

env:
MAINNET_VERSION: v24.9.0
TESTNET_VERSION: v24.9.0

jobs:
nix-build-aarch64:
Expand Down Expand Up @@ -53,6 +54,14 @@ jobs:
docker manifest create --amend ghcr.io/cronos-labs/external-node:mainnet-$MAINNET_VERSION ghcr.io/cronos-labs/external-node:mainnet-$MAINNET_VERSION-amd64
docker manifest push ghcr.io/cronos-labs/external-node:mainnet-$MAINNET_VERSION
nix build .#packages.aarch64-linux.testnet
docker load < result
docker tag testnet:nix ghcr.io/cronos-labs/external-node:testnet-$TESTNET_VERSION-aarch64
docker push ghcr.io/cronos-labs/external-node:testnet-$TESTNET_VERSION-aarch64
docker manifest create --amend ghcr.io/cronos-labs/external-node:testnet-$TESTNET_VERSION ghcr.io/cronos-labs/external-node:testnet-$TESTNET_VERSION-aarch64
docker manifest create --amend ghcr.io/cronos-labs/external-node:testnet-$TESTNET_VERSION ghcr.io/cronos-labs/external-node:testnet-$TESTNET_VERSION-amd64
docker manifest push ghcr.io/cronos-labs/external-node:testnet-$TESTNET_VERSION
nix-build-amd64:
runs-on: ubuntu-latest

Expand Down Expand Up @@ -89,3 +98,10 @@ jobs:
docker push ghcr.io/cronos-labs/external-node:mainnet-$MAINNET_VERSION-amd64
docker manifest create --amend ghcr.io/cronos-labs/external-node:mainnet-$MAINNET_VERSION ghcr.io/cronos-labs/external-node:mainnet-$MAINNET_VERSION-amd64
docker manifest push ghcr.io/cronos-labs/external-node:mainnet-$MAINNET_VERSION
nix build .#packages.x86_64-linux.testnet
docker load < result
docker tag testnet:nix ghcr.io/cronos-labs/external-node:testnet-$TESTNET_VERSION-amd64
docker push ghcr.io/cronos-labs/external-node:testnet-$TESTNET_VERSION-amd64
docker manifest create --amend ghcr.io/cronos-labs/external-node:testnet-$TESTNET_VERSION ghcr.io/cronos-labs/external-node:testnet-$TESTNET_VERSION-amd64
docker manifest push ghcr.io/cronos-labs/external-node:testnet-$TESTNET_VERSION
12 changes: 6 additions & 6 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 33 additions & 11 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,21 @@
cargo = rust-bin.fromRustupToolchainFile (inputs.zksync-era + /rust-toolchain);
rustc = rust-bin.fromRustupToolchainFile (inputs.zksync-era + /rust-toolchain);
};
base-image-mainnet =
(dockerTools.override
{
skopeo = pkgs.writeScriptBin "skopeo" ''exec ${skopeo}/bin/skopeo "$@" --authfile=/etc/docker/config.json'';
})
.pullImage {
finalImageTag = "mainnet-v24.9.0";
imageDigest = "sha256:aeaa2825da75b00fbd63e5f7f9dbd825098b1b068ed7397a479e9860b077af42";
imageName = "ghcr.io/cronos-labs/zkevm-base-image";
sha256 = "sha256-GQGaojsWBf0QNRSAj6vQAS+KElIXIRIBQxaxLEszpEs=";
};
dockerTools' = dockerTools.override {
skopeo = pkgs.writeScriptBin "skopeo" ''exec ${skopeo}/bin/skopeo "$@" --authfile=/etc/docker/config.json'';
};
base-image-mainnet = dockerTools'.pullImage {
finalImageTag = "mainnet-v24.9.0";
imageDigest = "sha256:aeaa2825da75b00fbd63e5f7f9dbd825098b1b068ed7397a479e9860b077af42";
imageName = "ghcr.io/cronos-labs/zkevm-base-image";
sha256 = "sha256-GQGaojsWBf0QNRSAj6vQAS+KElIXIRIBQxaxLEszpEs=";
};
base-image-testnet = dockerTools'.pullImage {
finalImageTag = "testnet-v24.9.0";
imageDigest = "sha256:28a7022cda8e5aa6abffd296213b9d01261846a9557d66f86dcdf6720600dbec";
imageName = "ghcr.io/cronos-labs/zkevm-base-image";
sha256 = "";
};
external-node = rustPlatform'.buildRustPackage.override {stdenv = clangStdenv;} {
buildInputs = [openssl];
cargoBuildFlags = "--bin zksync_external_node";
Expand Down Expand Up @@ -65,5 +69,23 @@
exec ${external-node}/bin/zksync_external_node "$@"
'';
};
packages.testnet = dockerTools.buildImage {
name = "testnet";
tag = "nix";
fromImage = base-image-testnet;
copyToRoot = buildEnv {
name = "image-root";
paths = [
bashInteractive
coreutils
dockerTools.caCertificates
];
};
config.Cmd = pkgs.writeScript "cmd" ''
#!${bash}/bin/bash
${sqlx-cli}/bin/sqlx database setup
exec ${external-node}/bin/zksync_external_node "$@"
'';
};
});
}

0 comments on commit 8c0091f

Please sign in to comment.