Skip to content

Commit

Permalink
Merge pull request #136 from osmosis-labs/anmol/restart-starship
Browse files Browse the repository at this point in the history
chore: fix tests for starship
  • Loading branch information
Anmol1696 authored Dec 30, 2023
2 parents a172297 + 8c3fafb commit 3cdce6e
Show file tree
Hide file tree
Showing 33 changed files with 820 additions and 509 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,12 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
uses: actions/checkout@v4

- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: "1.21"
go-version: "1.20"
check-latest: true

- name: Extract Docker metadata
Expand All @@ -46,6 +44,7 @@ jobs:
with:
images: ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE }}
tags: |
type=ref,event=branch
type=raw,value=latest,enable={{is_default_branch}}
type=semver,pattern=v{{major}}.{{minor}}
type=semver,pattern={{version}},value=v${{ inputs.tags }},enable=${{ inputs.tags != '' }}
Expand Down Expand Up @@ -75,4 +74,3 @@ jobs:
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
context: demo/
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.21
go-version: ^1.20
id: go

- name: Deps
Expand All @@ -41,16 +41,17 @@ jobs:
with:
values: tests/starship/configs/ci.yaml
port-forward: true
version: 0.1.46-rc1
version: 0.1.48-rc0

- name: Run Tests
id: run-tests
continue-on-error: true
run: |
cd tests/starship/
make test
- name: Run Tests (retry on failure)
if: steps.run-tests.outcome == 'failure'
if: failure() && steps.run-tests.outcome == 'failure'
run: |
cd tests/starship/
make test
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Setup Golang
uses: actions/setup-go@v4
with:
go-version: "^1.21"
go-version: "^1.20"
- name: Display go version
run: go version
- name: Run all tests
Expand Down
14 changes: 7 additions & 7 deletions demo/Dockerfile → Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
FROM golang:1.21-alpine AS go-builder
FROM golang:1.20-alpine3.17 AS go-builder

RUN apk add --no-cache ca-certificates build-base git

WORKDIR /code

# Download dependencies and CosmWasm libwasmvm if found.
ADD go.mod go.sum ./
ADD demo/go.mod demo/go.sum ./

#ADD https://github.com/CosmWasm/wasmvm/releases/download/v$wasmvm/libwasmvm_muslc.$arch.a /lib/libwasmvm_muslc.$arch.a
## Download
Expand All @@ -20,15 +20,15 @@ COPY . /code
# force it to use static lib (from above) not standard libgo_cosmwasm.so file
# then log output of file /code/bin/meshd
# then ensure static linking
RUN LEDGER_ENABLED=false BUILD_TAGS=muslc LINK_STATICALLY=true make build-vendored \
&& file /code/build/meshd \
RUN cd demo/ && LEDGER_ENABLED=false BUILD_TAGS=muslc LINK_STATICALLY=true make build \
&& file /code/demo/build/meshd \
&& echo "Ensuring binary is statically linked ..." \
&& (file /code/build/meshd | grep "statically linked")
&& (file /code/demo/build/meshd | grep "statically linked")

# --------------------------------------------------------
FROM alpine:3.16
FROM alpine:3.17

COPY --from=go-builder /code/build/meshd /usr/bin/meshd
COPY --from=go-builder /code/demo/build/meshd /usr/bin/meshd

# Install dependencies used for Starship
RUN apk add --no-cache curl make bash jq sed
Expand Down
2 changes: 1 addition & 1 deletion demo/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/osmosis-labs/mesh-security-sdk/demo

go 1.21
go 1.20

require (
github.com/CosmWasm/wasmd v0.45.0
Expand Down
32 changes: 0 additions & 32 deletions demo/go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion tests/e2e/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/osmosis-labs/mesh-security-sdk/tests/e2e

go 1.21
go 1.20

require (
github.com/CosmWasm/wasmd v0.45.0
Expand Down
34 changes: 0 additions & 34 deletions tests/e2e/go.sum

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions tests/starship/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ BUILD_DIR = ./build
all: test

test:
go test -count=1 -mod=readonly -v -race -run Test2WayContract ./...
go test -count=1 -mod=readonly -timeout 20m -v -race ./...

build-setup:
cd setup && go build cmd/... -o build/ ./setup
Expand All @@ -29,7 +29,7 @@ FILE = configs/local.yaml

HELM_REPO = starship
HELM_CHART = devnet
HELM_VERSION = v0.1.46-rc1
HELM_VERSION = v0.1.48-rc0

.PHONY: check
setup-deps:
Expand Down
14 changes: 10 additions & 4 deletions tests/starship/configs/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ chains:
- name: mesh-1
type: custom
numValidators: 1
image: ghcr.io/osmosis-labs/meshd:latest
image: ghcr.io/osmosis-labs/meshd:anmol-restart-starship@sha256:a2d44df58adf71dabecb9c03ae4eb5fdf460843de72b04ee49b91d55705005c9
home: /root/.meshd
binary: meshd
prefix: mesh
Expand All @@ -27,14 +27,16 @@ chains:
cpu: "0.2"
memory: "200M"
faucet:
concurreny: 2
enabled: true
type: starship
image: "ghcr.io/cosmology-tech/starship/faucet:20231215-7c22b86"
resources:
cpu: "0.1"
memory: "100M"
- name: mesh-2
type: custom
numValidators: 1
image: ghcr.io/osmosis-labs/meshd:latest
image: ghcr.io/osmosis-labs/meshd:anmol-restart-starship@sha256:a2d44df58adf71dabecb9c03ae4eb5fdf460843de72b04ee49b91d55705005c9
home: /root/.meshd
binary: meshd
prefix: mesh
Expand All @@ -59,7 +61,9 @@ chains:
cpu: "0.2"
memory: "200M"
faucet:
concurreny: 2
enabled: true
type: starship
image: "ghcr.io/cosmology-tech/starship/faucet:20231215-7c22b86"
resources:
cpu: "0.1"
memory: "100M"
Expand All @@ -81,13 +85,15 @@ relayers:

registry:
enabled: true
image: ghcr.io/cosmology-tech/starship/registry:20231215-7c22b86
ports:
rest: 8081
resources:
cpu: "0.1"
memory: "100M"

exposer:
image: "ghcr.io/cosmology-tech/starship/exposer:20231215-7c22b86"
resources:
cpu: "0.1"
memory: "100M"
4 changes: 2 additions & 2 deletions tests/starship/configs/devnet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ chains:
- name: mesh-1
type: custom
numValidators: 4
image: ghcr.io/osmosis-labs/meshd:latest
image: anmol1696/meshd:latest
home: /root/.meshd
binary: meshd
prefix: mesh
Expand Down Expand Up @@ -33,7 +33,7 @@ chains:
- name: mesh-2
type: custom
numValidators: 4
image: ghcr.io/osmosis-labs/meshd:latest
image: anmol1696/meshd:latest
home: /root/.meshd
binary: meshd
prefix: mesh
Expand Down
40 changes: 25 additions & 15 deletions tests/starship/configs/local.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
chains:
- name: mesh-1
type: custom
numValidators: 2
image: ghcr.io/osmosis-labs/meshd:latest
numValidators: 1
image: ghcr.io/osmosis-labs/meshd:anmol-restart-starship@sha256:a2d44df58adf71dabecb9c03ae4eb5fdf460843de72b04ee49b91d55705005c9
home: /root/.meshd
binary: meshd
prefix: mesh
Expand All @@ -24,16 +24,19 @@ chains:
rpc: 26653
faucet: 8003
resources:
cpu: 1
memory: 2Gi
cpu: "0.5"
memory: 1Gi
faucet:
enabled: true
type: starship
image: "ghcr.io/cosmology-tech/starship/faucet:20231215-7c22b86"
resources:
cpu: 0.5
memory: 1Gi
cpu: "0.2"
memory: "400Mi"
- name: mesh-2
type: custom
numValidators: 2
image: ghcr.io/osmosis-labs/meshd:latest
numValidators: 1
image: ghcr.io/osmosis-labs/meshd:anmol-restart-starship@sha256:a2d44df58adf71dabecb9c03ae4eb5fdf460843de72b04ee49b91d55705005c9
home: /root/.meshd
binary: meshd
prefix: mesh
Expand All @@ -55,12 +58,15 @@ chains:
rpc: 26657
faucet: 8007
resources:
cpu: 1
memory: 2Gi
cpu: "0.5"
memory: 1Gi
faucet:
enabled: true
type: starship
image: "ghcr.io/cosmology-tech/starship/faucet:20231215-7c22b86"
resources:
cpu: 0.5
memory: 1Gi
cpu: "0.2"
memory: "400Mi"

relayers:
- name: mesh-1-mesh-2
Expand All @@ -74,15 +80,19 @@ relayers:
event_source:
mode: pull
resources:
cpu: 1
memory: 2Gi
cpu: "0.5"
memory: 1Gi

registry:
enabled: true
image: ghcr.io/cosmology-tech/starship/registry:20231215-7c22b86
ports:
rest: 8081

explorer:
enabled: true
enabled: false
ports:
rest: 8080

exposer:
image: "ghcr.io/cosmology-tech/starship/exposer:20231215-7c22b86"
Loading

0 comments on commit 3cdce6e

Please sign in to comment.