Skip to content

Commit

Permalink
Merge branch 'main' into feat/supporting-slurm-manager
Browse files Browse the repository at this point in the history
  • Loading branch information
germa89 authored Mar 22, 2024
2 parents 29a82d6 + 359de06 commit f58dd22
Show file tree
Hide file tree
Showing 32 changed files with 497 additions and 183 deletions.
3 changes: 2 additions & 1 deletion .ci/collect_mapdl_logs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ echo "Collecting docker run log..."
cp log.txt ./"$LOG_NAMES"/log.txt || echo "MAPDL run docker log not found."

echo "Copying docker launch log..."
cp mapdl_launch.log ./"$LOG_NAMES"/mapdl_launch.log || echo "MAPDL launch docker log not found."
cp mapdl_launch_0.log ./"$LOG_NAMES"/mapdl_launch_0.log || echo "MAPDL launch docker log not found."
cp mapdl_launch_1.log ./"$LOG_NAMES"/mapdl_launch_1.log || echo "MAPDL launch docker log not found."

echo "Collecting file structure..."
ls -R > ./"$LOG_NAMES"/files_structure.txt || echo "Failed to copy file structure to a file"
Expand Down
9 changes: 7 additions & 2 deletions .ci/start_mapdl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ export VERSION="$MAJOR$MINOR"
echo "MAPDL VERSION: $VERSION"


if [[ $MAPDL_VERSION == *"ubuntu"* ]] ; then
if [[ $MAPDL_VERSION == *"latest-ubuntu"* ]]; then
echo "It is latest-ubuntu. Using 'ansys' script to launch"
export EXEC_PATH=ansys
# export P_SCHEMA=/ansys_inc/ansys/ac4/schema

elif [[ $MAPDL_VERSION == *"ubuntu"* ]] ; then
echo "It is an ubuntu based image"
export EXEC_PATH=/ansys_inc/v$VERSION/ansys/bin/mapdl
export P_SCHEMA=/ansys_inc/v$VERSION/ansys/ac4/schema
Expand All @@ -40,7 +45,7 @@ docker run \
-e ANSYS_LOCK="OFF" \
-p "$PYMAPDL_PORT":50052 \
-p "$PYMAPDL_DB_PORT":50055 \
--shm-size=1gb \
--shm-size=2gb \
-e I_MPI_SHM_LMT=shm \
-e P_SCHEMA="$P_SCHEMA" \
-w /jobs \
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/codespaces-dev/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ansys-dpf-core==0.10.1
autopep8==2.0.4
autopep8==2.1.0
matplotlib==3.8.3
scipy==1.12.0
pandas==2.2.1
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer-local/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ansys-dpf-core==0.10.1
autopep8==2.0.4
autopep8==2.1.0
matplotlib==3.8.3
scipy==1.12.0
pandas==2.2.1
Expand Down
21 changes: 16 additions & 5 deletions .github/workflows/cache_cleaner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
uses: actions/checkout@v4.1.2

- name: Cleanup PR caches
if: github.event_name != 'workflow_dispatch'
Expand All @@ -26,9 +26,15 @@ jobs:
## Setting this to not fail the workflow while deleting cache keys.
set +e
echo "Deleting caches..."
for cacheKey in $cacheKeysForPR
while [ ! -z "$cacheKeysForPR" ];
do
gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm && echo "Deleting cache with key: $cacheKey"
for cacheKey in $cacheKeysForPR
do
gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm && echo "Deleting cache with key: $cacheKey"
done
cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH | cut -f 1 )
done
echo "Done"
env:
Expand All @@ -48,9 +54,14 @@ jobs:
## Setting this to not fail the workflow while deleting cache keys.
set +e
echo "Deleting caches..."
for cacheKey in $cacheKeysForPR
while [ ! -z "$cacheKeysForPR" ];
do
gh actions-cache delete $cacheKey -R $REPO --confirm && echo "Deleting cache with key: $cacheKey"
for cacheKey in $cacheKeysForPR
do
gh actions-cache delete $cacheKey -R $REPO --confirm && echo "Deleting cache with key: $cacheKey"
done
cacheKeysForPR=$(gh actions-cache list -R $REPO | cut -f 1 )
done
echo "Done"
env:
Expand Down
78 changes: 64 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,10 @@ jobs:
ON_DOCUMENTATION: TRUE
steps:
- name: "Install Git and checkout project"
uses: actions/checkout@v4
uses: actions/checkout@v4.1.2

- name: "Login in Github container registry"
uses: docker/login-action@v3.0.0
uses: docker/login-action@v3.1.0
with:
registry: ghcr.io
username: ${{ github.actor }}
Expand Down Expand Up @@ -290,22 +290,49 @@ jobs:
strategy:
fail-fast: false
matrix:
mapdl-version: ['v22.2.1', 'v22.2-ubuntu', 'v23.1.0', 'v23.2.0', 'v24.1.0', 'v24.1-ubuntu-student']
mapdl-version: [
'v22.2.1',
'v22.2-ubuntu',
'v23.1.0',
'v23.1-ubuntu',
'v23.2.0',
'v23.2-ubuntu',
'v24.1.0',
'v24.1-ubuntu',
'v24.1-ubuntu-student',
'v24.2.0',
'latest-ubuntu',
'latest-ubuntu-student',
]
extended_testing:
- ${{ github.event_name == 'schedule' || ( github.event_name == 'workflow_dispatch' && inputs.run_all_tests ) || ( github.event_name == 'push' && contains(github.ref, 'refs/tags') ) }}
exclude:
# In PRs skipping all MAPDL version except student ones (commented out).
- extended_testing: false
mapdl-version: 'v22.2.1'
- extended_testing: false
mapdl-version: 'v22.2-ubuntu'
- extended_testing: false
mapdl-version: 'v23.1.0'
- extended_testing: false
mapdl-version: 'v23.1-ubuntu'
- extended_testing: false
mapdl-version: 'v23.2.0'
- extended_testing: false
mapdl-version: 'v23.1.0'
mapdl-version: 'v23.2-ubuntu'
- extended_testing: false
mapdl-version: 'v24.1.0'
- extended_testing: false
mapdl-version: 'v24.1-ubuntu'
# - extended_testing: false
# mapdl-version: 'v24.1-ubuntu-student'
- extended_testing: false
mapdl-version: 'v24.2.0'
- extended_testing: false
mapdl-version: 'latest-ubuntu'
# - extended_testing: false
# mapdl-version: 'latest-ubuntu-student'

env:
PYMAPDL_PORT: 21000 # default won't work on GitHub runners
PYMAPDL_PORT2: 21001 # for the pool testing and default won't work on GitHub runners
Expand All @@ -320,10 +347,10 @@ jobs:

steps:
- name: "Install Git and checkout project"
uses: actions/checkout@v4
uses: actions/checkout@v4.1.2

- name: "Login in Github container registry"
uses: docker/login-action@v3.0.0
uses: docker/login-action@v3.1.0
with:
registry: ghcr.io
username: ${{ github.actor }}
Expand Down Expand Up @@ -482,14 +509,22 @@ jobs:
strategy:
fail-fast: false
matrix:
mapdl-image: ['v23.2-ubuntu', 'v24.1-ubuntu', 'v24.1-ubuntu-student']
mapdl-image: [
'v23.2-ubuntu',
'v24.1-ubuntu',
'v24.1-ubuntu-student',
'latest-ubuntu',
'latest-ubuntu-student',
]
extended_testing:
- ${{ github.event_name == 'schedule' || ( github.event_name == 'workflow_dispatch' && inputs.run_all_tests ) || ( github.event_name == 'push' && contains(github.ref, 'refs/tags') ) }}
exclude:
- extended_testing: false
mapdl-image: 'v23.2-ubuntu'
- extended_testing: false
mapdl-image: 'v24.1-ubuntu'
- extended_testing: false
mapdl-image: 'latest-ubuntu'
container:
image: ghcr.io/ansys/mapdl:${{ matrix.mapdl-image }}
options: -u=0:0 --oom-kill-disable --memory=6656MB --memory-swap=16896MB --shm-size=1gb --entrypoint /bin/bash
Expand All @@ -505,7 +540,7 @@ jobs:

