Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New image link format #3477

Merged
merged 9 commits into from
Sep 26, 2023
Merged

New image link format #3477

merged 9 commits into from
Sep 26, 2023

Conversation

jprochazk
Copy link
Member

@jprochazk jprochazk commented Sep 26, 2023

What

The new link format is https://static.rerun.io/{original_image_name_minus_extension}/{content_hash}/{width}.{ext}

For example, https://static.rerun.io/ae4b8970edba8480431cb71e57b8cddd9e1769c7_clock_480w.png is now https://static.rerun.io/clock/ae4b8970edba8480431cb71e57b8cddd9e1769c7/480w.png.

What makes this more discoverable:

  • For machines, it's the fact that the hash is the same for all sizes. This means given an image URL, you can retrieve all the other sizes. This is important for Docs codegen #3445.
  • For humans, the top-level directory is the name of the image, which makes it much easier to browse through GCS looking for that image. You can compare the updated at date of each hash to find the latest one.

upload_image.py has been updated to use the new format. We're nowhere near the point of using too much space on GCS, so all the old links are preserved.

This PR also fixes some other issues:

  • thumbnails.py did not handle updating thumbnail_dimensions correctly if the property was already present in the frontmatter
  • upload_image.py would fail if the user does not have delete permission when uploading the same image twice, because it would attempt to overwrite the existing image. if the content hash does not change, then we do not need to upload the image again, so we just skip uploading to GCS if the object already exists.

Checklist

@jprochazk jprochazk added 🧑‍💻 dev experience developer experience (excluding CI) 📖 documentation Improvements or additions to documentation exclude from changelog PRs with this won't show up in CHANGELOG.md labels Sep 26, 2023
@jprochazk
Copy link
Member Author

Linkinator is useful for once: All the new links are confirmed to work 😄

https://github.com/rerun-io/rerun/actions/runs/6313004017/job/17140171704?pr=3477

@jprochazk jprochazk changed the title New image layout New image link format Sep 26, 2023
Copy link
Member

@emilk emilk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

niiice

@jprochazk jprochazk merged commit 6cf6902 into main Sep 26, 2023
29 checks passed
@jprochazk jprochazk deleted the jan/new-upload-image-layout branch September 26, 2023 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🧑‍💻 dev experience developer experience (excluding CI) 📖 documentation Improvements or additions to documentation exclude from changelog PRs with this won't show up in CHANGELOG.md
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve upload-image artifact discoverability
2 participants