From 9a884a8af8909bdd5243b3fc97228980a65f3081 Mon Sep 17 00:00:00 2001 From: Huy Do Date: Mon, 30 Dec 2024 18:12:59 -0800 Subject: [PATCH] Handle illegal character in benchmark configs filename (#7461) * Handle illegal character in benchmark configs filename * Only change the filename * Save benchmark config filename as GH output * Typo * Also update the spec --- .github/workflows/android-perf.yml | 6 ++++-- .github/workflows/apple-perf.yml | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/android-perf.yml b/.github/workflows/android-perf.yml index 48625898ae..1874a4fd6e 100644 --- a/.github/workflows/android-perf.yml +++ b/.github/workflows/android-perf.yml @@ -98,6 +98,7 @@ jobs: - uses: actions/checkout@v3 - name: Prepare the spec + id: prepare shell: bash env: BENCHMARK_CONFIG: ${{ toJSON(matrix) }} @@ -111,7 +112,7 @@ jobs: # so let's just sed it sed -i -e 's,{{ model_path }},'"${MODEL_PATH}"',g' android-llm-device-farm-test-spec.yml.j2 - BENCHMARK_CONFIG_ID="${{ matrix.model }}_${{ matrix.config }}" + BENCHMARK_CONFIG_ID=$(echo "${{ matrix.model }}_${{ matrix.config }}" | sed -e 's/[^A-Za-z0-9._-]/_/g') # The config for this benchmark runs, we save it in the test spec so that it can be fetched # later by the upload script sed -i -e 's,{{ benchmark_config_id }},'"${BENCHMARK_CONFIG_ID}"',g' android-llm-device-farm-test-spec.yml.j2 @@ -122,6 +123,7 @@ jobs: # Save the benchmark configs so that we can use it later in the dashboard echo "${BENCHMARK_CONFIG}" > "${BENCHMARK_CONFIG_ID}.json" + echo "benchmark-config-id=${BENCHMARK_CONFIG_ID}" >> $GITHUB_OUTPUT - name: Upload the spec uses: seemethere/upload-artifact-s3@v5 @@ -141,7 +143,7 @@ jobs: ${{ github.repository }}/${{ github.run_id }}/artifacts/benchmark-configs/ retention-days: 1 if-no-files-found: error - path: extension/benchmark/android/benchmark/${{ matrix.model }}_${{ matrix.config }}.json + path: extension/benchmark/android/benchmark/${{ steps.prepare.outputs.benchmark-config-id }}.json export-models: name: export-models diff --git a/.github/workflows/apple-perf.yml b/.github/workflows/apple-perf.yml index b35daebaf5..f4fbc0128b 100644 --- a/.github/workflows/apple-perf.yml +++ b/.github/workflows/apple-perf.yml @@ -100,6 +100,7 @@ jobs: - uses: actions/checkout@v3 - name: Prepare the spec + id: prepare shell: bash env: BENCHMARK_CONFIG: ${{ toJSON(matrix) }} @@ -113,7 +114,7 @@ jobs: # so let's just sed it sed -i -e 's,{{ model_path }},'"${MODEL_PATH}"',g' default-ios-device-farm-appium-test-spec.yml.j2 - BENCHMARK_CONFIG_ID="${{ matrix.model }}_${{ matrix.config }}" + BENCHMARK_CONFIG_ID=$(echo "${{ matrix.model }}_${{ matrix.config }}" | sed -e 's/[^A-Za-z0-9._-]/_/g') # The config for this benchmark runs, we save it in the test spec so that it can be fetched # later by the upload script sed -i -e 's,{{ benchmark_config_id }},'"${BENCHMARK_CONFIG_ID}"',g' default-ios-device-farm-appium-test-spec.yml.j2 @@ -124,6 +125,7 @@ jobs: # Save the benchmark configs so that we can use it later in the dashboard echo "${BENCHMARK_CONFIG}" > "${BENCHMARK_CONFIG_ID}.json" + echo "benchmark-config-id=${BENCHMARK_CONFIG_ID}" >> $GITHUB_OUTPUT - name: Upload the spec uses: seemethere/upload-artifact-s3@v5 @@ -143,7 +145,7 @@ jobs: ${{ github.repository }}/${{ github.run_id }}/artifacts/benchmark-configs/ retention-days: 1 if-no-files-found: error - path: extension/benchmark/apple/Benchmark/${{ matrix.model }}_${{ matrix.config }}.json + path: extension/benchmark/apple/Benchmark/${{ steps.prepare.outputs.benchmark-config-id }}.json export-models: name: export-models