-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into release/0.2
- Loading branch information
Showing
41 changed files
with
2,042 additions
and
526 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
name: Build Docker images | ||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
paths: | ||
- 'docker/**' | ||
- '.github/workflows/build_docker_image.yml' | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- 'docker/**' | ||
- '.github/workflows/build_docker_image.yml' | ||
release: | ||
types: [published] | ||
|
||
env: | ||
MAIN_PYTHON_VERSION: '3.10' | ||
ANSRV_GEO_IMAGE_WINDOWS_TAG: ghcr.io/pyansys/geometry:windows-latest-tmp | ||
ANSRV_GEO_IMAGE_LINUX_TAG: ghcr.io/pyansys/geometry:linux-latest-tmp | ||
ANSRV_GEO_PORT: 700 | ||
ANSRV_GEO_LICENSE_SERVER: ${{ secrets.LICENSE_SERVER }} | ||
GEO_CONT_NAME: ans_geo | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
# ================================================================================================= | ||
# vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv RUNNING ON SELF-HOSTED RUNNER vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv | ||
# ================================================================================================= | ||
|
||
build-windows: | ||
name: Building Geometry Service - Windows | ||
runs-on: [self-hosted, pygeometry-ci-1] | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.9' # use python3.9, self-hosted has an issue with 3.10 | ||
|
||
- name: Download Windows binaries | ||
uses: dsaltares/fetch-gh-release-asset@master | ||
with: | ||
version: 'latest' | ||
file: 'windows-binaries.zip' | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
target: 'docker/windows-binaries.zip' | ||
|
||
- name: Build Docker image | ||
working-directory: docker | ||
run: | | ||
docker build -f Dockerfile.windows -t ${{ env.ANSRV_GEO_IMAGE_WINDOWS_TAG }} . | ||
- name: Launch Geometry service | ||
run: | | ||
docker run --detach --name ${{ env.GEO_CONT_NAME }} -e LICENSE_SERVER=${{ env.ANSRV_GEO_LICENSE_SERVER }} -p ${{ env.ANSRV_GEO_PORT }}:50051 ${{ env.ANSRV_GEO_IMAGE_WINDOWS_TAG }} | ||
- name: Validate connection using PyGeometry | ||
run: | | ||
python -m venv .venv | ||
.\.venv\Scripts\Activate.ps1 | ||
python -m pip install --upgrade pip | ||
pip install . | ||
python -c "from ansys.geometry.core.connection.validate import validate; validate()" | ||
- name: Stop the Geometry service | ||
if: always() | ||
run: | | ||
docker stop ${{ env.GEO_CONT_NAME }} | ||
docker logs ${{ env.GEO_CONT_NAME }} | ||
docker rm ${{ env.GEO_CONT_NAME }} | ||
- name: Delete the Docker images (and untagged ones) | ||
if: always() | ||
run: | | ||
docker image rm ${{ env.ANSRV_GEO_IMAGE_WINDOWS_TAG }} | ||
docker system prune -f | ||
# ================================================================================================= | ||
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ RUNNING ON SELF-HOSTED RUNNER ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
# ================================================================================================= | ||
|
||
build-linux: | ||
name: Building Geometry Service - Linux | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ env.MAIN_PYTHON_VERSION }} | ||
|
||
- name: Download Linux binaries | ||
uses: dsaltares/fetch-gh-release-asset@master | ||
with: | ||
version: 'latest' | ||
file: 'linux-binaries.zip' | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
target: 'docker/linux-binaries.zip' | ||
|
||
- name: Build Docker image | ||
working-directory: docker | ||
run: | | ||
docker build -f Dockerfile.linux -t ${{ env.ANSRV_GEO_IMAGE_LINUX_TAG }} . | ||
- name: Launch Geometry service | ||
run: | | ||
docker run --detach --name ${{ env.GEO_CONT_NAME }} -e LICENSE_SERVER=${{ env.ANSRV_GEO_LICENSE_SERVER }} -p ${{ env.ANSRV_GEO_PORT }}:50051 ${{ env.ANSRV_GEO_IMAGE_LINUX_TAG }} | ||
- name: Validate connection using PyGeometry | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install . | ||
python -c "from ansys.geometry.core.connection.validate import validate; validate()" | ||
- name: Stop the Geometry service | ||
if: always() | ||
run: | | ||
docker stop ${{ env.GEO_CONT_NAME }} | ||
docker logs ${{ env.GEO_CONT_NAME }} | ||
docker rm ${{ env.GEO_CONT_NAME }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Geometry service Linux-based Dockerfile | ||
# | ||
# Based on mcr.microsoft.com/dotnet/aspnet:6.0 | ||
FROM mcr.microsoft.com/dotnet/aspnet:6.0 | ||
|
||
# Define the working directory - /app | ||
WORKDIR /app | ||
|
||
# Install unzip | ||
RUN apt-get update && apt-get install -y unzip | ||
|
||
# Add the binary files from the latest release | ||
COPY linux-binaries.zip . | ||
RUN unzip -qqju linux-binaries.zip -d . && rm linux-binaries.zip | ||
|
||
# Let the dynamic link loader where to search for shared libraries | ||
ENV LD_LIBRARY_PATH="/app" | ||
|
||
# Add container labels | ||
LABEL org.opencontainers.image.authors="ANSYS Inc." | ||
LABEL org.opencontainers.image.vendor="ANSYS Inc." | ||
|
||
# Expose the Geometry service port | ||
EXPOSE 50051 | ||
|
||
# Define the entrypoint for the Geometry service | ||
ENTRYPOINT ["dotnet", "/app/Presentation.ApiServerLinux.dll"] |
Oops, something went wrong.