From 8e6b3f77db1510d1f32acd1c8425a8f20aae6063 Mon Sep 17 00:00:00 2001 From: Xuefeng Zhu Date: Tue, 7 Dec 2021 16:09:06 -0800 Subject: [PATCH] add Akash deployment support --- .../templates/app/stargate/Makefile.plush | 21 +++++++++ .../app/stargate/deploy/deploy.yaml.plush | 45 +++++++++++++++++++ .../stargate/deploy/docker-compose.yml.plush | 23 ++++++++++ 3 files changed, 89 insertions(+) create mode 100644 starport/templates/app/stargate/Makefile.plush create mode 100644 starport/templates/app/stargate/deploy/deploy.yaml.plush create mode 100644 starport/templates/app/stargate/deploy/docker-compose.yml.plush diff --git a/starport/templates/app/stargate/Makefile.plush b/starport/templates/app/stargate/Makefile.plush new file mode 100644 index 0000000000..a88b0060fa --- /dev/null +++ b/starport/templates/app/stargate/Makefile.plush @@ -0,0 +1,21 @@ + +VERSION := $(shell echo $(shell git describe --tags) | sed 's/^v//') +COMMIT := $(shell git log -1 --format='%H') +LEDGER_ENABLED ?= true +BINDIR ?= $(GOPATH)/bin + +ifeq ($(LEDGER_ENABLED),true) + build_tags += ledger +endif + +ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=<%= AppName %> \ + -X github.com/cosmos/cosmos-sdk/version.AppName=<%= AppName %>d \ + -X github.com/cosmos/cosmos-sdk/version.Commit=$(COMMIT) \ + -X github.com/cosmos/cosmos-sdk/version.Version=$(VERSION) \ + -X "github.com/cosmos/cosmos-sdk/version.BuildTags=$(build_tags)" + +BUILD_FLAGS := -tags "$(build_tags)" -ldflags '$(ldflags)' + + +install: go.sum + go install $(BUILD_FLAGS) ./cmd/<%= BinaryNamePrefix %>d diff --git a/starport/templates/app/stargate/deploy/deploy.yaml.plush b/starport/templates/app/stargate/deploy/deploy.yaml.plush new file mode 100644 index 0000000000..13451c8ac7 --- /dev/null +++ b/starport/templates/app/stargate/deploy/deploy.yaml.plush @@ -0,0 +1,45 @@ +--- +version: "2.0" + +services: + node: + image: ghcr.io/ovrclk/cosmos-omnibus:v0.0.14-<%= AppName %>-v0.0.0 + env: + - MONIKER=node_1 + - CHAIN_JSON=https://raw.githubusercontent.com/cosmos/chain-registry/master/<%= AppName %>/chain.json + expose: + - port: 26657 + as: 80 + to: + - global: true + - port: 26656 + to: + - global: true + +profiles: + compute: + node: + resources: + cpu: + units: 2 + memory: + size: 2Gi + storage: + size: 60Gi + placement: + dcloud: + attributes: + host: akash + signedBy: + anyOf: + - akash1365yvmc4s7awdyj3n2sav7xfx76adc6dnmlx63 + pricing: + node: + denom: uakt + amount: 100 + +deployment: + node: + dcloud: + profile: node + count: 1 diff --git a/starport/templates/app/stargate/deploy/docker-compose.yml.plush b/starport/templates/app/stargate/deploy/docker-compose.yml.plush new file mode 100644 index 0000000000..bbc669f0a3 --- /dev/null +++ b/starport/templates/app/stargate/deploy/docker-compose.yml.plush @@ -0,0 +1,23 @@ +version: '3.4' + +services: + node_1: + build: + context: ../ + args: + PROJECT: <%= AppName %> + PROJECT_BIN: <%= BinaryNamePrefix %>d + VERSION: v0.0.0 + REPOSITORY: https://github.com/<%= OwnerAndRepoName %> + NAMESPACE: <%= AppName %> + PROJECT_DIR: .<%= BinaryNamePrefix %> + ports: + - '26656:26656' + - '26657:26657' + environment: + - MONIKER=node_1 + - CHAIN_JSON=https://raw.githubusercontent.com/cosmos/chain-registry/master/<%= AppName %>/chain.json + env_file: + - ../.env + volumes: + - ./node-data/.<%= BinaryNamePrefix %>:/root/.<%= BinaryNamePrefix %>