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

Ubuntu 2204 #2

Merged
merged 2 commits into from
Oct 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/on-pr-merge-ubuntu-2204.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: After merging PR

on:
push:
branches:
- main
- build_test

# Allow to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
devel-tag-push:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
# TODO: Review the below list of dependencies
- name: Install the Build dependencies
run: |
sudo apt update -y

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you add the line: "sudo apt install -y libunwind-dev"
between "sudo apt update -y" and "sudo apt install -y --no-install-recommends...." all would work.
Example and test run are here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the help.

Copy link

@pieter3d pieter3d Dec 10, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ran into this same issue, and this solved it for me as well (the libunwind-14 and libunwind-dev conflict). But I don't really understand why? Is that some issue with something that is depending on libunwind? And why would updating them in two different steps solve the problem? What prevents this from happening again? It's kind of awkward to have this explicit update in my CI without any real explanation.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @pieter3d!
Here is the explanation. It is just a related to dependencies bug. Nobody can prevent it.

sudo apt install -y libunwind-dev
sudo apt install -y --no-install-recommends python3 libtirpc3 init \
python3-pip ssh rsync lvm2 less software-properties-common \
sudo curl wget git build-essential automake autoconf automake libtool \
flex bison libssl-dev pkg-config uuid-dev acl-dev zlib1g-dev \
libxml2-dev libxml2-utils liburcu-dev xfsprogs gdb attr \
libgoogle-perftools-dev zfsutils-linux screen libsqlite3-dev sqlite3 \
debmake python3-debian debhelper dh-python \
libaio-dev libdb-dev libfuse-dev libibverbs-dev liblvm2-dev \
libncurses5-dev librdmacm-dev libreadline-dev python3-all-dev
- name: Install Crystal
run: |
curl -fsSL https://crystal-lang.org/install.sh | sudo bash
- name: Build Debian packages
run: |
PACKAGING_GPG_SIGNING_KEY="${{ secrets.PACKAGING_GPG_SIGNING_KEY }}" ./generate_deb_packages_ubuntu_2204.sh
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./output
2 changes: 1 addition & 1 deletion .github/workflows/on-pr-merge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:

jobs:
devel-tag-push:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
# TODO: Review the below list of dependencies
Expand Down
12 changes: 11 additions & 1 deletion generate_deb_packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,17 @@ debmake -b":python3"
debuild
cd ../../

# TODO: Clone the existing repo and checkout gh-pages to get the current output directory
# Clone the existing repo and checkout gh-pages to get the current output directory
git clone https://github.com/kadalu-tech/pkgs.git build/output
cd build/output
git checkout -b gh-pages origin/gh-pages
cd ../../

rm -rf output
mkdir output
# TODO: Add previous versions when a new version is released
cp -r build/output/${MAJOR_VERSION} output/${MAJOR_VERSION}

output_dir=output/${MAJOR_VERSION}/${DISTRO}/${DISTRO_VERSION}
rm -rf ${output_dir}
mkdir -p ${output_dir}
Expand Down
90 changes: 90 additions & 0 deletions generate_deb_packages_ubuntu_2204.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
#!/bin/bash

set -e

MOANA_BRANCH=1.0.0-beta.1
GLUSTERFS_BRANCH=kadalu_1
DISTRO_VERSION=22.04
DISTRO=ubuntu
VERSION=1.0.0-beta.1
MAJOR_VERSION=1
PKG_KADALU_STORAGE_MANAGER=kadalu-storage-manager
PKG_KADALU_STORAGE=kadalu-storage

rm -rf build
mkdir -p build

# Clone and Checkout GlusterFS
git clone https://github.com/kadalu/glusterfs.git build/${PKG_KADALU_STORAGE}-${VERSION}
cd build/${PKG_KADALU_STORAGE}-${VERSION}
git checkout -b ${GLUSTERFS_BRANCH} origin/${GLUSTERFS_BRANCH}
cd ../../

# Clone and Checkout Moana
git clone https://github.com/kadalu/moana.git build/${PKG_KADALU_STORAGE_MANAGER}-${VERSION}
cd build/${PKG_KADALU_STORAGE_MANAGER}-${VERSION}
git fetch --all --tags
git checkout -b ${MOANA_BRANCH} tags/${MOANA_BRANCH}
cd ../../

# Create tar
cd build/
tar cvzf ${PKG_KADALU_STORAGE_MANAGER}-${VERSION}.tar.gz ${PKG_KADALU_STORAGE_MANAGER}-${VERSION}
tar cvzf ${PKG_KADALU_STORAGE}-${VERSION}.tar.gz ${PKG_KADALU_STORAGE}-${VERSION}
cd ..

# Copy Debian meta files
cp -r build/${PKG_KADALU_STORAGE_MANAGER}-${VERSION}/packaging/moana/debian build/${PKG_KADALU_STORAGE_MANAGER}-${VERSION}/
cp -r build/${PKG_KADALU_STORAGE_MANAGER}-${VERSION}/packaging/glusterfs/debian build/${PKG_KADALU_STORAGE}-${VERSION}/

# Overwrite the Changelog file
cp changelogs/moana/changelog-${MAJOR_VERSION} build/${PKG_KADALU_STORAGE_MANAGER}-${VERSION}/debian/changelog
cp changelogs/glusterfs/changelog-${MAJOR_VERSION} build/${PKG_KADALU_STORAGE}-${VERSION}/debian/changelog

# Build Moana deb packages
cd build/${PKG_KADALU_STORAGE_MANAGER}-${VERSION}/
debmake -b":python3"
debuild -eVERSION=${VERSION}
cd ../../

# Build GlusterFS deb packages
cd build/${PKG_KADALU_STORAGE}-${VERSION}/
debmake -b":python3"
debuild
cd ../../

# Clone the existing repo and checkout gh-pages to get the current output directory
git clone https://github.com/kadalu-tech/pkgs.git build/output
cd build/output
git checkout -b gh-pages origin/gh-pages
cd ../../

rm -rf output
mkdir output
# TODO: Add previous versions when a new version is released
cp -r build/output/${MAJOR_VERSION} output/${MAJOR_VERSION}

output_dir=output/${MAJOR_VERSION}/${DISTRO}/${DISTRO_VERSION}
rm -rf ${output_dir}
mkdir -p ${output_dir}

# Copy generated Deb files
cp build/*.deb ${output_dir}/

# List of packages
cd ${output_dir}
dpkg-scanpackages --multiversion . > Packages
gzip -k -f Packages

# Import the Signing key from env var
echo -n "$PACKAGING_GPG_SIGNING_KEY" | base64 --decode | gpg --import
gpg --list-keys

# Release, Release.gpg & InRelease
apt-ftparchive release . > Release
gpg --local-user "packaging@kadalu.tech" -abs -o - Release > Release.gpg
gpg --local-user "packaging@kadalu.tech" --clearsign -o - Release > InRelease
gpg --armor --export "packaging@kadalu.tech" > KEY.gpg

echo "deb https://kadalu.tech/pkgs/${MAJOR_VERSION}/${DISTRO}/${DISTRO_VERSION} ./" > sources.list
cd ../../../../