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

Fix CI and Upgrade to llvm14 #15

Merged
merged 1 commit into from
Oct 17, 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 37 additions & 15 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ on:

# Run tests for any PRs.
pull_request:
types:
- opened
- edited

env:
REDBPF_IMAGE_NAME: ghcr.io/${{ github.repository_owner }}/redbpf-build
Expand Down Expand Up @@ -41,6 +44,12 @@ jobs:
echo "Status: ${{ steps.buildx.outputs.status }}"
echo "Flags: ${{ steps.buildx.outputs.flags }}"
echo "Platforms: ${{ steps.buildx.outputs.platforms }}"

-
name: Set image name lowercase
run: |
echo "REDBPF_IMAGE_NAME=${REDBPF_IMAGE_NAME,,}" >>${GITHUB_ENV}

-
name: Set up version information
run: |
Expand Down Expand Up @@ -107,6 +116,11 @@ jobs:
-
name: Checkout
uses: actions/checkout@v2
-
name: Set image name lowercase
run: |
echo "REDBPF_IMAGE_NAME=${REDBPF_IMAGE_NAME,,}" >>${GITHUB_ENV}

-
name: Set up version information
run: |
Expand Down Expand Up @@ -185,6 +199,10 @@ jobs:
-
name: Checkout
uses: actions/checkout@v2
-
name: Set image name lowercase
run: |
echo "REDBPF_IMAGE_NAME=${REDBPF_IMAGE_NAME,,}" >>${GITHUB_ENV}
-
name: Set up version information
run: |
Expand Down Expand Up @@ -214,19 +232,23 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Set image name lowercase
run: |
echo "IMAGE_NAME=${IMAGE_NAME,,}" >>${GITHUB_ENV}

- name: Set up version information
run: |
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
[ "$VERSION" == "$MAIN_BRANCH" ] && VERSION=latest
echo "version=$VERSION" >> $GITHUB_ENV

- name: Build Ubuntu 21.04
id: ubuntu2104
- name: Build Ubuntu 22.04
id: ubuntu2204
run: |
VERSION=${{ env.version }}-ubuntu-21.04
VERSION=${{ env.version }}-ubuntu-22.04
docker build --no-cache \
-f Dockerfile.21.04 \
-f Dockerfile.22.04 \
-t $IMAGE_NAME:$VERSION \
.
echo "::set-output name=image_id::$IMAGE_NAME:$VERSION"
Expand All @@ -251,22 +273,22 @@ jobs:
.
echo "::set-output name=image_id::$IMAGE_NAME:$VERSION"

- name: Build Fedora 34
id: fedora34
- name: Build Fedora 36
id: fedora36
run: |
VERSION=${{ env.version }}-fedora-34
VERSION=${{ env.version }}-fedora36
docker build --no-cache \
-f Dockerfile.fedora-34 \
-f Dockerfile.fedora36 \
-t $IMAGE_NAME:$VERSION \
.
echo "::set-output name=image_id::$IMAGE_NAME:$VERSION"

- name: Build Alpine 3.14
id: alpine314
- name: Build Alpine Edge
id: alpine-edge
run: |
VERSION=${{ env.version }}-alpine
VERSION=${{ env.version }}-alpine-edge
docker build --no-cache \
-f Dockerfile.alpine \
-f Dockerfile.alpine-edge \
-t $IMAGE_NAME:$VERSION \
.
echo "::set-output name=image_id::$IMAGE_NAME:$VERSION"
Expand All @@ -277,8 +299,8 @@ jobs:
- name: Push image
if: github.event_name == 'push'
run: |
docker push ${{ steps.ubuntu2104.outputs.image_id }}
docker push ${{ steps.ubuntu2204.outputs.image_id }}
docker push ${{ steps.ubuntu2004.outputs.image_id }}
docker push ${{ steps.ubuntu1804.outputs.image_id }}
docker push ${{ steps.fedora34.outputs.image_id }}
docker push ${{ steps.alpine314.outputs.image_id }}
docker push ${{ steps.fedora36.outputs.image_id }}
docker push ${{ steps.alpine-edge.outputs.image_id }}
49 changes: 38 additions & 11 deletions Dockerfile.18.04
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,46 @@ ENV RUSTUP_HOME=/usr/local/rustup \
DEBIAN_FRONTEND=noninteractive

RUN apt-get update \
&& apt-get -y install curl wget lsb-release wget software-properties-common debhelper cmake \
libelf-dev bison flex libedit-dev python python-netaddr \
python-pyroute2 luajit libluajit-5.1-dev arping iperf netperf ethtool \
devscripts zlib1g-dev libfl-dev \
pkg-config libssl-dev \
git \
musl musl-tools musl-dev \
capnproto \
linux-base libkmod2 kmod \
&& wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && ./llvm.sh 12 && rm -f ./llvm.sh \
&& apt-get update && apt-get -y install llvm libllvm12 llvm-12-dev libclang-12-dev clang-format-12 clang \
&& apt-get -y install \
curl \
wget \
lsb-release \
software-properties-common \
debhelper \
cmake \
libelf-dev \
bison \
flex \
libedit-dev \
python \
python-netaddr \
python-pyroute2 \
luajit \
libluajit-5.1-dev \
arping \
iperf \
netperf \
ethtool \
devscripts \
zlib1g-dev \
libfl-dev \
pkg-config \
libssl-dev \
git \
musl \
musl-tools \
musl-dev \
capnproto \
linux-base \
libkmod2 \
kmod \
&& add-apt-repository -y ppa:ubuntu-toolchain-r/test \
&& wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && ./llvm.sh 14 && rm -f ./llvm.sh \
&& apt-get update && apt-get -y install llvm libllvm14 llvm-14-dev libclang-14-dev clang-format-14 clang \
&& apt-get clean -y

RUN ln -sf /usr/bin/llvm-config-14 /usr/bin/llvm-config
RUN llvm-config --version | grep -q '^14'

# Install kernel v4.19 to check the oldest supported kernel
WORKDIR /tmp/kernel
Expand Down
47 changes: 36 additions & 11 deletions Dockerfile.20.04
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,44 @@ ENV RUSTUP_HOME=/usr/local/rustup \
DEBIAN_FRONTEND=noninteractive

RUN apt-get update \
&& apt-get -y install curl wget lsb-release wget software-properties-common \
debhelper cmake llvm libllvm12 llvm-12-dev libclang-12-dev \
libelf-dev bison flex libedit-dev clang-format-12 python python-netaddr \
luajit libluajit-5.1-dev arping iperf netperf ethtool \
devscripts zlib1g-dev libfl-dev \
pkg-config libssl-dev \
git \
clang \
musl musl-tools musl-dev \
capnproto \
linux-headers-generic \
&& apt-get -y install \
curl \
wget \
lsb-release \
software-properties-common \
debhelper \
cmake \
libelf-dev \
bison \
flex \
libedit-dev \
python-is-python3 \
python3-netaddr \
python3-pyroute2 \
luajit \
libluajit-5.1-dev \
arping \
iperf \
netperf \
ethtool \
devscripts \
zlib1g-dev \
libfl-dev \
pkg-config \
libssl-dev \
git \
musl \
musl-tools \
musl-dev \
capnproto \
linux-headers-generic \
&& wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && ./llvm.sh 14 && rm -f ./llvm.sh \
&& apt-get update && apt-get -y install llvm libllvm14 llvm-14-dev libclang-14-dev clang-format-14 clang \
&& apt-get clean -y

RUN ln -sf /usr/bin/llvm-config-14 /usr/bin/llvm-config
RUN llvm-config --version | grep -q '^14'

RUN curl https://sh.rustup.rs -sSf > rustup.sh \
&& sh rustup.sh -y \
--default-toolchain stable \
Expand Down
53 changes: 41 additions & 12 deletions Dockerfile.21.04 → Dockerfile.22.04
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:21.04
FROM ubuntu:22.04

ARG openssl_arch=linux-x86_64
ENV RUSTUP_HOME=/usr/local/rustup \
Expand All @@ -7,18 +7,47 @@ ENV RUSTUP_HOME=/usr/local/rustup \
DEBIAN_FRONTEND=noninteractive

RUN apt-get update \
&& apt-get -y install curl wget lsb-release wget software-properties-common \
debhelper cmake llvm libllvm12 llvm-12-dev libclang-12-dev \
libelf-dev bison flex libedit-dev clang-format-12 python python3-netaddr \
luajit libluajit-5.1-dev arping iperf netperf ethtool \
devscripts zlib1g-dev libfl-dev \
pkg-config libssl-dev \
git \
clang \
musl musl-tools musl-dev \
capnproto \
linux-headers-generic \
&& apt-get -y install \
curl \
wget \
lsb-release \
software-properties-common \
debhelper \
cmake \
llvm \
libllvm14 \
llvm-14-dev \
libclang-14-dev \
libelf-dev \
bison \
flex \
libedit-dev \
clang-format-14 \
python-is-python3 \
python3-netaddr \
luajit \
libluajit-5.1-dev \
arping \
iperf \
netperf \
ethtool \
devscripts \
zlib1g-dev \
libfl-dev \
pkg-config \
libssl-dev \
git \
clang \
musl \
musl-tools\
musl-dev \
capnproto \
linux-headers-generic \
&& apt-get clean -y

RUN ln -sf /usr/bin/llvm-config-14 /usr/bin/llvm-config
RUN llvm-config --version | grep -q '^14'

RUN apt-get -y install "linux-image-$(ls /lib/modules)"

RUN curl https://sh.rustup.rs -sSf > rustup.sh \
Expand Down
33 changes: 28 additions & 5 deletions Dockerfile.alpine → Dockerfile.alpine-edge
Original file line number Diff line number Diff line change
@@ -1,15 +1,38 @@
FROM alpine:3.14
FROM alpine:edge

ARG openssl_arch=linux-x86_64
ENV RUSTUP_HOME=/usr/local/rustup \
CARGO_HOME=/usr/local/cargo \
PATH=/usr/local/cargo/bin:$PATH \
DEBIAN_FRONTEND=noninteractive

RUN apk add --no-cache curl wget linux-headers make perl makedepend \
grep coreutils binutils linux-lts-dev linux-lts libxml2-dev gcc libc-dev \
clang-libs llvm11 llvm11-libs llvm11-dev llvm11-static g++ \
openssl openssl-dev openssl-libs-static
RUN apk add --no-cache \
curl \
wget \
linux-headers \
make \
perl \
makedepend \
grep \
coreutils \
binutils \
linux-lts-dev \
linux-lts \
libxml2-dev \
gcc \
libc-dev \
clang-libs \
llvm14 \
llvm14-libs \
llvm14-dev \
llvm14-static \
g++ \
openssl \
openssl-dev \
openssl-libs-static

RUN ln -sf /usr/lib/llvm14/bin/llvm-config /usr/bin/llvm-config
RUN llvm-config --version | grep -q '^14'

RUN curl https://sh.rustup.rs -sSf > rustup.sh \
&& sh rustup.sh -y \
Expand Down
45 changes: 29 additions & 16 deletions Dockerfile.fedora-34 → Dockerfile.fedora36
Original file line number Diff line number Diff line change
@@ -1,26 +1,39 @@
FROM fedora:34
FROM fedora:36

ARG openssl_arch=linux-x86_64
ENV RUSTUP_HOME=/usr/local/rustup \
CARGO_HOME=/usr/local/cargo \
PATH=/usr/local/cargo/bin:$PATH \
DEBIAN_FRONTEND=noninteractive

RUN dnf install -y clang-12.0.0 \
llvm-12.0.0 \
llvm-libs-12.0.0 \
llvm-devel-12.0.0 \
llvm-static-12.0.0 \
kernel \
kernel-devel \
elfutils-libelf-devel \
ca-certificates \
musl-devel musl-clang musl-libc musl-libc-static musl-gcc \
openssl-devel perl-podlators perl-File-Compare \
capnproto \
dnf-utils \
git \
make makedepend zstd bzip2
RUN echo "max_parallel_download=20" >> /etc/dnf/dnf.conf \
&& echo "fastestmirror=True" >> /etc/dnf/dnf.conf \
&& dnf install -y clang-14.0.0 \
llvm-14.0.0 \
llvm-libs-14.0.0 \
llvm-devel-14.0.0 \
llvm-static-14.0.0 \
kernel \
kernel-devel \
elfutils-libelf-devel \
ca-certificates \
musl-devel \
musl-clang \
musl-libc \
musl-libc-static \
musl-gcc \
openssl-devel \
perl-podlators \
perl-File-Compare \
capnproto \
dnf-utils \
git \
make \
makedepend \
zstd \
bzip2

RUN llvm-config --version | grep -q '^14'

RUN curl https://sh.rustup.rs -sSf > rustup.sh \
&& sh rustup.sh -y \
Expand Down
Loading