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

CI Fixes #51

Merged
merged 77 commits into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
e9204d2
fix: tidy up ci.
l-monninger May 10, 2024
7e7fb8e
fix: naming.
l-monninger May 10, 2024
96273c8
fix: build before run.
l-monninger May 10, 2024
c58b7a7
fix: gcc is needed.
l-monninger May 10, 2024
ba3dc50
fix: does add LD_LIBRARY_PATH work?
l-monninger May 11, 2024
82bab58
chore: cleanup tempdirs and action triggers.
l-monninger May 11, 2024
35cf243
fix: see if the tui is causing the crash.
l-monninger May 11, 2024
2502adc
fix: sequencer should not be default.
l-monninger May 11, 2024
9c12480
fix: ci playing with readiness probe.
l-monninger May 11, 2024
e38adf9
fix: playing with liveness probe.
l-monninger May 11, 2024
ed7b626
fix: reducing time.
l-monninger May 11, 2024
d02b780
fix: does this solve the problem for ubuntu.
l-monninger May 11, 2024
41dde0a
fix: this scheduling is very weird.
l-monninger May 11, 2024
ff76092
fix: this scheduling is very weird.
l-monninger May 11, 2024
c638162
fix: this scheduling is very weird.
l-monninger May 11, 2024
8356fcc
fix: trying as readiness probe.
l-monninger May 11, 2024
5fdb3ab
fix: trying as readiness probe.
l-monninger May 11, 2024
6a40c95
fix: try removig celestia-light-node from top level.
l-monninger May 11, 2024
e315082
fix: upping nix channel for new version of proces-compose.
l-monninger May 11, 2024
e8f5aad
fix: should check whether process completed successfully.
l-monninger May 11, 2024
b2fe1f7
fix: adding some logging to help figure out what's going wrong.
l-monninger May 11, 2024
191362b
fix: process_succeeded is not valid.
l-monninger May 11, 2024
30b0fda
fix: moving out of readiness check.
l-monninger May 11, 2024
ec7956a
fix: checking if for some reason ubuntu is looking for liveness.
l-monninger May 11, 2024
b9a8a56
fix: reintroducing a sleep before test to see if it helps.
l-monninger May 11, 2024
f56ce78
fix: add openssl to nix flake for some reason x86_64 ubuntu struggles…
l-monninger May 11, 2024
b0236d5
fix: add stricter exit conditions.
l-monninger May 11, 2024
20c9e0a
fix: try dropping ld path.
l-monninger May 12, 2024
8634be7
fix: try dropping ld path.
l-monninger May 12, 2024
ae0ea0b
fix: comabining tests to share build.
l-monninger May 12, 2024
8519922
fix: reintroducing ld path.
l-monninger May 12, 2024
067d366
feat: moving LD_LIBRARY_PATH out.
l-monninger May 12, 2024
bfb34f6
feat: moving LD_LIBRARY_PATH out.
l-monninger May 12, 2024
7c09150
fix: trying with LD_PATH another way.
l-monninger May 12, 2024
1a87d0a
fix: dropping openssl from LD_LIBRARY_PATH.
l-monninger May 12, 2024
781b8b3
fix: trying openssl path.
l-monninger May 12, 2024
d32972f
fix: try withnout pkgconfig.
l-monninger May 12, 2024
7b4afc9
fix: trying with OPENSSL_DEV set.
l-monninger May 12, 2024
f2cd03b
fix: try openssl_1_1
l-monninger May 12, 2024
c71e303
fix: seeing if environment.variables makes a difference.
l-monninger May 12, 2024
26300d5
fix: try with native build inputs.
l-monninger May 12, 2024
5d94214
fix: stricter availability.
l-monninger May 12, 2024
9d6cde3
fix: reverting to older nix pacakges.
l-monninger May 12, 2024
9827e1f
fix: revert.
l-monninger May 12, 2024
ea55c16
fix: explicit udev.
l-monninger May 12, 2024
b2fde5a
fix: try dropping LIB_PATH manual set.
l-monninger May 12, 2024
9d85992
fix: typos.
l-monninger May 12, 2024
0748d2b
fix: trying dropping pkg config.
l-monninger May 12, 2024
818eff6
fix: trying with full overlay.
l-monninger May 12, 2024
d1fd29a
fix: adding exit on failure back in.
l-monninger May 12, 2024
795f95a
fix: simplify.
l-monninger May 12, 2024
8c37556
fix: simplify again.
l-monninger May 12, 2024
21470d9
fix: simplifying differently.
l-monninger May 12, 2024
5f9ea53
fix: silencing noisy output for debugging.
l-monninger May 12, 2024
f0daca2
fix: supressing output for easier debugging.
l-monninger May 12, 2024
2aec054
fix: trying working config.
l-monninger May 12, 2024
96c583f
fix: trying working config.
l-monninger May 12, 2024
f17eea7
fix: clean up flake.
l-monninger May 12, 2024
72504a5
fix: manual patch of libssl-dev.
l-monninger May 12, 2024
02d5ad8
fix: tagging with additional comments for collaboration.
l-monninger May 12, 2024
7cf6eeb
fix: should be working.
l-monninger May 12, 2024
a149b0b
enhancement: drop unneeded libssl-dev install in shell hook.
l-monninger May 12, 2024
86284a8
fix: something suspicious is going on with the monza-aptos derivation.
l-monninger May 12, 2024
4297dd3
fix: try monza derivation.
l-monninger May 12, 2024
1218d30
chore: collapse into one workflow.
l-monninger May 12, 2024
f13c370
fix: monza-aptos.nix resolves incorrectly with different nix sha-256 …
l-monninger May 12, 2024
ff019f2
fix: adding garbage collect step.
l-monninger May 12, 2024
577e12f
fix: drop garbage collection, we'll worry about that later.
l-monninger May 12, 2024
197302d
fix: see how this does with a matrix.
l-monninger May 12, 2024
5151c12
fix: need to add x86_64 darwin to the flake.
l-monninger May 12, 2024
75fcf44
feat: upgrading to bigger runner on buildjet.
l-monninger May 12, 2024
32ce18b
fix: seems like buildjet might not be able to find a runner.
l-monninger May 12, 2024
0134626
fix: for some reason x86_64 darwin behaves poorly.
l-monninger May 12, 2024
a0fa919
Merge branch 'main' into l-monninger/ci-fix
l-monninger May 13, 2024
d90877f
fix: cleanup.
l-monninger May 13, 2024
afdf16b
Merge branch 'l-monninger/ci-fix' of https://github.com/movementlabsx…
l-monninger May 13, 2024
a3be398
fix: cleanup and drop infra hook from this branch.
l-monninger May 13, 2024
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
34 changes: 34 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Checks

