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

[WIP] add flb-wamrc deps for ubuntu packaging #7606

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
3 changes: 3 additions & 0 deletions packaging/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ FLB_DISTRO=${FLB_DISTRO:-}
FLB_OUT_DIR=${FLB_OUT_DIR:-}
FLB_NIGHTLY_BUILD=${FLB_NIGHTLY_BUILD:-}
FLB_JEMALLOC=${FLB_JEMALLOC:-On}
FLB_WAMRC=${FLB_WAMRC:-Off}

# Use this to pass special arguments to docker build
FLB_ARG=${FLB_ARG:-}
Expand Down Expand Up @@ -75,6 +76,7 @@ echo "IMAGE_CONTEXT_DIR => $IMAGE_CONTEXT_DIR"
echo "CMAKE_INSTALL_PREFIX => $CMAKE_INSTALL_PREFIX"
echo "FLB_NIGHTLY_BUILD => $FLB_NIGHTLY_BUILD"
echo "FLB_JEMALLOC => $FLB_JEMALLOC"
echo "FLB_WAMRC => $FLB_WAMRC"

export DOCKER_BUILDKIT=1

Expand All @@ -84,6 +86,7 @@ if ! docker build \
--build-arg CMAKE_INSTALL_PREFIX="$CMAKE_INSTALL_PREFIX" \
--build-arg FLB_NIGHTLY_BUILD="$FLB_NIGHTLY_BUILD" \
--build-arg FLB_JEMALLOC="$FLB_JEMALLOC" \
--build-arg FLB_WAMRC="$FLB_WAMRC" \
--build-arg FLB_TD="$FLB_TD" \
$FLB_ARG \
-t "$MAIN_IMAGE" \
Expand Down
23 changes: 17 additions & 6 deletions packaging/distros/ubuntu/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ RUN apt-get update && \
wget -q -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | \
gpg --dearmor - | tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null && \
apt-add-repository 'deb https://apt.kitware.com/ubuntu/ xenial main' && \
wget -q -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - && \
apt-add-repository "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-10 main" && \
apt-get update && \
apt-get install -y llvm-10 libclang-common-10-dev libedit-dev && \
apt-get install -y --reinstall lsb-base lsb-release cmake

# ubuntu/18.04 base image
Expand All @@ -39,7 +42,8 @@ RUN apt-get update && \
cmake make bash wget unzip nano vim valgrind dh-make flex bison \
libpq-dev postgresql-server-dev-all \
libsasl2-2 libsasl2-dev openssl libssl-dev libssl1.1 \
software-properties-common libyaml-dev apt-transport-https pkg-config zlib1g-dev && \
software-properties-common libyaml-dev apt-transport-https pkg-config zlib1g-dev \
llvm-10 libclang-common-10-dev libedit-dev && \
Comment on lines +45 to +46
Copy link
Contributor

@cosmo0920 cosmo0920 Jun 26, 2023

Choose a reason for hiding this comment

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

We'll plan to move to depends on LLVM 13 or later for flb-wamrc infrastructure on the PR #7587.
If you could, could you investigate and update to use LLVM 13 or later, please?
For Ubuntu/Debian, we can introduce LLVM 13 or later with the aptline:
https://apt.llvm.org/

Copy link
Author

Choose a reason for hiding this comment

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

I was not entirely sure which LLVM version to use, so I will look into that! Although I know for Ubuntu 16.04 I think it goes up to LLVM 12 only from the official LLVM APT repos

Copy link
Contributor

Choose a reason for hiding this comment

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

Dropping flb-wamrc compilation for Ubuntu.16.04 would be reasonable, I guess.

wget -q -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | \
gpg --dearmor - | tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null && \
apt-add-repository 'deb https://apt.kitware.com/ubuntu/ bionic main' && \
Expand All @@ -61,7 +65,8 @@ RUN apt-get update && \
cmake make bash wget unzip nano vim valgrind dh-make flex bison \
libpq-dev postgresql-server-dev-all \
libsasl2-2 libsasl2-dev openssl libssl-dev libssl1.1 \
software-properties-common libyaml-dev apt-transport-https pkg-config zlib1g-dev && \
software-properties-common libyaml-dev apt-transport-https pkg-config zlib1g-dev \
llvm-10 libclang-common-10-dev libedit-dev && \
wget -q -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | \
gpg --dearmor - | tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null && \
apt-add-repository 'deb https://apt.kitware.com/ubuntu/ bionic main' && \
Expand All @@ -79,7 +84,8 @@ RUN apt-get update && \
apt-get install -y curl ca-certificates build-essential libsystemd-dev \
cmake make bash wget unzip nano vim valgrind dh-make flex bison \
libpq-dev postgresql-server-dev-all \
libsasl2-2 libsasl2-dev openssl libssl-dev libssl1.1 libyaml-dev pkg-config zlib1g-dev && \
libsasl2-2 libsasl2-dev openssl libssl-dev libssl1.1 libyaml-dev pkg-config zlib1g-dev \
llvm libclang-common-10-dev libedit-dev && \
apt-get install -y --reinstall lsb-base lsb-release

# ubuntu/20.04.arm64v8 base image
Expand All @@ -93,7 +99,8 @@ RUN apt-get update && \
apt-get install -y curl ca-certificates build-essential libsystemd-dev \
cmake make bash wget unzip nano vim valgrind dh-make flex bison \
libpq-dev postgresql-server-dev-all \
libsasl2-2 libsasl2-dev openssl libssl-dev libssl1.1 libyaml-dev pkg-config zlib1g-dev && \
libsasl2-2 libsasl2-dev openssl libssl-dev libssl1.1 libyaml-dev pkg-config zlib1g-dev \
llvm libclang-common-10-dev libedit-dev && \
apt-get install -y --reinstall lsb-base lsb-release

# ubuntu/22.04 base image
Expand All @@ -105,7 +112,8 @@ RUN apt-get update && \
apt-get install -y curl ca-certificates build-essential libsystemd-dev \
cmake make bash wget unzip nano vim valgrind dh-make flex bison \
libpq-dev postgresql-server-dev-all libpq5 \
libsasl2-2 libsasl2-dev openssl libssl-dev libssl3 libyaml-dev pkg-config zlib1g-dev && \
libsasl2-2 libsasl2-dev openssl libssl-dev libssl3 libyaml-dev pkg-config zlib1g-dev \
llvm libmlir-14-dev libedit-dev libpfm4-dev && \
apt-get install -y --reinstall lsb-base lsb-release

# ubuntu/22.04.arm64v8 base image
Expand All @@ -119,7 +127,8 @@ RUN apt-get update && \
apt-get install -y curl ca-certificates build-essential libsystemd-dev \
cmake make bash wget unzip nano vim valgrind dh-make flex bison \
libpq-dev postgresql-server-dev-all libpq5 \
libsasl2-2 libsasl2-dev openssl libssl-dev libssl3 libyaml-dev pkg-config zlib1g-dev && \
libsasl2-2 libsasl2-dev openssl libssl-dev libssl3 libyaml-dev pkg-config zlib1g-dev \
llvm libmlir-14-dev libedit-dev libpfm4-dev && \
apt-get install -y --reinstall lsb-base lsb-release

# Common build for all distributions now
Expand All @@ -146,6 +155,7 @@ ARG FLB_OUT_KAFKA=On
ARG FLB_OUT_PGSQL=On
ARG FLB_JEMALLOC=On
ARG FLB_CHUNK_TRACE=On
ARG FLB_WAMRC=Off

ENV CFLAGS=$CFLAGS
RUN cmake -DCMAKE_INSTALL_PREFIX="$CMAKE_INSTALL_PREFIX" \
Expand All @@ -159,6 +169,7 @@ RUN cmake -DCMAKE_INSTALL_PREFIX="$CMAKE_INSTALL_PREFIX" \
-DFLB_NIGHTLY_BUILD="$FLB_NIGHTLY_BUILD" \
-DFLB_JEMALLOC="${FLB_JEMALLOC}" \
-DFLB_CHUNK_TRACE="${FLB_CHUNK_TRACE}" \
-DFLB_WAMRC="${FLB_WAMRC}" \
../

VOLUME [ "/output" ]
Expand Down