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

use pkg-builder to build packages #56

Merged
merged 121 commits into from
May 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
121 commits
Select commit Hold shift + click to select a range
321e433
feat: start integrating pkg-builder into eth-nodes
eenagy Apr 16, 2024
2108685
chore: github ci
eenagy Apr 16, 2024
588129c
chore: add pull_request to yml
eenagy Apr 16, 2024
921a843
chore: add cmd to path
eenagy Apr 16, 2024
ddc07ee
chore: github ci
eenagy Apr 16, 2024
0aa7a47
feat: add other client package ci
eenagy Apr 17, 2024
6bb3f93
chore: reuse one workflow
eenagy Apr 17, 2024
13adf8b
test: remove versions
eenagy Apr 17, 2024
8316fb1
test: use correct name for workflow parameters
eenagy Apr 17, 2024
4375e37
test: remove labeler
eenagy Apr 17, 2024
da75afa
chore: use in-development mode version of pkg-builder
eenagy Apr 17, 2024
b5e557a
chore: remove no_hash
eenagy Apr 17, 2024
e399cf1
test: fix for checkout
eenagy Apr 17, 2024
3d6ef68
test: use local path
eenagy Apr 17, 2024
c2a276c
test: create dir
eenagy Apr 17, 2024
b7c6b75
feat: merge all workflows on github ci into one workflow
eenagy Apr 17, 2024
e339945
feat: provide tarball_hash for all packages
eenagy Apr 17, 2024
efc2eb1
test: see work directory on github
eenagy Apr 17, 2024
29a0b73
test: use absolute path on ci
eenagy Apr 17, 2024
7f0239c
fix: names and versions in packaging.yml
eenagy Apr 17, 2024
c67d3fd
fix: update package inputs
eenagy Apr 17, 2024
406c951
fix: remove old rules & update java url
eenagy Apr 17, 2024
0eb9ac9
feat: add gradle to teku
eenagy Apr 17, 2024
d065893
feat: eth-node-teku packaging is working without autopkgtest, piupart…
eenagy Apr 18, 2024
8fadee8
feat: eth-node-prysm packaging is working without autopkgtest, piupar…
eenagy Apr 18, 2024
54f5ecb
fix: eth-node-teku deps and add tests
eenagy Apr 18, 2024
f1fbe46
feat: eth-node-besu packaging is working without autopkgtest, piupart…
eenagy Apr 18, 2024
c7d3d88
feat: eth-node-geth packaging is working without autopkgtest, piupart…
eenagy Apr 18, 2024
22038a7
feat: eth-node-lighthouse changes
eenagy Apr 18, 2024
7c9d6ae
fix: disable lighthouse tests as because docker setup inside chroot i…
eenagy Apr 18, 2024
67bd0af
fix: actually disable tests
eenagy Apr 18, 2024
21cc0fa
feat: add eth-node-lodestar with tests disabled
eenagy Apr 18, 2024
ba85142
feat: add eth-node-nethermind with failing tests
eenagy Apr 18, 2024
be98046
chore: simplify changelog + remove unneded rule for debian/rules
eenagy Apr 18, 2024
c81dfd6
chore: disable docker, not working
eenagy Apr 19, 2024
f49b34f
feat: work on nimbus-eth2 client, still not works, but at least sourc…
eenagy Apr 22, 2024
d90945d
fix: wrong build depends name
eenagy Apr 22, 2024
bcce137
feat: nimbus builds
eenagy Apr 22, 2024
0684894
fix: disable dwz optimization, seems it was wrongly commented out
eenagy Apr 23, 2024
d7d62a8
chore: save nim progress, install file is missing
eenagy Apr 23, 2024
f3d06b2
fix: geth dwz optimization
eenagy Apr 23, 2024
ac68d49
chore: reenable all tests, even if they fail
eenagy Apr 23, 2024
4947d94
chore: enable lintian for all clients
eenagy Apr 23, 2024
07c8fd1
feat: remove autoinstall
eenagy Apr 23, 2024
ceabfeb
chore: enable piuparts as well
eenagy Apr 23, 2024
62d7a07
feat: add copyright files, still needs to be checked
eenagy Apr 23, 2024
f003fbc
fix: lintian for geth, erigon and disable nimbus-eth
eenagy Apr 23, 2024
0903e03
fix: move the source overrides to the right place
eenagy Apr 23, 2024
3a56eb8
fix: remove duplicated copyright pattern
eenagy Apr 23, 2024
2d97cc0
chore: change distribution, geth lintian fix
eenagy Apr 23, 2024
b31a50e
chore: remove unneded files
eenagy Apr 24, 2024
1fef37b
fix: lintian and tests
eenagy Apr 24, 2024
86d6d6d
chore: update geth summary
eenagy Apr 24, 2024
ebdb634
feat: lintian fix for lighthouse
eenagy Apr 24, 2024
bc70571
feat: nethermind lintian, disable tests
eenagy Apr 24, 2024
1d9e2a1
chore: remove copyright
eenagy Apr 24, 2024
7e55e6a
chore: change /usr/share to /usr/lib
eenagy Apr 24, 2024
f581133
chore: enable piuparts
eenagy Apr 24, 2024
32a47b7
chore: add fail-fast to tests
eenagy Apr 24, 2024
58861ff
chore: add test, just to make sure they run
eenagy Apr 24, 2024
ed7b19f
fix: lintian messages for nimbus
eenagy Apr 24, 2024
bffad1a
chore: modify maintainer email
eenagy Apr 24, 2024
d8e58b5
chore: update changelog to today, more correct date
eenagy Apr 24, 2024
8d0c935
feat: run piuparts as seperate step
eenagy Apr 25, 2024
f90faf5
fix: pkg-builder location
eenagy Apr 25, 2024
8d59433
test: pkg-builder-deps.yml
eenagy Apr 25, 2024
a57b80d
fix: remove sudo, try to run through inside
eenagy Apr 25, 2024
335a90c
fix: location of pkgbuilder
eenagy Apr 25, 2024
2a34136
fix: nimbus lintian, and copright notices
eenagy Apr 25, 2024
7436486
chore: wrong month for release date
eenagy Apr 25, 2024
985f2aa
feat: enable autopkgtest for clients, some will fail as of now
eenagy Apr 27, 2024
9e5f6bf
chore: move around dependency, as github actions did not seem to inst…
eenagy Apr 27, 2024
64f4649
chore: disable tests and add lintian as step
eenagy Apr 27, 2024
bf4696f
chore: github actions and qemu install keeps failing
eenagy Apr 27, 2024
bb08a25
fix: geth installs missing
eenagy Apr 27, 2024
a0d4bfb
fix: sudo: a terminal is required to read the password
eenagy Apr 27, 2024
d2fdcb2
fix: github actions Could not access KVM kernel module: Permission de…
eenagy Apr 27, 2024
ccc5db0
feat: add provides and suggests fields
eenagy Apr 27, 2024
179bf07
chore: copy pkgbuilder dir under root
eenagy Apr 27, 2024
9d8eed6
feat: testbeds update for some of the clients
eenagy Apr 27, 2024
3160839
feat: other client with proper testbeds
eenagy Apr 27, 2024
dff0c38
feat: testbed for lodestar
eenagy Apr 27, 2024
004248e
chore: instead of toml reported as scheme
eenagy Apr 27, 2024
870b064
feat: check against built versions, if version returned is correct
eenagy Apr 29, 2024
a6c45ae
chore: input output on autopkgtest
eenagy Apr 30, 2024
bf3ef30
chore: directory structure
eenagy Apr 30, 2024
67bcc8a
chore: pin cmake dependency with lighthouse
eenagy Apr 30, 2024
a92558c
feat: update autopkgtests
eenagy Apr 30, 2024
1d2bcaa
feat: add verify task
eenagy Apr 30, 2024
bb414bd
chore: ci
eenagy Apr 30, 2024
6f94ca5
chore: add besu hash
eenagy Apr 30, 2024
c389555
chore: add local hashes to verify against for each client
eenagy Apr 30, 2024
e64593c
chore: rename verify to actualy verify
eenagy Apr 30, 2024
853265f
feat: prysm hash update
eenagy Apr 30, 2024
3ea59fc
feat: reproducible lodestar
eenagy May 1, 2024
fcf4a8a
feat: reproducible nethermind
eenagy May 1, 2024
9b1763a
feat: maybe lighthouse is also reproducible
eenagy May 1, 2024
69c2fd0
feat: lighthouse reproducible builds
eenagy May 1, 2024
6f2a4b9
feat: nimbus-eth2 verify
eenagy May 2, 2024
51f2ce6
feat: reenable tests for some clients
eenagy May 2, 2024
1103453
chore: update nimbus hash
eenagy May 2, 2024
ac9e25a
chore: update hashes
eenagy May 2, 2024
3a18f12
fix: lodestar as tests broke the reproducibility
eenagy May 2, 2024
8ae48ed
chore: modify workflow to save artifacts to investigate diff
eenagy May 2, 2024
6eb8bac
chore: see where the packages get created
eenagy May 2, 2024
f3e57e6
fix: artifacts dir path
eenagy May 2, 2024
5edceac
fix: remove colons for artifacts upload
eenagy May 2, 2024
7f7edcd
chore: change upload artificat place
eenagy May 2, 2024
0c29486
fix: omit unneded dirs from tar
eenagy May 2, 2024
1d8df21
fix: some of the nimbus hashes, after adding git-lfs to pkg-builder
eenagy May 2, 2024
2b13cb9
fix: copy
eenagy May 2, 2024
b367f33
fix: lintian after art upload
eenagy May 2, 2024
1bb3b2c
chore: upload artifacts to know why nimbus deb is different
eenagy May 2, 2024
5b69a42
chore: try cflags on ci
eenagy May 3, 2024
d5613ca
chore: try using nim flags
eenagy May 3, 2024
34ca23f
chore: local built nimbus with provided flags
eenagy May 3, 2024
eef2ab3
chore: local built nimbus with provided flags
eenagy May 3, 2024
9920c9d
chore: modified flags
eenagy May 3, 2024
cfb06a4
feat: full nimbus build without tests enabled
eenagy May 3, 2024
05a148e
feat: nimbus full build with tests
eenagy May 3, 2024
a47aee9
chore: full build
eenagy May 3, 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
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.sss linguist-language=toml
*.sps linguist-language=toml
129 changes: 129 additions & 0 deletions .github/workflows/debian-12-packaging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
name: Debian 12 packaging

