Skip to content

Commit febcd52

Browse files
authored
fix: ci-fix
CI Fixes
2 parents 4e2d452 + a3be398 commit febcd52

23 files changed

+164
-175
lines changed

.github/workflows/checks.yml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Checks
2+
3+
on:
4+
push:
5+
6+
jobs:
7+
build:
8+
strategy:
9+
matrix:
10+
include:
11+
- os: ubuntu-22.04
12+
arch: x86_64
13+
runs-on: movement-runner
14+
- os: macos-13-latest
15+
arch: arm64
16+
runs-on: macos-13-xlarge
17+
18+
runs-on: ${{ matrix.runs-on }}
19+
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@v4
23+
24+
- name: Install Nix
25+
uses: DeterminateSystems/nix-installer-action@main
26+
27+
- name: Run test in nix environment
28+
run: nix develop --command bash -c "cargo check"
29+
30+
- name: Run test in nix environment
31+
run: nix develop --command bash -c "just m1-da-light-node test.local -t=false"
32+
33+
- name: Run test in nix environment
34+
run: nix develop --command bash -c "just monza-full-node test.local -t=false"

.github/workflows/handle-target-comment.yml

+1-62
Original file line numberDiff line numberDiff line change
@@ -14,65 +14,4 @@ jobs:
1414
steps:
1515
- name: Output the comment
1616
run: |
17-
echo "Comment was: ${{ github.event.inputs.comment }}"
18-
19-
manage-infra-pr:
20-
if: startsWith(github.event.inputs.comment, 'infra')
21-
runs-on: ubuntu-latest
22-
steps:
23-
- name: Checkout code
24-
uses: actions/checkout@v3
25-
26-
- name: Extract repository name
27-
id: repo-name
28-
run: echo "REPO_NAME=$(echo ${{ github.repository }} | cut -d '/' -f2)" >> $GITHUB_ENV
29-
30-
- name: Search for existing PRs
31-
id: search-prs
32-
uses: actions/github-script@v6
33-
with:
34-
github-token: ${{ secrets.GITHUB_TOKEN }}
35-
script: |
36-
const title = `${process.env.REPO_NAME}/${{ github.event.issue.title }}`;
37-
const prs = await github.rest.pulls.list({
38-
owner: 'movementlabsxyz',
39-
repo: 'infra',
40-
state: 'open',
41-
head: 'main'
42-
});
43-
const existingPr = prs.data.find(pr => pr.title === title);
44-
if (existingPr) {
45-
return existingPr.html_url;
46-
}
47-
return '';
48-
49-
- name: Create PR in Infra Repo if not exist
50-
if: steps.search-prs.outputs.result == ''
51-
run: |
52-
gh_pr_up() { gh pr create $* || gh pr edit $* }
53-
gh_pr_up --title "${{ steps.repo-name.outputs.REPO_NAME }}/${{ github.event.issue.title }}" --body "**Infrastructure requested:** ${{ github.event.issue.html_url }}\n\n${{ github.event.comment.body }} --repo movementlabsxyz/infra"
54-
55-
- name: Comment on the Original PR with new PR link
56-
if: steps.search-prs.outputs.result == ''
57-
uses: peter-evans/create-or-update-comment@v2
58-
with:
59-
token: ${{ secrets.GITHUB_TOKEN }}
60-
issue_number: ${{ github.event.issue.number }}
61-
body: ${{ steps.create-pr.outputs.pr_url }}
62-
63-
- name: Comment on Original PR with PR link if PR already exists
64-
if: steps.search-prs.outputs.result != ''
65-
uses: peter-evans/create-or-update-comment@v2
66-
with:
67-
token: ${{ secrets.GITHUB_TOKEN }}
68-
issue_number: ${{ github.event.issue.number }}
69-
body: "A related PR already exists and you can follow it here: ${{ steps.search-prs.outputs.result }}"
70-
71-
- name: Comment on the Infra PR if created
72-
if: steps.search-prs.outputs.result == ''
73-
uses: peter-evans/create-or-update-comment@v2
74-
with:
75-
token: ${{ secrets.GITHUB_TOKEN }}
76-
repository: "movementlabsxyz/infra"
77-
issue_number: ${{ steps.create-pr.outputs.pr_number }}
78-
body: "This PR relates to changes triggered by an issue in another repository. Original PR: ${{ github.event.issue.html_url }} \n\n Details: ${{ github.event.comment.body }}"
17+
echo "Comment was: ${{ github.event.inputs.comment }}"

.gitignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ target/
55
ledger_db/
66
state_merkle_db/
77
.etc
8-
idea
9-
.movement
8+
.movement
9+
.idea

Cargo.lock

-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.lock

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

+39-60
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
inputs = {
3-
nixpkgs.url = "github:NixOS/nixpkgs/6143fc5eeb9c4f00163267708e26191d1e918932";
3+
nixpkgs.url = "github:NixOS/nixpkgs/f1010e0469db743d14519a1efd37e23f8513d714";
44
rust-overlay.url = "github:oxalica/rust-overlay";
55
flake-utils.url = "github:numtide/flake-utils";
66
};
@@ -12,9 +12,14 @@
1212
flake-utils,
1313
...
1414
}:
15-
flake-utils.lib.eachSystem ["aarch64-darwin" "x86_64-linux" "aarch64-linux"] (
15+
flake-utils.lib.eachSystem ["aarch64-darwin" "x86_64-darwin" "x86_64-linux" "aarch64-linux"] (
16+
1617
system: let
18+
19+
overrides = (builtins.fromTOML (builtins.readFile ./rust-toolchain.toml));
20+
1721
overlays = [(import rust-overlay)];
22+
1823
pkgs = import nixpkgs {
1924
inherit system overlays;
2025
};
@@ -28,29 +33,8 @@
2833
celestia-app = import ./celestia-app.nix { inherit pkgs; };
2934

3035
# monza-aptos
31-
monza-aptos = pkgs.stdenv.mkDerivation {
32-
pname = "monza-aptos";
33-
version = "branch-monza";
34-
35-
src = pkgs.fetchFromGitHub {
36-
owner = "movementlabsxyz";
37-
repo = "aptos-core";
38-
rev = "06443b81f6b8b8742c4aa47eba9e315b5e6502ff";
39-
sha256 = "sha256-iIYGbIh9yPtC6c22+KDi/LgDbxLEMhk4JJMGvweMJ1Q=";
40-
};
41-
42-
installPhase = ''
43-
cp -r . $out
44-
'';
45-
46-
meta = with pkgs.lib; {
47-
description = "Aptos core repository on the monza branch";
48-
homepage = "https://github.com/movementlabsxyz/aptos-core";
49-
license = licenses.asl20;
50-
};
36+
monza-aptos = import ./monza-aptos.nix { inherit pkgs; };
5137

52-
};
53-
5438
# Specific version of toolchain
5539
rust = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
5640

@@ -59,46 +43,37 @@
5943
rustc = rust;
6044
};
6145

62-
runtimeDependencies = with pkgs; [
46+
dependencies = with pkgs; [
47+
llvmPackages.bintools
6348
openssl
49+
openssl.dev
50+
libiconv
51+
pkg-config
6452
process-compose
6553
just
6654
jq
67-
];
68-
69-
70-
buildDependencies = with pkgs; [
71-
libclang.lib
72-
libz
73-
clang
74-
pkg-config
75-
protobuf
76-
rustPlatform.bindgenHook
77-
lld
78-
coreutils
79-
]
80-
++ runtimeDependencies
81-
# Be it Darwin
82-
++ lib.optionals stdenv.isDarwin [
83-
frameworks.Security
84-
frameworks.CoreServices
85-
frameworks.SystemConfiguration
86-
frameworks.AppKit
87-
]
88-
++ lib.optionals stdenv.isLinux [
89-
systemd
90-
];
91-
92-
testingDependencies = with pkgs; [
93-
celestia-node
94-
celestia-app
95-
monza-aptos
96-
]
97-
++ buildDependencies;
98-
99-
developmentDependencies = with pkgs; [
55+
libclang.lib
56+
libz
57+
clang
58+
pkg-config
59+
protobuf
60+
rustPlatform.bindgenHook
61+
lld
62+
coreutils
63+
gcc
10064
rust
101-
] ++ testingDependencies;
65+
celestia-node
66+
celestia-app
67+
monza-aptos
68+
] ++ lib.optionals stdenv.isDarwin [
69+
frameworks.Security
70+
frameworks.CoreServices
71+
frameworks.SystemConfiguration
72+
frameworks.AppKit
73+
] ++ lib.optionals stdenv.isLinux [
74+
udev
75+
systemd
76+
];
10277

10378

10479
in
@@ -109,7 +84,11 @@
10984

11085
# Development Shell
11186
devShells.default = mkShell {
112-
buildInputs = developmentDependencies;
87+
88+
OPENSSL_DEV=pkgs.openssl.dev;
89+
PKG_CONFIG_PATH = "${pkgs.openssl.dev}/lib/pkgconfig";
90+
buildInputs = dependencies;
91+
nativeBuildInputs = dependencies;
11392

11493
shellHook = ''
11594
#!/bin/bash

monza-aptos.nix

+3-5
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,16 @@ pkgs.stdenv.mkDerivation {
88
owner = "movementlabsxyz";
99
repo = "aptos-core";
1010
rev = "06443b81f6b8b8742c4aa47eba9e315b5e6502ff";
11-
sha256 = "sha256-bmFcJrC4ocbCw1pew2HKEdLj6+1D/0VuWtdoTs1S2sU=";
11+
sha256 = "sha256-iIYGbIh9yPtC6c22+KDi/LgDbxLEMhk4JJMGvweMJ1Q=";
1212
};
1313

1414
installPhase = ''
15-
ls -al && sleep 30
16-
mkdir -p $out
17-
cp -r ./* $out/
15+
cp -r . $out
1816
'';
1917

2018
meta = with pkgs.lib; {
2119
description = "Aptos core repository on the monza branch";
2220
homepage = "https://github.com/movementlabsxyz/aptos-core";
2321
license = licenses.asl20;
2422
};
25-
}
23+
}

process-compose/m1-da-light-node/process-compose.sequencer.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ processes:
99
cargo run -p m1-da-light-node --features "sequencer"
1010
depends_on:
1111
m1-da-light-node-verifier-tests:
12-
condition: process_completed
12+
condition: process_completed_successfully
1313
celestia-light-node:
1414
condition: process_healthy
1515
readiness_probe:
@@ -26,4 +26,4 @@ processes:
2626
m1-da-light-node:
2727
condition: process_healthy
2828
m1-da-light-node-verifier-tests:
29-
condition: process_completed
29+
condition: process_completed_successfully

process-compose/m1-da-light-node/process-compose.test.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ processes:
1111
celestia-light-node:
1212
condition: process_healthy
1313
celestia-light-node-synced:
14-
condition: process_completed
14+
condition: process_completed_successfully
1515

1616
readiness_probe:
1717
exec:
@@ -27,7 +27,7 @@ processes:
2727
m1-da-light-node:
2828
condition: process_healthy
2929
m1-da-light-node-verifier-tests:
30-
condition: process_completed
30+
condition: process_completed_successfully
3131
availability:
3232
# NOTE: `restart: exit_on_failure` is not needed since
3333
# exit_on_end implies it.

process-compose/m1-da-light-node/process-compose.yml

+2-3
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,17 @@ processes:
1313

1414
celestia-light-node-synced:
1515
command: |
16-
sleep 10
1716
cargo run --bin wait-for-celestia-light-node
1817
depends_on:
1918
celestia-light-node:
2019
condition: process_healthy
2120

2221
m1-da-light-node:
2322
command: |
24-
cargo run -p m1-da-light-node
23+
./target/debug/m1-da-light-node
2524
depends_on:
2625
m1-da-light-node-verifier-tests:
27-
condition: process_completed
26+
condition: process_completed_successfully
2827
celestia-light-node:
2928
condition: process_healthy
3029
readiness_probe:

process-compose/monza-full-node/process-compose.local.yml

+15-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ processes:
88
command: |
99
./scripts/celestia/celestia-local-appd
1010
readiness_probe:
11+
initial_delay_seconds: 10
12+
exec:
13+
command: echo "true"
14+
liveness_probe:
15+
initial_delay_seconds: 10
1116
exec:
1217
command: echo "true"
1318

@@ -18,6 +23,10 @@ processes:
1823
initial_delay_seconds: 10
1924
exec:
2025
command: echo "true"
26+
liveness_probe:
27+
initial_delay_seconds: 10
28+
exec:
29+
command: echo "true"
2130
depends_on:
2231
celestia-node-appd:
2332
condition: process_healthy
@@ -27,7 +36,12 @@ processes:
2736
sleep 999999999d
2837
echo "started"
2938
readiness_probe:
30-
initial_delay_seconds: 30
39+
initial_delay_seconds: 10
40+
exec:
41+
command: |
42+
echo "true"
43+
liveness_probe:
44+
initial_delay_seconds: 10
3145
exec:
3246
command: |
3347
echo "true"

0 commit comments

Comments
 (0)