Skip to content

Commit

Permalink
Merge pull request #216 from sapcc/use-promquery-bulkcache
Browse files Browse the repository at this point in the history
update and simplify Manila share metric fetching
  • Loading branch information
majewsky committed Feb 27, 2024
2 parents 1cb3ff9 + 3b80948 commit bef6ee0
Show file tree
Hide file tree
Showing 12 changed files with 162 additions and 600 deletions.
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ COPY --from=builder /etc/ssl/cert.pem /etc/ssl/cert.pem
COPY --from=builder /pkg/ /usr/
# make sure all binaries can be executed
RUN castellum --version 2>/dev/null
RUN castellum-netapp-scout --version 2>/dev/null

ARG BININFO_BUILD_DATE BININFO_COMMIT_HASH BININFO_VERSION
LABEL source_repository="https://github.com/sapcc/castellum" \
Expand Down
44 changes: 19 additions & 25 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,26 +38,21 @@ BININFO_VERSION ?= $(shell git describe --tags --always --abbrev=7)
BININFO_COMMIT_HASH ?= $(shell git rev-parse --verify HEAD)
BININFO_BUILD_DATE ?= $(shell date -u +"%Y-%m-%dT%H:%M:%SZ")

build-all: build/castellum build/castellum-netapp-scout
build-all: build/castellum

build/castellum: FORCE
go build $(GO_BUILDFLAGS) -ldflags '-s -w -X github.com/sapcc/go-api-declarations/bininfo.binName=castellum -X github.com/sapcc/go-api-declarations/bininfo.version=$(BININFO_VERSION) -X github.com/sapcc/go-api-declarations/bininfo.commit=$(BININFO_COMMIT_HASH) -X github.com/sapcc/go-api-declarations/bininfo.buildDate=$(BININFO_BUILD_DATE) $(GO_LDFLAGS)' -o build/castellum .

build/castellum-netapp-scout: FORCE
go build $(GO_BUILDFLAGS) -ldflags '-s -w -X github.com/sapcc/go-api-declarations/bininfo.binName=castellum-netapp-scout -X github.com/sapcc/go-api-declarations/bininfo.version=$(BININFO_VERSION) -X github.com/sapcc/go-api-declarations/bininfo.commit=$(BININFO_COMMIT_HASH) -X github.com/sapcc/go-api-declarations/bininfo.buildDate=$(BININFO_BUILD_DATE) $(GO_LDFLAGS)' -o build/castellum-netapp-scout ./cmd/netapp-scout

DESTDIR =
ifeq ($(shell uname -s),Darwin)
PREFIX = /usr/local
else
PREFIX = /usr
endif

install: FORCE build/castellum build/castellum-netapp-scout
install: FORCE build/castellum
install -d -m 0755 "$(DESTDIR)$(PREFIX)/bin"
install -m 0755 build/castellum "$(DESTDIR)$(PREFIX)/bin/castellum"
install -d -m 0755 "$(DESTDIR)$(PREFIX)/bin"
install -m 0755 build/castellum-netapp-scout "$(DESTDIR)$(PREFIX)/bin/castellum-netapp-scout"