on:
push:
branches:
- main
pull_request:
branches:
- main
paths:
- 'debian-12/**'

jobs:

eth-node-besu:
strategy:
matrix:
package-name: ["eth-node-besu"]
package-version-with-revision: ["23.10.1-1"]
codename: ["debian-12"]
fail-fast: false
uses: ./.github/workflows/pkgbuilder-deps.yml
with:
package-name: ${{ matrix.package-name }}
package-version-with-revision: ${{ matrix.package-version-with-revision }}
codename: ${{ matrix.codename }}

eth-node-erigon:
strategy:
matrix:
package-name: ["eth-node-erigon"]
package-version-with-revision: ["2.53.2-1"]
codename: ["debian-12"]
fail-fast: false
uses: ./.github/workflows/pkgbuilder-deps.yml
with:
package-name: ${{ matrix.package-name }}
package-version-with-revision: ${{ matrix.package-version-with-revision }}
codename: ${{ matrix.codename }}

eth-node-geth:
strategy:
matrix:
package-name: ["eth-node-geth"]
package-version-with-revision: ["1.13.4-1"]
codename: ["debian-12"]
fail-fast: false
uses: ./.github/workflows/pkgbuilder-deps.yml
with:
package-name: ${{ matrix.package-name }}
package-version-with-revision: ${{ matrix.package-version-with-revision }}
codename: ${{ matrix.codename }}

eth-node-lighthouse:
strategy:
matrix:
package-name: ["eth-node-lighthouse"]
package-version-with-revision: ["4.5.0-1"]
codename: ["debian-12"]
uses: ./.github/workflows/pkgbuilder-deps.yml
with:
package-name: ${{ matrix.package-name }}
package-version-with-revision: ${{ matrix.package-version-with-revision }}
codename: ${{ matrix.codename }}

eth-node-lodestar:
strategy:
matrix:
package-name: ["eth-node-lodestar"]
package-version-with-revision: ["1.11.3-1"]
codename: ["debian-12"]
fail-fast: false
uses: ./.github/workflows/pkgbuilder-deps.yml
with:
package-name: ${{ matrix.package-name }}
package-version-with-revision: ${{ matrix.package-version-with-revision }}
codename: ${{ matrix.codename }}

eth-node-nethermind:
strategy:
matrix:
package-name: ["eth-node-nethermind"]
package-version-with-revision: ["1.21.1-1"]
codename: ["debian-12"]
fail-fast: false
uses: ./.github/workflows/pkgbuilder-deps.yml
with:
package-name: ${{ matrix.package-name }}
package-version-with-revision: ${{ matrix.package-version-with-revision }}
codename: ${{ matrix.codename }}

eth-node-nimbus-eth2:
strategy:
matrix:
package-name: ["eth-node-nimbus-eth2"]
package-version-with-revision: ["24.3.0-1"]
codename: ["debian-12"]
fail-fast: false
uses: ./.github/workflows/pkgbuilder-deps.yml
with:
package-name: ${{ matrix.package-name }}
package-version-with-revision: ${{ matrix.package-version-with-revision }}
codename: ${{ matrix.codename }}

