Skip to content

Commit

Permalink
Reduce CI load (#415)
Browse files Browse the repository at this point in the history
### Issue
No issue

### Description
We are running same tests on both versions of ubuntu.
There is no need to think that tests would fall on one of the version
and not the other, and we never saw this case. I still intentionally
left building on ubuntu 22 though.
I chose ubuntu-20 since this is the same one as used in tt-metal.

### List of the changes
- Changed build-tests and run-tests to accept ubuntu version argument
- Added required ubuntu versions in build_and_run tests. Build on both
20 and 22, run tests only on 20.
- I'll also add these tests as required for PRs after this PR.

### Testing
CI tests on this PR

### API Changes
There are no API changes in this PR.
  • Loading branch information
broskoTT authored Dec 18, 2024
1 parent e157d9b commit d774668
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 21 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/build-and-run-all-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,14 @@ jobs:
{arch: wormhole_b0},
{arch: blackhole},
]
ubuntu-version: [
'ubuntu-22.04',
'ubuntu-20.04',
]
uses: ./.github/workflows/build-tests.yml
with:
arch: ${{ matrix.test-group.arch}}
ubuntu-version: ${{ matrix.ubuntu-version}}
timeout: 15

test-all:
Expand All @@ -39,8 +44,14 @@ jobs:
# Enable once we have functional cards.
# {arch: blackhole},
]
ubuntu-version: [
# Running tests on ubuntu-20.04 should be sufficient. Reduce load on CI.
# 'ubuntu-22.04',
'ubuntu-20.04',
]
uses: ./.github/workflows/run-tests.yml
with:
arch: ${{ matrix.test-group.arch}}
ubuntu-version: ${{ matrix.ubuntu-version}}
card: ${{ matrix.test-group.card}}
timeout: ${{ matrix.test-group.timeout}}
25 changes: 14 additions & 11 deletions .github/workflows/build-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ on:
arch:
required: true
type: string
ubuntu-version:
required: true
type: string
timeout:
required: true
type: number
Expand All @@ -21,6 +24,13 @@ on:
- grayskull
- wormhole_b0
- blackhole
ubuntu-version:
required: true
description: 'The version of Ubuntu to build on'
type: choice
options:
- ubuntu-22.04
- ubuntu-20.04
timeout:
required: true
description: 'The timeout for the build job in minutes'
Expand All @@ -40,18 +50,11 @@ jobs:
build:
# Due to parsing bug, fromJSON is used to convert string to number
timeout-minutes: ${{ fromJSON(inputs.timeout) }}
strategy:
fail-fast: false
matrix:
build: [
{runs-on: ubuntu-22.04, docker-image: tt-umd-ci-ubuntu-22.04},
{runs-on: ubuntu-20.04, docker-image: tt-umd-ci-ubuntu-20.04},
]

name: Build umd_tests for ${{ inputs.arch }} on ${{ matrix.build.runs-on }}
runs-on: ${{ matrix.build.runs-on }}
name: Build umd_tests for ${{ inputs.arch }} on ${{ inputs.ubuntu-version }}
runs-on: ${{ inputs.ubuntu-version }}
container:
image: ghcr.io/${{ github.repository }}/${{ matrix.build.docker-image }}:latest
image: ghcr.io/${{ github.repository }}/tt-umd-ci-${{ inputs.ubuntu-version }}:latest
options: --user root

env:
Expand Down Expand Up @@ -84,5 +87,5 @@ jobs:
- name: Upload build artifacts archive
uses: actions/upload-artifact@v4
with:
name: build-artifacts-${{ inputs.arch }}-${{ matrix.build.runs-on }}
name: build-artifacts-${{ inputs.arch }}-${{ inputs.ubuntu-version }}
path: artifact.tar
23 changes: 13 additions & 10 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:
arch:
required: true
type: string
ubuntu-version:
required: true
type: string
card:
required: true
type: string
Expand All @@ -23,6 +26,13 @@ on:
- grayskull
- wormhole_b0
- blackhole
ubuntu-version:
required: true
description: 'The version of Ubuntu to build on'
type: choice
options:
- ubuntu-22.04
- ubuntu-20.04
card:
required: true
description: 'The card to run tests on'
Expand All @@ -47,20 +57,13 @@ jobs:
test:
# Due to parsing bug, fromJSON is used to convert string to number
timeout-minutes: ${{ fromJSON(inputs.timeout) }}
strategy:
fail-fast: false
matrix:
build: [
{runs-on: ubuntu-22.04, docker-image: tt-umd-ci-ubuntu-22.04},
{runs-on: ubuntu-20.04, docker-image: tt-umd-ci-ubuntu-20.04},
]

name: Run tests for ${{ inputs.arch }} on ${{ inputs.card }} on ${{ matrix.build.runs-on }}
name: Run tests for ${{ inputs.arch }} on ${{ inputs.card }} on ${{ inputs.ubuntu-version }}
runs-on:
- self-hosted
- ${{ inputs.card }}
container:
image: ghcr.io/${{ github.repository }}/${{ matrix.build.docker-image }}:latest
image: ghcr.io/${{ github.repository }}/tt-umd-ci-${{ inputs.ubuntu-version }}:latest
options: --user root --device /dev/tenstorrent/0
volumes:
- /dev/hugepages:/dev/hugepages
Expand All @@ -83,7 +86,7 @@ jobs:
- name: Use build artifacts
uses: actions/download-artifact@v4
with:
name: build-artifacts-${{ inputs.arch }}-${{ matrix.build.runs-on }}
name: build-artifacts-${{ inputs.arch }}-${{ inputs.ubuntu-version }}
path: ./

# This is needed to preserve file permissions
Expand Down

0 comments on commit d774668

Please sign in to comment.