Skip to content

Commit

Permalink
fix conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
arnaubennassar committed Oct 25, 2024
2 parents 8f9e656 + ad87a4e commit 7cfb43e
Show file tree
Hide file tree
Showing 232 changed files with 21,896 additions and 4,689 deletions.
89 changes: 89 additions & 0 deletions .github/workflows/arm_deb_packager.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: arm_deb_packager


on:
push:
branches:
- 'main'
paths:
- '**'
tags:
- 'v*.*.*'
- 'v*.*.*-*'

jobs:
build:
permissions:
id-token: write
contents: write
runs-on:
labels: arm-runner-2204
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@master
with:
go-version: 1.22.x
# Variables
- name: Adding TAG to ENV
run: echo "GIT_TAG=`echo $(git describe --tags --abbrev=0)`" >> $GITHUB_ENV
- name: adding version
run: |
NUMERIC_VERSION=$( echo ${{ env.GIT_TAG }} | sed 's/[^0-9.]//g' )
echo "VERSION=$NUMERIC_VERSION" >> $GITHUB_ENV
- name: go mod download
run: go mod download

- name: Build the binary
run: make build

- name: Build the rust binary
run: |
BUILD_SCRIPT_DISABLED=1
cargo build --release --bin cdk
- name: making directory structure
run: mkdir -p packaging/deb/cdk/usr/bin/
- name: copying necessary binary for arm64
run: cp -rp target/cdk-node packaging/deb/cdk/usr/bin/cdk-node
- name: copying rust binary for arm64
run: cp -rp target/release/cdk packaging/deb/cdk/usr/bin/cdk

# Control file creation
- name: Create control file
run: |
echo "Package: cdk" >> packaging/deb/cdk/DEBIAN/control
echo "Version: ${{ env.VERSION }}" >> packaging/deb/cdk/DEBIAN/control
echo "Section: base" >> packaging/deb/cdk/DEBIAN/control
echo "Priority: optional" >> packaging/deb/cdk/DEBIAN/control
echo "Architecture: arm64" >> packaging/deb/cdk/DEBIAN/control
echo "Maintainer: [email protected]" >> packaging/deb/cdk/DEBIAN/control
echo "Description: cdk binary package" >> packaging/deb/cdk/DEBIAN/control
- name: Creating package for binary for cdk ${{ env.ARCH }}
run: cp -rp packaging/deb/cdk packaging/deb/cdk-${{ env.GIT_TAG }}-${{ env.ARCH }}
env:
ARCH: arm64

- name: Running package build
run: dpkg-deb --build --root-owner-group packaging/deb/cdk-${{ env.GIT_TAG }}-${{ env.ARCH }}
env:
ARCH: arm64

- name: create checksum for the arm64 package
run: cd packaging/deb/ && sha256sum cdk-${{ env.GIT_TAG }}-${{ env.ARCH }}.deb > cdk-${{ env.GIT_TAG }}-${{ env.ARCH }}.deb.checksum
env:
ARCH: arm64

- name: Release cdk Packages
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ env.GIT_TAG }}
prerelease: true
files: |
packaging/deb/cdk**.deb
packaging/deb/cdk**.deb.checksum
103 changes: 103 additions & 0 deletions .github/workflows/arm_rpm_packager.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
name: arm_rpm_packager

on:
push:
branches:
- 'main'
paths:
- '**'
tags:
- 'v*.*.*'
- 'v*.*.*-*'

jobs:
build:
permissions:
id-token: write
contents: write
runs-on:
labels: arm-runner-2204
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@master
with:
go-version: 1.22.x
- name: Adding TAG to ENV
run: echo "GIT_TAG=`echo $(git describe --tags --abbrev=0)`" >> $GITHUB_ENV

- name: Adding a TAG.1 to the env
run: echo "GIT_TAG1=`echo $(git describe --tags --abbrev=0)`" | sed 's/-/./g' >> $GITHUB_ENV

- name: Download deps for project
run: go mod download

- name: Building cdk-node for amd64
run: make build

- name: Building the cdk
run: |
BUILD_SCRIPT_DISABLED=1
cargo build --release --bin cdk
- name: Installing some dependencies
run: sudo apt-get update && sudo apt-get install -y rpm

- name: Setup rpm package for binary
run: |
mkdir -p packaging/rpm/SPECS
mkdir -p packaging/rpm/BUILD
mkdir -p packaging/rpm/RPMS
mkdir -p packaging/rpm/SRPMS
touch packaging/rpm/cdk.spec
echo "Name: cdk" >> packaging/rpm/SPECS/cdk.spec
echo "Version: ${{ env.GIT_TAG1 }}" >> packaging/rpm/SPECS/cdk.spec
echo "Release: 1%{?dist}" >> packaging/rpm/SPECS/cdk.spec
echo "License: GPL/AGPL" >> packaging/rpm/SPECS/cdk.spec
echo "BuildArch: aarch64" >> packaging/rpm/SPECS/cdk.spec
echo "Summary: cdk rpm package" >> packaging/rpm/SPECS/cdk.spec
echo "%description" >> packaging/rpm/SPECS/cdk.spec
echo "cdk rpm package" >> packaging/rpm/SPECS/cdk.spec
echo "%pre" >> packaging/rpm/SPECS/cdk.spec
echo "getent group cdk >/dev/null || groupadd -r cdk" >> packaging/rpm/SPECS/cdk.spec
echo "getent passwd cdk >/dev/null || useradd -s /bin/false -d /opt/cdk -r cdk -g cdk" >> packaging/rpm/SPECS/cdk.spec
echo "%install" >> packaging/rpm/SPECS/cdk.spec
echo "mkdir -p %{buildroot}/usr/bin" >> packaging/rpm/SPECS/cdk.spec
echo "cp /home/runner/work/cdk/cdk/target/cdk-node %{buildroot}/usr/bin/cdk-node" >> packaging/rpm/SPECS/cdk.spec
echo "cp /home/runner/work/cdk/cdk/target/release/cdk %{buildroot}/usr/bin/cdk" >> packaging/rpm/SPECS/cdk.spec
echo "%files" >> packaging/rpm/SPECS/cdk.spec
echo "/usr/bin/cdk" >> packaging/rpm/SPECS/cdk.spec
echo "/usr/bin/cdk-node" >> packaging/rpm/SPECS/cdk.spec
- name: Construct rpm package
run: |
rpmbuild --define "_topdir /home/runner/work/cdk/cdk/packaging/rpm_build" \
--define "_builddir %{_topdir}/BUILD" \
--define "_rpmdir %{_topdir}/RPMS" \
--define "_srcrpmdir %{_topdir}/SRPMS" \
--define "__spec_install_post /bin/true" \
-bb packaging/rpm/SPECS/cdk.spec
- name: Rename file for post rpm build and for checksum
run: mv /home/runner/work/cdk/cdk/packaging/rpm_build/RPMS/aarch64/cdk-${{ env.GIT_TAG1 }}-1.aarch64.rpm /home/runner/work/cdk/cdk/packaging/rpm_build/RPMS/aarch64/cdk-${{ env.GIT_TAG1 }}.aarch64.rpm

- name: Checksum for the rpm package
run: sha256sum /home/runner/work/cdk/cdk/packaging/rpm_build/RPMS/aarch64/cdk-${{ env.GIT_TAG1 }}.aarch64.rpm > /home/runner/work/cdk/cdk/packaging/rpm_build/RPMS/aarch64/cdk-${{ env.GIT_TAG1 }}.aarch64.rpm.checksum

- name: Release cdk Packages
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ env.GIT_TAG }}
prerelease: true
files: |
packaging/rpm_build/RPMS/aarch64/cdk-**.rpm
packaging/rpm_build/RPMS/aarch64/cdk-**.rpm.checksum
13 changes: 7 additions & 6 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: 1.21.x
- name: Checkout code
uses: actions/checkout@v3
- name: Lint
run: |
make install-linter
make lint
uses: actions/checkout@v4
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.61
args: --timeout=30m
11 changes: 4 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: Release

on:
push:
tags:
# run only against tags that follow semver (https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string)
- 'v[0-9]+.[0-9]+.[0-9]+*'
push:
tags:
- 'v*.*.*'
- 'v*.*.*-*'

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
Expand Down Expand Up @@ -33,9 +33,6 @@ jobs:
TAGS: ${{ steps.meta.outputs.tags }}
VERSION: ${{ steps.meta.outputs.version }}
steps:
- name: validate tag
run: echo ${{ github.ref_name }} | grep -qE '^v[0-9]+\.[0-9]+\.[0-9]+(-rc\.[0-9]+)?$'

