Skip to content

Conversation

@cgwalters
Copy link
Contributor

Motivated by having a good Codespaces default UX.

This repo will also contain our centralized container image GC.

@cgwalters cgwalters changed the title WIP: Add devcontainer and container GC pipeline Add devcontainer and container GC pipeline Oct 22, 2025
@gemini-code-assist
Copy link

Summary of Changes

Hello @cgwalters, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the project's infrastructure by introducing a robust development container setup and a centralized system for managing container images. The primary goal is to provide a seamless and consistent development experience, especially for Codespaces users, while also automating the cleanup of stale container images in the GitHub Container Registry to maintain efficiency and reduce storage costs.

Highlights

  • Development Environment Setup: A new DevContainer configuration has been added, providing a standardized and consistent development environment. This includes pre-installed tools, Rust toolchain, and VSCode extensions, aiming to improve the Codespaces user experience.
  • Container Image Garbage Collection: A Rust-based xtask utility has been introduced for automated garbage collection of old container images from the GitHub Container Registry. This tool supports configurable retention periods, dry-run functionality, and protection for 'latest' tagged images.
  • Automated Build and Management Commands: New just commands have been integrated to streamline the process of building, tagging, and pushing the devcontainer image, as well as for executing the container garbage collection tasks with various options.
  • Project Structure and Documentation Updates: The project now utilizes a Rust workspace with an xtask pattern for automation. The README.md has been significantly updated to include detailed sections on the new development environment, container image management, and general development guidelines.
Ignored Files
  • Ignored by pattern: .github/workflows/** (3)
    • .github/workflows/build-devcontainer.yml
    • .github/workflows/container-gc.yml
    • .github/workflows/rust.yml
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a devcontainer setup and a container image garbage collection mechanism. The changes include adding configuration files for the devcontainer, a Rust-based tool for container image management, and associated automation scripts. The review focuses on correctness and maintainability, with suggestions for improvements in error handling and code clarity.

@@ -0,0 +1,278 @@
//! Container image garbage collection for GHCR.
//!
//! Deletes old container images from GitHub Container Registry based on age.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

There of course are probably other tools to do this...I didn't search really hard. The AI generated code here looked plausible to me though.

Copy link

@SNThrailkill SNThrailkill Oct 24, 2025

Choose a reason for hiding this comment

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

maybe itd be easier to just use an existing workflow like this one rather than try to code a quick rust script?

Choose a reason for hiding this comment

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

Been using this one with success: https://github.com/dataaxiom/ghcr-cleanup-action

Here's our implementation: https://github.com/ublue-os/bluefin/blob/main/.github/workflows/clean.yml

Github's SLA is 90 days, but I've never seen it garbage collect so we just do rolling 90 days and clean out everything else.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks! For now I went with Sean's one because I have a bias for Rust and I had done the switch before seeing your comment, but if we hit issues it'd likely make sense to switch and share a bit more code!

@cgwalters
Copy link
Contributor Author

OK yeah the main thing here is getting podman to work inside this codespaces environment (privileged docker) looks like it will require some fighting.

@cgwalters cgwalters force-pushed the devcontainer branch 2 times, most recently from 4d5dbe1 to b2866e9 Compare October 23, 2025 19:41
@SNThrailkill
Copy link

OK yeah the main thing here is getting podman to work inside this codespaces environment (privileged docker) looks like it will require some fighting.

Even if we dont get codespaces working, a devcontainer setup for local development still is valuable!

@cgwalters cgwalters marked this pull request as draft October 24, 2025 20:14
@cgwalters cgwalters removed the request for review from gursewak1997 October 24, 2025 20:14
@cgwalters cgwalters force-pushed the devcontainer branch 2 times, most recently from 6fdc498 to 56f6478 Compare October 28, 2025 21:05
@cgwalters cgwalters marked this pull request as ready for review October 28, 2025 21:07
@cgwalters
Copy link
Contributor Author

Awesome, so this devcontainer works e2e for me in a Github Codespace now!

@cgwalters
Copy link
Contributor Author

(I looked around and apparently there's also a competing https://devfile.io - might make sense to handle both)

@cgwalters cgwalters enabled auto-merge (squash) October 28, 2025 21:21
Motivated by having a good Codespaces default UX.

This repo will also contain our centralized container
image GC.

Assisted-by: Cursor (Claude Sonnet 4.5)
Signed-off-by: Colin Walters <walters@verbum.org>
Copy link

@SNThrailkill SNThrailkill left a comment

Choose a reason for hiding this comment

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

LGTM! I tried to open this in a codespace but I guess GitHub is having issues. Looking forward to trying this out.

@cgwalters cgwalters merged commit b23aa64 into bootc-dev:main Oct 31, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants