From 29240eb62bc424dbeead1dc9a15c60de996468dd Mon Sep 17 00:00:00 2001 From: Mohamed Koubaa Date: Mon, 11 Nov 2024 15:18:55 -0600 Subject: [PATCH 1/6] test --- .github/workflows/ci_cd.yml | 5 +++-- docker/run/Dockerfile | 37 +++++++++++++++++++++++++++---------- 2 files changed, 30 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index 54436b84d..a306d4e96 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -13,6 +13,7 @@ env: PACKAGE_NAME: 'ansys-dyna-core' PACKAGE_NAMESPACE: 'ansys.dyna.core' DOCUMENTATION_CNAME: "dyna.docs.pyansys.com" + PYDYNA_RUN_CONTAINER: ghcr.io/ansys/pydyna-run:latest concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -250,11 +251,11 @@ jobs: - name: Pull PyDyna-run image run: | - docker pull ghcr.io/ansys/pydyna-run:latest + docker pull ${{env.PYDYNA_RUN_CONTAINER}} - name: Unit testing env: - PYDYNA_RUN_CONTAINER: ghcr.io/ansys/pydyna-run:latest + PYDYNA_RUN_CONTAINER: ${{env.PYDYNA_RUN_CONTAINER}} ANSYSLI_SERVERS: 2325@${{secrets.LICENSE_SERVER}} ANSYSLMD_LICENSE_FILE: 1055@${{secrets.LICENSE_SERVER}} LSTC_LICENSE: ansys diff --git a/docker/run/Dockerfile b/docker/run/Dockerfile index 397e872e0..02d1395f9 100644 --- a/docker/run/Dockerfile +++ b/docker/run/Dockerfile @@ -1,12 +1,14 @@ -FROM ghcr.io/ansys/mechanical:24.1.0 +FROM ghcr.io/ansys/mechanical:24.1.0 AS pymechanical -#TODO - update to a more recent mechanical imaged -#TODO - reduce the size of this image by pruning unnecessary files from the Mechanical image +FROM ubuntu:20.04 LABEL description="lsdyna solver" # install Intel-MPI +ENV TZ=America/New_York +ENV DEBIAN_FRONTEND=noninteractive + RUN apt update -y RUN apt install -y wget @@ -19,14 +21,31 @@ RUN echo "deb [signed-by=/usr/share/keyrings/intel-mpi-archive-keyring.gpg] http RUN apt update -y RUN apt install -y intel-mpi-rt-2019.9-304 +ARG MAJORVER=24 +ARG MINORVER=1 +ARG VER=$MAJORVER$MINORVER + +RUN mkdir -p /install/ansys_inc/shared_files +RUN mkdir -p /install/ansys_inc/v$VER/ansys/bin/linx64 +RUN mkdir -p /install/ansys_inc/v$VER/mpi + +COPY --from=pymechanical /install/ansys_inc/v$VER/ansys/bin/linx64/lsdyna_dp.e /install/ansys_inc/v$VER/ansys/bin/linx64/lsdyna_dp.e +COPY --from=pymechanical /install/ansys_inc/v$VER/ansys/bin/linx64/lsdyna_dp_mpp.e /install/ansys_inc/v$VER/ansys/bin/linx64/lsdyna_dp_mpp.e +COPY --from=pymechanical /install/ansys_inc/v$VER/ansys/bin/linx64/lsdyna_sp.e /install/ansys_inc/v$VER/ansys/bin/linx64/lsdyna_sp.e +COPY --from=pymechanical /install/ansys_inc/v$VER/ansys/bin/linx64/lsdyna_sp_mpp.e /install/ansys_inc/v$VER/ansys/bin/linx64/lsdyna_sp_mpp.e +COPY --from=pymechanical /install/ansys_inc/v$VER/licensingclient /install/ansys_inc/v$VER/licensingclient +COPY --from=pymechanical /install/ansys_inc/shared_files /install/ansys_inc/shared_files +COPY --from=pymechanical /install/ansys_inc/v$VER/builddate.txt /install/ansys_inc/v$VER/builddate.txt +COPY --from=pymechanical /install/ansys_inc/v$VER/commonfiles/MPI/Intel/2021.10.0/linx64/bin /install/ansys_inc/v$VER/mpi + # Set environment variables pointing to Intel-MPI and LS-DYNA ENV MPIVARS=/opt/intel/impi/2019.9.304/intel64/bin/mpivars.sh -ENV MPIRUN=/install/ansys_inc/v241/commonfiles/MPI/Intel/2021.10.0/linx64/bin/mpirun -ENV LSDYNA_DP=/install/ansys_inc/v241/ansys/bin/linx64/lsdyna_dp.e -ENV LSDYNA_DP_MPP=/install/ansys_inc/v241/ansys/bin/linx64/lsdyna_dp_mpp.e -ENV LSDYNA_SP=/install/ansys_inc/v241/ansys/bin/linx64/lsdyna_sp.e -ENV LSDYNA_SP_MPP=/install/ansys_inc/v241/ansys/bin/linx64/lsdyna_sp_mpp.e +ENV MPIRUN=/install/ansys_inc/v$VER/mpi/mpirun +ENV LSDYNA_DP=/install/ansys_inc/v$VER/ansys/bin/linx64/lsdyna_dp.e +ENV LSDYNA_DP_MPP=/install/ansys_inc/v$VER/ansys/bin/linx64/lsdyna_dp_mpp.e +ENV LSDYNA_SP=/install/ansys_inc/v$VER/ansys/bin/linx64/lsdyna_sp.e +ENV LSDYNA_SP_MPP=/install/ansys_inc/v$VER/ansys/bin/linx64/lsdyna_sp_mpp.e # OPTIONAL # pass licensing environment variables into the build @@ -41,6 +60,4 @@ ENV ANSYSLMD_LICENSE_FILE=$ANSYSLMD_LICENSE_FILE COPY ./file.sh / -RUN ["chmod", "+x", "/file.sh"] - ENTRYPOINT ["/file.sh"] From db0d8ac4d4112e51277f83b65ba9dadc96bbad9a Mon Sep 17 00:00:00 2001 From: Mohamed Koubaa Date: Mon, 11 Nov 2024 15:21:07 -0600 Subject: [PATCH 2/6] add tagversion input to publish pipeline --- .github/workflows/publish-run-image.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish-run-image.yml b/.github/workflows/publish-run-image.yml index 419a25369..9198117f0 100644 --- a/.github/workflows/publish-run-image.yml +++ b/.github/workflows/publish-run-image.yml @@ -2,6 +2,11 @@ name: Docker images publishing on: workflow_dispatch: + inputs: + tagVersion: + description: 'Tag' + required: false + default: latest push: tags: - "*" @@ -40,5 +45,5 @@ jobs: context: docker/run file: docker/run/Dockerfile push: true - tags: ${{ env.REGISTRY }}/ansys/pydyna-run:latest + tags: ${{ env.REGISTRY }}/ansys/pydyna-run:${{ github.event.inputs.tagVersion }} cache-from: type=registry,ref=${{ env.REGISTRY }}/ansys/pydyna-run:latest From 9c1d846ee05d7878d093b8abc0f186f49445b893 Mon Sep 17 00:00:00 2001 From: Mohamed Koubaa Date: Mon, 11 Nov 2024 15:22:32 -0600 Subject: [PATCH 3/6] add run container option to cicd --- .github/workflows/ci_cd.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index a306d4e96..9f808962e 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -2,6 +2,11 @@ name: CI on: pull_request: workflow_dispatch: + inputs: + PyDynaRunContainer: + description: 'Run container name' + required: false + default: ghcr.io/ansys/pydyna-run:latest push: tags: - "*" @@ -117,13 +122,13 @@ jobs: - name: "Build the html documentation" env: - PYDYNA_RUN_CONTAINER: ghcr.io/ansys/pydyna-run:latest + PYDYNA_RUN_CONTAINER: ${{ github.event.inputs.PyDynaRunContainer }} run: | xvfb-run make -C doc html - name: "Build the pdf documentation" env: - PYDYNA_RUN_CONTAINER: ghcr.io/ansys/pydyna-run:latest + PYDYNA_RUN_CONTAINER: ${{ github.event.inputs.PyDynaRunContainer }} run: | make -C doc pdf @@ -251,11 +256,11 @@ jobs: - name: Pull PyDyna-run image run: | - docker pull ${{env.PYDYNA_RUN_CONTAINER}} + docker pull ${{ github.event.inputs.PyDynaRunContainer }} - name: Unit testing env: - PYDYNA_RUN_CONTAINER: ${{env.PYDYNA_RUN_CONTAINER}} + PYDYNA_RUN_CONTAINER: ${{ github.event.inputs.PyDynaRunContainer }} ANSYSLI_SERVERS: 2325@${{secrets.LICENSE_SERVER}} ANSYSLMD_LICENSE_FILE: 1055@${{secrets.LICENSE_SERVER}} LSTC_LICENSE: ansys From 1c52ae344d085d1f6a3efa0ce11ed55b13537ecc Mon Sep 17 00:00:00 2001 From: Mohamed Koubaa Date: Mon, 11 Nov 2024 15:30:35 -0600 Subject: [PATCH 4/6] test --- .github/workflows/ci_cd.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index 9f808962e..588097eda 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -18,7 +18,7 @@ env: PACKAGE_NAME: 'ansys-dyna-core' PACKAGE_NAMESPACE: 'ansys.dyna.core' DOCUMENTATION_CNAME: "dyna.docs.pyansys.com" - PYDYNA_RUN_CONTAINER: ghcr.io/ansys/pydyna-run:latest + PYDYNA_RUN_CONTAINER: ${{ github.event.inputs.PyDynaRunContainer || 'ghcr.io/ansys/pydyna-run:latest'}} concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -122,13 +122,13 @@ jobs: - name: "Build the html documentation" env: - PYDYNA_RUN_CONTAINER: ${{ github.event.inputs.PyDynaRunContainer }} + PYDYNA_RUN_CONTAINER: ${{ env.PYDYNA_RUN_CONTAINER }} run: | xvfb-run make -C doc html - name: "Build the pdf documentation" env: - PYDYNA_RUN_CONTAINER: ${{ github.event.inputs.PyDynaRunContainer }} + PYDYNA_RUN_CONTAINER: ${{ env.PYDYNA_RUN_CONTAINER }} run: | make -C doc pdf @@ -260,7 +260,7 @@ jobs: - name: Unit testing env: - PYDYNA_RUN_CONTAINER: ${{ github.event.inputs.PyDynaRunContainer }} + PYDYNA_RUN_CONTAINER: ${{ env.PYDYNA_RUN_CONTAINER }} ANSYSLI_SERVERS: 2325@${{secrets.LICENSE_SERVER}} ANSYSLMD_LICENSE_FILE: 1055@${{secrets.LICENSE_SERVER}} LSTC_LICENSE: ansys From 90209dc11187e6c14d8ef28a1c8c85f0703938e3 Mon Sep 17 00:00:00 2001 From: Mohamed Koubaa Date: Mon, 11 Nov 2024 15:31:46 -0600 Subject: [PATCH 5/6] update --- docker/run/Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docker/run/Dockerfile b/docker/run/Dockerfile index 02d1395f9..18dc932be 100644 --- a/docker/run/Dockerfile +++ b/docker/run/Dockerfile @@ -60,4 +60,6 @@ ENV ANSYSLMD_LICENSE_FILE=$ANSYSLMD_LICENSE_FILE COPY ./file.sh / +RUN ["chmod", "+x", "/file.sh"] + ENTRYPOINT ["/file.sh"] From 08cb0d2f738fcd8a6ac78eb509215a3b9301e6fd Mon Sep 17 00:00:00 2001 From: Mohamed Koubaa Date: Mon, 11 Nov 2024 15:35:45 -0600 Subject: [PATCH 6/6] fix --- .github/workflows/ci_cd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index 588097eda..c37d221f8 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -256,7 +256,7 @@ jobs: - name: Pull PyDyna-run image run: | - docker pull ${{ github.event.inputs.PyDynaRunContainer }} + docker pull ${{ env.PYDYNA_RUN_CONTAINER }} - name: Unit testing env: