Skip to content
This repository was archived by the owner on Jun 2, 2026. It is now read-only.

Commit a76859e

Browse files
committed
Added Core snapshot script, update to latest proto
Signed-off-by: Tareque Hossain <thossain@nvidia.com>
1 parent 8b5704a commit a76859e

32 files changed

Lines changed: 31225 additions & 22596 deletions

Makefile

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,17 +218,25 @@ docker-build:
218218
docker build -t $(IMAGE_REGISTRY)/carbide-psm:$(IMAGE_TAG) -f $(DOCKERFILE_DIR)/Dockerfile.carbide-psm .
219219
docker build -t $(IMAGE_REGISTRY)/carbide-nsm:$(IMAGE_TAG) -f $(DOCKERFILE_DIR)/Dockerfile.carbide-nsm .
220220

221-
core-proto:
222-
if [ -d "nico-core" ]; then cd nico-core && git pull; else git clone ssh://git@github.com/NVIDIA/ncx-infra-controller-core.git nico-core; fi
221+
core-proto: core-proto-clean core-proto-fetch core-proto-fmt core-protogen
222+
223+
core-proto-clean:
224+
@echo "Cleaning up Core proto and protobuf files"
225+
rm -rf workflow-schema/site-agent/workflows/v1/*_carbide.proto
226+
rm -rf workflow-schema/schema/site-agent/workflows/v1/*.pb.go
227+
228+
core-proto-fetch:
229+
if [ -d "nico-core" ]; then cd nico-core && git fetch origin && git reset --hard origin/main; else git clone ssh://git@github.com/NVIDIA/ncx-infra-controller-core.git nico-core; fi
223230
ls nico-core/crates/rpc/proto
224231
@for file in nico-core/crates/rpc/proto/*.proto; do \
225232
cp "$$file" "workflow-schema/site-agent/workflows/v1/$$(basename "$$file" .proto)_carbide.proto"; \
226233
echo "Copied: $$file"; \
227234
done
235+
echo "Successfully copied Core protobuf files"
228236
rm -rf nico-core
229-
echo "Successfully copied Core protobuf files. However, updating Core proto is a complex process and requires manual editing of copied files. Check for WARNING statements in the diff."
230237

231238
core-proto-fmt:
239+
@echo "Formatting Core protobuf files"
232240
cd workflow-schema/scripts && go run core-proto-fmt.go
233241

234242
core-protogen:

api/pkg/api/handler/expectedpowershelf.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ func (cepsh CreateExpectedPowerShelfHandler) Handle(c echo.Context) error {
207207
}
208208

209209
if expectedPowerShelf.IpAddress != nil {
210-
createExpectedPowerShelfRequest.IpAddress = *expectedPowerShelf.IpAddress
210+
createExpectedPowerShelfRequest.BmcIpAddress = *expectedPowerShelf.IpAddress
211211
}
212212

213213
if expectedPowerShelf.RackID != nil {
@@ -725,7 +725,7 @@ func (uepsh UpdateExpectedPowerShelfHandler) Handle(c echo.Context) error {
725725
}
726726

727727
if updatedExpectedPowerShelf.IpAddress != nil {
728-
updateExpectedPowerShelfRequest.IpAddress = *updatedExpectedPowerShelf.IpAddress
728+
updateExpectedPowerShelfRequest.BmcIpAddress = *updatedExpectedPowerShelf.IpAddress
729729
}
730730

731731
if updatedExpectedPowerShelf.RackID != nil {

site-workflow/pkg/activity/expectedpowershelf.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -423,8 +423,8 @@ func expectedPowerShelfToRLAComponent(eps *cwssaws.ExpectedPowerShelf) *rlav1.Co
423423
component.Position = pos
424424
}
425425

426-
if eps.GetIpAddress() != "" {
427-
ipAddr := eps.GetIpAddress()
426+
if eps.GetBmcIpAddress() != "" {
427+
ipAddr := eps.GetBmcIpAddress()
428428
component.Bmcs[0].IpAddress = &ipAddr
429429
}
430430

site-workflow/pkg/activity/expectedpowershelf_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ func Test_expectedPowerShelfToRLAComponent(t *testing.T) {
485485
ExpectedPowerShelfId: &cwssaws.UUID{Value: "eps-001"},
486486
BmcMacAddress: "AA:BB:CC:DD:EE:FF",
487487
ShelfSerialNumber: "SHELF-001",
488-
IpAddress: "10.0.0.1",
488+
BmcIpAddress: "10.0.0.1",
489489
RackId: &cwssaws.RackId{Id: "rack-001"},
490490
Name: strPtr("pdu-shelf-1"),
491491
Manufacturer: strPtr("Vertiv"),

workflow-schema/schema/site-agent/workflows/v1/common_carbide.pb.go

Lines changed: 106 additions & 27 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

workflow-schema/schema/site-agent/workflows/v1/dns_carbide.pb.go

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

workflow-schema/schema/site-agent/workflows/v1/dpa_rpc_carbide.pb.go

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)