on:
push:

jobs:
build:
strategy:
matrix:
include:
- os: ubuntu-22.04
arch: x86_64
runs-on: movement-runner
- os: macos-13-latest
arch: arm64
runs-on: macos-13-xlarge

runs-on: ${{ matrix.runs-on }}

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main

- name: Run test in nix environment
run: nix develop --command bash -c "cargo check"

- name: Run test in nix environment
run: nix develop --command bash -c "just m1-da-light-node test.local -t=false"

- name: Run test in nix environment
run: nix develop --command bash -c "just monza-full-node test.local -t=false"
63 changes: 1 addition & 62 deletions .github/workflows/handle-target-comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,65 +14,4 @@ jobs:
steps:
- name: Output the comment
run: |
echo "Comment was: ${{ github.event.inputs.comment }}"

manage-infra-pr:
if: startsWith(github.event.inputs.comment, 'infra')
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Extract repository name
id: repo-name
run: echo "REPO_NAME=$(echo ${{ github.repository }} | cut -d '/' -f2)" >> $GITHUB_ENV

- name: Search for existing PRs
id: search-prs
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const title = `${process.env.REPO_NAME}/${{ github.event.issue.title }}`;
const prs = await github.rest.pulls.list({
owner: 'movementlabsxyz',
repo: 'infra',
state: 'open',
head: 'main'
});
const existingPr = prs.data.find(pr => pr.title === title);
if (existingPr) {
return existingPr.html_url;
}
return '';

- name: Create PR in Infra Repo if not exist
if: steps.search-prs.outputs.result == ''
run: |
gh_pr_up() { gh pr create $* || gh pr edit $* }
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"

- name: Comment on the Original PR with new PR link
if: steps.search-prs.outputs.result == ''
uses: peter-evans/create-or-update-comment@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
issue_number: ${{ github.event.issue.number }}
body: ${{ steps.create-pr.outputs.pr_url }}

- name: Comment on Original PR with PR link if PR already exists
if: steps.search-prs.outputs.result != ''
uses: peter-evans/create-or-update-comment@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
issue_number: ${{ github.event.issue.number }}
body: "A related PR already exists and you can follow it here: ${{ steps.search-prs.outputs.result }}"

- name: Comment on the Infra PR if created
if: steps.search-prs.outputs.result == ''
uses: peter-evans/create-or-update-comment@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
repository: "movementlabsxyz/infra"
issue_number: ${{ steps.create-pr.outputs.pr_number }}
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 }}"
echo "Comment was: ${{ github.event.inputs.comment }}"
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ target/
ledger_db/
state_merkle_db/
.etc
idea
.movement
.movement
.idea
1 change: 0 additions & 1 deletion Cargo.lock

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

8 changes: 4 additions & 4 deletions flake.lock

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

