-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Experimental arm64 support for Cassandra 3.11.6 (#36)
* Update netty for epoll arm64 support * Disable metrics monitor for arm64 since we have no binary for it * Update build for testing multiarch * Fix workflow typo * Update branch for testing * Try only adding aarch64 epoll binary instead of replace all netty * Revert "Try only adding aarch64 epoll binary instead of replace all netty" This reverts commit 8039c7c. * Fix release workflow for merging * Update ci to build 3.11 same as for release * Revert "Update ci to build 3.11 same as for release" This reverts commit fd5139b. * Revert "Revert "Update ci to build 3.11 same as for release"" This reverts commit 1a40ff1. * Update ci to build for amd64 and arm64 * Add use of buildx in integration test * Temporarily only test 3.11 * Revert "Temporarily only test 3.11" This reverts commit e64005d. * Update to use 3.11.7 explicitly
- Loading branch information
1 parent
5b98bcc
commit 5256425
Showing
7 changed files
with
212 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
FROM --platform=$BUILDPLATFORM maven:3.6.3-jdk-8-slim as builder | ||
|
||
WORKDIR /build | ||
|
||
COPY pom.xml ./ | ||
COPY management-api-agent/pom.xml ./management-api-agent/pom.xml | ||
COPY management-api-common/pom.xml ./management-api-common/pom.xml | ||
COPY management-api-server/pom.xml ./management-api-server/pom.xml | ||
COPY management-api-shim-3.x/pom.xml ./management-api-shim-3.x/pom.xml | ||
COPY management-api-shim-4.x/pom.xml ./management-api-shim-4.x/pom.xml | ||
# this duplicates work done in the next steps, but this should provide | ||
# a solid cache layer that only gets reset on pom.xml changes | ||
RUN mvn -q -ff -T 1C install && rm -rf target | ||
|
||
COPY management-api-agent ./management-api-agent | ||
COPY management-api-common ./management-api-common | ||
COPY management-api-server ./management-api-server | ||
COPY management-api-shim-3.x ./management-api-shim-3.x | ||
COPY management-api-shim-4.x ./management-api-shim-4.x | ||
RUN mvn -q -ff package -DskipTests | ||
|
||
FROM --platform=$BUILDPLATFORM maven:3.6.3-jdk-8-slim as netty4150 | ||
RUN mvn dependency:get -DgroupId=io.netty -DartifactId=netty-all -Dversion=4.1.50.Final -Dtransitive=false | ||
|
||
FROM --platform=linux/amd64 cassandra:3.11.7 as oss311-amd64 | ||
|
||
FROM --platform=linux/arm64 cassandra:3.11.7 as oss311-arm64 | ||
# Netty arm64 epoll support was not added until 4.1.50 (https://github.com/netty/netty/pull/9804) | ||
# Only replace this dependency for arm64 to avoid regressions | ||
RUN rm /opt/cassandra/lib/netty-all-*.jar | ||
COPY --from=netty4150 /root/.m2/repository/io/netty/netty-all/4.1.50.Final/netty-all-4.1.50.Final.jar /opt/cassandra/lib/netty-all-4.1.50.Final.jar | ||
|
||
FROM oss311-${TARGETARCH} as oss311 | ||
|
||
ARG TARGETARCH | ||
|
||
COPY --from=builder /build/management-api-common/target/datastax-mgmtapi-common-0.1.0-SNAPSHOT.jar /etc/cassandra/ | ||
COPY --from=builder /build/management-api-agent/target/datastax-mgmtapi-agent-0.1.0-SNAPSHOT.jar /etc/cassandra/ | ||
COPY --from=builder /build/management-api-server/target/datastax-mgmtapi-server-0.1.0-SNAPSHOT.jar /opt/mgmtapi/ | ||
COPY --from=builder /build/management-api-shim-3.x/target/datastax-mgmtapi-shim-3.x-0.1.0-SNAPSHOT.jar /opt/mgmtapi/ | ||
COPY --from=builder /build/management-api-shim-4.x/target/datastax-mgmtapi-shim-4.x-0.1.0-SNAPSHOT.jar /opt/mgmtapi/ | ||
|
||
ENV TINI_VERSION v0.18.0 | ||
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-${TARGETARCH} /tini | ||
RUN chmod +x /tini | ||
|
||
RUN set -eux; \ | ||
rm -fr /etc/apt/sources.list.d/*; \ | ||
rm -rf /var/lib/apt/lists/*; \ | ||
apt-get update; \ | ||
apt-get install -y --no-install-recommends wget iproute2; \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
ENV MCAC_VERSION 0.1.7 | ||
ADD https://github.com/datastax/metric-collector-for-apache-cassandra/releases/download/v${MCAC_VERSION}/datastax-mcac-agent-${MCAC_VERSION}.tar.gz /opt/mcac-agent.tar.gz | ||
RUN mkdir /opt/mcac-agent && tar zxvf /opt/mcac-agent.tar.gz -C /opt/mcac-agent --strip-components 1 && rm /opt/mcac-agent.tar.gz | ||
|
||
# backwards compat with upstream ENTRYPOINT | ||
COPY scripts/docker-entrypoint.sh /usr/local/bin/ | ||
RUN chmod +x /usr/local/bin/docker-entrypoint.sh && \ | ||
ln -sf /usr/local/bin/docker-entrypoint.sh /docker-entrypoint.sh | ||
|
||
EXPOSE 9103 | ||
EXPOSE 8080 | ||
|
||
ENTRYPOINT ["/docker-entrypoint.sh"] | ||
CMD ["mgmtapi"] | ||
|
||
|
||
# NOTE: Presently, OSS doesn't have official Cassandra 4.0 builds on dockerhub | ||
# and our build at datastax/cassandra:4.0 is not a multiarch image like the | ||
# official ones. Once one of those issues is fixed, the following targets can | ||
# be used to build Cassandra 4.0 with Management API. | ||
|
||
# FROM --platform=linux/amd64 cassandra:4.0 as oss40-amd64 | ||
|
||
# FROM --platform=linux/arm64 cassandra:4.0 as oss40-arm64 | ||
# # Netty arm64 epoll support was not added until 4.1.50 (https://github.com/netty/netty/pull/9804) | ||
# # Only replace this dependency for arm64 to avoid regressions | ||
# RUN rm /opt/cassandra/lib/netty-all-*.jar | ||
# COPY --from=netty4150 /root/.m2/repository/io/netty/netty-all/4.1.50.Final/netty-all-4.1.50.Final.jar /opt/cassandra/lib/netty-all-4.1.50.Final.jar | ||
|
||
# FROM oss40-${TARGETARCH} as oss40 | ||
|
||
# ARG TARGETARCH | ||
|
||
# COPY --from=builder /build/management-api-common/target/datastax-mgmtapi-common-0.1.0-SNAPSHOT.jar /etc/cassandra/ | ||
# COPY --from=builder /build/management-api-agent/target/datastax-mgmtapi-agent-0.1.0-SNAPSHOT.jar /etc/cassandra/ | ||
# COPY --from=builder /build/management-api-server/target/datastax-mgmtapi-server-0.1.0-SNAPSHOT.jar /opt/mgmtapi/ | ||
# COPY --from=builder /build/management-api-shim-3.x/target/datastax-mgmtapi-shim-3.x-0.1.0-SNAPSHOT.jar /opt/mgmtapi/ | ||
# COPY --from=builder /build/management-api-shim-4.x/target/datastax-mgmtapi-shim-4.x-0.1.0-SNAPSHOT.jar /opt/mgmtapi/ | ||
|
||
# ENV TINI_VERSION v0.18.0 | ||
# ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-${TARGETARCH} /tini | ||
# RUN chmod +x /tini | ||
|
||
# RUN set -eux; \ | ||
# apt-get update; \ | ||
# apt-get install -y --no-install-recommends wget iproute2; \ | ||
# rm -rf /var/lib/apt/lists/* | ||
|
||
# ENV MCAC_VERSION 0.1.7 | ||
# ADD https://github.com/datastax/metric-collector-for-apache-cassandra/releases/download/v${MCAC_VERSION}/datastax-mcac-agent-${MCAC_VERSION}.tar.gz /opt/mcac-agent.tar.gz | ||
# RUN mkdir /opt/mcac-agent && tar zxvf /opt/mcac-agent.tar.gz -C /opt/mcac-agent --strip-components 1 && rm /opt/mcac-agent.tar.gz | ||
|
||
# # backwards compat with upstream ENTRYPOINT | ||
# COPY scripts/docker-entrypoint.sh /usr/local/bin/ | ||
# RUN chmod +x /usr/local/bin/docker-entrypoint.sh && \ | ||
# ln -sf /usr/local/bin/docker-entrypoint.sh /docker-entrypoint.sh | ||
|
||
# EXPOSE 9103 | ||
# EXPOSE 8080 | ||
|
||
# ENTRYPOINT ["/docker-entrypoint.sh"] | ||
# CMD ["mgmtapi"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters