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

MCU Workflow example with RP2350 #305

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

mangelajo
Copy link
Member

@mangelajo mangelajo commented Feb 21, 2025

Summary by CodeRabbit

  • New Features

    • Introduced new container configuration setups to streamline the development environment for Rust projects.
    • Added a project configuration file, enhancing project metadata and dependencies management.
    • Expanded workspace sources for better management of components within the project.
  • Bug Fixes

    • Updated installation commands to ensure compatibility with the latest development tools and environments.

Copy link
Contributor

coderabbitai bot commented Feb 21, 2025

Walkthrough

Three new configuration files have been added under the examples/mcu-rp2350/ directory. The Containerfile establishes a base image for a container and includes commands to download and run a script for installing probe-rs-tools. The Containerfile.devspace sets up a development environment with additional tools like gcc and gdb, initially as the root user, before switching to a non-root user. The pyproject.toml file defines project metadata, dependencies, and Python requirements for the project "jumpstarter-mcu-rp2350".

Changes

File(s) Change Summary
ex.../mcu-rp2350/Containerfile, ex.../mcu-rp2350/Containerfile.devspace Introduces two new container configuration files. The Containerfile uses quay.io/jumpstarter-dev/jumpstarter:latest and includes commands to download probe-rs-tools. The Containerfile.devspace uses quay.io/jumpstarter-dev/jumpstarter-devspace:latest, installs additional tools as root, then switches to non-root UID 10001, and installs Rust with specific configurations.
ex.../mcu-rp2350/pyproject.toml, pyproject.toml Introduces a new project configuration file pyproject.toml for "jumpstarter-mcu-rp2350" with metadata, dependencies, and Python version requirements. Updates the existing pyproject.toml to include jumpstarter-all as a workspace source.

Sequence Diagram(s)

sequenceDiagram
    participant U as User
    participant C as Container Build
    participant D as DNF Package Manager
    participant R as Rust Setup
    U->>C: Initiate build (Containerfile)
    C->>D: Install gcc, systemd-devel
    D-->>C: Packages installed
    C->>R: Run rustup install & update PATH
    R-->>C: Rust installed
    C->>R: Add target thumbv8m.main-none-eabihf
    C->>R: Install probe-rs-tools via Cargo
Loading
sequenceDiagram
    participant U as User
    participant C as Container Build
    participant D as DNF Package Manager
    participant S as User Switch
    participant R as Rust Setup
    U->>C: Initiate build (Containerfile.devspace)
    C->>D: Install gcc, systemd-devel, gdb as root
    D-->>C: Packages installed
    C->>S: Switch to UID 10001
    S-->>C: User switched
    C->>R: Run rust installation script & update PATH
    R-->>C: Rust installed
    C->>R: Add target thumbv8m.main-none-eabihf
    C->>R: Install probe-rs-tools (locked)
Loading

Possibly related PRs

  • probe-rs driver #306: This PR introduces a driver for the probe-rs tool, related to the Containerfile changes that involve the probe-rs ecosystem.

Poem

I'm a rabbit with a codey cheer,
Three files now hop into the sphere.
Rust tools and packages, all so near,
Building dreams without a fear.
In this dev world, we persevere,
Celebrating changes with a joyful cheer!
🐇✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

netlify bot commented Feb 21, 2025

Deploy Preview for jumpstarter-docs ready!

Name Link
🔨 Latest commit d6d2b6b
🔍 Latest deploy log https://app.netlify.com/sites/jumpstarter-docs/deploys/67c172cf4a68a80008571301
😎 Deploy Preview https://deploy-preview-305--jumpstarter-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (4)
examples/mcu-rp2350/Containerfile (2)

1-3: Add package cleanup after installation.

To reduce the container image size, consider cleaning up the DNF cache after package installation.

-RUN dnf install -y rustup gcc systemd-devel
+RUN dnf install -y rustup gcc systemd-devel && \
+    dnf clean all && \
+    rm -rf /var/cache/dnf

4-7: Optimize Dockerfile by chaining commands.

Multiple RUN commands create unnecessary layers in the container image. Consider chaining these commands to reduce the image size.

-RUN rustup-init -y
-ENV PATH="$PATH:$HOME/.cargo/bin"
-RUN ~/.cargo/bin/rustup target add thumbv8m.main-none-eabihf
-RUN ~/.cargo/bin/cargo install --locked probe-rs-tools
+RUN rustup-init -y && \
+    source $HOME/.cargo/env && \
+    rustup target add thumbv8m.main-none-eabihf && \
+    cargo install --locked probe-rs-tools
+ENV PATH="$PATH:$HOME/.cargo/bin"
examples/mcu-rp2350/Containerfile.devspace (2)

1-5: Add package cleanup after installation.

To reduce the container image size, consider cleaning up the DNF cache after package installation while running as root.

 USER root
-RUN dnf install -y gcc systemd-devel gdb
+RUN dnf install -y gcc systemd-devel gdb && \
+    dnf clean all && \
+    rm -rf /var/cache/dnf
 USER 10001

7-9: Optimize Dockerfile by chaining commands.

Multiple RUN commands create unnecessary layers in the container image. Consider chaining these commands to reduce the image size.

-ENV PATH="$PATH:$HOME/.cargo/bin"
-RUN ~/.cargo/bin/rustup target add thumbv8m.main-none-eabihf
-RUN ~/.cargo/bin/cargo install --locked probe-rs-tools
+RUN source $HOME/.cargo/env && \
+    rustup target add thumbv8m.main-none-eabihf && \
+    cargo install --locked probe-rs-tools
+ENV PATH="$PATH:$HOME/.cargo/bin"
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between dfea238 and 58df77e.

📒 Files selected for processing (2)
  • examples/mcu-rp2350/Containerfile (1 hunks)
  • examples/mcu-rp2350/Containerfile.devspace (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: e2e

USER root
RUN dnf install -y gcc systemd-devel gdb
USER 10001
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
Copy link
Collaborator

Choose a reason for hiding this comment

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

Or also use dnf as above?

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
pyproject.toml (1)

6-6: New Workspace Source Entry: jumpstarter-all

A new source entry jumpstarter-all = { workspace = true } has been added. This entry will allow the workspace to treat the jumpstarter-all package consistently with the other jumpstarter components. Ensure that downstream projects or configuration files (e.g., the new pyproject.toml in examples/mcu-rp2350) reference this entry correctly.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 58df77e and d6d2b6b.

⛔ Files ignored due to path filters (1)
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (4)
  • examples/mcu-rp2350/Containerfile (1 hunks)
  • examples/mcu-rp2350/Containerfile.devspace (1 hunks)
  • examples/mcu-rp2350/pyproject.toml (1 hunks)
  • pyproject.toml (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • examples/mcu-rp2350/pyproject.toml
🚧 Files skipped from review as they are similar to previous changes (2)
  • examples/mcu-rp2350/Containerfile
  • examples/mcu-rp2350/Containerfile.devspace
⏰ Context from checks skipped due to timeout of 90000ms (7)
  • GitHub Check: pytest-matrix (3.13)
  • GitHub Check: pytest-matrix (3.12)
  • GitHub Check: pytest-matrix (3.11)
  • GitHub Check: e2e
  • GitHub Check: build-and-push-image (jumpstarter-dev/jumpstarter-devspace .devfile/Containerfile.client)
  • GitHub Check: build-and-push-image (jumpstarter-dev/jumpstarter-dev .devfile/Containerfile)
  • GitHub Check: build-and-push-image (jumpstarter-dev/jumpstarter Dockerfile)

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.

2 participants