eth-node-prysm:
strategy:
matrix:
package-name: ["eth-node-prysm"]
package-version-with-revision: ["4.1.1-1"]
codename: ["debian-12"]
fail-fast: false
uses: ./.github/workflows/pkgbuilder-deps.yml
with:
package-name: ${{ matrix.package-name }}
package-version-with-revision: ${{ matrix.package-version-with-revision }}
codename: ${{ matrix.codename }}

eth-node-teku:
strategy:
matrix:
package-name: ["eth-node-teku"]
package-version-with-revision: ["23.10.0-1"]
codename: ["debian-12"]
fail-fast: false
uses: ./.github/workflows/pkgbuilder-deps.yml
with:
package-name: ${{ matrix.package-name }}
package-version-with-revision: ${{ matrix.package-version-with-revision }}
codename: ${{ matrix.codename }}
126 changes: 126 additions & 0 deletions .github/workflows/pkgbuilder-deps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
name: pkbuilder-deps

on:
workflow_call:
inputs:
package-name:
required: true
type: string
package-version-with-revision:
required: true
type: string
codename:
required: true
type: string

jobs:
package:
runs-on: ubuntu-latest
steps:
- name: Sbuild setup
run: |
sudo apt-get update
# Note this is an older version of sbuild, no need to patch it, yet
sudo apt install -y debhelper schroot ubuntu-dev-tools piuparts
sudo apt-get -y install pkg-config libssl-dev uidmap
sudo apt-get install -y libfilesys-df-perl libmime-lite-perl
sudo apt-get install -y autopkgtest vmdb2 qemu-system-x86
wget -q https://github.com/eth-pkg/sbuild-ubuntu/releases/download/0.85-6-1/sbuild_0.85.6_all.deb
wget -q https://github.com/eth-pkg/sbuild-ubuntu/releases/download/0.85-6-1/libsbuild-perl_0.85.6_all.deb
sudo dpkg -i sbuild_0.85.6_all.deb libsbuild-perl_0.85.6_all.deb || true


# - name: pkg-builder
# run: |
# wget -q https://github.com/eth-pkg/pkg-builder/releases/download/v0.1/pkg-builder
# wget -q https://github.com/eth-pkg/pkg-builder/releases/download/v0.1/debcrafter
# mkdir -p ${HOME}/.local/bin
# mv pkg-builder ${HOME}/.local/bin
# mv debcrafter ${HOME}/.local/bin
# chmod +x ${HOME}/.local/bin/pkg-builder
# chmod +x ${HOME}/.local/bin/debcrafter
# echo "${HOME}/.local/bin" >> $GITHUB_PATH

- name: Checkout dependency repository
uses: actions/checkout@v4
with:
repository: eenagy/pkg-builder
ref: main
path: pkg-builder

- name: Install pkg-builder
run: |
cd pkg-builder
cargo build --release
mkdir -p ${HOME}/.local/bin
mv target/release/pkg-builder ${HOME}/.local/bin
chmod +x ${HOME}/.local/bin/pkg-builder
echo "${HOME}/.local/bin" >> $GITHUB_PATH
cd .. && rm -rf pkg-builder

- name: Install debcrafter
run: |
wget -q https://github.com/eth-pkg/pkg-builder/releases/download/v0.1/debcrafter
mkdir -p ${HOME}/.local/bin
mv debcrafter ${HOME}/.local/bin
chmod +x ${HOME}/.local/bin/debcrafter
echo "${HOME}/.local/bin" >> $GITHUB_PATH

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

- name: Create chroot env
run: |
pkg-builder env create ${{ inputs.codename }}/x86_64/${{inputs.package-name}}/${{ inputs.package-version-with-revision }}/pkg-builder.toml
echo "${HOME}/.cache/sbuild/bookworm-amd64.tar.gz" >> $GITHUB_PATH

- name: package
run: |
pkg-builder package --run-piuparts false --run-autopkgtests false --run-lintian false ${{ inputs.codename }}/x86_64/${{inputs.package-name}}/${{ inputs.package-version-with-revision }}/pkg-builder.toml


- name: lintian
run: pkg-builder lintian ${{ inputs.codename }}/x86_64/${{inputs.package-name}}/${{ inputs.package-version-with-revision }}/pkg-builder.toml


- name: piuparts
run: |
# Install debian-archive-keyring but fails, as it is already installed
# sudo apt-get install -y debian-archive-keyring
${HOME}/.local/bin/pkg-builder piuparts ${{ inputs.codename }}/x86_64/${{inputs.package-name}}/${{ inputs.package-version-with-revision }}/pkg-builder.toml

- name: autopkgtests
run: |
# Copy files under root
sudo cp -R ${HOME}/.pkg-builder /root
sudo ${HOME}/.local/bin/pkg-builder autopkgtest ${{ inputs.codename }}/x86_64/${{inputs.package-name}}/${{ inputs.package-version-with-revision }}/pkg-builder.toml

- name: verify
run: |
${HOME}/.local/bin/pkg-builder verify --config-file ${{ inputs.codename }}/x86_64/${{inputs.package-name}}/${{ inputs.package-version-with-revision }}/pkg-builder.toml --verify-config-file ${{ inputs.codename }}/x86_64/${{inputs.package-name}}/${{ inputs.package-version-with-revision }}/pkg-builder-verify.toml --no-package true # do not need to repackage it, as we run it multiple times on CI, and hashes should come from locally built sources

- name: upload cleanup
run: |
version=$(echo ${{inputs.package-version-with-revision}} | cut -d'-' -f1)
rm -rf /home/runner/.pkg-builder/packages/${{inputs.package-name}}/${{inputs.package-name}}-$version
rm -rf /home/runner/.pkg-builder/packages/${{inputs.package-name}}/${{inputs.package-name}}
# copy pkg-builder configs to artifacts
cp ${{ inputs.codename }}/x86_64/${{inputs.package-name}}/${{ inputs.package-version-with-revision }}/pkg-builder.toml /home/runner/.pkg-builder/packages/${{inputs.package-name}}
cp ${{ inputs.codename }}/x86_64/${{inputs.package-name}}/${{ inputs.package-version-with-revision }}/pkg-builder-verify.toml /home/runner/.pkg-builder/packages/${{inputs.package-name}}
cd /home/runner/.pkg-builder/packages/${{inputs.package-name}}
rm *:*
rm *dbgsym* || true # possible there is none


# This should come after verify, but sometimes it is good to have it, to check why the verify fails
- name: Save results
uses: actions/upload-artifact@v4
with:
name: ${{inputs.package-name}}-${{ inputs.codename }}-${{ inputs.package-version-with-revision }}
path: /home/runner/.pkg-builder/packages/${{inputs.package-name}}






66 changes: 29 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,52 +1,44 @@
# Ethereum Node Packaging
## Ethereum Node Packaging

