Skip to content

Commit 0012053

Browse files
authored
feat: reorganizing docker publish workflow (#535)
1 parent 23d11a0 commit 0012053

File tree

4 files changed

+72
-10
lines changed

4 files changed

+72
-10
lines changed

.github/workflows/ci_cd.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,4 +412,3 @@ jobs:
412412
with:
413413
cname: ${{ env.DOCUMENTATION_CNAME }}
414414
token: ${{ secrets.GITHUB_TOKEN }}
415-
python-version: ${{ env.MAIN_PYTHON_VERSION }}

.github/workflows/docker_push_stable.yml

Lines changed: 64 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,19 @@ concurrency:
2323
permissions:
2424
packages: write
2525

26+
env:
27+
WINDOWS_UNSTABLE: ghcr.io/ansys/geometry:windows-latest-unstable
28+
WINDOWS_STABLE_GHCR: ghcr.io/ansys/geometry:windows-latest
29+
WINDOWS_STABLE_FUJI: azwepsifujiaksacr.azurecr.io/ansys/discovery/geometry:windows-latest
30+
LINUX_UNSTABLE: ghcr.io/ansys/geometry:linux-latest-unstable
31+
LINUX_STABLE_GHCR: ghcr.io/ansys/geometry:linux-latest
32+
LINUX_STABLE_FUJI: azwepsifujiaksacr.azurecr.io/ansys/discovery/geometry:linux-latest
33+
2634
jobs:
2735
windows:
2836
name: Publish Windows latest image
2937
runs-on: windows-latest
3038
if: inputs.images == 'all' || inputs.images == 'windows-latest'
31-
env:
32-
WINDOWS_UNSTABLE: ghcr.io/ansys/geometry:windows-latest-unstable
33-
WINDOWS_STABLE_GHCR: ghcr.io/ansys/geometry:windows-latest
34-
WINDOWS_STABLE_FUJI: azwepsifujiaksacr.azurecr.io/ansys/discovery/geometry:windows-latest
3539
steps:
3640
- name: Login in Github Container registry
3741
uses: docker/login-action@v2
@@ -65,14 +69,38 @@ jobs:
6569
if: ${{ inputs.ansyslab }}
6670
run: docker push ${{ env.WINDOWS_STABLE_FUJI }}
6771

72+
windows-ansyslab:
73+
if: inputs.ansyslab
74+
needs: [windows]
75+
runs-on: [self-hosted, Windows, pygeometry]
76+
steps:
77+
- name: Login in Github Container registry
78+
uses: docker/login-action@v2
79+
with:
80+
registry: ghcr.io
81+
username: ${{ github.actor }}
82+
password: ${{ secrets.GITHUB_TOKEN }}
83+
84+
- name: Pull Windows latest unstable container
85+
run: docker pull ${{ env.WINDOWS_STABLE_GHCR }}
86+
87+
- name: Login in AnsysLab registry
88+
uses: docker/login-action@v2
89+
with:
90+
registry: azwepsifujiaksacr.azurecr.io
91+
username: ${{ secrets.FUJI_USER }}
92+
password: ${{ secrets.FUJI_TOKEN }}
93+
94+
- name: Tag container as latest (stable) for AnsysLab registry
95+
run: docker tag ${{ env.WINDOWS_STABLE_GHCR }} ${{ env.WINDOWS_STABLE_FUJI }}
96+
97+
- name: Publish latest stable container in AnsysLab registry
98+
run: docker push ${{ env.WINDOWS_STABLE_FUJI }}
99+
68100
linux:
69101
name: Publish Linux latest image
70102
runs-on: ubuntu-latest
71103
if: inputs.images == 'all' || inputs.images == 'linux-latest'
72-
env:
73-
LINUX_UNSTABLE: ghcr.io/ansys/geometry:linux-latest-unstable
74-
LINUX_STABLE_GHCR: ghcr.io/ansys/geometry:linux-latest
75-
LINUX_STABLE_FUJI: azwepsifujiaksacr.azurecr.io/ansys/discovery/geometry:linux-latest
76104
steps:
77105
- name: Login in Github Container registry
78106
uses: docker/login-action@v2
@@ -105,3 +133,31 @@ jobs:
105133
- name: Publish latest stable container in AnsysLab registry
106134
if: ${{ inputs.ansyslab }}
107135
run: docker push ${{ env.LINUX_STABLE_FUJI }}
136+
137+
linux-ansyslab:
138+
if: inputs.ansyslab
139+
needs: [linux]
140+
runs-on: [self-hosted, Linux]
141+
steps:
142+
- name: Login in Github Container registry
143+
uses: docker/login-action@v2
144+
with:
145+
registry: ghcr.io
146+
username: ${{ github.actor }}
147+
password: ${{ secrets.GITHUB_TOKEN }}
148+
149+
- name: Pull Linux latest stable container
150+
run: docker pull ${{ env.LINUX_STABLE_GHCR }}
151+
152+
- name: Login in AnsysLab registry
153+
uses: docker/login-action@v2
154+
with:
155+
registry: azwepsifujiaksacr.azurecr.io
156+
username: ${{ secrets.FUJI_USER }}
157+
password: ${{ secrets.FUJI_TOKEN }}
158+
159+
- name: Tag container as latest (stable) for AnsysLab registry
160+
run: docker tag ${{ env.LINUX_STABLE_GHCR }} ${{ env.LINUX_STABLE_FUJI }}
161+
162+
- name: Publish latest stable container in AnsysLab registry
163+
run: docker push ${{ env.LINUX_STABLE_FUJI }}

docker/Dockerfile.linux

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@ RUN unzip -qqju linux-binaries.zip -d . && rm linux-binaries.zip
1616
# Let the dynamic link loader where to search for shared libraries
1717
ENV LD_LIBRARY_PATH="/app"
1818

19+
# Define env variables
20+
ENV ANS_DSCO_REMOTE_PORT=50051
21+
ENV ANS_DSCO_REMOTE_IP="0.0.0.0"
22+
ENV LOG_LEVEL=2
23+
ENV ENABLE_TRACE=0
24+
ENV ANSYSLMD_LICENSE_FILE=""
25+
1926
# Add container labels
2027
LABEL org.opencontainers.image.authors="ANSYS Inc."
2128
LABEL org.opencontainers.image.vendor="ANSYS Inc."

docker/Dockerfile.windows

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ RUN for /R "tmp_folder" %f in (*) do move /Y "%f" .
2020
RUN del windows-binaries.zip && rmdir /s /q tmp_folder
2121

2222
# Defining environment variables
23-
ENV LICENSE_SERVER = ""
23+
ENV LICENSE_SERVER=""
2424
ENV SERVER_ENDPOINT="0.0.0.0:50051"
2525
ENV ENABLE_TRACE=0
2626
ENV LOG_LEVEL=2

0 commit comments

Comments
 (0)