Skip to content

feat: sign gcp_all drives#1425

Closed
rugggger wants to merge 1 commit intomainfrom
07-02-feat_sign_gcp_all_drives
Closed

feat: sign gcp_all drives#1425
rugggger wants to merge 1 commit intomainfrom
07-02-feat_sign_gcp_all_drives

Conversation

@rugggger
Copy link
Contributor

@rugggger rugggger commented Jul 2, 2025

sign "gcp_all" drives (for Google GKE cluster)

<release_notes>

Sign all GCP drives for GKE clusters

Type: feature
Added support for automatically signing all eligible drives on GCP GKE nodes based on vendor and device IDs. Use type: gcp-all in the signDrivesPayload of a WekaManualOperation.
</release_notes>

Copy link
Contributor Author

rugggger commented Jul 2, 2025


How to use the Graphite Merge Queue

Add the label main-merge-queue to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has required the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@rugggger rugggger marked this pull request as ready for review July 2, 2025 08:33
@graphite-app
Copy link

graphite-app bot commented Jul 2, 2025

Graphite Automations

"Add anton/matt/sergey/kristina as reviwers on operator PRs" took an action on this PR • (07/02/25)

3 reviewers were added to this PR based on Anton Bykov's automation.

@rugggger rugggger force-pushed the 07-02-feat_sign_gcp_all_drives branch from 771ce46 to f7a1188 Compare July 2, 2025 08:43
serial_id_path = "/".join(pci_device_path.split("/")[:-2]) + "/serial"
serial_id = subprocess.check_output(f"cat {serial_id_path}", shell=True).decode().strip()
device_path = "/dev/" + pci_device_path.split("/")[-2]
if is_google_cos() and (not serial_id or serial_id == "nvme_card"):
Copy link
Contributor

Choose a reason for hiding this comment

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

isn't it enough to check for google_cos?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If I remember correctly there are other devices there of different types and you want only the nvme_card ones

Copy link
Contributor

Choose a reason for hiding this comment

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

but here you cover both cases that it is nvme and not, since you cover also not serial_id

if not serial_id:
logging.warning(f"lsblk did not return serial for {device_path}. Using fallback.")
serial_id = await get_serial_id_fallback(device_path)
if serial_id == "nvme_card":
Copy link
Contributor

Choose a reason for hiding this comment

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

why is this needed? you already have above handle for google cos

Copy link
Contributor

Choose a reason for hiding this comment

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

Since you expect to get here only for cos, you should just call here :

if is_google_cos():
        logging.info(f"Using COS-specific method for {device_name}")
        serial_id = await get_serial_id_cos_specific(device_name)
        if serial_id:
            return serial_id

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't know for sure that if the device name is "nvme_card" that it is COS. I know that it is not a valid name and so I will direct the call to a fallback.
In the fallback function itself I treat different cases, including is_google_cos

Copy link
Contributor

Choose a reason for hiding this comment

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

instead of having it in the fallback, check here for cos and have it here directly

@rugggger rugggger force-pushed the 07-02-feat_sign_gcp_all_drives branch 2 times, most recently from 11fc1f2 to 81968c0 Compare July 2, 2025 10:31
@rugggger rugggger force-pushed the 07-02-feat_sign_gcp_all_drives branch from 81968c0 to 161a799 Compare July 3, 2025 07:13
@graphite-app
Copy link

graphite-app bot commented Jul 3, 2025

Merge activity

  • Jul 3, 7:40 AM UTC: rugggger added this pull request to the Graphite merge queue.
  • Jul 3, 7:41 AM UTC: CI is running for this pull request on a draft pull request (#1431) due to your merge queue CI optimization settings.
  • Jul 3, 7:42 AM UTC: Merged by the Graphite merge queue via draft PR: #1431.

@graphite-app graphite-app bot closed this Jul 3, 2025
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