Skip to content

Attempt to replace Netty jars with ARM compatible ones #628

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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
29 changes: 28 additions & 1 deletion dse/Dockerfile-dse6.9.jdk11
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,31 @@
#
ARG DSE_VERSION=6.9.7
ARG DS_BASE_DEBIAN=ds-base-ubuntu-openjdk-11
ARG BASETAG=11.0.22-jdk-ubuntu-20240427
ARG BASETAG=11.0.26-4-1ubuntu1-20.04
FROM --platform=$BUILDPLATFORM maven:3.8.6-openjdk-11-slim AS netty-setup-base
COPY settings.xml /root/.m2/settings.xml
RUN set -x \
&& mvn dependency:get -Dartifact=io.netty:netty-all:4.1.100.2.dse \
&& mvn dependency:get -Dtransitive=false -Dartifact=io.netty:netty-transport-native-epoll:4.1.100.2.dse \
&& mvn dependency:get -Dtransitive=false -Dartifact=io.netty:netty-transport-native-kqueue:4.1.100.2.dse \
## The artifacts below don't seem to be present yet, we'll need them for ARM images to work on OSX
# && mvn dependency:get -Dtransitive=false -Dartifact=io.netty:netty-transport-native-kqueue:4.1.100.2.dse:jar:osx-x86_64 \
# && mvn dependency:get -Dtransitive=false -Dartifact=io.netty:netty-transport-native-kqueue:4.1.100.2.dse:jar:osx-aarch_64 \
&& mkdir /netty \
&& find ~/.m2/repository/io/netty -type f -name "netty*4.1.100.2.dse*.jar" -exec cp {} /netty/ \;

FROM --platform=linux/arm64 netty-setup-base as netty-setup-arm64
RUN set -x \
&& mvn dependency:get -Dtransitive=false -Dartifact=io.netty:netty-transport-native-epoll:4.1.100.2.dse:jar:linux-aarch_64 \
&& find ~/.m2/repository/io/netty -type f -name "netty*4.1.100.2.dse*.jar" -exec cp {} /netty/ \;

FROM --platform=linux/amd64 netty-setup-base as netty-setup-amd64
RUN set -x \
&& mvn dependency:get -Dtransitive=false -Dartifact=io.netty:netty-transport-native-epoll:4.1.100.2.dse:jar:linux-x86_64 \
&& find ~/.m2/repository/io/netty -type f -name "netty*4.1.100.2.dse*.jar" -exec cp {} /netty/ \;

FROM netty-setup-${TARGETARCH} as netty-setup

FROM datastax/${DS_BASE_DEBIAN}:${BASETAG} AS dse-server-prep

# Set up configuration variables
Expand All @@ -26,6 +50,8 @@ RUN set -x \
&& mkdir -p "$DSE_HOME" \
&& tar -C "$DSE_HOME" --strip-components=1 -xzf /${TARBALL} \
&& rm /${TARBALL} \
# Replace Netty with ARM compatible version
&& find ${DSE_HOME}/resources/cassandra/lib/ -type f -name "netty*" -exec rm {} \; \
# Unpack Agent tarball
&& mkdir -p "$DSE_AGENT_HOME" \
&& tar -C "$DSE_AGENT_HOME" --strip-components=1 -xzf /${DSE_AGENT_TARBALL} \
Expand All @@ -35,6 +61,7 @@ RUN set -x \
&& apt-get install -y --install-recommends rdfind \
&& rdfind -makehardlinks true -makeresultsfile false ${DSE_HOME} \
&& chmod -R g+w ${DSE_HOME} ${DSE_AGENT_HOME}
COPY --chown=dse:root --from=netty-setup /netty ${DSE_HOME}/resources/cassandra/lib/
COPY dse/patches/remove-writable.patch /tmp
RUN patch ${DSE_HOME}/bin/dse < /tmp/remove-writable.patch

Expand Down
12 changes: 11 additions & 1 deletion dse/Dockerfile-dse6.9.ubi8
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,17 @@ ARG UBI_MAJOR=8
ARG UBI_BASETAG=latest
ARG DSE_BASE_IMAGE=datastax/dse-mgmtapi-6_8:${DSE_VERSION}-jdk11

FROM ${DSE_BASE_IMAGE} AS dse-server-base
FROM --platform=$BUILDPLATFORM ${DSE_BASE_IMAGE} AS dse-server-base-amd64
ENV DSE_HOME=/opt/dse
RUN set -x \
&& rm ${DSE_HOME}/resources/cassandra/lib/netty*aarch*

FROM --platform=$BUILDPLATFORM ${DSE_BASE_IMAGE} AS dse-server-base-arm64
ENV DSE_HOME=/opt/dse
RUN set -x \
&& rm ${DSE_HOME}/resources/cassandra/lib/netty*linux-x86*

FROM --platform=$BUILDPLATFORM dse-server-base-${TARGETARCH} AS dse-server-base

#############################################################

Expand Down
Loading