Skip to content

[virtual-machine] Fix: Add GPU names to virtual machines spec - #862

Merged
Andrei Kvapil (kvaps) merged 1 commit into
mainfrom
vm-gpu
Apr 23, 2025
Merged

[virtual-machine] Fix: Add GPU names to virtual machines spec#862
Andrei Kvapil (kvaps) merged 1 commit into
mainfrom
vm-gpu

Conversation

@kvaps

@kvaps Andrei Kvapil (kvaps) commented Apr 23, 2025

Copy link
Copy Markdown
Member

Signed-off-by: Andrei Kvapil kvapss@gmail.com

Summary by CodeRabbit

  • New Features

    • Each GPU device entry now includes a unique identifier alongside its device name in both VirtualMachine and VM Instance templates.
  • Configuration

    • The default GPU configuration now includes a specific GPU entry by default, instead of being empty.
  • Version Updates

    • Chart versions for VirtualMachine and VM Instance applications have been incremented.

@coderabbitai

coderabbitai Bot commented Apr 23, 2025

Copy link
Copy Markdown
Contributor

Warning

Rate limit exceeded

Andrei Kvapil (@kvaps) has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 24 minutes and 45 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 7f673fc and 8547dc3.

📒 Files selected for processing (5)
  • packages/apps/versions_map (2 hunks)
  • packages/apps/virtual-machine/Chart.yaml (1 hunks)
  • packages/apps/virtual-machine/templates/vm.yaml (1 hunks)
  • packages/apps/vm-instance/Chart.yaml (1 hunks)
  • packages/apps/vm-instance/templates/vm.yaml (1 hunks)

Walkthrough

This update modifies both the virtual-machine and vm-instance applications. It assigns specific commit hashes to previous HEAD version references and introduces new version numbers for both packages. The Helm chart versions are incremented accordingly. The GPU device configuration in the templates is enhanced by adding a unique name field for each GPU entry. Additionally, the default GPU list in the virtual-machine values file now includes a specific GPU by default instead of being empty.

Changes

File(s) Change Summary
packages/apps/versions_map Updated virtual-machine and vm-instance package version mappings: assigned commit hashes to previous HEAD entries, added new versions marked as HEAD.
packages/apps/virtual-machine/Chart.yaml
packages/apps/vm-instance/Chart.yaml
Incremented chart version numbers for both applications.
packages/apps/virtual-machine/templates/vm.yaml
packages/apps/vm-instance/templates/vm.yaml
Modified GPU device entries to include a unique name field alongside the existing deviceName.
packages/apps/virtual-machine/values.yaml Changed default GPU list from empty to containing one specific GPU entry.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant HelmChart
    participant VMTemplate

    User->>HelmChart: Deploy/Upgrade Chart
    HelmChart->>VMTemplate: Render vm.yaml with values (including gpus)
    VMTemplate->>VMTemplate: For each GPU, assign unique name (gpu1, gpu2, ...)
    VMTemplate->>HelmChart: Return rendered manifest with named GPU devices
    HelmChart->>User: Deployment includes GPUs with unique identifiers
Loading

Possibly related PRs

  • cozystack/cozystack#776: Updates version mappings for the virtual-machine and vm-instance packages, similar to this PR.
  • cozystack/cozystack#766: Introduced GPU support and configuration fields, which this PR builds upon by enhancing GPU device entries.

Suggested labels

ok-to-test

Suggested reviewers

  • lllamnyp

Poem

In the meadow of code where the GPUs play,
Each now has a name, not lost in the hay.
Versions march forward, charts rise anew,
With hashes and mappings all shiny and true.
A hop and a skip, the deployment feels right—
Rabbits rejoice, GPUs named in sight!
🐇💻✨


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ 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 generate sequence diagram to generate a sequence diagram of the changes in 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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

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 (3)
packages/apps/vm-instance/templates/vm.yaml (1)

49-50: GPU name field addition for vm-instance template
Great improvement adding a unique name field for each GPU device. To keep the chart self‑documented, consider updating packages/apps/vm-instance/values.yaml (or the README) to include an example and schema description for the new name property under the gpus array.

packages/apps/virtual-machine/values.yaml (1)

34-34: Consider quoting the GPU name
For clarity and to avoid any YAML parsing edge cases, quote the GPU name string:

