Skip to content

Merge CSM SMD head to OpenCHAMI #60

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

Merged
merged 49 commits into from
Jun 18, 2025
Merged

Merge CSM SMD head to OpenCHAMI #60

merged 49 commits into from
Jun 18, 2025

Conversation

shunr-hpe
Copy link
Contributor

This merges the HEAD of CSM SMD into OpenCHAMI.

The changes are>

  • Fixed resource leaks where the http responses were not being fully closed.
  • Added support for pprof.
  • Changed to use go 1.24.0.
  • Updated go dependencies.
  • Changed to use xnametypes API more.
  • Added support for Nvidia Foxconn Paradise nodes.

Hopefully this is the last big PR merging changes in from CSM. In the future as changes go into CSM they can also be added to OpenCHAMI.

This PR includes all the changes that happened in CSM since SMD was forked for OpenCHAMI.

Manny Alvarez III and others added 30 commits August 17, 2023 13:23
Fix case for the Arch enum in the swagger spec
CASMTRIAGE-5914
CASMHMS-6073: Migrate HSM to hms-base v2 and hms-xname.
Change FRU history to create 'Detected' events after 'Removed' events
Add ability to determine arch for paradise nodes (1.6 changes)

CASMHMS-6130
jwlv and others added 19 commits May 15, 2024 07:17
(cherry picked from commit a96ea6763a97267cdbf53a41f1508cde23a6ee37)
CASMHMS-5838: Fix bugs that break component role/subrole bulk updates
* Updated image and module dependencies for security updates
* Updated tests to look for 404 codes instead of 405 code due to gorilla/mux update
* Resolved build warnings in Dockerfiles and docker compose files
* Added image-pprof Makefile support
* Internal tracking Jira: CASMHMS-5678
* Update module dependencies related to hms-certs
* Updated vault override variables due to hms-certs update
* Internal tracking ticket: CASMHMS-5678
* Updated test_components test to allow additional flag values
Updated error message

* Updated test file with new error message and test
* Fixed false positive ComponentEndpoints test failure
* Internal tracking ticket: CASMTRIAGE-8027
* Updated module and image dependencies to latest versions
* Update version of Go to v1.24
* Removed several sections of code code that's now redundant with the  latest hms-base module
* Fixed various issues associated with upgrading Go to v1.24
* Internal tracking tickets: CASMHMS-6482, CASMHMS-6401, CASMHMS-6402
@alexlovelltroy alexlovelltroy requested a review from Copilot May 9, 2025 15:27
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR merges changes from CSM’s SMD head into OpenCHAMI. Key changes include fixing resource leaks by ensuring HTTP responses and request bodies are properly closed, switching from the legacy base API to the new xnametypes API, adding support for pprof profiling, and enhancing error message details and test expectations.

Reviewed Changes

Copilot reviewed 82 out of 82 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
cmd/smd/*.go Updated API calls to use xnametypes; added calls to DrainAndCloseRequestBody for proper resource finalization
cmd/smd/routers.go Integrated pprof handlers registration based on build tags
cmd/smd/rfevent.go Revised logging and added Foxconn Paradise node support
cmd/smd-api_test.go Updated test expectations to match revised error messages
Makefile & Dockerfile Updated build tags and version details to support go 1.24 and pprof support

@@ -281,6 +283,8 @@ func compGetLockFltrToCompLockV2Filter(cglf CompGetLockFltr) (clf sm.CompLockV2F

// Get the readiness state of HSM
func (s *SmD) doReadyGet(w http.ResponseWriter, r *http.Request) {
defer base.DrainAndCloseRequestBody(r)
Copy link
Preview

Copilot AI May 9, 2025

Choose a reason for hiding this comment

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

[nitpick] The repeated use of 'defer base.DrainAndCloseRequestBody(r)' in many handlers suggests that this logic could be centralized in middleware. Moving this responsibility to a common middleware function would reduce code duplication and the risk of missing a handler.

Copilot uses AI. Check for mistakes.

Copy link
Member

@alexlovelltroy alexlovelltroy left a comment

Choose a reason for hiding this comment

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

Approving based on lots of successful testing.

@alexlovelltroy alexlovelltroy merged commit 944b996 into main Jun 18, 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.

8 participants