Skip to content

Commit

Permalink
Remove mock SLURM Cluster CI step (#145)
Browse files Browse the repository at this point in the history
* Try new version of ansible-slurm, continue on err

Signed-off-by: Fabrice Normandin <[email protected]>

* Try to update role to match new version

Signed-off-by: Fabrice Normandin <[email protected]>

* Add --diff -vvv to ansible-playbook command

Signed-off-by: Fabrice Normandin <[email protected]>

* Disable the step for now

Signed-off-by: Fabrice Normandin <[email protected]>

* Remove the mock slurm cluster CI step and files

Signed-off-by: Fabrice Normandin <[email protected]>

---------

Signed-off-by: Fabrice Normandin <[email protected]>
  • Loading branch information
lebrice authored Jan 21, 2025
1 parent 4b3d9bb commit 1c14222
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 201 deletions.
54 changes: 0 additions & 54 deletions .github/custom_setup_slurm_action/action.yml

This file was deleted.

74 changes: 0 additions & 74 deletions .github/custom_setup_slurm_action/slurm-playbook.yml

This file was deleted.

74 changes: 1 addition & 73 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,82 +78,10 @@ jobs:
name: coverage-reports-unit-${{ matrix.platform }}-${{ matrix.python-version }}
path: ./coverage.xml

mock-slurm-integration-tests:
name: integration tests with a mock slurm cluster
needs: [unit-tests]
runs-on: ${{ matrix.platform }}

strategy:
max-parallel: 5
matrix:
platform: [ubuntu-latest]
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']

# For the action to work, you have to supply a mysql
# service as defined below.
services:
mysql:
image: mysql:8.0
env:
MYSQL_ROOT_PASSWORD: root
ports:
- "8888:3306"
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3

steps:
- uses: actions/checkout@v4

# NOTE: Replacing this with our customized version of
# - uses: koesterlab/setup-slurm-action@v1
- uses: ./.github/custom_setup_slurm_action
timeout-minutes: 5

- name: Test if the slurm cluster is setup correctly
run: srun --nodes=1 --ntasks=1 --cpus-per-task=1 --mem=1G --time=00:01:00 hostname

- name: Setup passwordless SSH access to localhost for tests
# Adapted from https://stackoverflow.com/a/60367309/6388696
run: |
ssh-keygen -t ed25519 -f ~/.ssh/testkey -N ''
cat > ~/.ssh/config <<EOF
Host localhost
User $USER
HostName 127.0.0.1
IdentityFile ~/.ssh/testkey
EOF
echo -n 'from="127.0.0.1" ' | cat - ~/.ssh/testkey.pub > ~/.ssh/authorized_keys
chmod og-rw ~
ssh -o 'StrictHostKeyChecking no' localhost id
- name: Install the latest version of uv
uses: astral-sh/setup-uv@v3
with:
version: "latest"
enable-cache: true
# https://github.com/astral-sh/setup-uv?tab=readme-ov-file#github-authentication-token
github-token: ${{ secrets.GITHUB_TOKEN }}
cache-suffix: ${{ matrix.python-version }}
- name: Pin Python version to ${{ matrix.python-version }}
run: uv python pin ${{ matrix.python-version }}
- name: Install dependencies
run: uv sync

- name: Launch integration tests
run: uv run pytest --slow --cov=milatools --cov-report=xml --cov-append -vvv --log-level=DEBUG
timeout-minutes: 15
env:
SLURM_CLUSTER: localhost

- name: Store coverage report as an artifact
uses: actions/upload-artifact@v4
with:
name: coverage-reports-mock-${{ matrix.platform }}-${{ matrix.python-version }}
path: ./coverage.xml

real-slurm-integration-tests:

name: integration tests with a real SLURM cluster
needs: [mock-slurm-integration-tests]
needs: [unit-tests]

strategy:
max-parallel: 1
Expand Down

0 comments on commit 1c14222

Please sign in to comment.