steps:
- name: "Install Git and checkout project"
uses: actions/checkout@v4
uses: actions/checkout@v4.1.2
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
Expand Down Expand Up @@ -608,14 +643,22 @@ jobs:
strategy:
fail-fast: false
matrix:
mapdl-image: ['v23.2-ubuntu', 'v24.1-ubuntu', 'v24.1-ubuntu-student']
mapdl-image: [
'v23.2-ubuntu',
'v24.1-ubuntu',
'v24.1-ubuntu-student',
'latest-ubuntu',
'latest-ubuntu-student',
]
extended_testing:
- ${{ github.event_name == 'schedule' || ( github.event_name == 'workflow_dispatch' && inputs.run_all_tests ) || ( github.event_name == 'push' && contains(github.ref, 'refs/tags') ) }}
exclude:
- extended_testing: false
mapdl-image: 'v23.2-ubuntu'
- extended_testing: false
mapdl-image: 'v24.1-ubuntu'
- extended_testing: false
mapdl-image: 'latest-ubuntu'
container:
image: ghcr.io/ansys/mapdl:${{ matrix.mapdl-image }}
options: -u=0:0 --oom-kill-disable --memory=6656MB --memory-swap=16896MB --shm-size=1gb --entrypoint /bin/bash
Expand All @@ -629,7 +672,7 @@ jobs:

steps:
- name: "Install Git and checkout project"
uses: actions/checkout@v4
uses: actions/checkout@v4.1.2
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
Expand Down Expand Up @@ -665,7 +708,13 @@ jobs:
run: |
# Because there is no 'ansys-tools-path' we need to input the
# executable path with the env var: PYMAPDL_MAPDL_EXEC.
version=$(echo "${{ matrix.mapdl-image }}" | head -c 5 | tail -c 4 | tr -d '.')
if [[ "${{ matrix.mapdl-image }}" == *"latest-ubuntu"* ]] ; then
version="242"
else
version=$(echo "${{ matrix.mapdl-image }}" | head -c 5 | tail -c 4 | tr -d '.')
fi;
echo "$version"
export PYMAPDL_MAPDL_EXEC=/ansys_inc/v"$version"/ansys/bin/ansys"$version"
Expand All @@ -692,6 +741,7 @@ jobs:


test-windows:
# Skipped
if: github.repository == ''
name: "Local: Build & test on Windows"
runs-on: [self-hosted, Windows, pymapdl]
Expand All @@ -700,7 +750,7 @@ jobs:
ON_LOCAL: TRUE

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4.1.2

# Skipping because it is installed locally.
# - name: Setup Python
Expand Down Expand Up @@ -826,7 +876,7 @@ jobs:
needs: upload-docs-release
steps:
- name: "Install Git and clone project"
uses: actions/checkout@v4
uses: actions/checkout@v4.1.2

- name: "Install the package requirements"
run: pip install -e .
Expand Down Expand Up @@ -899,7 +949,7 @@ jobs:
os: [ubuntu-latest, windows-latest]

steps:
- uses: actions/checkout@v1.0.0
- uses: actions/checkout@v4.1.2
- name: "Set up Julia"
uses: julia-actions/setup-julia@v1
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
name: Syncer
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4.1.2
- uses: micnncim/action-label-syncer@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
49 changes: 29 additions & 20 deletions .github/workflows/linkchecker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ concurrency:

env:
ON_CI: True
DOCKER_PACKAGE: ghcr.io/ansys/mapdl
DOCKER_IMAGE_VERSION_DOCS_BUILD: v23.1.0
MAIN_PYTHON_VERSION: '3.9'
MAPDL_PACKAGE: ghcr.io/ansys/mapdl
MAPDL_IMAGE_VERSION_DOCS_BUILD: v24.1.0
MAIN_PYTHON_VERSION: '3.10'
PYANSYS_OFF_SCREEN: True
DPF_START_SERVER: False
DPF_PORT: 21002
Expand All @@ -31,7 +31,30 @@ jobs:
SHELLOPTS: "errexit:pipefail"
steps:
- name: "Install Git and checkout project"
uses: actions/checkout@v4
uses: actions/[email protected]

- name: "Login in Github container registry"
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ secrets.GH_USERNAME }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: "DPF server activation"
run: |
$(docker pull ghcr.io/ansys/dpf-core:22.2dev && docker run -d --name dpfserver -p ${{ env.DPF_PORT }}:50052 ghcr.io/ansys/dpf-core:22.2dev && echo "DPF Server active on port ${{ env.DPF_PORT }}.") &
- name: "Pull, launch, and validate MAPDL service"
id: start_mapdl
env:
LICENSE_SERVER: ${{ secrets.LICENSE_SERVER }}
MAPDL_VERSION: ${{ env.MAPDL_IMAGE_VERSION_DOCS_BUILD }}
DISTRIBUTED_MODE: "dmp"
run: |
export INSTANCE_NAME=MAPDL
.ci/start_mapdl.sh &> mapdl_launch.log & export DOCKER_PID=$!
echo "Launching MAPDL service at PID: $DOCKER_PID"
echo "DOCKER_PID=$(echo $DOCKER_PID)" >> $GITHUB_OUTPUT
- name: "Setup Python"
uses: actions/setup-python@v5
Expand All @@ -53,19 +76,6 @@ jobs:
pip install .
xvfb-run python -c "from ansys.mapdl import core as pymapdl; print(pymapdl.Report())"
- name: "Login in Github container registry"
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ secrets.GH_USERNAME }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: "Pull, launch, and validate MAPDL service"
run: .ci/start_mapdl.sh
env:
LICENSE_SERVER: ${{ secrets.LICENSE_SERVER }}
MAPDL_IMAGE: '${{ env.DOCKER_PACKAGE }}:${{ env.DOCKER_IMAGE_VERSION_DOCS_BUILD }}'

- name: "Retrieve PyMAPDL version"
id: version
run: |
Expand All @@ -76,10 +86,9 @@ jobs:
run: |
pip install .[doc]
- name: "DPF server activation"
- name: "Waiting for the services to be up"
run: |
docker pull ghcr.io/ansys/dpf-core:22.2dev
docker run -d --name dpfserver -p ${{ env.DPF_PORT }}:50052 ghcr.io/ansys/dpf-core:22.2dev && echo "DPF Server active on port ${{ env.DPF_PORT }}."
.ci/waiting_services.sh
- name: LinkCheck
run: |
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ repos:
)
- repo: https://github.com/psf/black
rev: 24.2.0 # If version changes --> modify "blacken-docs" manually as well.
rev: 24.3.0 # If version changes --> modify "blacken-docs" manually as well.
hooks:
- id: black
args:
Expand All @@ -36,7 +36,7 @@ repos:
rev: 1.16.0
hooks:
- id: blacken-docs
additional_dependencies: [black==24.2.0]
additional_dependencies: [black==24.3.0]

- repo: https://github.com/PyCQA/flake8
rev: 7.0.0
Expand Down
2 changes: 1 addition & 1 deletion doc/source/api/pool.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ Local MAPDL pool
.. autosummary::
:toctree: _autosummary

pool.LocalMapdlPool
pool.MapdlPool
Loading

0 comments on commit f58dd22

Please sign in to comment.