Skip to content
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

FIX: split the workflow #14

Draft
wants to merge 15 commits into
base: main
Choose a base branch
from
68 changes: 61 additions & 7 deletions .github/workflows/geometry-mechanical-dpf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ jobs:
docker rm $dockerContainers
}

mech-dpf:
name: Mechanical - Dpf
mechanical:
name: Mechanical
runs-on: ubuntu-latest-8-cores
needs: geometry
strategy:
Expand All @@ -105,15 +105,15 @@ jobs:
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
python${{ env.MAIN_PYTHON_VERSION }} -m venv /env
python${{ env.MAIN_PYTHON_VERSION }} -m venv .venv

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

- name: Check out the geometry outputs
- name: Download the geometry outputs
uses: actions/download-artifact@v4
with:
name: geometry-outputs-${{ matrix.ansys-release }}
Expand All @@ -131,14 +131,68 @@ jobs:
xvfb-run mechanical-env python geometry-mechanical-dpf/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
with:
name: mechanical-outputs-${{ matrix.ansys-release }}
path: geometry-mechanical-dpf/outputs


dpf:
name: Data Processing Framework
runs-on: ubuntu-latest
needs: mechanical
strategy:
fail-fast: false
matrix:
ansys-release: [24.1, 24.2]
steps:

- name: Checkout code
uses: actions/checkout@v4
with:
sparse-checkout: 'geometry-mechanical-dpf'

- name: Set up Python ${{ env.MAIN_PYTHON_VERSION }}
uses: actions/setup-python@v5
with:
python-version: ${{ env.MAIN_PYTHON_VERSION }}

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

- name: Update ansys-version for DPF
run: |
ansys_version=${{ matrix.ansys-release }}
ansys_version_no_dot=${ansys_version//./}
echo ansys_version=$ansys_version_no_dot >> $GITHUB_ENV

- name: "Install DPF server"
id: set-server-path
uses: ansys/pydpf-actions/[email protected]
with:
dpf-standalone-TOKEN: ${{ secrets.PYANSYS_CI_BOT_TOKEN }}
ANSYS_VERSION : ${{env.ansys_version}}

- name: Download the mechanical outputs
uses: actions/download-artifact@v4
with:
name: mechanical-outputs-${{ matrix.ansys-release }}
path: geometry-mechanical-dpf/outputs

- name: Run the PyDPF script
run: |
. /env/bin/activate
xvfb-run python geometry-mechanical-dpf/03_dpf.py > pydpflogs${{ matrix.ansys-release }}.txt 2>&1 || true
cat pydpflogs${{ matrix.ansys-release }}.txt

- name: Store the outputs
uses: actions/upload-artifact@v4
with:
name: pymechanical-dpf-outputs-${{ matrix.ansys-release }}
name: dpf-outputs-${{ matrix.ansys-release }}
path: geometry-mechanical-dpf/outputs

- name: "Kill all servers"
uses: ansys/pydpf-actions/[email protected]
if: always()
8 changes: 4 additions & 4 deletions .github/workflows/geometry-mesh-fluent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,10 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Download Fluent service container
- name: Pull Fluent docker image
dipinknair marked this conversation as resolved.
Show resolved Hide resolved
run: docker pull ${{ env.FLUENT_DOCKER_IMAGE }}:v${{ matrix.ansys-release }}.0

- name: Check out the geometry outputs
- name: Download the geometry outputs
uses: actions/download-artifact@v4
with:
name: geometry-outputs-${{ matrix.ansys-release }}
Expand Down Expand Up @@ -168,10 +168,10 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Download Fluent service container
- name: Pull Fluent docker image
run: docker pull ${{ env.FLUENT_DOCKER_IMAGE }}:v${{ matrix.ansys-release }}.0

- name: Check out the meshing outputs
- name: Download the meshing outputs
uses: actions/download-artifact@v4
with:
name: fluent-mesh-outputs-${{ matrix.ansys-release }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/geometry-mesh.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,10 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Download PRIME service container
- name: Pull PRIME docker image
run: docker pull ${{ env.PRIME_DOCKER_IMAGE }}:${{ matrix.ansys-release }}

- name: Check out the geometry outputs
- name: Download the geometry outputs
uses: actions/download-artifact@v4
with:
name: geometry-outputs-${{ matrix.ansys-release }}
Expand Down
8 changes: 4 additions & 4 deletions geometry-mechanical-dpf/03_dpf.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,14 @@ def find_files(directory, extension):
if GRAPHICS_BOOL:
temp.plot()

# -- Transien thermal results --
# -- Transient thermal results --
#
# Create model
model = dpf.Model(transient_rth_file[0])
print(steady_state_model)
transient_model = dpf.Model(transient_rth_file[0])
print(transient_model)

# Get temperature distribution
temp = model.results.temperature.on_last_time_freq.eval()[0]
temp = transient_model.results.temperature.on_last_time_freq.eval()[0]

# Plot the the temperature for ic-1
if GRAPHICS_BOOL:
Expand Down
Loading