This project is designed to simplify the process of packaging different Ethereum nodes for Debian-based systems. It provides a structured way to create Debian packages for multiple Ethereum clients.
This initiative streamlines the process of packaging diverse Ethereum nodes for Debian-based systems. It offers a systematic approach to generate Debian packages for various Ethereum clients.

## Usage
### Usage

### Build debian packages
#### Prerequisites

#### Create sbuild env
Begin by installing `pkg-builder`. Refer to the README for installation instructions: [https://github.com/eth-pkg/pkg-builder](https://github.com/eth-pkg/pkg-builder)

Sbuild env
```bash
bash build-systems/v1/create-chroot-no-deps.sh bookworm amd64
```
Sbuild env for java/besu
```bash
bash build-systems/v1/create-chroot-oracle-jdk.sh bookworm amd64
```
#### Building Debian Packages

Sbuild env for dotnet/nethermind
```bash
bash build-systems/v1/create-chroot-dotnet.sh bookworm amd64
```
**Building Debian Packages**:

Sbuild env for node.js/lodestar
```bash
bash build-systems/v1/create-chroot-node.sh bookworm amd64
# Change into the directoy which you want to package
cd debian-12/x86_64/eth-node-nimbus-eth2/24.3.0-1
# Create an environment once for each distribution/architecture pairing
pkg-builder env create pkg-builder-verify.toml

# This command installs dependencies, downloads source code, builds the client, and conducts tests against it
# Note: Autopkgtests and piuparts may require elevated permissions
pkg-builder package pkg-builder.toml

# To verify a successful build without running tests, you can use this command
pkg-builder verify --config-file pkg-builder.toml --verfiy-config-file pkg-builder-verify.toml
```

Sbuild env for lighthouse/docker
If you're not building but simply ensuring the built client matches a specific hash:

```bash
bash build-systems/v1/create-chroot-docker.sh bookworm amd64
```
debian-12/x86_64/eth-node-nimbus-eth2/24.3.0-1
# Create an environment once for each distribution/architecture pairing
pkg-builder env create pkg-builder-verify.toml

**Build the Debian Packages**: Build Debian packages for each client using the generated variables.
```bash
make build PACKAGE=eth-node VERSION=0.1-1
make build PACKAGE=eth-node-besu VERSION=23.10.1-1
make build PACKAGE=eth-node-erigon VERSION=2.53.2-1
make build PACKAGE=eth-node-geth VERSION=1.13.4-1
make build PACKAGE=eth-node-lighthouse VERSION=4.5.0-1
make build PACKAGE=eth-node-lodestar VERSION=1.11.3-1
make build PACKAGE=eth-node-nethermind VERSION=1.21.1-1
make build PACKAGE=eth-node-nimbus-eth2 VERSION=23.10.0-1
make build PACKAGE=eth-node-prysm VERSION=4.1.1-1
make build PACKAGE=eth-node-service VERSION=0.1-1
make build PACKAGE=eth-node-teku VERSION=23.10.0-1
# Verify the successful build without running tests
pkg-builder verify --config-file pkg-builder.toml --verfiy-config-file pkg-builder-verify.toml
```

```
This will generate the appropiate .deb files for each package.
### How It Works

This process leverages `debcrafter` and `pkg-builder` to establish reproducible environments. Debcrafter aids in creating reproducible Debian directories based on detailed specification files ending with `.sss` and `.sps`. Meanwhile, pkg-builder utilizes debcrafter, and extends it to setup minimal environments to build and adheres to Debian's best practices, including `sbuild`, `piuparts`, `lintian`, and `autopkgtest`, to build the packages and test them thoroughly, ensuring they are not merely packages but functional ones.

Currently, a significant obstacle in Debian packaging is the requirement for a separate git repository per package, which might hinder the support for numerous applications. Despite Debian packaging already facilitating reproducible builds, this aspect is still in its infancy. This project aims to adhere to distribution best practices to the fullest extent possible, only deviating when necessary or when certain support structures are not yet in place.
13 changes: 0 additions & 13 deletions build-systems/v1/.quiltrc-dpkg

This file was deleted.

Loading