Skip to content

CHORE: convert remote session to embed #69

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 26 additions & 25 deletions .github/workflows/fluent-mechanical.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,9 @@ jobs:
fail-fast: false
matrix:
ansys-release: [24.1, 24.2, 25.1]
container:
image: 'ghcr.io/ansys/mechanical:${{ matrix.ansys-release }}.0'
options: --entrypoint /bin/bash
steps:

- name: Checkout code
Expand All @@ -142,49 +145,42 @@ jobs:
doc

- name: Set up Python ${{ env.MAIN_PYTHON_VERSION }}
uses: actions/setup-python@v5
with:
python-version: ${{ env.MAIN_PYTHON_VERSION }}
run: |
apt update
apt install --reinstall ca-certificates
apt install software-properties-common -y
add-apt-repository ppa:deadsnakes/ppa -y
apt install -y python${{ env.MAIN_PYTHON_VERSION }} python${{ env.MAIN_PYTHON_VERSION }}-venv make
python${{ env.MAIN_PYTHON_VERSION }} -m venv .venv

- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y nodejs npm graphviz xvfb
apt-get update
apt-get install -y nodejs npm graphviz xvfb
npm install -g @mermaid-js/mermaid-cli

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m venv .venv
. .venv/bin/activate
python -m pip install --upgrade pip
pip install -r fluent-mechanical/requirements_${{ matrix.ansys-release }}.txt

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Download (if needed) launch, and validate Mechanical service
env:
LICENSE_SERVER: ${{ secrets.LICENSE_SERVER }}
MECHANICAL_IMAGE: ${{ env.MECHANICAL_DOCKER_IMAGE }}:${{ matrix.ansys-release }}.0
run: |
docker pull ${{ env.MECHANICAL_IMAGE }}
docker run --restart always --name ${{ env.DOCKER_MECH_CONTAINER_NAME }} -e ANSYSLMD_LICENSE_FILE=1055@${{ env.LICENSE_SERVER }} -p ${{ env.PYMECHANICAL_PORT }}:10000 ${{ env.MECHANICAL_IMAGE }} > log.txt &
grep -q 'WB Initialize Done' <(timeout 60 tail -f log.txt)

- name: Check out the fluent outputs
uses: actions/download-artifact@v4
with:
name: fluent-mechanical-workflow-fluent-outputs-${{ matrix.ansys-release }}
path: fluent-mechanical/outputs

- name: Run the PyMechanical script
env:
NUM_CORES: 1
ANSYS_WORKBENCH_LOGGING_CONSOLE: 0
ANSYS_WORKBENCH_LOGGING: 0
ANSYS_WORKBENCH_LOGGING_FILTER_LEVEL: 2
run: |
. .venv/bin/activate
xvfb-run python fluent-mechanical/wf_fm_02_mechanical.py
xvfb-run mechanical-env python fluent-mechanical/wf_fm_02_mechanical.py > pymechlogs${{ matrix.ansys-release }}.txt 2>&1 || true
cat pymechlogs${{ matrix.ansys-release }}.txt

- name: Store the outputs
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -214,12 +210,17 @@ jobs:
- name: (DOCS) Build the documentation (only on ${{ env.ANSYS_RELEASE_FOR_DOCS }})
if: ${{ env.RUN_DOC_BUILD == 'true' }}
env:
NUM_CORES: 1
ANSYS_WORKBENCH_LOGGING_CONSOLE: 0
ANSYS_WORKBENCH_LOGGING: 0
ANSYS_WORKBENCH_LOGGING_FILTER_LEVEL: 2
BUILD_DOCS_SCRIPT: 'fluent-mechanical/wf_fm_02_mechanical.py'
run: |
. .venv/bin/activate
cd doc
pip install -r requirements.txt
xvfb-run make html
xvfb-run mechanical-env make -C doc html > pymech-docs-logs${{ matrix.ansys-release }}.txt 2>&1 || true
cat pymech-docs-logs${{ matrix.ansys-release }}.txt

- name: (DOCS) Upload docs artifacts
if: ${{ env.RUN_DOC_BUILD == 'true' }}
Expand Down
Loading