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

Debugging RXD failure #65

Draft
wants to merge 9 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
111 changes: 5 additions & 106 deletions .github/workflows/build-neuron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,55 +21,12 @@ defaults:
shell: bash

jobs:
# This allows us to dynamically vary the number of branches we run on on
# different days.
provide_version_matrix:
runs-on: ubuntu-latest
steps:
- name: check Azure drop url exists -> ${{ github.event.inputs.azure_drop_url }}
if: github.event_name == 'workflow_dispatch' && github.event.inputs.azure_drop_url
run: |
curl -sfSI -X GET '${{ github.event.inputs.azure_drop_url }}'
- name: Get latest release information
id: get_latest_release
uses: joutvhu/get-release@v1
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
with:
debug: true
latest: true
prerelease: true
repo: "nrn"
- name: Construct matrix of branch/tag names and wheel versions to test
id: provide_versions
run: |
if [[ '${{github.event.inputs.neuron_branch}}' == "" ]]
then
# If we're not told to test a specific branch, test the default branch with neuron-nightly wheels
values="{\"branch_or_tag\": \"\", \"default_wheel\": \"neuron-nightly\"}"
if [[ $(date +%u) == 1 ]] || [[ ${{ github.event_name }} == 'pull_request' ]] || [[ ${{ github.event_name }} == 'push' ]]
then
# If it's a Monday, test the latest release (and latest released wheels) in addition
# Also test it on any PR, and any push to a PR
tag_name="${{steps.get_latest_release.outputs.tag_name}}"
values="${values}, {\"branch_or_tag\": \"${tag_name}\", \"default_wheel\": \"neuron==${tag_name}\"}"
fi
echo "matrix=[${values}]" >> $GITHUB_OUTPUT
else
# Test the given branch with no wheels by default. If an Azure URL is given, those wheels will be used.
echo "matrix=[{\"branch_or_tag\": \"${{github.event.inputs.neuron_branch}}\", \"default_wheel\": \"\"}]" >> $GITHUB_OUTPUT
fi
outputs:
matrix: ${{ steps.provide_versions.outputs.matrix }}

ci:
timeout-minutes: 45
needs: provide_version_matrix
runs-on: ${{ matrix.os.vm }}
container: ${{ matrix.os.container }}
name: ${{matrix.os.container || matrix.os.vm}} ${{matrix.branch_or_tag_and_default_wheel.branch_or_tag}} ${{matrix.branch_or_tag_and_default_wheel.default_wheel}}
name: "blabla"
env:
SDK_ROOT: $(xcrun --sdk macosx --show-sdk-path)
OS_FLAVOUR: ${{matrix.os.flavour}}
UNPRIVILEGED_USER: runner # User created+used inside Docker containers
# Extra software collections to be installed and enabled on CentOS7
Expand All @@ -78,27 +35,8 @@ jobs:
strategy:
matrix:
os:
# GitHub Actions MacOS 13 runner
- { vm: macos-13, flavour: macOS }
# GitHub Actions MacOS 12 runner
- { vm: macos-12, flavour: macOS }
# Alma Linux 8 Docker image
- { vm: ubuntu-latest, container: "almalinux:8.10", flavour: redhat }
# CentOS Stream 9 Docker image
- { vm: ubuntu-latest, container: "quay.io/centos/centos:stream9", flavour: redhat }
# Fedora 37 Docker image
- { vm: ubuntu-latest, container: "fedora:37", flavour: redhat }
# Fedora Latest (38, at time of writing) Docker image
- { vm: ubuntu-latest, container: "fedora:latest", flavour: redhat }
# Ubuntu 20.04 Docker image
- { vm: ubuntu-latest, container: "ubuntu:20.04", flavour: debian }
# Ubuntu Latest (22.04, at time of writing) Docker image
- { vm: ubuntu-latest, container: "ubuntu:latest", flavour: debian }
# Debian Bullseye (11) Docker image
- { vm: ubuntu-latest, container: "debian:bullseye", flavour: debian }
# At the time of writing, Debian Bookworm (12) Docker image
- { vm: ubuntu-latest, container: "debian:stable", flavour: debian }
branch_or_tag_and_default_wheel: ${{ fromJson(needs.provide_version_matrix.outputs.matrix) }}
fail-fast: false

steps:
Expand Down Expand Up @@ -139,46 +77,7 @@ jobs:
git clone --depth=1 --single-branch ${BRANCH_OPT} ${{github.server_url}}/${{github.repository_owner}}/nrn
# Init submodules for testing purposes
cd nrn && git submodule update --init --recursive

# When we run in Ubuntu/Fedora/Debian containers from Docker Hub then we
# are root. This is different from when we use the GitHub Actions images
# directly, and leads to errors from MPI later. If we run inside Docker,
# create a regular user to run as.
- name: Setup unprivileged user
# If we run in a native GitHub Actions container, without Docker, this
# isn't needed
if: matrix.os.container
run: |
useradd --create-home ${UNPRIVILEGED_USER}
chown -R ${UNPRIVILEGED_USER}:${UNPRIVILEGED_USER} ${GITHUB_WORKSPACE}

# Put all the remaining steps in one job that runs as an unprivileged user
- name: Build and test NEURON
working-directory: ${{github.workspace}}/nrn
run: ../wrappers/runUnprivileged.sh ../scripts/buildNeuron.sh
env:
INSTALL_DIR : ${{github.workspace}}/nrn/install

# Download specific wheels from Azure via workflow dispatch
- name: Download Azure drop (artifacts) -> ${{ github.event.inputs.azure_drop_url }}
if: github.event.inputs.azure_drop_url
working-directory: ${{github.workspace}}
run: ./scripts/getAzureDrop.sh '${{ github.event.inputs.azure_drop_url }}'

# Test the wheels. If an Azure URL was given, those wheels are used. Otherwise:
# - default branch (master): neuron-nightly
# - latest release (tag X.Y): neuron==X.Y
# - feature branch: wheels only tested if a URL is given
- name: Test (nightly) NEURON wheel
if: github.event.inputs.azure_drop_url || matrix.branch_or_tag_and_default_wheel.default_wheel
working-directory: ${{github.workspace}}/nrn
run: ../wrappers/runUnprivileged.sh ../scripts/testNeuronWheel.sh
env:
NRN_PACKAGE: ${{matrix.branch_or_tag_and_default_wheel.default_wheel}}
NEURON_BRANCH_OR_TAG: ${{matrix.branch_or_tag}}

# This step will set up an SSH connection on tmate.io for live debugging
# of non-Docker runs that failed.
- name: live debug session on failure
if: failure() && !matrix.os.container
uses: mxschmitt/action-tmate@v3
python3 -m venv env
source env/bin/activate
env/bin/python -m pip install neuron-nightly pytest
env/bin/python -m pytest -k test_multi_gridding_mix test/
2 changes: 1 addition & 1 deletion scripts/buildNeuron.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,4 @@ echo "------- Install NEURON -------"
cmake --build . -- install

echo "------- Run test suite -------"
ctest -VV -j ${PARALLEL_JOBS}
ctest -VV -j ${PARALLEL_JOBS} -R 'rxdmod_tests::rxd_tests'
Loading