From 1cd3d562ec5c6e922cad599fd1e3f31f8ba07023 Mon Sep 17 00:00:00 2001 From: Theodore Chang Date: Wed, 11 Dec 2024 11:59:05 +0100 Subject: [PATCH] Add base image for aarch64 --- .github/workflows/docker-env.yml | 11 +++++++++-- ...y.Pre.Dockerfile => Rocky.Pre.amd64.Dockerfile} | 0 Script/Rocky.Pre.arm64.Dockerfile | 14 ++++++++++++++ 3 files changed, 23 insertions(+), 2 deletions(-) rename Script/{Rocky.Pre.Dockerfile => Rocky.Pre.amd64.Dockerfile} (100%) create mode 100644 Script/Rocky.Pre.arm64.Dockerfile diff --git a/.github/workflows/docker-env.yml b/.github/workflows/docker-env.yml index cf81ed69..6a88af7c 100644 --- a/.github/workflows/docker-env.yml +++ b/.github/workflows/docker-env.yml @@ -7,6 +7,9 @@ jobs: ide-image-base: runs-on: self-hosted timeout-minutes: 240 + strategy: + matrix: + arch: [ amd64, arm64 ] steps: - name: Clone uses: actions/checkout@v4 @@ -15,13 +18,17 @@ jobs: with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: QEMU + if: ${{ matrix.arch == 'arm64' }} + uses: docker/setup-qemu-action@v3 - name: Buildx uses: docker/setup-buildx-action@v3 - - name: Base + - name: Base ${{ matrix.arch }} uses: docker/build-push-action@v6 with: context: . - file: ./Script/Rocky.Pre.Dockerfile + file: ./Script/Rocky.Pre.${{ matrix.arch }}.Dockerfile + platforms: linux/${{ matrix.arch }} push: true tags: tlcfem/suanpan-env:latest ide-image-cuda: diff --git a/Script/Rocky.Pre.Dockerfile b/Script/Rocky.Pre.amd64.Dockerfile similarity index 100% rename from Script/Rocky.Pre.Dockerfile rename to Script/Rocky.Pre.amd64.Dockerfile diff --git a/Script/Rocky.Pre.arm64.Dockerfile b/Script/Rocky.Pre.arm64.Dockerfile new file mode 100644 index 00000000..915e2c8b --- /dev/null +++ b/Script/Rocky.Pre.arm64.Dockerfile @@ -0,0 +1,14 @@ +FROM arm64v8/rockylinux:9 AS build + +RUN dnf install -y epel-release && crb enable +RUN dnf install -y gcc g++ gfortran cmake wget git hdf5-devel + +# part 1: openblas +RUN git clone --depth 1 --branch v0.3.28 https://github.com/OpenMathLib/OpenBLAS.git + +# change the following configurations to match your needs +RUN cd OpenBLAS && make TARGET=ARMV8 DYNAMIC_ARCH=1 BINARY=64 USE_THREAD=1 USE_OPENMP=1 NUM_THREADS=20 NO_SHARED=1 NO_CBLAS=1 NO_LAPACKE=1 GEMM_MULTITHREAD_THRESHOLD=64 + +# part 2: tbb +RUN git clone --depth 1 --branch v2021.12.0 https://github.com/oneapi-src/oneTBB.git +RUN mkdir tbb-build && cd tbb-build && cmake -DCMAKE_BUILD_TYPE=Release -DTBB_TEST=OFF ../oneTBB && cmake --build . --target install --config Release --parallel "$(nproc)"