Skip to content

Use Cubit in GitHub hosted runners #393

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

Merged
merged 1 commit into from
Jun 30, 2025
Merged
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
6 changes: 5 additions & 1 deletion .github/actions/run_tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,20 @@ inputs:
description: Additional flags to pass to pytest, i.e., markers
required: false
default: ""
cubit-root:
description: Path to the cubit installation
required: false
default: ""
runs:
using: composite
steps:
- name: MeshPy testing
shell: bash
env:
MESHPY_FOUR_C_EXE: /home/user/4C/build/4C
CUBIT_ROOT: /imcs/public/compsim/opt/cubit-15.2
OMPI_MCA_rmaps_base_oversubscribe: 1
run: |
export CUBIT_ROOT=${{ inputs.cubit-root }}
cd ${GITHUB_WORKSPACE}
${{ inputs.source-command }}
pip install ${{ inputs.install-command }}
Expand Down
41 changes: 41 additions & 0 deletions .github/actions/setup_cubit/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: setup_cubit
description: Setup a Cubit installation for testing
inputs:
cubit_download_url:
description: URL where Cubit can be downloaded from
required: true
cubit_email:
description: Email to activate cubit
required: true
cubit_password:
description: Password to activate cubit
required: true
outputs:
cubit_root:
description: "Path to the Cubit installation"
value: ${{ steps.setup-cubit.outputs.cubit_root }}
runs:
using: composite
steps:
- name: Download and unpack Cubit
id: setup-cubit
shell: bash
run: |
# Check if secrets are available
if [[ -z "${{ inputs.cubit_email }}" || -z "${{ inputs.cubit_password }}" ]]; then
echo "cubit_email or cubit_password is empty or not injected. Cannot activate Cubit."
exit 1
fi
# We need these packages for cubit to work
sudo apt update
sudo apt install -y libglu1-mesa
# Download cubit and extract it
cd ${GITHUB_WORKSPACE}
wget -q ${{ inputs.cubit_download_url }}
tar -xzf *.tar.gz
# Save cubit root path for following steps
CUBIT_FOLDER=$(find . -maxdepth 1 -type d -name "Coreform-Cubit-*" | head -n 1 | sed 's|^\./||')
CUBIT_ROOT="$(pwd)/$CUBIT_FOLDER"
echo "cubit_root=$CUBIT_ROOT" >> "$GITHUB_OUTPUT"
# Activate cubit
$CUBIT_ROOT/bin/rlm_activate --login ${{ inputs.cubit_email }} ${{ inputs.cubit_password }}
7 changes: 1 addition & 6 deletions .github/actions/setup_virtual_python_environment/action.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
name: setup_virtual_python_environment
description: Configure the python virtual environment
inputs:
python-exe:
description: Command for python executable
required: false
default: "python"
runs:
using: composite
steps:
- name: Setup virtual environment
shell: bash
run: |
cd ${GITHUB_WORKSPACE}
${{ inputs.python-exe }} -m venv python-workflow-venv
python -m venv python-workflow-venv
source python-workflow-venv/bin/activate
pip install --upgrade pip
64 changes: 29 additions & 35 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ on:
push:
branches:
- main
pull_request:
pull_request_target:
types:
- opened
- reopened
- synchronize
workflow_dispatch:
type: choice

env:
CUBIT_DOWNLOAD_URL: https://f002.backblazeb2.com/file/cubit-downloads/Coreform-Cubit/Releases/Linux/Coreform-Cubit-2025.3%2B58709-Lin64.tar.gz

jobs:
meshpy-testing:
Expand Down Expand Up @@ -49,34 +51,8 @@ jobs:
name: ${{github.job}}-${{ matrix.os-version }}-python${{ matrix.python-version }}-${{github.run_number}}
path: ${{ env.PYTEST_TMPDIR }}

meshpy-testing-cubitpy:
name: self-hosted with CubitPy
runs-on: self-hosted
defaults:
run:
shell: bash
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup virtual python environment
uses: ./.github/actions/setup_virtual_python_environment
with:
python-exe: /home_local/github-runner/testing_lib/spack/opt/spack/linux-ubuntu20.04-icelake/gcc-9.4.0/python-3.12.1-qnjucxirxh534suwewl6drfa237u6t7w/bin/python
- name: Run the test suite
uses: ./.github/actions/run_tests
with:
install-command: ".[cubitpy,dev,fourc]"
source-command: "source python-workflow-venv/bin/activate"
additional-pytest-flags: "--CubitPy --no-cov"
- name: Upload test results on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: ${{github.job}}-${{github.run_number}}
path: ${{ env.PYTEST_TMPDIR }}

meshpy-testing-4C-arborx:
name: ubuntu-latest with 4C and ArborX
meshpy-testing-all-dependencies:
name: ubuntu-latest with all dependencies
runs-on: ubuntu-latest
container:
image: ghcr.io/4c-multiphysics/4c:main
Expand All @@ -88,6 +64,13 @@ jobs:
uses: actions/checkout@v4
with:
submodules: true
- name: Setup cubit
id: cubit
uses: ./.github/actions/setup_cubit
with:
cubit_download_url: ${{ env.CUBIT_DOWNLOAD_URL }}
cubit_email: ${{ secrets.CUBIT_EMAIL }}
cubit_password: ${{ secrets.CUBIT_PASSWORD }}
- name: Setup virtual python environment
uses: ./.github/actions/setup_virtual_python_environment
- name: Build ArborX geometric search
Expand All @@ -96,8 +79,9 @@ jobs:
uses: ./.github/actions/run_tests
with:
source-command: "source python-workflow-venv/bin/activate"
install-command: "-e .[dev,fourc]"
additional-pytest-flags: "--4C --ArborX --cov-fail-under=93"
install-command: "-e .[cubitpy,dev,fourc]"
additional-pytest-flags: "--4C --ArborX --CubitPy --cov-fail-under=93"
cubit-root: ${{ steps.cubit.outputs.cubit_root }}
- name: Upload test results on failure
if: failure()
uses: actions/upload-artifact@v4
Expand All @@ -109,24 +93,34 @@ jobs:

meshpy-performance-testing:
name: performance tests
runs-on: self-hosted
continue-on-error: true
runs-on: ubuntu-latest
container:
image: ghcr.io/4c-multiphysics/4c:main
defaults:
run:
shell: bash
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: true
- name: Setup cubit
id: cubit
uses: ./.github/actions/setup_cubit
with:
cubit_download_url: ${{ env.CUBIT_DOWNLOAD_URL }}
cubit_email: ${{ secrets.CUBIT_EMAIL }}
cubit_password: ${{ secrets.CUBIT_PASSWORD }}
- name: Setup virtual python environment
uses: ./.github/actions/setup_virtual_python_environment
with:
python-exe: /home_local/github-runner/testing_lib/spack/opt/spack/linux-ubuntu20.04-icelake/gcc-9.4.0/python-3.12.1-qnjucxirxh534suwewl6drfa237u6t7w/bin/python
- name: Run the test suite
uses: ./.github/actions/run_tests
with:
install-command: ".[cubitpy,dev,fourc]"
source-command: "source python-workflow-venv/bin/activate"
additional-pytest-flags: "--performance-tests --exclude-standard-tests -s --no-cov"
cubit-root: ${{ steps.cubit.outputs.cubit_root }}
- name: Upload test results on failure
if: failure()
uses: actions/upload-artifact@v4
Expand Down