diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 77bb19fc42..98606fac33 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -60,7 +60,9 @@ jobs: echo "TEST_REQUIRED=$test_required" >> $GITHUB_ENV - name: run test if: env.TEST_REQUIRED == 'true' - env: UPGRADE_BINARY_VERSION=${{ env.RELEASE_TAG }} + env: + UPGRADE_BINARY_VERSION: ${{ env.RELEASE_TAG }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | cd tests/upgrade make test diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 1efd834557..cbe9c18740 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -83,7 +83,6 @@ jobs: with: go-version: "${{ env.GOLANG_VERSION }}" - run: make deps-tidy - - run: make deps-vendor - run: make build - run: make test-vet - name: lint all diff --git a/Makefile b/Makefile index 32d261da12..78923303a7 100644 --- a/Makefile +++ b/Makefile @@ -11,8 +11,6 @@ include make/init.mk .DEFAULT_GOAL := bins DOCKER_RUN := docker run --rm -v $(shell pwd):/workspace -w /workspace -DOCKER_BUF := $(DOCKER_RUN) bufbuild/buf:$(BUF_VERSION) -DOCKER_CLANG := $(DOCKER_RUN) tendermintdev/docker-build-proto GOLANGCI_LINT_RUN := $(GOLANGCI_LINT) run LINT = $(GOLANGCI_LINT_RUN) ./... --disable-all --deadline=5m --enable @@ -69,12 +67,10 @@ all: build bins clean: cache-clean rm -f $(BINS) -include make/proto.mk include make/releasing.mk include make/mod.mk include make/lint.mk include make/test-integration.mk include make/test-simulation.mk include make/tools.mk -include make/environment.mk include make/codegen.mk diff --git a/go.mod b/go.mod index 7ec6631016..5b5a2500e0 100644 --- a/go.mod +++ b/go.mod @@ -3,9 +3,9 @@ module github.com/akash-network/node go 1.20 require ( - github.com/akash-network/akash-api v0.0.20 + github.com/akash-network/akash-api v0.0.23 github.com/blang/semver/v4 v4.0.0 - github.com/boz/go-lifecycle v0.1.0 + github.com/boz/go-lifecycle v0.1.1 github.com/cosmos/cosmos-sdk v0.45.16 github.com/cosmos/ibc-go/v4 v4.4.1 github.com/gogo/protobuf v1.3.3 diff --git a/go.sum b/go.sum index f1c0dbf8c8..05e54cd628 100644 --- a/go.sum +++ b/go.sum @@ -99,8 +99,8 @@ github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBA github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY= github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= -github.com/akash-network/akash-api v0.0.20 h1:rLj7DfAUNkL/HfArHZk9gnX7UjPNVz5ad9/kiBGmLSY= -github.com/akash-network/akash-api v0.0.20/go.mod h1:9/uYusyBcZecBQCgZWUbXRu0i1tyxj4/ze45XB2oLIU= +github.com/akash-network/akash-api v0.0.23 h1:zsu5ARReF7h8pD5jlBci3RpyJaahcvwI56IvNpR9+gE= +github.com/akash-network/akash-api v0.0.23/go.mod h1:9/uYusyBcZecBQCgZWUbXRu0i1tyxj4/ze45XB2oLIU= github.com/akash-network/cometbft v0.34.27-akash h1:V1dApDOr8Ee7BJzYyQ7Z9VBtrAul4+baMeA6C49dje0= github.com/akash-network/cometbft v0.34.27-akash/go.mod h1:BcCbhKv7ieM0KEddnYXvQZR+pZykTKReJJYf7YC7qhw= github.com/akash-network/ledger-go v0.14.3 h1:LCEFkTfgGA2xFMN2CtiKvXKE7dh0QSM77PJHCpSkaAo= @@ -151,8 +151,8 @@ github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= github.com/bmizerany/pat v0.0.0-20170815010413-6226ea591a40/go.mod h1:8rLXio+WjiTceGBHIoTvn60HIbs7Hm7bcHjyrSqYB9c= github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= -github.com/boz/go-lifecycle v0.1.0 h1:ytF+zvxcIhu5DHxkENEh9eeaw4NnTZbKbDoiUunDEpw= -github.com/boz/go-lifecycle v0.1.0/go.mod h1:zdagAUMcC2C0OmQkBlJZFV77uF4GCVaGphAexGi7oho= +github.com/boz/go-lifecycle v0.1.1 h1:tG/wff7Zxbkf19g4D4I0G8Y4sq83iT5QjD4rzEf/zrI= +github.com/boz/go-lifecycle v0.1.1/go.mod h1:zdagAUMcC2C0OmQkBlJZFV77uF4GCVaGphAexGi7oho= github.com/btcsuite/btcd v0.0.0-20190315201642-aa6e0f35703c/go.mod h1:DrZx5ec/dmnfpw9KyYoQyYo7d0KEvTkk/5M/vbZjAr8= github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ= github.com/btcsuite/btcd v0.21.0-beta.0.20201114000516-e9c7a5ac6401/go.mod h1:Sv4JPQ3/M+teHz9Bo5jBpkNcP0x6r7rdihlNL/7tTAs= diff --git a/make/environment.mk b/make/environment.mk deleted file mode 100644 index 34c7e1ddd6..0000000000 --- a/make/environment.mk +++ /dev/null @@ -1,5 +0,0 @@ -.PHONY: setup-devenv -setup-devenv: $(PROTOC) $(GRPC_GATEWAY) $(MODVENDOR) $(PROTOC_SWAGGER_GEN) $(KIND) deps-vendor modvendor - -.PHONY: setup-cienv -setup-cienv: deps-vendor modvendor diff --git a/make/init.mk b/make/init.mk index a729635937..60364417a6 100644 --- a/make/init.mk +++ b/make/init.mk @@ -57,19 +57,16 @@ GO_MOD_NAME := $(shell go list -m 2>/dev/null) # ==== Build tools versions ==== # Format _VERSION -BUF_VERSION ?= 0.35.1 GOLANGCI_LINT_VERSION ?= v1.51.2 GOLANG_VERSION ?= 1.16.1 STATIK_VERSION ?= v0.1.7 GIT_CHGLOG_VERSION ?= v0.15.1 -MODVENDOR_VERSION ?= v0.3.0 MOCKERY_VERSION ?= 2.24.0 COSMOVISOR_VERSION ?= v1.4.0 # ==== Build tools version tracking ==== # _VERSION_FILE points to the marker file for the installed version. # If _VERSION_FILE is changed, the binary will be re-downloaded. -MODVENDOR_VERSION_FILE := $(AKASH_DEVCACHE_VERSIONS)/modvendor/$(MODVENDOR_VERSION) GIT_CHGLOG_VERSION_FILE := $(AKASH_DEVCACHE_VERSIONS)/git-chglog/$(GIT_CHGLOG_VERSION) MOCKERY_VERSION_FILE := $(AKASH_DEVCACHE_VERSIONS)/mockery/v$(MOCKERY_VERSION) GOLANGCI_LINT_VERSION_FILE := $(AKASH_DEVCACHE_VERSIONS)/golangci-lint/$(GOLANGCI_LINT_VERSION) @@ -77,7 +74,6 @@ STATIK_VERSION_FILE := $(AKASH_DEVCACHE_VERSIONS)/statik/$(STATIK_V COSMOVISOR_VERSION_FILE := $(AKASH_DEVCACHE_VERSIONS)/cosmovisor/$(COSMOVISOR_VERSION) # ==== Build tools executables ==== -MODVENDOR := $(AKASH_DEVCACHE_BIN)/modvendor GIT_CHGLOG := $(AKASH_DEVCACHE_BIN)/git-chglog MOCKERY := $(AKASH_DEVCACHE_BIN)/mockery NPM := npm diff --git a/make/mod.mk b/make/mod.mk index 8c577ff694..89fa0c2e87 100644 --- a/make/mod.mk +++ b/make/mod.mk @@ -7,18 +7,3 @@ deps-install: .PHONY: deps-tidy deps-tidy: go mod tidy - -.PHONY: deps-vendor -deps-vendor: - go mod vendor - -.PHONY: modsensure -modsensure: deps-tidy deps-vendor - -.PHONY: modvendor -modvendor: $(MODVENDOR) modsensure -ifeq ($(GO_MOD), vendor) -modvendor: - @echo "vendoring non-go files..." - $(MODVENDOR) -copy="**/*.h **/*.c" -include=github.com/zondax/hid -endif diff --git a/make/proto.mk b/make/proto.mk deleted file mode 100644 index bc74f782c0..0000000000 --- a/make/proto.mk +++ /dev/null @@ -1,31 +0,0 @@ -############################################################################### -### Protobuf ### -############################################################################### -ifeq ($(UNAME_OS),Linux) - PROTOC_ZIP ?= protoc-${PROTOC_VERSION}-linux-x86_64.zip - GRPC_GATEWAY_BIN ?= protoc-gen-grpc-gateway-${GRPC_GATEWAY_VERSION}-linux-x86_64 -endif -ifeq ($(UNAME_OS),Darwin) - PROTOC_ZIP ?= protoc-${PROTOC_VERSION}-osx-x86_64.zip - GRPC_GATEWAY_BIN ?= protoc-gen-grpc-gateway-${GRPC_GATEWAY_VERSION}-darwin-x86_64 -endif - -.PHONY: proto-lint -proto-lint: - $(DOCKER_BUF) lint --error-format=json - -.PHONY: proto-check-breaking -proto-check-breaking: - rm -rf $(AKASH_DEVCACHE)/akash - mkdir -p $(AKASH_DEVCACHE)/akash - (cp -r .git $(AKASH_DEVCACHE)/akash; \ - cd $(AKASH_DEVCACHE)/akash; \ - git checkout master; \ - git reset --hard; \ - $(MAKE) modvendor) - $(DOCKER_BUF) check breaking --against-input '.cache/akash/' - rm -rf $(AKASH_DEVCACHE)/akash - -.PHONY: proto-format -proto-format: - $(DOCKER_CLANG) find ./ ! -path "./vendor/*" -name *.proto -exec clang-format -i {} \; diff --git a/make/releasing.mk b/make/releasing.mk index 996145ed00..c6d5372713 100644 --- a/make/releasing.mk +++ b/make/releasing.mk @@ -34,11 +34,11 @@ endif # if go.mod contains replace for any modules on local filesystem # mount them into docker during goreleaser build to exactly same path -REPLACED_MODULES := $(shell go list -mod=readonly -m -f '{{ .Replace }}' all 2>/dev/null | grep -v -x -F "" | grep "^/") -ifneq ($(REPLACED_MODULES), ) - GORELEASER_MOUNT_REPLACED := $(foreach mod, $(REPLACED_MODULES), -v $(mod):$(mod)\\) -endif -GORELEASER_MOUNT_REPLACED := $(GORELEASER_MOUNT_REPLACED:\\=) +#REPLACED_MODULES := $(shell go list -mod=readonly -m -f '{{ .Replace }}' all 2>/dev/null | grep -v -x -F "" | grep "^/") +#ifneq ($(REPLACED_MODULES), ) +# GORELEASER_MOUNT_REPLACED := $(foreach mod, $(REPLACED_MODULES), -v $(mod):$(mod)\\) +#endif +#GORELEASER_MOUNT_REPLACED := $(GORELEASER_MOUNT_REPLACED:\\=) .PHONY: bins bins: $(BINS) @@ -47,7 +47,7 @@ bins: $(BINS) build: $(GO_BUILD) -a ./... -$(AKASH): modvendor +$(AKASH): $(GO_BUILD) -o $@ $(BUILD_FLAGS) ./cmd/akash .PHONY: akash @@ -77,10 +77,11 @@ docker-image: -e STRIP_FLAGS="$(GORELEASER_STRIP_FLAGS)" \ -e LINKMODE="$(GO_LINKMODE)" \ -e DOCKER_IMAGE=$(RELEASE_DOCKER_IMAGE) \ + -e GOPATH=/go \ + -v $(GOPATH):/go:ro \ -v /var/run/docker.sock:/var/run/docker.sock \ - $(GORELEASER_MOUNT_REPLACED) \ - -v `pwd`:/go/src/github.com/akash-network/node \ - -w /go/src/github.com/akash-network/node \ + -v `pwd`:/go/src/$(GO_MOD_NAME) \ + -w /go/src/$(GO_MOD_NAME) \ $(GORELEASER_IMAGE) \ -f .goreleaser-docker.yaml \ --debug=$(GORELEASER_DEBUG) \ @@ -94,7 +95,7 @@ gen-changelog: $(GIT_CHGLOG) @echo "generating changelog to .cache/changelog" ./script/genchangelog.sh "$(RELEASE_TAG)" .cache/changelog.md .PHONY: release -release: modvendor gen-changelog +release: gen-changelog docker run \ --rm \ -e STABLE=$(IS_STABLE) \ @@ -106,8 +107,9 @@ release: modvendor gen-changelog -e GITHUB_TOKEN="$(GITHUB_TOKEN)" \ -e GORELEASER_CURRENT_TAG="$(RELEASE_TAG)" \ -e DOCKER_IMAGE=$(RELEASE_DOCKER_IMAGE) \ + -e GOPATH=/go \ + -v $(GOPATH):/go:ro \ -v /var/run/docker.sock:/var/run/docker.sock \ - $(GORELEASER_MOUNT_REPLACED) \ -v `pwd`:/go/src/$(GO_MOD_NAME) \ -w /go/src/$(GO_MOD_NAME) \ $(GORELEASER_IMAGE) \ diff --git a/make/setup-cache.mk b/make/setup-cache.mk index de15fb916c..d354c4d4de 100644 --- a/make/setup-cache.mk +++ b/make/setup-cache.mk @@ -8,15 +8,6 @@ $(AKASH_DEVCACHE): mkdir -p $(AKASH_DEVCACHE)/run cache: $(AKASH_DEVCACHE) -$(MODVENDOR_VERSION_FILE): $(AKASH_DEVCACHE) - @echo "installing modvendor $(MODVENDOR_VERSION) ..." - rm -f $(MODVENDOR) - GOBIN=$(AKASH_DEVCACHE_BIN) $(GO) install github.com/goware/modvendor@$(MODVENDOR_VERSION) - rm -rf "$(dir $@)" - mkdir -p "$(dir $@)" - touch $@ -$(MODVENDOR): $(MODVENDOR_VERSION_FILE) - $(GIT_CHGLOG_VERSION_FILE): $(AKASH_DEVCACHE) @echo "installing git-chglog $(GIT_CHGLOG_VERSION) ..." rm -f $(GIT_CHGLOG) diff --git a/sdl/resources.go b/sdl/resources.go index 946e72e2b2..477a9aa229 100644 --- a/sdl/resources.go +++ b/sdl/resources.go @@ -67,8 +67,10 @@ func toManifestResources(res *v2ComputeResources) types.ResourceUnits { if res.GPU != nil { units.GPU = &types.GPU{ - Units: types.NewResourceValue(uint64(res.GPU.Units)), + Units: types.NewResourceValue(uint64(res.GPU.Units)), + Attributes: make(types.Attributes, len(res.GPU.Attributes)), } + copy(units.GPU.Attributes, res.GPU.Attributes) } else { units.GPU = &types.GPU{ Units: types.NewResourceValue(0), diff --git a/sdl/v2.go b/sdl/v2.go index 672811be12..11197b6b8e 100644 --- a/sdl/v2.go +++ b/sdl/v2.go @@ -344,7 +344,7 @@ func (sdl *v2) Manifest() (manifest.Manifest, error) { groups[group.Name] = group } - // at this moment compute and svc have been check for existence + // at this moment compute and svc have been checked for existence compute := sdl.Profiles.Compute[svcdepl.Profile] svc := sdl.Services[svcName] diff --git a/sdl/v2_test.go b/sdl/v2_test.go index 07ca3a2fdd..ff69c7e1f6 100644 --- a/sdl/v2_test.go +++ b/sdl/v2_test.go @@ -109,6 +109,12 @@ func TestV2ParseSimpleGPU(t *testing.T) { }, GPU: &atypes.GPU{ Units: atypes.NewResourceValue(1), + Attributes: atypes.Attributes{ + { + Key: "vendor/nvidia/model/a100", + Value: "true", + }, + }, }, Memory: &atypes.Memory{ Quantity: atypes.NewResourceValue(128 * unit.Mi),