- - name: nvidia.com/GA102GL_A10
+ - name: "nvidia.com/GA102GL_A10"
packages/apps/virtual-machine/templates/vm.yaml (1)

77-78: GPU naming: Ensure unique identifiers and correct indentation

The added fields correctly introduce a unique name for each GPU (gpu1, gpu2, etc.) alongside the existing deviceName. Please confirm that:

  1. Your values.yaml defines .Values.gpus as a list of objects with a name key (e.g., - name: "nvidia.com/GA102GL_A10") so $gpu.name resolves correctly.
  2. The indentation of the - name: and deviceName: lines aligns with the surrounding YAML (consider using Helm’s nindent for consistent spacing).

If you’d like to support both string and object definitions in .Values.gpus, consider this refactor:

{{- range $i, $gpu := .Values.gpus }}
- name: gpu{{ add $i 1 }}
  deviceName: {{ if kindIs "string" $gpu }}{{ $gpu }}{{ else }}{{ $gpu.name }}{{ end }}
{{- end }}
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between c22603b and 7f673fc.

📒 Files selected for processing (6)
  • packages/apps/versions_map (2 hunks)
  • packages/apps/virtual-machine/Chart.yaml (1 hunks)
  • packages/apps/virtual-machine/templates/vm.yaml (1 hunks)
  • packages/apps/virtual-machine/values.yaml (1 hunks)
  • packages/apps/vm-instance/Chart.yaml (1 hunks)
  • packages/apps/vm-instance/templates/vm.yaml (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Build and Test
🔇 Additional comments (5)
packages/apps/vm-instance/Chart.yaml (1)

20-20:

Details

✅ Verification successful

Chart version bump to 0.6.1 in vm-instance
Bumping the chart version to 0.6.1 correctly reflects the new GPU name feature while the appVersion remains unchanged. Please verify that packages/apps/versions_map includes a matching vm-instance 0.6.1 HEAD entry.


🏁 Script executed:

#!/bin/bash
# Verify versions_map entry exists for vm-instance 0.6.1 HEAD
set -e
rg -n '^vm-instance 0.6.1 HEAD$' packages/apps/versions_map

Length of output: 97


Chart version bump verified
The chart in packages/apps/vm-instance/Chart.yaml has been updated to 0.6.1, and a matching entry (vm-instance 0.6.1 HEAD) exists in packages/apps/versions_map (line 158). Approving this change.

packages/apps/virtual-machine/Chart.yaml (1)

20-20:

Details

✅ Verification successful

Chart version bump to 0.9.1 in virtual‑machine
The chart version is correctly incremented to 0.9.1 per semantic versioning, with appVersion unchanged at 0.9.0. Please confirm that packages/apps/versions_map has an entry for virtual-machine 0.9.1 HEAD.


🏁 Script executed:

#!/bin/bash
# Verify versions_map entry exists for virtual-machine 0.9.1 HEAD
set -e
rg -n '^virtual-machine 0.9.1 HEAD$' packages/apps/versions_map

Length of output: 105


Chart version bump to 0.9.1 in virtual‑machine
Version updated to 0.9.1 in Chart.yaml (line 20); appVersion remains at 0.9.0. Confirmed packages/apps/versions_map contains virtual-machine 0.9.1 HEAD. LGTM.

packages/apps/versions_map (2)

146-147: Update version mapping for virtual‑machine
The mapping pins 0.9.0 to commit 721c12a7 and marks 0.9.1 as HEAD, matching the chart bump.


157-158: Update version mapping for vm‑instance
The mapping pins 0.6.0 to commit 721c12a7 and marks 0.6.1 as HEAD, aligning with the updated chart version.

packages/apps/virtual-machine/values.yaml (1)

33-34: Review default GPU change in values.yaml
Introducing a default GPU entry means VMs will now attach nvidia.com/GA102GL_A10 unless overridden. Ensure this behavioural change is intended for all users and document it in the chart’s README or migration guide for transparency.

Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
@kvaps Andrei Kvapil (kvaps) added the backport Should change be backported on previous release label Apr 23, 2025
@kvaps
Andrei Kvapil (kvaps) merged commit e7ded52 into main Apr 23, 2025
@kvaps
Andrei Kvapil (kvaps) deleted the vm-gpu branch April 23, 2025 14:26
@github-actions

Copy link
Copy Markdown

Successfully created backport PR for release-0.30:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport Should change be backported on previous release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants