From 17ca97500d602879b82a01e8d3d4436e36dfd01e Mon Sep 17 00:00:00 2001 From: Kyle Shores Date: Fri, 22 Mar 2024 11:50:52 -0500 Subject: [PATCH 1/5] adding a build of netcdf with the intel compiler --- .github/workflows/run_docker.yml | 34 +++++++++++++++++++++++++++++++ docker/Dockerfile.intel | 35 ++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+) create mode 100644 .github/workflows/run_docker.yml create mode 100644 docker/Dockerfile.intel diff --git a/.github/workflows/run_docker.yml b/.github/workflows/run_docker.yml new file mode 100644 index 0000000000..f263864157 --- /dev/null +++ b/.github/workflows/run_docker.yml @@ -0,0 +1,34 @@ +name: Docker + +on: [pull_request,workflow_dispatch] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref || github.run_id }} + cancel-in-progress: true + +jobs: + docker-build-and-test: + name: Build and Test - ${{ matrix.dockerfile }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + dockerfile: + - Dockerfile.intel + steps: + - name: Checkout code + uses: actions/checkout@v3 + with: + submodules: recursive + + # Some base images, like nvidia or intel, are very large and cannot be built by github + # This tool cache folder is only necessary if you are building the image in the same runner + # Since we are only building docker images, we don't need it + - name: Delete huge unnecessary tools folder + run: rm -rf /opt/hostedtoolcache + + - name: Build Docker image + run: docker build -t netcdf -f docker/${{ matrix.dockerfile }} . + + - name: Run tests in container + run: docker run --name test-container -t netcdf bash -c 'make test ARGS="--rerun-failed --output-on-failure -j8"' \ No newline at end of file diff --git a/docker/Dockerfile.intel b/docker/Dockerfile.intel new file mode 100644 index 0000000000..c71dd04286 --- /dev/null +++ b/docker/Dockerfile.intel @@ -0,0 +1,35 @@ +# versions and sizes from here: https://hub.docker.com/r/intel/oneapi-hpckit/tags +FROM intel/oneapi-hpckit:latest + +# Install necessary dependencies +RUN apt update -y && \ + apt install -y \ + bzip2 \ + cmake \ + libcurl4-openssl-dev \ + libhdf5-dev \ + git \ + m4 \ + make \ + wget \ + zlib1g-dev \ + && apt clean all + +# Set working directory +WORKDIR /usr/local/src + +# Clone NetCDF source code from Git +RUN git clone https://github.com/Unidata/netcdf-c.git + +# Set environment variables for Intel compilers +ENV CC=icx +ENV CXX=icpx +ENV FC=ifx + +# Build and install NetCDF +WORKDIR /usr/local/src/netcdf-c +RUN cmake -S . -B build && \ + cd build && make -j && \ + make install + +WORKDIR /usr/local From 9cb5250391c6735775015b6db9e738bc5556a105 Mon Sep 17 00:00:00 2001 From: Kyle Shores Date: Fri, 22 Mar 2024 12:10:14 -0500 Subject: [PATCH 2/5] testing the current branch, setting proper workdir --- .dockerignore | 1 + .github/workflows/run_docker.yml | 2 -- docker/Dockerfile.intel | 5 ++--- 3 files changed, 3 insertions(+), 5 deletions(-) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000000..c795b054e5 --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +build \ No newline at end of file diff --git a/.github/workflows/run_docker.yml b/.github/workflows/run_docker.yml index f263864157..2f075ae151 100644 --- a/.github/workflows/run_docker.yml +++ b/.github/workflows/run_docker.yml @@ -18,8 +18,6 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v3 - with: - submodules: recursive # Some base images, like nvidia or intel, are very large and cannot be built by github # This tool cache folder is only necessary if you are building the image in the same runner diff --git a/docker/Dockerfile.intel b/docker/Dockerfile.intel index c71dd04286..58a474ed5d 100644 --- a/docker/Dockerfile.intel +++ b/docker/Dockerfile.intel @@ -18,8 +18,7 @@ RUN apt update -y && \ # Set working directory WORKDIR /usr/local/src -# Clone NetCDF source code from Git -RUN git clone https://github.com/Unidata/netcdf-c.git +COPY . netcdf-c # Set environment variables for Intel compilers ENV CC=icx @@ -32,4 +31,4 @@ RUN cmake -S . -B build && \ cd build && make -j && \ make install -WORKDIR /usr/local +WORKDIR /usr/local/src/netcdf-c/build \ No newline at end of file From 4bca50e50a2900e595a34f5fe908c156e8507fb3 Mon Sep 17 00:00:00 2001 From: Kyle Shores Date: Fri, 22 Mar 2024 12:28:18 -0500 Subject: [PATCH 3/5] adding unzip tool --- docker/Dockerfile.intel | 1 + 1 file changed, 1 insertion(+) diff --git a/docker/Dockerfile.intel b/docker/Dockerfile.intel index 58a474ed5d..959f8b9a0b 100644 --- a/docker/Dockerfile.intel +++ b/docker/Dockerfile.intel @@ -11,6 +11,7 @@ RUN apt update -y && \ git \ m4 \ make \ + unzip \ wget \ zlib1g-dev \ && apt clean all From b950fecc89e11a8a362dd2b76dcd71ac78b97c38 Mon Sep 17 00:00:00 2001 From: Kyle Shores Date: Sat, 23 Mar 2024 15:58:11 -0500 Subject: [PATCH 4/5] internet too slow to test nvhpc rn --- .github/workflows/run_docker.yml | 1 + docker/Dockerfile.nvhpc | 40 ++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 docker/Dockerfile.nvhpc diff --git a/.github/workflows/run_docker.yml b/.github/workflows/run_docker.yml index 2f075ae151..a628ea60b7 100644 --- a/.github/workflows/run_docker.yml +++ b/.github/workflows/run_docker.yml @@ -15,6 +15,7 @@ jobs: matrix: dockerfile: - Dockerfile.intel + - Dockerfile.nvhpc steps: - name: Checkout code uses: actions/checkout@v3 diff --git a/docker/Dockerfile.nvhpc b/docker/Dockerfile.nvhpc new file mode 100644 index 0000000000..b04d2fb3fd --- /dev/null +++ b/docker/Dockerfile.nvhpc @@ -0,0 +1,40 @@ +# nvidia rate limits requests. You can get around this by restarting docker if for +# some reason you have to build this image many times +# https://stackoverflow.com/a/75757516/5217293 +# +# Container versions, and sizes, can be found at https://catalog.ngc.nvidia.com/orgs/nvidia/containers/nvhpc/tags +# +FROM nvcr.io/nvidia/nvhpc:23.7-devel-cuda12.2-ubuntu22.04 + +# Install necessary dependencies +RUN apt update -y && \ + apt install -y \ + bzip2 \ + cmake \ + libcurl4-openssl-dev \ + libhdf5-dev \ + git \ + m4 \ + make \ + unzip \ + wget \ + zlib1g-dev \ + && apt clean all + +# Set working directory +WORKDIR /usr/local/src + +COPY . netcdf-c + +# Set environment variables for nvidia compilers +ENV CXX=nvc++ +ENV CC=nvc +ENV FC=nvfortran + +# Build and install NetCDF +WORKDIR /usr/local/src/netcdf-c +RUN cmake -S . -B build && \ + cd build && make -j && \ + make install + +WORKDIR /usr/local/src/netcdf-c/build \ No newline at end of file From 957aa3d3202c5a0a136f096d383014ba345cb53e Mon Sep 17 00:00:00 2001 From: Kyle Shores Date: Mon, 25 Mar 2024 08:38:25 -0500 Subject: [PATCH 5/5] just triggering a rebuild --- .dockerignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.dockerignore b/.dockerignore index c795b054e5..f5fc676c70 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1 +1,2 @@ +# Ignore these build \ No newline at end of file