Skip to content

Commit 8ba0c84

Browse files
committed
Merge remote-tracking branch 'csm/master' into csm-sync
2 parents 4c116ca + 5764136 commit 8ba0c84

File tree

82 files changed

+5047
-1957
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+5047
-1957
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ dist/
2323
/smd-loader
2424
/smd-loader-native
2525
/smd-native
26-
26+
/pprof

Dockerfile.pprof

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
FROM chainguard/wolfi-base:latest
2+
3+
RUN apk add --no-cache tini
4+
5+
# Include curl in the final image.
6+
RUN set -ex \
7+
&& apk update \
8+
&& apk add --no-cache curl tini \
9+
&& rm -rf /var/cache/apk/* \
10+
&& rm -rf /tmp/*
11+
12+
COPY pprof/smd /
13+
COPY pprof/smd-loader /
14+
COPY pprof/smd-init /
15+
RUN mkdir /persistent_migrations
16+
COPY migrations/* /persistent_migrations/
17+
18+
EXPOSE 27779
19+
20+
# nobody 65534:65534
21+
USER 65534:65534
22+
23+
CMD [ "/smd" ]
24+
25+
ENTRYPOINT [ "/sbin/tini", "--" ]

Makefile

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# MIT License
22
#
3-
# (C) Copyright 2021-2022 Hewlett Packard Enterprise Development LP
3+
# (C) Copyright 2021-2022,2025 Hewlett Packard Enterprise Development LP
44
#
55
# Permission is hereby granted, free of charge, to any person obtaining a
66
# copy of this software and associated documentation files (the "Software"),
@@ -41,7 +41,7 @@ LDFLAGS := -ldflags "-X main.GitCommit=$(COMMIT) \
4141
-X 'main.GoVersion=$(GO_VERSION)' \
4242
-X 'main.BuildUser=$(BUILD_USER)'"
4343

44-
all: image unittest ct snyk ct_image
44+
all: image image-pprof unittest ct snyk ct_image
4545

4646
.PHONY : all image unittest snyk ct ct_image binaries coverage docker
4747

@@ -62,29 +62,41 @@ ct_image:
6262

6363
binaries: smd smd-init smd-loader native
6464

65-
66-
6765
smd: cmd/smd/*.go
6866
GOOS=linux GOARCH=amd64 go build -o smd -v -tags musl $(LDFLAGS) ./cmd/smd
6967

7068
smd-init: cmd/smd-init/*.go
7169
GOOS=linux GOARCH=amd64 go build -o smd-init -v -tags musl $(LDFLAGS) ./cmd/smd-init
7270

71+
smd-loader: cmd/smd-loader/*.go
72+
GOOS=linux GOARCH=amd64 go build -o smd-loader -v -tags musl $(LDFLAGS) ./cmd/smd-loader
73+
74+
7375
native:
7476
go build -o smd-init-native -v -tags musl $(LDFLAGS) ./cmd/smd-init
7577
go build -o smd-native -v -tags musl $(LDFLAGS) ./cmd/smd
7678
go build -o smd-loader-native -v -tags musl $(LDFLAGS) ./cmd/smd-loader
7779

80+
coverage:
81+
go test -cover -v -tags musl ./cmd/* ./internal/* ./pkg/*
82+
83+
binaries-pprof: pprof/smd pprof/smd-init pprof/smd-loader
7884

85+
pprof/smd: cmd/smd/*.go
86+
GOOS=linux GOARCH=amd64 go build -o pprof/smd -v -tags "musl pprof" $(LDFLAGS) ./cmd/smd
7987

80-
smd-loader: cmd/smd-loader/*.go
81-
GOOS=linux GOARCH=amd64 go build -o smd-loader -v -tags musl $(LDFLAGS) ./cmd/smd-loader
88+
pprof/smd-init: cmd/smd-init/*.go
89+
GOOS=linux GOARCH=amd64 go build -o pprof/smd-init -v -tags "musl pprof" $(LDFLAGS) ./cmd/smd-init
8290

83-
coverage:
84-
go test -cover -v -tags musl ./cmd/* ./internal/* ./pkg/*
91+
pprof/smd-loader: cmd/smd-loader/*.go
92+
GOOS=linux GOARCH=amd64 go build -o pprof/smd-loader -v -tags "musl pprof" $(LDFLAGS) ./cmd/smd-loader
93+
94+
image-pprof:
95+
docker build ${NO_CACHE} --pull ${DOCKER_ARGS} --tag '${NAME}-pprof:${VERSION}' -f Dockerfile.pprof .
8596

8697
clean:
8798
rm -f smd smd-init smd-init-native smd-loader smd-loader-native smd-native
99+
rm -rf pprof
88100
go clean -testcache
89101
go clean -cache
90102
go clean -modcache

api/swagger_v2.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1423,6 +1423,7 @@ paths:
14231423
- MgmtHLSwitch
14241424
- CDUMgmtSwitch
14251425
- Node
1426+
- VirtualNode
14261427
- Processor
14271428
- Drive
14281429
- StorageGroup
@@ -11869,6 +11870,7 @@ definitions:
1186911870
- MgmtHLSwitch
1187011871
- CDUMgmtSwitch
1187111872
- Node
11873+
- VirtualNode
1187211874
- Processor
1187311875
- Drive
1187411876
- StorageGroup
@@ -12157,6 +12159,7 @@ parameters:
1215712159
- MgmtHLSwitch
1215812160
- CDUMgmtSwitch
1215912161
- Node
12162+
- VirtualNode
1216012163
- Processor
1216112164
- Drive
1216212165
- StorageGroup
@@ -12272,7 +12275,7 @@ parameters:
1227212275
- X86
1227312276
- ARM
1227412277
- Other
12275-
- Unknown
12278+
- UNKNOWN
1227612279
compClassParam:
1227712280
name: class
1227812281
in: query

cmd/smd-loader/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ import (
2929
"net/http"
3030
"os"
3131
"os/signal"
32+
"github.com/Cray-HPE/hms-base/v2"
33+
hmshttp "github.com/Cray-HPE/hms-go-http-lib"
3234
"syscall"
3335
"time"
3436

35-
base "github.com/Cray-HPE/hms-base"
36-
hmshttp "github.com/Cray-HPE/hms-go-http-lib"
3737
"github.com/hashicorp/go-retryablehttp"
3838
)
3939

0 commit comments

Comments
 (0)