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

feat(ci): add package generation #592

Closed
wants to merge 26 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
32e5468
fix(freelist): use uintptr_t for pointer arithmetic
aws-nslick Aug 12, 2024
742e8d5
fix(tree): move declarations to top of function
aws-nslick Aug 12, 2024
ff6a575
fix(api): avoid mid-function initiializers
aws-nslick Aug 12, 2024
24c4ee0
fix(cuda): use decltype instead of typeof for cxx
aws-nslick Aug 12, 2024
142a39a
fix(tuner): avoid gotos
aws-nslick Sep 4, 2024
dfcface
fix(tuner): fix implicit conversions
aws-nslick Sep 4, 2024
12fc23e
feat(param): add uint parameter macro
aws-nslick Sep 4, 2024
c7d1598
fix(param): move some parameters to unsigned
aws-nslick Sep 4, 2024
4a8e756
fix(tree): avoid sign comparison issues
aws-nslick Sep 4, 2024
093b75e
fix(rdma): use COMM_ID_MASK as invalid id
aws-nslick Sep 4, 2024
db3af3c
fix(tree): add fallthrough switch markers
aws-nslick Sep 11, 2024
aad34f3
fix(rdma): avoid enum/integral comparison
aws-nslick Sep 11, 2024
bd01034
fix(sendrecv): add missing nccl-headers include
aws-nslick Sep 4, 2024
9d26e7d
fix(neuron): remove const from ncclNetPlugin_v4 sym
aws-nslick Sep 4, 2024
26b7007
fix(test): fix typing issues
aws-nslick Sep 11, 2024
189af46
fix(build): check features before mangling CFLAGS
aws-nslick Sep 11, 2024
bbfb706
fix(tracing/nvtx): silence -Wmissing-field-initializer warnings
aws-nslick Sep 12, 2024
5502846
fix(tree): use empty brace initializers for zero-initialization
aws-nslick Sep 12, 2024
c5aa794
fix(platform-aws): fill all platform values
aws-nslick Sep 12, 2024
ec96367
feat(build): add -Wextra to "picky" compiler flags
aws-nslick Sep 11, 2024
edca74e
feat(rdma): constrain C linkage to init
aws-nslick Sep 12, 2024
3251e61
chore(build): add AC_PROG_CXX
aws-nslick Aug 12, 2024
68343c0
chore(build): mpi: set mpicxx, too.
aws-nslick Aug 12, 2024
17645ae
feat(test): parse as c++ source
aws-nslick Aug 12, 2024
3413c46
chore(build): replace `-Wc++-compat' with `-x c++'
aws-nslick Sep 5, 2024
83b3b05
feat(ci): add package generation
aws-nslick Aug 15, 2024
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
44 changes: 44 additions & 0 deletions .docker/Dockerfile.dnf
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#
# Copyright (c) 2024, Amazon.com, Inc. or its affiliates. All rights reserved.
#
# See LICENSE.txt for license information
#

ARG FAMILY=fedora
ARG VERSION=rawhide
ARG VARIANT=cuda
ARG CUDA_DISTRO
ARG AWS_BUILD
ARG ENABLE_POWERTOOLS

# Install EFA-installer deps.
FROM ${FAMILY}:${VERSION} AS builder
ARG CUDA_DISTRO
ARG ENABLE_POWERTOOLS
ENV CUDA_DISTRO=${CUDA_DISTRO}
ENV ENABLE_POWERTOOLS=${ENABLE_POWERTOOLS}
# Add NVIDIA repo for CUDA builds.
COPY --from=efainstaller / /
RUN --mount=type=cache,target=/var/cache/yum,sharing=locked \
--mount=type=cache,target=/var/cache/dnf,sharing=locked \
bash -c "cd /aws-efa-installer && dnf install -y gcc rpmdevtools rpmlint dnf-plugins-core util-linux && ./efa_installer.sh -n -l -k -d -y && rm -rf /aws-efa-installer" && \
dnf config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/${CUDA_DISTRO}/$(uname -m)/cuda-${CUDA_DISTRO}.repo && \
( test "${ENABLE_POWERTOOLS}" = "1" && sed -i 's/enabled=0/enabled=1/' /etc/yum.repos.d/Rocky-PowerTools.repo || /bin/true ) && \
dnf -y update && dnf -y upgrade
RUN rpmdev-setuptree

FROM builder AS environment
ARG VARIANT
ARG AWS_BUILD
ENV VARIANT=${VARIANT}
ENV AWS_BUILD=${AWS_BUILD}
COPY --from=srpm . .
RUN yum search hwloc
RUN echo "%with_${VARIANT} 1" >> ~/.rpmmacros
RUN echo "%with_platform_aws ${AWS_BUILD}" >> ~/.rpmmacros
RUN --mount=type=cache,target=/var/cache/yum,sharing=locked \
--mount=type=cache,target=/var/cache/dnf,sharing=locked \
dnf -y install cuda-cudart-devel-12-6 && dnf -y builddep *.src.rpm && rpmbuild --rebuild *.src.rpm

FROM scratch
COPY --from=environment /root/rpmbuild/RPMS/**/* /
65 changes: 65 additions & 0 deletions .docker/Dockerfile.dpkg
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#
# Copyright (c) 2024, Amazon.com, Inc. or its affiliates. All rights reserved.
#
# See LICENSE.txt for license information
#

ARG FAMILY=ubuntu
ARG VERSION=latest
ARG CUDA_DISTRO
ARG DEBIAN_FRONTEND=noninteractive
ARG AWS_BUILD

FROM ${FAMILY}:${VERSION} AS build
ARG CUDA_DISTRO
ENV CUDA_DISTRO=${CUDA_DISTRO}
ARG AWS_BUILD=0
ENV AWS_BUILD=${AWS_BUILD}

RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
apt-get update -y && apt-get install wget -y

RUN wget https://developer.download.nvidia.com/compute/cuda/repos/${CUDA_DISTRO}/$(uname -m)/cuda-keyring_1.1-1_all.deb

RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
dpkg -i cuda-keyring_1.1-1_all.deb

COPY --from=efainstaller / .
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
bash -c "apt-get update -y && cd /aws-efa-installer && ./efa_installer.sh /efa_installer.sh -n -l -k -d -y && apt-get install -y autoconf automake libtool gcc g++ git libhwloc-dev make && rm -rf /aws-efa-installer"

COPY --from=makedist / .
RUN tar xvf ./aws-ofi-nccl*.tar.gz -C .
RUN cd aws-ofi-nccl* && \
./configure --$(test "$ACCELERATOR" = "cuda" && echo "with-cuda=/usr/local/cuda" || echo "enable-neuron=yes") \
--prefix=/opt/amazon/libnccl-net-ofi$(test "$AWS_BUILD" -eq 0 || echo -n "-aws") \
--with-libfabric=/opt/amazon/efa \
--disable-tests \
--$(test "$AWS_BUILD" -eq 0 && echo -n "disable" || echo -n "enable")-platform-aws \
--with-mpi=no && make -j && make install

FROM ubuntu:latest AS packager
ARG FAMILY
ARG VERSION
ARG AWS_BUILD=0
ENV AWS_BUILD=${AWS_BUILD}
ENV FAMILY=${FAMILY}
ENV VERSION=${VERSION}
COPY --from=build /opt/amazon/ /opt/amazon/
RUN find /opt/amazon/ | grep -E \.la$ | xargs rm
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
apt-get update -y && apt-get install -y ruby tar squashfs-tools binutils && gem install fpm
RUN fpm \
-s dir -t deb \
--license Apache2.0 \
-p /libnccl-net-ofi$(test "$AWS_BUILD" -eq 0 || echo -n "-aws")-${FAMILY}-${VERSION}.deb \
--name nccl-net-ofi$(test "$AWS_BUILD" -eq 0 || echo -n "-aws") \
/opt/amazon/libnccl-net-ofi$(test "$AWS_BUILD" -eq 0 || echo -n "-aws")/=/opt/amazon/libnccl-net-ofi$(test "$AWS_BUILD" -eq 0 || echo -n "-aws")

FROM scratch
COPY --from=packager /libnccl-net-ofi* /

15 changes: 15 additions & 0 deletions .docker/Dockerfile.efa
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#
# Copyright (c) 2024, Amazon.com, Inc. or its affiliates. All rights reserved.
#
# See LICENSE.txt for license information
#

FROM alpine:latest AS efa_installer_extracted
ARG EFA_INSTALLER_VERSION=latest
ENV EFA_INSTALLER_VERSION=${EFA_INSTALLER_VERSION}
RUN apk add tar curl
RUN mkdir /libfabric
RUN curl -s -L https://efa-installer.amazonaws.com/aws-efa-installer-${EFA_INSTALLER_VERSION}.tar.gz | tar -xvzf - -C /

FROM scratch
COPY --from=efa_installer_extracted /aws-efa-installer /aws-efa-installer
26 changes: 26 additions & 0 deletions .docker/Dockerfile.makedist
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#
# Copyright (c) 2024, Amazon.com, Inc. or its affiliates. All rights reserved.
#
# See LICENSE.txt for license information
#

ARG ACCELERATOR
ARG BASE_IMAGE=ubuntu:22.04
FROM ${BASE_IMAGE} AS distbuilder
ARG ACCELERATOR
ENV ACCELERATOR=${ACCELERATOR}
RUN mkdir /aws-efa-installer
COPY --from=efainstaller /aws-efa-installer /aws-efa-installer
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
bash -c "apt-get update -y && cd /aws-efa-installer && ./efa_installer.sh /efa_installer.sh -n -l -k -d -y && apt-get install -y autoconf automake libtool gcc git libhwloc-dev make && rm -rf /aws-efa-installer"
COPY ../ /proj
WORKDIR /proj
RUN autoreconf -ivf
RUN ./configure --with-libfabric=/opt/amazon/efa --$(test "$ACCELERATOR" = "cuda" && echo "with-cuda=/usr/local/cuda" || echo "enable-neuron=yes") --with-libfabric=/opt/amazon/efa
RUN make dist
RUN ls -lart
RUN pwd

FROM scratch
COPY --from=distbuilder /proj/aws-ofi-nccl*.tar.gz /
18 changes: 18 additions & 0 deletions .docker/Dockerfile.srpm
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#
# Copyright (c) 2024, Amazon.com, Inc. or its affiliates. All rights reserved.
#
# See LICENSE.txt for license information
#

FROM fedora:rawhide AS packitimg
RUN dnf install -y packit mock

FROM packitimg AS srpm
RUN mkdir /proj
WORKDIR /proj
COPY --from=src . .
COPY --from=makedist . .
RUN packit srpm

FROM scratch
COPY --from=srpm /proj/*.src.rpm /
42 changes: 42 additions & 0 deletions .docker/Dockerfile.yum
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#
# Copyright (c) 2024, Amazon.com, Inc. or its affiliates. All rights reserved.
#
# See LICENSE.txt for license information
#

ARG FAMILY=amazonlinux
ARG VERSION=2
ARG VARIANT=cuda
ARG CUDA_DISTRO
ARG AWS_BUILD

# Install EFA-installer deps.
FROM ${FAMILY}:${VERSION} AS builder
ARG CUDA_DISTRO
ENV CUDA_DISTRO=${CUDA_DISTRO}
# Add NVIDIA repo for CUDA builds.
COPY --from=efainstaller / /
RUN --mount=type=cache,target=/var/cache/yum,sharing=locked \
--mount=type=cache,target=/var/cache/dnf,sharing=locked \
bash -c "cd /aws-efa-installer && yum install -y gcc rpmdevtools rpmlint yum-utils util-linux && ./efa_installer.sh -n -l -k -d -y && rm -rf /aws-efa-installer" && \
yum-config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/${CUDA_DISTRO}/$(uname -m)/cuda-${CUDA_DISTRO}.repo && \
yum update -y
RUN rpmdev-setuptree

FROM builder AS environment
ARG VARIANT
ARG AWS_BUILD
ARG TOOLKIT_VERSION=12-6
ENV VARIANT=${VARIANT}
ENV AWS_BUILD=${AWS_BUILD}
ENV TOOLKIT_VERSION=${TOOLKIT_VERSION}
COPY --from=srpm . .
RUN echo "%with_${VARIANT} 1" >> ~/.rpmmacros
RUN echo "%with_platform_aws ${AWS_BUILD}" >> ~/.rpmmacros
RUN echo "%_cuda_toolkit_version ${TOOLKIT_VERSION}" >> ~/.rpmmacros
RUN --mount=type=cache,target=/var/cache/yum,sharing=locked \
--mount=type=cache,target=/var/cache/dnf,sharing=locked \
yum install -y cuda-cudart-devel-${TOOLKIT_VERSION} && yum-builddep -y *.src.rpm && rpmbuild --rebuild *.src.rpm

FROM scratch
COPY --from=environment /root/rpmbuild/RPMS/**/* /
30 changes: 24 additions & 6 deletions .github/workflows/distcheck.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ jobs:
matrix:
sdk:
- cuda
mode:
- cpp
- c
amazonlinux:
- al2023
- al2
Expand All @@ -47,7 +50,7 @@ jobs:
cudapackages: cuda-cudart-devel-12-3 cuda-driver-devel-12-3