- name: Prepare
run: |
platform=${{ matrix.platform }}
Expand Down
42 changes: 40 additions & 2 deletions .github/workflows/test-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ jobs:
matrix:
go-version: [ 1.22.x ]
goarch: [ "amd64" ]
e2e-group: [ "elderberry-validium", "elderberry-rollup" ]
e2e-group:
- "fork9-validium"
- "fork11-rollup"
- "fork12-validium"
- "fork12-rollup"
runs-on: ubuntu-latest
steps:
- name: Checkout code
Expand All @@ -35,7 +39,7 @@ jobs:
run: |
echo "deb [trusted=yes] https://apt.fury.io/kurtosis-tech/ /" | sudo tee /etc/apt/sources.list.d/kurtosis.list
sudo apt update
sudo apt install kurtosis-cli=0.90.1
sudo apt install kurtosis-cli=1.3.0
kurtosis version
- name: Disable kurtosis analytics
Expand All @@ -48,6 +52,16 @@ jobs:
pip3 install yq
yq --version
- name: Install polycli
run: |
POLYCLI_VERSION="${{ vars.POLYCLI_VERSION }}"
tmp_dir=$(mktemp -d)
curl -L "https://github.com/0xPolygon/polygon-cli/releases/download/${POLYCLI_VERSION}/polycli_${POLYCLI_VERSION}_linux_amd64.tar.gz" | tar -xz -C "$tmp_dir"
mv "$tmp_dir"/* /usr/local/bin/polycli
rm -rf "$tmp_dir"
sudo chmod +x /usr/local/bin/polycli
/usr/local/bin/polycli version
- name: Install foundry
uses: foundry-rs/foundry-toolchain@v1

Expand All @@ -56,9 +70,33 @@ jobs:
with:
repository: 0xPolygon/kurtosis-cdk
path: "kurtosis-cdk"
ref: "v0.2.15"

- name: Setup Bats and bats libs
uses: bats-core/[email protected]

- name: Test
run: make test-e2e-${{ matrix.e2e-group }}
working-directory: test
env:
KURTOSIS_FOLDER: ${{ github.workspace }}/kurtosis-cdk
BATS_LIB_PATH: /usr/lib/

- name: Dump enclave logs
if: failure()
run: kurtosis dump ./dump

- name: Generate archive name
if: failure()
run: |
archive_name="dump_run_with_args_${{matrix.e2e-group}}_${{ github.run_id }}"
echo "ARCHIVE_NAME=${archive_name}" >> "$GITHUB_ENV"
echo "Generated archive name: ${archive_name}"
kurtosis service exec cdk cdk-node-001 'cat /etc/cdk/cdk-node-config.toml' > ./dump/cdk-node-config.toml
- name: Upload logs
if: failure()
uses: actions/upload-artifact@v4
with:
name: ${{ env.ARCHIVE_NAME }}
path: ./dump
15 changes: 11 additions & 4 deletions .github/workflows/test-resequence.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on:
push:
branches:
# Disable test for the moment as it takes too long
- "this-test-is-disabled"
- "test_disabled"


concurrency:
Expand Down Expand Up @@ -34,7 +34,7 @@ jobs:
uses: actions/checkout@v4
with:
repository: 0xPolygon/kurtosis-cdk
ref: 3debe0a4dd000e02f7e6bde3247432211bf0336f
ref: a7a80b7b5d98a69a23415ab0018e556257a6dfb6
path: kurtosis-cdk

- name: Install Kurtosis CDK tools
Expand All @@ -51,7 +51,11 @@ jobs:
- name: Install polycli
run: |
tmp_dir=$(mktemp -d) && curl -L https://github.com/0xPolygon/polygon-cli/releases/download/v0.1.48/polycli_v0.1.48_linux_amd64.tar.gz | tar -xz -C "$tmp_dir" && mv "$tmp_dir"/* /usr/local/bin/polycli && rm -rf "$tmp_dir"
POLYCLI_VERSION="${{ vars.POLYCLI_VERSION }}"
tmp_dir=$(mktemp -d)
curl -L "https://github.com/0xPolygon/polygon-cli/releases/download/${POLYCLI_VERSION}/polycli_${POLYCLI_VERSION}_linux_amd64.tar.gz" | tar -xz -C "$tmp_dir"
mv "$tmp_dir"/* /usr/local/bin/polycli
rm -rf "$tmp_dir"
sudo chmod +x /usr/local/bin/polycli
/usr/local/bin/polycli version
Expand All @@ -68,8 +72,11 @@ jobs:
- name: Configure Kurtosis CDK
working-directory: ./kurtosis-cdk
run: |
/usr/local/bin/yq -i '.args.cdk_erigon_node_image = "jerrycgh/cdk-erigon:d5d04906f723f3f1d8c43c9e6baf3e18c27ff348"' params.yml
/usr/local/bin/yq -i '.args.cdk_node_image = "cdk:local"' params.yml
/usr/local/bin/yq -i '.args.zkevm_rollup_fork_id = "12"' params.yml
/usr/local/bin/yq -i '.args.zkevm_prover_image = "hermeznetwork/zkevm-prover:v8.0.0-RC5-fork.12"' params.yml
/usr/local/bin/yq -i '.args.cdk_erigon_node_image = "jerrycgh/cdk-erigon:d5d04906f723f3f1d8c43c9e6baf3e18c27ff348"' params.yml
- name: Deploy Kurtosis CDK package
working-directory: ./kurtosis-cdk
Expand Down
Loading

0 comments on commit 7cfb43e

Please sign in to comment.