Skip to content

Commit

Permalink
Upload the colmap rrd file to gcloud.
Browse files Browse the repository at this point in the history
  • Loading branch information
jleibs committed Mar 21, 2023
1 parent f40752a commit 9caf9de
Showing 1 changed file with 49 additions and 2 deletions.
51 changes: 49 additions & 2 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,10 @@ jobs:
shell: bash
# If you change the line below you should almost definitely change the `key:` line above by giving it a new, unique name
run: |
mkdir rrd
pip install -r examples/python/colmap/requirements.txt
python3 examples/python/colmap/main.py --dataset colmap_fiat --resize 800x600 --save colmap.rrd
cp colmap.rrd unpack-dist/${{ env.pkg_folder }}/rerun_sdk/rerun_demo/colmap.rrd
python3 examples/python/colmap/main.py --dataset colmap_fiat --resize 800x600 --save rrd/colmap.rrd
cp rrd/colmap.rrd unpack-dist/${{ env.pkg_folder }}/rerun_sdk/rerun_demo/colmap.rrd
- name: Repack the wheel
shell: bash
Expand All @@ -254,8 +255,54 @@ jobs:
name: wheels
path: dist

# All platforms are currently creating the same rrd file, upload one of them
- name: Save RRD artifact
if: matrix.platform == 'linux'
uses: actions/upload-artifact@v3
with:
name: rrd
path: rrd

# ---------------------------------------------------------------------------

upload_rrd:
name: Upload RRD to GCloud
permissions:
contents: "read"
id-token: "write"
needs: [wheels]
runs-on: "ubuntu-latest"
steps:
- name: Download Artifact
uses: actions/download-artifact@v3
with:
name: rrd
path: rrd

- id: "auth"
uses: google-github-actions/auth@v1
with:
workload_identity_provider: ${{ secrets.GOOGLE_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }}

- name: Add SHORT_SHA env property with commit short sha
run: echo "SHORT_SHA=`echo ${{github.sha}} | cut -c1-8`" >> $GITHUB_ENV

- name: "Upload RRD"
uses: google-github-actions/upload-cloud-storage@v1
with:
path: "rrd"
destination: "rerun-example-rrd/commit/${{env.SHORT_SHA}}"
parent: false

- name: "Upload RRD (tagged)"
if: startsWith(github.ref, 'refs/tags/v')
uses: google-github-actions/upload-cloud-storage@v1
with:
path: "rrd"
destination: "rerun-example-rrd/version/${{github.ref_name}}"
parent: false

# See https://github.com/ncipollo/release-action
pre-release:
name: Pre Release
Expand Down

0 comments on commit 9caf9de

Please sign in to comment.