runs-on: codebuild-ghactions-${{ matrix.amazonlinux }}-${{ github.run_id }}-${{ github.run_attempt }}
name: ${{matrix.amazonlinux}}/${{ matrix.sdk }}/efa@${{ matrix.efainstaller }}/makeinstall
name: ${{matrix.amazonlinux}}/${{ matrix.sdk }}/efa@${{ matrix.efainstaller }}/makeinstall(${{ matrix.mode }})
steps:
# note, do not bump to v4: https://github.com/actions/checkout/issues/1590
- uses: actions/checkout@v3
Expand Down Expand Up @@ -76,6 +79,7 @@ jobs:
./configure --prefix=/opt/aws-ofi-nccl --with-mpi=/opt/amazon/openmpi \
--with-libfabric=/opt/amazon/efa \
--with-cuda=/usr/local/cuda \
--enable-cpp=${{ matrix.mode == 'cpp' && 'yes' || 'no' }} \
--enable-tests=no \
--enable-platform-aws

Expand All @@ -95,13 +99,15 @@ jobs:
cc:
- gcc
- clang
mode:
- cpp
- c
tracing:
- lttng
- none
sdk:
- cuda
- neuron

include:
- cc-variant: latest
cc: clang
Expand All @@ -110,7 +116,7 @@ jobs:
cc: gcc
cc-version: 13

name: u2204/${{ matrix.sdk }}/libfabric@git/${{matrix.cc}}(${{matrix.cc-variant}})/distcheck/
name: u2204/${{ matrix.sdk }}/libfabric@git/${{matrix.cc}}(${{matrix.cc-variant}})/distcheck(${{ matrix.mode }})/
steps:
- uses: actions/checkout@v4
- name: Configure Neuron SDK Repository
Expand Down Expand Up @@ -196,10 +202,12 @@ jobs:
./configure --with-mpi=/opt/amazon/openmpi \
--with-libfabric=/opt/amazon/efa \
--with-cuda=/usr/local/cuda/ \
--enable-cpp=${{ matrix.mode == 'cpp' && 'yes' || 'no' }} \
--enable-tests \
--enable-platform-aws
else
./configure --with-libfabric=/opt/amazon/efa \
--enable-cpp=${{ matrix.mode == 'cpp' && 'yes' || 'no' }} \
--enable-neuron \
--enable-platform-aws
fi
Expand All @@ -226,6 +234,9 @@ jobs:
cc:
- gcc
- clang
mode:
- cpp
- c
sdk:
- cuda
- neuron
Expand All @@ -237,7 +248,7 @@ jobs:
cc: gcc
cc-version: 13

name: u2204/${{ matrix.sdk }}/${{matrix.cc}}(${{matrix.cc-variant}})/unit-tests/
name: u2204/${{ matrix.sdk }}/${{matrix.cc}}(${{matrix.cc-variant}})/unit-tests(${{ matrix.mode }})/
steps:
- uses: actions/checkout@v4
- name: Configure Neuron SDK Repository
Expand Down Expand Up @@ -316,13 +327,15 @@ jobs:
./configure --with-mpi=/opt/amazon/openmpi \
--with-libfabric=/opt/amazon/efa \
--with-cuda=/usr/local/cuda/ \
--enable-cpp=${{ matrix.mode == 'cpp' && 'yes' || 'no' }} \
--enable-tests \
--enable-debug \
--enable-platform-aws
else
./configure --with-libfabric=/opt/amazon/efa \
--enable-neuron \
--enable-debug \
--enable-cpp=${{ matrix.mode == 'cpp' && 'yes' || 'no' }} \
--enable-platform-aws
fi
make -j "$(nproc)"
Expand All @@ -346,7 +359,10 @@ jobs:
sdk:
- cuda
- neuron
name: CodeChecker - ${{ matrix.sdk }}
mode:
- cpp
- c
name: CodeChecker - ${{ matrix.sdk }} ${{ matrix.mode }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
Expand Down Expand Up @@ -404,12 +420,14 @@ jobs:
./configure \
--with-libfabric="/opt/amazon/efa" \
--enable-neuron \
--enable-cpp=${{ matrix.mode == 'cpp' && 'yes' || 'no' }} \
--enable-platform-aws
else
./configure \
--with-libfabric="/opt/amazon/efa" \
--with-mpi="/opt/amazon/openmpi" \
--with-cuda=/usr/local/cuda/ \
--enable-cpp=${{ matrix.mode == 'cpp' && 'yes' || 'no' }} \
--enable-tests \
--enable-platform-aws
fi
Expand All @@ -428,7 +446,7 @@ jobs:
- name: Save CodeChecker HTML output.
uses: actions/upload-artifact@v4
with:
name: CodeChecker Bug Reports for ${{ matrix.sdk }}
name: CodeChecker Bug Reports for ${{ matrix.sdk }} ${{ matrix.mode }}
path: ${{ steps.codechecker.outputs.result-html-dir }}/*.html

- name: CodeChecker Pass Or Fail?
Expand Down
Loading
Loading