# which packages to test with test runner
GO_TESTPKGS := $(shell go list -f '{{if or .TestGoFiles .XTestGoFiles}}{{.ImportPath}}{{end}}' ./...)
Expand Down Expand Up @@ -130,31 +125,30 @@ help: FORCE
@printf " make \e[36m<target>\e[0m\n"
@printf "\n"
@printf "\e[1mGeneral\e[0m\n"
@printf " \e[36mvars\e[0m Display values of relevant Makefile variables.\n"
@printf " \e[36mhelp\e[0m Display this help.\n"
@printf " \e[36mvars\e[0m Display values of relevant Makefile variables.\n"
@printf " \e[36mhelp\e[0m Display this help.\n"
@printf "\n"
@printf "\e[1mPrepare\e[0m\n"
@printf " \e[36mprepare-static-check\e[0m Install any tools required by static-check. This is used in CI before dropping privileges, you should probably install all the tools using your package manager\n"
@printf " \e[36mprepare-static-check\e[0m Install any tools required by static-check. This is used in CI before dropping privileges, you should probably install all the tools using your package manager\n"
@printf "\n"
@printf "\e[1mBuild\e[0m\n"
@printf " \e[36mbuild-all\e[0m Build all binaries.\n"
@printf " \e[36mbuild/castellum\e[0m Build castellum.\n"
@printf " \e[36mbuild/castellum-netapp-scout\e[0m Build castellum-netapp-scout.\n"
@printf " \e[36minstall\e[0m Install all binaries. This option understands the conventional 'DESTDIR' and 'PREFIX' environment variables for choosing install locations.\n"
@printf " \e[36mbuild-all\e[0m Build all binaries.\n"
@printf " \e[36mbuild/castellum\e[0m Build castellum.\n"
@printf " \e[36minstall\e[0m Install all binaries. This option understands the conventional 'DESTDIR' and 'PREFIX' environment variables for choosing install locations.\n"
@printf "\n"
@printf "\e[1mTest\e[0m\n"
@printf " \e[36mcheck\e[0m Run the test suite (unit tests and golangci-lint).\n"
@printf " \e[36mrun-golangci-lint\e[0m Install and run golangci-lint. Installing is used in CI, but you should probably install golangci-lint using your package manager.\n"
@printf " \e[36mbuild/cover.out\e[0m Run tests and generate coverage report.\n"
@printf " \e[36mbuild/cover.html\e[0m Generate an HTML file with source code annotations from the coverage report.\n"
@printf " \e[36mstatic-check\e[0m Run static code checks\n"
@printf " \e[36mcheck\e[0m Run the test suite (unit tests and golangci-lint).\n"
@printf " \e[36mrun-golangci-lint\e[0m Install and run golangci-lint. Installing is used in CI, but you should probably install golangci-lint using your package manager.\n"
@printf " \e[36mbuild/cover.out\e[0m Run tests and generate coverage report.\n"
@printf " \e[36mbuild/cover.html\e[0m Generate an HTML file with source code annotations from the coverage report.\n"
@printf " \e[36mstatic-check\e[0m Run static code checks\n"
@printf "\n"
@printf "\e[1mDevelopment\e[0m\n"
@printf " \e[36mvendor\e[0m Run go mod tidy, go mod verify, and go mod vendor.\n"
@printf " \e[36mvendor-compat\e[0m Same as 'make vendor' but go mod tidy will use '-compat' flag with the Go version from go.mod file as value.\n"
@printf " \e[36mlicense-headers\e[0m Add license headers to all non-vendored .go files.\n"
@printf " \e[36mcheck-license-headers\e[0m Check license headers in all non-vendored .go files.\n"
@printf " \e[36mcheck-dependency-licenses\e[0m Check all dependency licenses using go-licence-detector.\n"
@printf " \e[36mclean\e[0m Run git clean.\n"
@printf " \e[36mvendor\e[0m Run go mod tidy, go mod verify, and go mod vendor.\n"
@printf " \e[36mvendor-compat\e[0m Same as 'make vendor' but go mod tidy will use '-compat' flag with the Go version from go.mod file as value.\n"
@printf " \e[36mlicense-headers\e[0m Add license headers to all non-vendored .go files.\n"
@printf " \e[36mcheck-license-headers\e[0m Check license headers in all non-vendored .go files.\n"
@printf " \e[36mcheck-dependency-licenses\e[0m Check all dependency licenses using go-licence-detector.\n"
@printf " \e[36mclean\e[0m Run git clean.\n"

.PHONY: FORCE
3 changes: 0 additions & 3 deletions Makefile.maker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ binaries:
- name: castellum
fromPackage: .
installTo: bin/
- name: castellum-netapp-scout
fromPackage: ./cmd/netapp-scout
installTo: bin/

coverageTest:
only: '/internal'
Expand Down
152 changes: 0 additions & 152 deletions cmd/netapp-scout/api.go

This file was deleted.

120 changes: 0 additions & 120 deletions cmd/netapp-scout/engine.go

This file was deleted.

Loading

0 comments on commit bef6ee0

Please sign in to comment.