Skip to content

Commit 863ac61

Browse files
committed
test smaller image size
1 parent d11df4b commit 863ac61

File tree

4 files changed

+30
-4
lines changed

4 files changed

+30
-4
lines changed

.github/workflows/build-and-push-base.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
context: .
4242
push: true
4343
tags: |
44-
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:cuda${{ env.CUDA_VERSION }}-nccl${{ env.NCCL_VERSION }}
44+
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:cuda-libraries${{ env.CUDA_VERSION }}-nccl${{ env.NCCL_VERSION }}
4545
platforms: linux/amd64
4646
cache-from: type=gha
4747
cache-to: type=gha,mode=max

.github/workflows/temp-branch-build-and-push.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Branch - Build and push docker image
33
on:
44
push:
55
branches:
6-
- "add-graceful-shutdown-during-s3-sync"
6+
- "reduce-size-docker-image"
77

88
concurrency:
99
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ WORKDIR /src/gpu-iris-mpc
3030
COPY . .
3131
RUN cargo build --release --target x86_64-unknown-linux-gnu --bin nccl --bin server --bin client --bin key-manager --bin upgrade-server --bin upgrade-client --bin upgrade-checker --bin reshare-server --bin reshare-client
3232

33-
FROM --platform=linux/amd64 ghcr.io/worldcoin/iris-mpc-base:cuda12_2-nccl2_22_3_1
33+
FROM --platform=linux/amd64 ghcr.io/worldcoin/iris-mpc-base:cuda-libraries12_2-nccl2_22_3_1
3434
ENV DEBIAN_FRONTEND=noninteractive
3535

3636
# Include client, server and key-manager, upgrade-client and upgrade-server binaries

Dockerfile.base

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM --platform=linux/amd64 ubuntu:22.04 as build-image
1+
FROM --platform=linux/amd64 ubuntu:22.04 as base-image
22

33
RUN apt-get update && apt-get install -y pkg-config wget libssl-dev ca-certificates protobuf-compiler \
44
&& rm -rf /var/lib/apt/lists/*
@@ -46,3 +46,29 @@ RUN cd /tmp \
4646
--with-nccl=/tmp/nccl/build \
4747
--with-mpi=/opt/amazon/openmpi/ \
4848
&& make && make install
49+
50+
51+
# Runtime Image
52+
FROM --platform=linux/amd64 ubuntu:22.04 as build-image
53+
54+
RUN apt-get update && apt-get install -y pkg-config wget
55+
56+
RUN wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb \
57+
&& dpkg -i cuda-keyring_1.1-1_all.deb \
58+
&& apt-get update \
59+
&& apt-get install -y cuda-libraries-12-2 libnccl2=2.22.3-1+cuda12.2 libnccl-dev=2.22.3-1+cuda12.2 \
60+
&& rm -f cuda-keyring_1.1-1_all.deb
61+
62+
# Set environment variables for runtime
63+
ENV LD_LIBRARY_PATH=/usr/local/cuda/extras/CUPTI/lib64:/opt/aws-ofi-nccl/install/lib:/usr/local/cuda/lib64:$LD_LIBRARY_PATH
64+
ENV PATH=/opt/aws-ofi-nccl/install/bin:/usr/local/cuda/bin:$PATH
65+
66+
# Copy necessary files from build stage
67+
COPY --from=base-image /opt/gdrcopy /opt/gdrcopy
68+
COPY --from=base-image /opt/aws-ofi-nccl/install /opt/aws-ofi-nccl/install
69+
COPY --from=base-image /opt/amazon/efa /opt/amazon/efa
70+
71+
ENV LD_LIBRARY_PATH=/opt/gdrcopy/lib:/usr/local/cuda/compat:$LD_LIBRARY_PATH
72+
ENV LIBRARY_PATH=/opt/gdrcopy/lib:/usr/local/cuda/compat/:$LIBRARY_PATH
73+
ENV CPATH=/opt/gdrcopy/include:$CPATH
74+
ENV PATH=/opt/gdrcopy/bin:$PATH

0 commit comments

Comments
 (0)