Skip to content

Commit

Permalink
Merge pull request #277 from SpiNNakerManchester/use_build
Browse files Browse the repository at this point in the history
github action fixes
  • Loading branch information
Christian-B authored Jul 12, 2024
2 parents 16414c6 + a073007 commit 051c06e
Show file tree
Hide file tree
Showing 8 changed files with 136 additions and 163 deletions.
124 changes: 94 additions & 30 deletions .github/workflows/c_actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,53 +19,44 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Checkout SupportScripts
uses: actions/checkout@v4
- name: Prepare
uses: SpiNNakerManchester/SupportScripts/actions/prepare@main
with:
repository: SpiNNakerManchester/SupportScripts
path: support
- name: Install Ubuntu packages
uses: ./support/actions/apt-get-install
with:
packages: doxygen gcc-arm-none-eabi
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Checkout SpiNNaker Dependencies
uses: ./support/actions/install-spinn-deps
with:
# Note: SpiNNUtils needed for spinn_utilities.make_tools
repositories: spinnaker_tools spinn_common SpiNNFrontEndCommon

- name: "Prepare: Install SpiNNUtils"
uses: ./support/actions/install-spinn-deps
with:
# Note: SpiNNUtils needed for spinn_utilities.make_tools
repositories: SpiNNUtils
install: true
checkout_dependencies: spinnaker_tools spinn_common SpiNNFrontEndCommon
install_dependencies: SpiNNUtils
install_module: false
install_check_tools: false
ubuntu_packages: doxygen gcc-arm-none-eabi

# Note: run these before building to avoid linting modified_src directories
- name: Lint C code using Vera++
uses: ./support/actions/vera
uses: SpiNNakerManchester/SupportScripts/actions/vera@main
with:
base-dir: spinnaker_graph_front_end
options: -P max-dirname-length=40

- name: Lint C code using Vera++
uses: ./support/actions/vera
uses: SpiNNakerManchester/SupportScripts/actions/vera@main
with:
base-dir: gfe_integration_tests

- name: Build C dependencies
- name: "Prepare: Set Environment variables"
run: |
export SPINN_DIRS=$PWD/spinnaker_tools
echo "SPINN_DIRS=$PWD/spinnaker_tools" >> $GITHUB_ENV
echo "C_LOGS_DICT=$PWD/logs.sqlite3" >> $GITHUB_ENV
- name: Build C dependencies
run: |
make -C spinnaker_tools
make -C spinn_common install
make -C SpiNNFrontEndCommon/c_common install
- name: Build FEC C code
run: make
working-directory: SpiNNFrontEndCommon/c_common
env:
CFLAGS: -fdiagnostics-color=always

- name: Build Example code
run: make
env:
Expand All @@ -79,3 +70,76 @@ jobs:
CFLAGS: -fdiagnostics-color=always
GCC_COLORS: error=01;31:warning=01;35:note=01;36:range1=32:range2=34:locus=01:quote=01:fixit-insert=32:fixit-delete=31:diff-filename=01:diff-hunk=32:diff-delete=31:diff-insert=32
working-directory: gfe_integration_tests

- name: Upload Fec binaries
uses: actions/upload-artifact@v4
with:
name: fec_binaries
path: SpiNNFrontEndCommon/spinn_front_end_common/common_model_binaries/*.aplx
retention-days: 5

- name: Upload test_extra_monitor binaries
uses: actions/upload-artifact@v4
with:
name: test_extra_monitor_binary
path: gfe_integration_tests/test_extra_monitor/*.aplx
retention-days: 5

- name: Upload log.sqlite3s
uses: actions/upload-artifact@v4
with:
name: logs.sqlite3
path: logs.sqlite3
retention-days: 5

test:
needs: build
runs-on: ${{ matrix.runner }}
timeout-minutes: 20
strategy:
matrix:
runner: [ubuntu-latest, windows-latest, macos-latest]

steps:
- name: Prepare
uses: SpiNNakerManchester/SupportScripts/actions/prepare@main
with:
install_dependencies: >
SpiNNUtils SpiNNMachine SpiNNMan PACMAN spalloc
SpiNNFrontEndCommon TestBase
install_module: true
install_check_tools: false
ubuntu_packages: graphviz
cfg_file: spiNNakerGraphFrontEnd

- name: Download Fec binaries
uses: actions/download-artifact@v4
with:
name: fec_binaries
# Need to go into spynnaker as FEC will have been moved by install
path: external_binaries

- name: Download test_extra_monitor_binary Binaries
uses: actions/download-artifact@v4
with:
name: test_extra_monitor_binary
path: external_binaries

- name: Download logs.sqlite3
uses: actions/download-artifact@v4
with:
name: logs.sqlite3
path: external_binaries

- name: Append cfg
# Doing this in the prepare action ended with a different path
run: |
echo '[Mapping]' >> ~/.spiNNakerGraphFrontEnd.cfg
echo "external_binaries=$PWD/external_binaries" >> ~/.spiNNakerGraphFrontEnd.cfg
cat ~/.spiNNakerGraphFrontEnd.cfg
- name: Test with pytest and proxy
env:
SPALLOC_USER: ${{ secrets.SPALLOC_USER }}
SPALLOC_PASSWORD: ${{ secrets.SPALLOC_PASSWORD }}
run: pytest gfe_integration_tests/test_extra_monitor
126 changes: 12 additions & 114 deletions .github/workflows/python_actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,118 +17,16 @@

name: Python Actions
on: [push]
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
matrix:
python-version: [3.8, 3.9, "3.10", "3.11", "3.12"]

env:
BASE_PKG: spinnaker_graph_front_end
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Checkout SupportScripts
uses: actions/checkout@v4
with:
repository: SpiNNakerManchester/SupportScripts
path: support

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install pip, etc
uses: ./support/actions/python-tools
- name: Install mypy
run: pip install mypy

- name: Install Spinnaker Dependencies
uses: ./support/actions/install-spinn-deps
with:
repositories: >
SpiNNUtils SpiNNMachine SpiNNMan PACMAN spalloc
SpiNNFrontEndCommon TestBase
install: true
- name: Install matplotlib
uses: ./support/actions/install-matplotlib
- name: Setup
uses: ./support/actions/run-install

- name: Create a configuration file
uses: ./support/actions/configure-spynnaker
with:
board-address: spinn-4.cs.man.ac.uk
- run: mv ~/.spynnaker.cfg ~/.spiNNakerGraphFrontEnd.cfg
- name: Test with pytest
uses: ./support/actions/pytest
with:
tests: unittests
coverage: ${{ matrix.python-version == 3.12 }}
cover-packages: ${{ env.BASE_PKG }}
coveralls-token: ${{ secrets.GITHUB_TOKEN }}

- name: Lint with flake8
run: flake8 ${{ env.BASE_PKG }} unittests gfe_examples
- name: Lint with pylint
uses: ./support/actions/pylint
with:
package: ${{ env.BASE_PKG }} gfe_examples
exitcheck: 31 # Action fails on any message
language: en_GB

- name: Lint with mypy
run: mypy $BASE_PKG

validate:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.12]

steps:
- name: Checkout
uses: actions/checkout@v4
- name: Checkout SupportScripts
uses: actions/checkout@v4
with:
repository: SpiNNakerManchester/SupportScripts
path: support

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install pip, etc
uses: ./support/actions/python-tools
- name: Install Spinnaker Dependencies
uses: ./support/actions/install-spinn-deps
with:
repositories: >
SpiNNUtils SpiNNMachine SpiNNMan PACMAN spalloc
SpiNNFrontEndCommon TestBase
install: true
- name: Install matplotlib
uses: ./support/actions/install-matplotlib
- name: Setup
uses: ./support/actions/run-install

- name: Create a configuration file
uses: ./support/actions/configure-spynnaker
with:
board-address: spinn-4.cs.man.ac.uk
- run: mv ~/.spynnaker.cfg ~/.spiNNakerGraphFrontEnd.cfg
- name: Run rat copyright enforcement
uses: ./support/actions/check-copyrights
with:
config_file: rat_asl20.xml

- name: Build documentation with sphinx
uses: ./support/actions/sphinx
with:
directory: doc/source

- name: Validate CITATION.cff
uses: dieghernan/cff-validator@main
jobs:
call:
uses: SpiNNakerManchester/SupportScripts/.github/workflows/python_checks.yml@main
with:
dependencies: SpiNNUtils SpiNNMachine SpiNNMan PACMAN spalloc SpiNNFrontEndCommon TestBase
ubuntu_packages: graphviz
test_directories: unittests
coverage-package: spinnaker_graph_front_end
flake8-packages: spinnaker_graph_front_end unittests gfe_examples
pylint-packages: spinnaker_graph_front_end
mypy-packages: spinnaker_graph_front_end gfe_examples gfe_integration_tests
cfg_file: spiNNakerGraphFrontEnd
6 changes: 4 additions & 2 deletions gfe_examples/sync_test/sync_test_vertex.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,10 @@ def generate_data_specification(
spec.write_value(0)
else:
routing_info = FecDataView.get_routing_infos()
spec.write_value(routing_info.get_first_key_from_pre_vertex(
self, SEND_PARTITION))
key = routing_info.get_first_key_from_pre_vertex(
self, SEND_PARTITION)
assert key is not None
spec.write_value(key)

# End-of-Spec:
spec.end_specification()
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ class SDRAMSplitter(AbstractSplitterCommon):
"_post_vertices",
"_partition"]

def __init__(self):
def __init__(self) -> None:
super().__init__()
self.__pre_vertex = None
self._post_vertices: list[SDRAMMachineVertex] = list()
self._post_vertices: List[SDRAMMachineVertex] = list()

@property
def _pre_vertex(self) -> SDRAMMachineVertex:
Expand All @@ -51,7 +51,7 @@ def get_out_going_vertices(self, partition_id: str) -> List[SDRAMMachineVertex]:
return self._post_vertices

@overrides(AbstractSplitterCommon.get_in_coming_vertices)
def get_in_coming_vertices(self, partition_id: str) -> SDRAMMachineVertex:
def get_in_coming_vertices(self, partition_id: str) -> List[SDRAMMachineVertex]:
return [self._pre_vertex]

def create_machine_vertices(self, chip_counter):
Expand Down Expand Up @@ -102,7 +102,9 @@ def get_in_coming_slices(self) -> List[Slice]:
@overrides(AbstractSplitterCommon.machine_vertices_for_recording)
def machine_vertices_for_recording(
self, variable_to_record: str) -> List[SDRAMMachineVertex]:
return [self._pre_vertex].extend(self._post_vertices)
mv = [self._pre_vertex]
mv.extend(self._post_vertices)
return mv

@overrides(AbstractSplitterCommon.reset_called)
def reset_called(self) -> None:
Expand Down
Loading

0 comments on commit 051c06e

Please sign in to comment.