99 changes: 39 additions & 60 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/6143fc5eeb9c4f00163267708e26191d1e918932";
nixpkgs.url = "github:NixOS/nixpkgs/f1010e0469db743d14519a1efd37e23f8513d714";
rust-overlay.url = "github:oxalica/rust-overlay";
flake-utils.url = "github:numtide/flake-utils";
};
Expand All @@ -12,9 +12,14 @@
flake-utils,
...
}:
flake-utils.lib.eachSystem ["aarch64-darwin" "x86_64-linux" "aarch64-linux"] (
flake-utils.lib.eachSystem ["aarch64-darwin" "x86_64-darwin" "x86_64-linux" "aarch64-linux"] (

system: let

overrides = (builtins.fromTOML (builtins.readFile ./rust-toolchain.toml));

overlays = [(import rust-overlay)];

pkgs = import nixpkgs {
inherit system overlays;
};
Expand All @@ -28,29 +33,8 @@
celestia-app = import ./celestia-app.nix { inherit pkgs; };

# monza-aptos
monza-aptos = pkgs.stdenv.mkDerivation {
pname = "monza-aptos";
version = "branch-monza";

src = pkgs.fetchFromGitHub {
owner = "movementlabsxyz";
repo = "aptos-core";
rev = "06443b81f6b8b8742c4aa47eba9e315b5e6502ff";
sha256 = "sha256-iIYGbIh9yPtC6c22+KDi/LgDbxLEMhk4JJMGvweMJ1Q=";
};

installPhase = ''
cp -r . $out
'';

meta = with pkgs.lib; {
description = "Aptos core repository on the monza branch";
homepage = "https://github.com/movementlabsxyz/aptos-core";
license = licenses.asl20;
};
monza-aptos = import ./monza-aptos.nix { inherit pkgs; };

};

# Specific version of toolchain
rust = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;

Expand All @@ -59,46 +43,37 @@
rustc = rust;
};

runtimeDependencies = with pkgs; [
dependencies = with pkgs; [
llvmPackages.bintools
openssl
openssl.dev
libiconv
pkg-config
process-compose
just
jq
];


buildDependencies = with pkgs; [
libclang.lib
libz
clang
pkg-config
protobuf
rustPlatform.bindgenHook
lld
coreutils
]
++ runtimeDependencies
# Be it Darwin
++ lib.optionals stdenv.isDarwin [
frameworks.Security
frameworks.CoreServices
frameworks.SystemConfiguration
frameworks.AppKit
]
++ lib.optionals stdenv.isLinux [
systemd
];

testingDependencies = with pkgs; [
celestia-node
celestia-app
monza-aptos
]
++ buildDependencies;

developmentDependencies = with pkgs; [
libclang.lib
libz
clang
pkg-config
protobuf
rustPlatform.bindgenHook
lld
coreutils
gcc
rust
] ++ testingDependencies;
celestia-node
celestia-app
monza-aptos
] ++ lib.optionals stdenv.isDarwin [
frameworks.Security
frameworks.CoreServices
frameworks.SystemConfiguration
frameworks.AppKit
] ++ lib.optionals stdenv.isLinux [
udev
systemd
];


in
Expand All @@ -109,7 +84,11 @@

# Development Shell
devShells.default = mkShell {
buildInputs = developmentDependencies;

OPENSSL_DEV=pkgs.openssl.dev;
PKG_CONFIG_PATH = "${pkgs.openssl.dev}/lib/pkgconfig";
buildInputs = dependencies;
nativeBuildInputs = dependencies;

shellHook = ''
#!/bin/bash
Expand Down
8 changes: 3 additions & 5 deletions monza-aptos.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,16 @@ pkgs.stdenv.mkDerivation {
owner = "movementlabsxyz";
repo = "aptos-core";
rev = "06443b81f6b8b8742c4aa47eba9e315b5e6502ff";
sha256 = "sha256-bmFcJrC4ocbCw1pew2HKEdLj6+1D/0VuWtdoTs1S2sU=";
sha256 = "sha256-iIYGbIh9yPtC6c22+KDi/LgDbxLEMhk4JJMGvweMJ1Q=";
};

installPhase = ''
ls -al && sleep 30
mkdir -p $out
cp -r ./* $out/
cp -r . $out
'';

meta = with pkgs.lib; {
description = "Aptos core repository on the monza branch";
homepage = "https://github.com/movementlabsxyz/aptos-core";
license = licenses.asl20;
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ processes:
cargo run -p m1-da-light-node --features "sequencer"
depends_on:
m1-da-light-node-verifier-tests:
condition: process_completed
condition: process_completed_successfully
celestia-light-node:
condition: process_healthy
readiness_probe:
Expand All @@ -26,4 +26,4 @@ processes:
m1-da-light-node:
condition: process_healthy
m1-da-light-node-verifier-tests:
condition: process_completed
condition: process_completed_successfully
4 changes: 2 additions & 2 deletions process-compose/m1-da-light-node/process-compose.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ processes:
celestia-light-node:
condition: process_healthy
celestia-light-node-synced:
condition: process_completed
condition: process_completed_successfully

readiness_probe:
exec:
Expand All @@ -27,7 +27,7 @@ processes:
m1-da-light-node:
condition: process_healthy
m1-da-light-node-verifier-tests:
condition: process_completed
condition: process_completed_successfully
availability:
# NOTE: `restart: exit_on_failure` is not needed since
# exit_on_end implies it.
Expand Down
5 changes: 2 additions & 3 deletions process-compose/m1-da-light-node/process-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,17 @@ processes:

celestia-light-node-synced:
command: |
sleep 10
cargo run --bin wait-for-celestia-light-node
depends_on:
celestia-light-node:
condition: process_healthy

m1-da-light-node:
command: |
cargo run -p m1-da-light-node
./target/debug/m1-da-light-node
depends_on:
m1-da-light-node-verifier-tests:
condition: process_completed
condition: process_completed_successfully
celestia-light-node:
condition: process_healthy
readiness_probe:
Expand Down
16 changes: 15 additions & 1 deletion process-compose/monza-full-node/process-compose.local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ processes:
command: |
./scripts/celestia/celestia-local-appd
readiness_probe:
initial_delay_seconds: 10
exec:
command: echo "true"
liveness_probe:
initial_delay_seconds: 10
exec:
command: echo "true"

Expand All @@ -18,6 +23,10 @@ processes:
initial_delay_seconds: 10
exec:
command: echo "true"
liveness_probe:
initial_delay_seconds: 10
exec:
command: echo "true"
depends_on:
celestia-node-appd:
condition: process_healthy
Expand All @@ -27,7 +36,12 @@ processes:
sleep 999999999d
echo "started"
readiness_probe:
initial_delay_seconds: 30
initial_delay_seconds: 10
exec:
command: |
echo "true"
liveness_probe:
initial_delay_seconds: 10
exec:
command: |
echo "true"
Expand Down
Loading
Loading