From f12da9383dfa3f0d5e1ff650876ab8551987af0a Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Thu, 1 Aug 2024 00:28:45 +0000 Subject: [PATCH] addign graviton ci --- .github/workflows/ci_cpu.yml | 38 ++++++++--------- .github/workflows/regression_tests_cpu.yml | 33 +++++++-------- .../regression_tests_graviton_cpu.yml | 42 +++++++++++++++++++ 3 files changed, 77 insertions(+), 36 deletions(-) create mode 100644 .github/workflows/regression_tests_graviton_cpu.yml diff --git a/.github/workflows/ci_cpu.yml b/.github/workflows/ci_cpu.yml index 26fc185da1..3871e6e682 100644 --- a/.github/workflows/ci_cpu.yml +++ b/.github/workflows/ci_cpu.yml @@ -17,24 +17,24 @@ concurrency: jobs: ci-cpu: - runs-on: [self-hosted, graviton-test] - # strategy: - # fail-fast: false - # matrix: - # os: [ubuntu-20.04, macos-latest] + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-20.04, macos-latest] steps: - name: Setup Python for M1 - # if: matrix.os == 'macos-latest' + if: matrix.os == 'macos-latest' uses: actions/setup-python@v5 with: python-version: '3.10' architecture: arm64 - # - name: Setup Python for all other OS - # if: matrix.os != 'macos-latest' - # uses: actions/setup-python@v5 - # with: - # python-version: '3.9' - # architecture: x64 + - name: Setup Python for all other OS + if: matrix.os != 'macos-latest' + uses: actions/setup-python@v5 + with: + python-version: '3.9' + architecture: x64 - name: Setup Java 17 uses: actions/setup-java@v3 with: @@ -49,7 +49,7 @@ jobs: python ts_scripts/install_dependencies.py --environment=dev - name: Torchserve Sanity env: - TS_MAC_ARM64_CPU_ONLY: 'False' + TS_MAC_ARM64_CPU_ONLY: ${{ matrix.os == 'macos-latest' && 'True' || 'False' }} uses: nick-fields/retry@v3 with: timeout_minutes: 60 @@ -59,9 +59,9 @@ jobs: python torchserve_sanity.py # Any coverage.xml will be picked up by this step # Just make sure each coverage.xml is in a different folder - # - name: Upload codecov - # if: matrix.os == 'ubuntu-20.04' - # run : | - # curl -Os https://uploader.codecov.io/latest/linux/codecov - # chmod +x codecov - # ./codecov + - name: Upload codecov + if: matrix.os == 'ubuntu-20.04' + run : | + curl -Os https://uploader.codecov.io/latest/linux/codecov + chmod +x codecov + ./codecov \ No newline at end of file diff --git a/.github/workflows/regression_tests_cpu.yml b/.github/workflows/regression_tests_cpu.yml index f4f97bea32..d026209ede 100644 --- a/.github/workflows/regression_tests_cpu.yml +++ b/.github/workflows/regression_tests_cpu.yml @@ -3,10 +3,10 @@ name: Run Regression Tests on CPU on: push: branches: - - graviton_test + - master pull_request: branches: - - graviton_test + - master merge_group: concurrency: @@ -16,24 +16,24 @@ concurrency: jobs: regression-cpu: # creates workflows for OS: ubuntu, macOS M1 - runs-on: [self-hosted, graviton-test] - # strategy: - # fail-fast: false - # matrix: - # os: [ubuntu-20.04, macos-latest] + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-20.04, macos-latest] steps: - name: Setup Python for M1 - # if: matrix.os == 'macos-latest' + if: matrix.os == 'macos-latest' uses: actions/setup-python@v5 with: python-version: '3.10' architecture: arm64 - # - name: Setup Python for all other OS - # if: matrix.os != 'macos-latest' - # uses: actions/setup-python@v5 - # with: - # python-version: '3.9' - # architecture: x64 + - name: Setup Python for all other OS + if: matrix.os != 'macos-latest' + uses: actions/setup-python@v5 + with: + python-version: '3.9' + architecture: x64 - name: Setup Java 17 uses: actions/setup-java@v3 with: @@ -46,9 +46,8 @@ jobs: - name: Install dependencies run: | python ts_scripts/install_dependencies.py --environment=dev - pip install torchtext --no-deps - name: Torchserve Regression Tests env: - TS_MAC_ARM64_CPU_ONLY: 'False' + TS_MAC_ARM64_CPU_ONLY: ${{ matrix.os == 'macos-latest' && 'True' || 'False' }} run: | - python test/regression_tests.py + python test/regression_tests.py \ No newline at end of file diff --git a/.github/workflows/regression_tests_graviton_cpu.yml b/.github/workflows/regression_tests_graviton_cpu.yml new file mode 100644 index 0000000000..9f1e67a89e --- /dev/null +++ b/.github/workflows/regression_tests_graviton_cpu.yml @@ -0,0 +1,42 @@ +name: Run Regression Tests on CPU for Graviton + +on: + push: + branches: + - master + pull_request: + branches: + - master + merge_group: + +concurrency: + group: ci-cpu-${{ github.workflow }}-${{ github.ref == 'refs/heads/master' && github.run_number || github.ref }} + cancel-in-progress: true + +jobs: + regression-cpu: + runs-on: [self-hosted, graviton-test] + steps: + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: '3.10' + architecture: arm64 + - name: Setup Java 17 + uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: '17' + - name: Checkout TorchServe + uses: actions/checkout@v3 + with: + submodules: recursive + - name: Install dependencies + run: | + python ts_scripts/install_dependencies.py --environment=dev + pip install torchtext --no-deps + - name: Torchserve Regression Tests + env: + TS_MAC_ARM64_CPU_ONLY: 'False' + run: | + python test/regression_tests.py