Skip to content

Commit

Permalink
Try 2: Split MSQuic building into a separate stage (#1070)
Browse files Browse the repository at this point in the history
  • Loading branch information
jkoritzinsky authored May 22, 2024
1 parent 6c57fb1 commit 79bc930
Show file tree
Hide file tree
Showing 8 changed files with 292 additions and 327 deletions.
76 changes: 35 additions & 41 deletions src/alpine/3.16/helix/amd64/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,36 @@
FROM alpine:3.16 as msquic

# build MsQuic as we don't have packages
RUN apk update && apk add --no-cache && \
apk add \
cmake \
g++ \
gcc \
git \
numactl-dev \
linux-headers \
lttng-ust-dev \
make \
musl-dev \
openssl-dev \
perl

RUN git clone --depth 1 --single-branch --branch v2.3.5 --recursive https://github.com/microsoft/msquic /tmp/msquic

WORKDIR /tmp/msquic

RUN cmake -B build/linux/x64_Release_openssl \
-DQUIC_OUTPUT_DIR=/tmp/msquic/artifacts/bin/linux/x64_Release_openssl \
-DCMAKE_BUILD_TYPE=Release \
-DQUIC_TLS=openssl \
-DQUIC_ENABLE_LOGGING=true \
-DQUIC_USE_SYSTEM_LIBCRYPTO=true \
-DQUIC_BUILD_TOOLS=off \
-DQUIC_BUILD_TEST=off \
-DQUIC_BUILD_PERF=off && \
cmake --build build/linux/x64_Release_openssl --config Release && \
cmake --install build/linux/x64_Release_openssl --prefix /msquic

FROM alpine:3.16

RUN apk update && \
Expand Down Expand Up @@ -54,47 +87,8 @@ RUN ln -sf /usr/bin/python3 /usr/bin/python && \
pip download --no-deps helix-scripts --index-url https://dnceng.pkgs.visualstudio.com/public/_packaging/helix-client-prod/pypi/simple && \
pip install ./helix_scripts-*-py3-none-any.whl

# build MsQuic as we don't have packages
RUN apk update && apk add --no-cache && \
apk add \
cmake \
g++ \
gcc \
git \
numactl-dev \
linux-headers \
lttng-ust-dev \
make \
musl-dev \
openssl-dev \
perl && \
cd /tmp && \
git clone --depth 1 --single-branch --branch v2.3.5 --recursive https://github.com/microsoft/msquic && \
cd msquic && \
cmake -B build/linux/x64_openssl \
-DQUIC_OUTPUT_DIR=/tmp/msquic/artifacts/bin/linux/x64_Release_openssl \
-DCMAKE_BUILD_TYPE=Release \
-DQUIC_TLS=openssl \
-DQUIC_ENABLE_LOGGING=true \
-DQUIC_USE_SYSTEM_LIBCRYPTO=true \
-DQUIC_BUILD_TOOLS=off \
-DQUIC_BUILD_TEST=off \
-DQUIC_BUILD_PERF=off && \
cmake --build build/linux/x64_openssl --config Release && \
cp artifacts/bin/linux/x64_Release_openssl/libmsquic.so.* artifacts/bin/linux/x64_Release_openssl/libmsquic.lttng.so.* /usr/lib && \
ldd artifacts/bin/linux/x64_Release_openssl/libmsquic.so.* && \
rm -rf /tmp/msquic && \
apk del \
cmake \
g++ \
gcc \
git \
linux-headers \
lttng-ust-dev \
make \
musl-dev \
openssl-dev \
perl
# Copy msquic from the msquic image into our image that will run on Helix
COPY --from=msquic /msquic /usr

# Needed for corefx tests to pass
ENV LANG=en-US.UTF-8
Expand Down
79 changes: 37 additions & 42 deletions src/alpine/3.16/helix/arm64v8/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,37 @@
FROM arm64v8/alpine:3.16 as msquic

# build MsQuic as we don't have packages
RUN apk update && apk add --no-cache && \
apk add \
cmake \
g++ \
gcc \
git \
numactl-dev \
linux-headers \
lttng-ust-dev \
make \
musl-dev \
openssl-dev \
perl

RUN git clone --depth 1 --single-branch --branch v2.3.5 --recursive https://github.com/microsoft/msquic /tmp/msquic

WORKDIR /tmp/msquic

RUN cmake -B build/linux/arm64_Release_openssl \
-DQUIC_OUTPUT_DIR=/tmp/msquic/artifacts/bin/linux/arm64_Release_openssl \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_TARGET_ARCHITECTURE=arm64 \
-DQUIC_TLS=openssl \
-DQUIC_ENABLE_LOGGING=true \
-DQUIC_USE_SYSTEM_LIBCRYPTO=true \
-DQUIC_BUILD_TOOLS=off \
-DQUIC_BUILD_TEST=off \
-DQUIC_BUILD_PERF=off && \
cmake --build build/linux/arm64_Release_openssl --config Release && \
cmake --install build/linux/arm64_Release_openssl --prefix /msquic

FROM arm64v8/alpine:3.16
# Install .NET and test dependencies
RUN apk update && apk add --no-cache \
Expand All @@ -12,6 +46,7 @@ RUN apk update && apk add --no-cache \
llvm \
lttng-ust \
musl-locales \
numactl \
openssl \
python3 \
sudo \
Expand All @@ -38,48 +73,8 @@ RUN apk update && apk add --no-cache && \
python3-dev \
openssl-dev

# build MsQuic as we don't have Alpine packages (yet)
RUN apk update && apk add --no-cache && \
apk add \
cmake \
g++ \
gcc \
git \
numactl-dev \
linux-headers \
lttng-ust-dev \
make \
musl-dev \
openssl-dev \
perl && \
cd /tmp && \
git clone --depth 1 --single-branch --branch v2.3.5 --recursive https://github.com/microsoft/msquic && \
cd msquic && \
cmake -B build/linux/arm64_openssl \
-DQUIC_OUTPUT_DIR=/tmp/msquic/artifacts/bin/linux/arm64_Release_openssl \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_TARGET_ARCHITECTURE=arm64 \
-DQUIC_TLS=openssl \
-DQUIC_ENABLE_LOGGING=true \
-DQUIC_USE_SYSTEM_LIBCRYPTO=true \
-DQUIC_BUILD_TOOLS=off \
-DQUIC_BUILD_TEST=off \
-DQUIC_BUILD_PERF=off && \
cmake --build build/linux/arm64_openssl --config Release && \
cp artifacts/bin/linux/arm64_Release_openssl/libmsquic.so.* artifacts/bin/linux/arm64_Release_openssl/libmsquic.lttng.so.* /usr/lib && \
ldd artifacts/bin/linux/arm64_Release_openssl/libmsquic.so.* && \
rm -rf /tmp/msquic && \
apk del \
cmake \
g++ \
gcc \
git \
linux-headers \
lttng-ust-dev \
make \
musl-dev \
openssl-dev \
perl
# Copy msquic from the msquic image into our image that will run on Helix
COPY --from=msquic /msquic /usr

# Needed for runtime tests to pass
ENV LANG=en-US.UTF-8
Expand Down
76 changes: 36 additions & 40 deletions src/alpine/3.17/helix/amd64/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,36 @@
FROM alpine:3.17 as msquic

# build MsQuic as we don't have packages
RUN apk update && apk add --no-cache && \
apk add \
cmake \
g++ \
gcc \
git \
numactl-dev \
linux-headers \
lttng-ust-dev \
make \
musl-dev \
openssl-dev \
perl

RUN git clone --depth 1 --single-branch --branch v2.3.5 --recursive https://github.com/microsoft/msquic /tmp/msquic

WORKDIR /tmp/msquic

RUN cmake -B build/linux/x64_Release_openssl3 \
-DQUIC_OUTPUT_DIR=/tmp/msquic/artifacts/bin/linux/x64_Release_openssl3 \
-DCMAKE_BUILD_TYPE=Release \
-DQUIC_TLS=openssl3 \
-DQUIC_ENABLE_LOGGING=true \
-DQUIC_USE_SYSTEM_LIBCRYPTO=true \
-DQUIC_BUILD_TOOLS=off \
-DQUIC_BUILD_TEST=off \
-DQUIC_BUILD_PERF=off && \
cmake --build build/linux/x64_Release_openssl3 --config Release && \
cmake --install build/linux/x64_Release_openssl3 --prefix /msquic

FROM alpine:3.17
# Install .NET and test dependencies
RUN apk update && apk add --no-cache \
Expand All @@ -12,6 +45,7 @@ RUN apk update && apk add --no-cache \
llvm \
lttng-ust \
musl-locales \
numactl \
openssl \
python3 \
sudo \
Expand Down Expand Up @@ -39,46 +73,8 @@ RUN apk update && apk add --no-cache && \
python3-dev \
openssl-dev

# build MsQuic as we don't have Alpine packages (yet)
RUN apk update && apk add --no-cache && \
apk add \
cmake \
g++ \
gcc \
git \
numactl-dev \
linux-headers \
lttng-ust-dev \
make \
musl-dev \
openssl-dev \
perl && \
cd /tmp && \
git clone --depth 1 --single-branch --branch v2.3.5 --recursive https://github.com/microsoft/msquic && \
cd msquic && \
cmake -B build/linux/x64_openssl3 \
-DQUIC_OUTPUT_DIR=/tmp/msquic/artifacts/bin/linux/x64_Release_openssl3 \
-DCMAKE_BUILD_TYPE=Release \
-DQUIC_TLS=openssl3 \
-DQUIC_ENABLE_LOGGING=true \
-DQUIC_USE_SYSTEM_LIBCRYPTO=true \
-DQUIC_BUILD_TOOLS=off \
-DQUIC_BUILD_TEST=off \
-DQUIC_BUILD_PERF=off && \
cmake --build build/linux/x64_openssl3 --config Release && \
cp artifacts/bin/linux/x64_Release_openssl3/libmsquic.so.* artifacts/bin/linux/x64_Release_openssl3/libmsquic.lttng.so.* /usr/lib && \
rm -rf /tmp/msquic && \
apk del \
cmake \
g++ \
gcc \
git \
linux-headers \
lttng-ust-dev \
make \
musl-dev \
openssl-dev \
perl
# Copy msquic from the msquic image into our image that will run on Helix
COPY --from=msquic /msquic /usr

# Needed for runtime tests to pass
ENV LANG=en-US.UTF-8
Expand Down
78 changes: 37 additions & 41 deletions src/alpine/3.17/helix/arm32v7/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,37 @@
FROM arm32v7/alpine:3.17 as msquic

# build MsQuic as we don't have packages
RUN apk update && apk add --no-cache && \
apk add \
cmake \
g++ \
gcc \
git \
numactl-dev \
linux-headers \
lttng-ust-dev \
make \
musl-dev \
openssl-dev \
perl

RUN git clone --depth 1 --single-branch --branch v2.3.5 --recursive https://github.com/microsoft/msquic /tmp/msquic

WORKDIR /tmp/msquic

RUN cmake -B build/linux/arm_Release_openssl3 \
-DQUIC_OUTPUT_DIR=/tmp/msquic/artifacts/bin/linux/arm_Release_openssl3 \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_TARGET_ARCHITECTURE=arm \
-DQUIC_TLS=openssl3 \
-DQUIC_ENABLE_LOGGING=true \
-DQUIC_USE_SYSTEM_LIBCRYPTO=true \
-DQUIC_BUILD_TOOLS=off \
-DQUIC_BUILD_TEST=off \
-DQUIC_BUILD_PERF=off && \
cmake --build build/linux/arm_Release_openssl3 --config Release && \
cmake --install build/linux/arm_Release_openssl3 --prefix /msquic

FROM arm32v7/alpine:3.17
# Install .NET and test dependencies
RUN apk update && apk add --no-cache \
Expand All @@ -12,6 +46,7 @@ RUN apk update && apk add --no-cache \
llvm \
lttng-ust \
musl-locales \
numactl \
openssl \
python3 \
sudo \
Expand Down Expand Up @@ -39,47 +74,8 @@ RUN apk update && apk add --no-cache && \
python3-dev \
openssl-dev

# build MsQuic as we don't have Alpine packages (yet)
RUN apk update && apk add --no-cache && \
apk add \
cmake \
g++ \
gcc \
git \
numactl-dev \
linux-headers \
lttng-ust-dev \
make \
musl-dev \
openssl-dev \
perl && \
cd /tmp && \
git clone --depth 1 --single-branch --branch v2.3.5 --recursive https://github.com/microsoft/msquic && \
cd msquic && \
cmake -B build/linux/arm_openssl3 \
-DQUIC_OUTPUT_DIR=/tmp/msquic/artifacts/bin/linux/arm_Release_openssl3 \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_TARGET_ARCHITECTURE=arm \
-DQUIC_TLS=openssl3 \
-DQUIC_ENABLE_LOGGING=true \
-DQUIC_USE_SYSTEM_LIBCRYPTO=true \
-DQUIC_BUILD_TOOLS=off \
-DQUIC_BUILD_TEST=off \
-DQUIC_BUILD_PERF=off && \
cmake --build build/linux/arm_openssl3 --config Release && \
cp artifacts/bin/linux/arm_Release_openssl3/libmsquic.so.* artifacts/bin/linux/arm_Release_openssl3/libmsquic.lttng.so.* /usr/lib && \
rm -rf /tmp/msquic && \
apk del \
cmake \
g++ \
gcc \
git \
linux-headers \
lttng-ust-dev \
make \
musl-dev \
openssl-dev \
perl
# Copy msquic from the msquic image into our image that will run on Helix
COPY --from=msquic /msquic /usr

# Needed for runtime tests to pass
ENV LANG=en-US.UTF-8
Expand Down
Loading

0 comments on commit 79bc930

Please sign in to comment.