From 455d531c927fe4091f5b439ac6d6cca6922b3375 Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Fri, 8 Apr 2022 19:03:44 +0200 Subject: [PATCH 1/3] support setting GALAXY_SLOTS this will enable that each Galaxy job started within planemo test can use more than the default of 1 CPU core --- action.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/action.yml b/action.yml index 5f883ba..4989664 100644 --- a/action.yml +++ b/action.yml @@ -65,6 +65,9 @@ inputs: additional-planemo-options: description: 'Additional options passed to planemo in lint/test mode' default: '' + galaxy-slots: + description: 'Number of cores to be used for Galaxy jobs in planemo test' + default: '1' # inputs that are needed for testing this action # not supposed to be used github-event-name-override: @@ -132,6 +135,7 @@ runs: GITHUB_EVENT_NAME_OVERRIDE: ${{ inputs.github-event-name-override }} GITHUB_REF_OVERRIDE: ${{ inputs.github-ref-override }} ADDITIONAL_PLANEMO_OPTIONS: ${{ inputs.additional-planemo-options }} + GALAXY_SLOTS: ${{ inputs.galaxy-slots }} # see https://trstringer.com/github-actions-multiline-strings/ - run: | From fe9006110eb1e57c8a59f7c68db7b354ab697f54 Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Sat, 9 Apr 2022 14:32:52 +0200 Subject: [PATCH 2/3] add test --- .github/workflows/tools.yaml | 10 ++++--- test/tools/galaxy_slots/.shed.yml | 4 +++ test/tools/galaxy_slots/galaxy_slots.xml | 34 ++++++++++++++++++++++++ 3 files changed, 45 insertions(+), 3 deletions(-) create mode 100644 test/tools/galaxy_slots/.shed.yml create mode 100644 test/tools/galaxy_slots/galaxy_slots.xml diff --git a/.github/workflows/tools.yaml b/.github/workflows/tools.yaml index a2f2533..e72aa42 100644 --- a/.github/workflows/tools.yaml +++ b/.github/workflows/tools.yaml @@ -145,8 +145,8 @@ jobs: if ! grep -q "tool1.xml" <<<$(echo "${{ steps.discover.outputs.tool-list }}"); then echo "tool1.xml must be in the repo list"; exit 1; fi if ! grep -q "tool2.xml" <<<$(echo "${{ steps.discover.outputs.tool-list }}"); then echo "tool2.xml must be in the repo list"; exit 1; fi # chunk-count will only consider tools/workflows depending on the workflow input to the action - - name: Check that the number of chunks is two, i.e. the number of tools - run: if [ "${{ steps.discover.outputs.chunk-count }}" != "2" ]; then exit 1; fi + - name: Check that the number of chunks is three, i.e. the number of tools + run: if [ "${{ steps.discover.outputs.chunk-count }}" != "3" ]; then exit 1; fi lint: name: Test linting of tools @@ -217,6 +217,9 @@ jobs: with: path: ~/.cache/pip key: pip_cache_py_${{ matrix.python-version }}_gxy_${{ needs.setup-ci-tools.outputs.galaxy-head-sha }} + - name: Get number of CPU cores + uses: SimenB/github-actions-cpu-cores@v1 + id: cpu-cores - name: Planemo test tools uses: ./ id: test-tools @@ -228,6 +231,7 @@ jobs: chunk: ${{ matrix.chunk }} chunk-count: ${{ needs.setup-ci-tools.outputs.chunk-count }} additional-planemo-options: --simultaneous_uploads --check_uploads_ok + galaxy-slots: ${{ steps.cpu-cores.outputs.count }} - uses: actions/upload-artifact@v2 with: name: 'Tool test output ${{ matrix.chunk }}' @@ -264,7 +268,7 @@ jobs: mode: combine html-report: true - name: Check statistics - run: if ! grep -q "2\s\+success" <<<$(echo ${{ steps.combine.outputs.statistics }}); then echo "wrong statistics"; exit 1; fi + run: if ! grep -q "3\s\+success" <<<$(echo ${{ steps.combine.outputs.statistics }}); then echo "wrong statistics"; exit 1; fi - uses: actions/upload-artifact@v2 with: name: 'All tool test results' diff --git a/test/tools/galaxy_slots/.shed.yml b/test/tools/galaxy_slots/.shed.yml new file mode 100644 index 0000000..7ff5cd8 --- /dev/null +++ b/test/tools/galaxy_slots/.shed.yml @@ -0,0 +1,4 @@ +categories: [Sequence Analysis] +description: test setting GALAXY_SLOTS +name: galaxy_slots +owner: adent diff --git a/test/tools/galaxy_slots/galaxy_slots.xml b/test/tools/galaxy_slots/galaxy_slots.xml new file mode 100644 index 0000000..ae4b84c --- /dev/null +++ b/test/tools/galaxy_slots/galaxy_slots.xml @@ -0,0 +1,34 @@ + + + 0.1.0 + 0 + + '$out' + ]]> + + + + + + + + + + + + + + + + blah + + \ No newline at end of file From 63c20c3bdaca21dc02b745adcab2c65828a5135e Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Sat, 9 Apr 2022 15:45:47 +0200 Subject: [PATCH 3/3] add docs --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 357c8be..04c56cf 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ The version of planemo can be controlled with the input `planemo-version` (defau Assumptions ----------- -The action currently only works on workflows using an Ubuntu image. +The action currently only works on github actions workflows using an Ubuntu image. Assumptions on the repository ----------------------------- @@ -112,6 +112,7 @@ Optional inputs: - `galaxy-source` - `python-version` - `additional-planemo-options`: additional options passed to `planemo test`, see for instance [here](https://github.com/galaxyproject/planemo-ci-action/blob/657582777416fc51b6171961d90dced7dacbeea2/.github/workflows/tools.yaml#L229) +- `galaxy-slots`: number of slots (threads) to use in Galaxy jobs (sets the `GALAXY_SLOTS` environment variable) Output: