Skip to content

Commit 28cd25d

Browse files
committed
improve uploading
1 parent 662b24c commit 28cd25d

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

.github/workflows/upload_benchmark_results.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ jobs:
4040
4141
- name: Upload SDGym Benchmark
4242
env:
43-
PY_state: "" # (optional) remove if unused
4443
PYDRIVE_TOKEN: ${{ secrets.PYDRIVE_TOKEN }}
4544
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
4645
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
@@ -54,6 +53,7 @@ jobs:
5453
run: |
5554
set -euo pipefail
5655
mkdir -p pr-staging
56+
5757
echo "Looking for files in: $GITHUB_LOCAL_RESULTS_DIR"
5858
ls -l "$GITHUB_LOCAL_RESULTS_DIR" || true
5959
@@ -87,7 +87,7 @@ jobs:
8787
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
8888
8989
git add assets/
90-
git commit -m "Upload SDGym Benchmark Results ($FOLDER_NAME)" || echo "No changes to commit"
90+
git commit -m "Upload SDGym Benchmark Results ($FOLDER_NAME) - Modality: ${{ inputs.modality }}" || echo "No changes to commit"
9191
9292
git remote set-url origin "https://x-access-token:${GH_TOKEN}@github.com/sdv-dev/sdv-dev.github.io.git"
9393
git push origin gatsby-home

sdgym/run_benchmark/upload_benchmark_results.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,14 @@ def upload_results(
164164
local_export_dir = temp_dir
165165

166166
Path(local_export_dir).mkdir(parents=True, exist_ok=True)
167-
local_file_path = str(Path(local_export_dir) / RESULT_FILENAME)
167+
local_file_path = str(Path(local_export_dir) / f'[{modality}] {RESULT_FILENAME}')
168168
s3_key = f'{prefix}{modality}/{RESULT_FILENAME}'
169-
s3_client.download_file(bucket, s3_key, local_file_path)
169+
try:
170+
s3_client.download_file(bucket, s3_key, local_file_path)
171+
except ClientError as e:
172+
if not e.response['Error']['Code'] == '404':
173+
raise
174+
170175
datas = {
171176
'Wins': summary,
172177
f'{run_date}_Detailed_results': results,

0 commit comments

Comments
 (0)