Skip to content

Commit

Permalink
fix: containers, list command, and file name to match new version
Browse files Browse the repository at this point in the history
  • Loading branch information
gluax committed Oct 25, 2024
1 parent 5dce834 commit bb8b147
Show file tree
Hide file tree
Showing 17 changed files with 45 additions and 88 deletions.
10 changes: 1 addition & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,9 @@ name: Build

on:
pull_request:
push:
branches:
- main

env:
GO_VERSION: "1.21.0"
GOPRIVATE: github.com/sedaprotocol/vrf-go
GITHUB_TOKEN: ${{ secrets.PAT }}

permissions:
contents: read
Expand Down Expand Up @@ -40,16 +35,13 @@ jobs:
restore-keys: |
${{ runner.os }}-go-
- name: Setup go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache: true
env:
GOOS: ${{ matrix.targetos }}
GOARCH: ${{ matrix.arch }}
- name: Configure private token
run: |
git config --global url."https://${GITHUB_TOKEN}@github.com/".insteadOf "https://github.com/"
- name: Compile
run: |
go mod download
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gosec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
GO111MODULE: on
steps:
- name: Checkout Source
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Run Gosec Security Scanner
uses: informalsystems/gosec@master
with:
Expand Down
15 changes: 5 additions & 10 deletions .github/workflows/interchaintest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,9 @@ name: Interchaintest

on:
pull_request:
push:
branches:
- main

env:
GO_VERSION: "1.21.0"
GOPRIVATE: github.com/sedaprotocol/vrf-go
GITHUB_TOKEN: ${{ secrets.PAT }}
TAR_PATH: /tmp/seda-docker-image.tar
IMAGE_NAME: sedad-e2e

Expand All @@ -30,7 +25,7 @@ jobs:
uses: actions/checkout@v4

- name: Setup Go ${{ env.GO_VERSION }}
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache-dependency-path: interchaintest/go.sum
Expand All @@ -39,15 +34,15 @@ jobs:
uses: docker/setup-buildx-action@v3

- name: Build and export
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: .
file: ./dockerfiles/Dockerfile.e2e
tags: sedad-e2e
outputs: type=docker,dest=${{ env.TAR_PATH }}

- name: Upload artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ env.IMAGE_NAME }}
path: ${{ env.TAR_PATH }}
Expand All @@ -69,7 +64,7 @@ jobs:

steps:
- name: Set up Go ${{ env.GO_VERSION }}
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache-dependency-path: interchaintest/go.sum
Expand All @@ -78,7 +73,7 @@ jobs:
uses: actions/checkout@v4

- name: Download Tarball Artifact
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: ${{ env.IMAGE_NAME }}
path: /tmp
Expand Down
10 changes: 2 additions & 8 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ name: Lint

on:
pull_request:
push:
branches:
- main

permissions:
contents: read
Expand All @@ -20,8 +17,8 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 1.21.3
check-latest: true
Expand All @@ -33,9 +30,6 @@ jobs:

protobuf:
runs-on: ubuntu-latest
env:
GOPRIVATE: github.com/sedaprotocol/vrf-go
GITHUB_TOKEN: ${{ secrets.PAT }}
steps:
- uses: actions/checkout@v4
- name: Install Buf
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
- name: 🐳 Build and Push
id: build
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: .
file: ./dockerfiles/Dockerfile.release
Expand All @@ -68,10 +68,10 @@ jobs:
platforms: linux/amd64,linux/arm64
outputs: type=image,name=${{ env.REGISTRY_IMAGE }},name-canonical=true,push=true
tags: ${{ env.REGISTRY_IMAGE }}:${{ github.ref_name }}, ${{ env.REGISTRY_IMAGE }}:latest

- name: 🪵 Conventional Changelog
id: changelog
uses: TriPSs/conventional-changelog-action@v3
uses: TriPSs/conventional-changelog-action@v5
with:
github-token: ${{ secrets.github_token }}
output-file: "false"
Expand Down
10 changes: 3 additions & 7 deletions .github/workflows/simulations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,26 @@ name: Simulation
# This workflow is run on pushes to master & every Pull Requests where a .go, .mod, .sum have been changed
on:
pull_request:
push:
branches:
- main

env:
GO_VERSION: "1.21.0"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
check-latest: true
cache: true
cache-dependency-path: go.sum
-
name: Get git diff
- name: Get git diff
uses: technote-space/[email protected]
with:
PATTERNS: |
Expand Down
13 changes: 3 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,9 @@ name: Tests

on:
pull_request:
push:
branches:
- main

env:
GO_VERSION: "1.21.0"
GOPRIVATE: github.com/sedaprotocol/vrf-go
GITHUB_TOKEN: ${{ secrets.PAT }}

permissions:
contents: read
Expand All @@ -25,16 +20,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
check-latest: true
cache: true
cache-dependency-path: go.sum
- run: git config --global url.https://${GITHUB_TOKEN}@github.com/.insteadOf https://github.com/
- name: Test & coverage report creation
run: make test-unit-cover
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: "${{ github.sha }}-${{ matrix.part }}-coverage"
path: ./${{ matrix.part }}profile.out
Expand All @@ -44,10 +38,9 @@ jobs:
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- run: git config --global url.https://${GITHUB_TOKEN}@github.com/.insteadOf https://github.com/
- name: Test e2e
run: |
make test-e2e
2 changes: 1 addition & 1 deletion DEVELOPING.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,5 +185,5 @@ make cover-html
To run end-to-end tests:

```bash
GITHUB_TOKEN=<your_github_pat> make test-e2e
make test-e2e
```
10 changes: 2 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -308,16 +308,10 @@ cover-html: test-unit-cover
@echo "--> Opening in the browser"
@go tool cover -html=$(TEST_COVERAGE_PROFILE)

ifdef GITHUB_TOKEN
docker-build-e2e:
@docker build \
--build-arg GITHUB_TOKEN=$(GITHUB_TOKEN) \
docker build \
-t sedaprotocol/sedad-e2e \
-f dockerfiles/Dockerfile.e2e .
else
docker-build-e2e:
@echo "Error: GITHUB_TOKEN variable required to build e2e image"
endif

.PHONY: cover-html run-tests $(TEST_TARGETS) test test-race docker-build-e2e

Expand Down Expand Up @@ -389,7 +383,7 @@ rm-testcache:

GO_VERSION=1.21
GORELEASER_IMAGE := ghcr.io/goreleaser/goreleaser-cross:v$(GO_VERSION)
COSMWASM_VERSION := $(shell go list -m github.com/CosmWasm/wasmvm | sed 's/.* //')
COSMWASM_VERSION := $(shell go list -m github.com/CosmWasm/wasmvm/v2 | sed 's/.* //')
ifdef GITHUB_TOKEN
release:
docker run \
Expand Down
14 changes: 7 additions & 7 deletions dockerfiles/Dockerfile.build-static
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,17 @@ RUN --mount=type=cache,target=/root/.cache/go-build \
go mod download

# Cosmwasm - Download correct libwasmvm_muslc version for amd64
RUN ARCH=x86_64 && WASMVM_VERSION=$(go list -m github.com/CosmWasm/wasmvm | sed 's/.* //') && \
RUN ARCH=x86_64 && WASMVM_VERSION=$(go list -m github.com/CosmWasm/wasmvm/v2 | sed 's/.* //') && \
wget https://github.com/CosmWasm/wasmvm/releases/download/$WASMVM_VERSION/libwasmvm_muslc.$ARCH.a \
-O /lib/libwasmvm_muslc.a && \
-O /lib/libwasmvm_muslc.$ARCH.a && \
# verify checksum
wget https://github.com/CosmWasm/wasmvm/releases/download/$WASMVM_VERSION/checksums.txt -O /tmp/checksums.txt && \
sha256sum /lib/libwasmvm_muslc.a | grep $(cat /tmp/checksums.txt | grep libwasmvm_muslc.$ARCH | cut -d ' ' -f 1)
sha256sum /lib/libwasmvm_muslc.$ARCH.a | grep $(cat /tmp/checksums.txt | grep libwasmvm_muslc.$ARCH | cut -d ' ' -f 1)

# Download SEDA Wasm VM static library for amd64
RUN ARCH=x86_64 && TALLYVM_VERSION=$(go list -m github.com/sedaprotocol/seda-wasm-vm/tallyvm | sed 's/.* //') && \
wget https://github.com/sedaprotocol/seda-wasm-vm/releases/download/tallyvm%2F$TALLYVM_VERSION/libseda_tally_vm_muslc.$ARCH.a \
-O /lib/libseda_tally_vm_muslc.a
-O /lib/libseda_tally_vm_muslc.$ARCH.a

# Build sedad binary for amd64
RUN --mount=type=cache,target=/root/.cache/go-build \
Expand All @@ -54,12 +54,12 @@ RUN --mount=type=cache,target=/root/.cache/go-build \
/seda-chain/cmd/sedad/main.go

# Cosmwasm - Download correct libwasmvm_muslc version for aarch64
RUN ARCH=aarch64 && WASMVM_VERSION=$(go list -m github.com/CosmWasm/wasmvm | sed 's/.* //') && \
RUN ARCH=aarch64 && WASMVM_VERSION=$(go list -m github.com/CosmWasm/wasmvm/v2 | sed 's/.* //') && \
wget https://github.com/CosmWasm/wasmvm/releases/download/$WASMVM_VERSION/libwasmvm_muslc.$ARCH.a \
-O /lib/libwasmvm_muslc.a && \
-O /lib/libwasmvm_muslc.$ARCH.a && \
# verify checksum
wget https://github.com/CosmWasm/wasmvm/releases/download/$WASMVM_VERSION/checksums.txt -O /tmp/checksums.txt && \
sha256sum /lib/libwasmvm_muslc.a | grep $(cat /tmp/checksums.txt | grep libwasmvm_muslc.$ARCH | cut -d ' ' -f 1)
sha256sum /lib/libwasmvm_muslc.$ARCH.a | grep $(cat /tmp/checksums.txt | grep libwasmvm_muslc.$ARCH | cut -d ' ' -f 1)

# Download SEDA Wasm VM static library for aarch64
RUN ARCH=aarch64 && TALLYVM_VERSION=$(go list -m github.com/sedaprotocol/seda-wasm-vm/tallyvm | sed 's/.* //') && \
Expand Down
14 changes: 5 additions & 9 deletions dockerfiles/Dockerfile.e2e
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@ ARG RUNNER_IMAGE="alpine:3.17"
# Builder
# --------------------------------------------------------

FROM golang:${GO_VERSION}-alpine as builder
FROM golang:${GO_VERSION}-alpine AS builder

ARG GIT_VERSION
ARG GIT_COMMIT
ARG GITHUB_TOKEN

RUN apk add --no-cache \
ca-certificates \
Expand All @@ -22,20 +21,17 @@ RUN apk add --no-cache \
WORKDIR /seda-chain
COPY go.mod go.sum ./

# Configure Git to use the PAT for authentication
RUN git config --global url."https://${GITHUB_TOKEN}@github.com/".insteadOf "https://github.com/"

RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/root/go/pkg/mod \
go mod download

# Cosmwasm - Download correct libwasmvm version
RUN ARCH=$(uname -m) && WASMVM_VERSION=$(go list -m github.com/CosmWasm/wasmvm | sed 's/.* //') && \
RUN ARCH=$(uname -m) && WASMVM_VERSION=$(go list -m github.com/CosmWasm/wasmvm/v2 | sed 's/.* //') && \
wget https://github.com/CosmWasm/wasmvm/releases/download/$WASMVM_VERSION/libwasmvm_muslc.$ARCH.a \
-O /lib/libwasmvm_muslc.a && \
-O /lib/libwasmvm_muslc.$ARCH.a && \
# verify checksum
wget https://github.com/CosmWasm/wasmvm/releases/download/$WASMVM_VERSION/checksums.txt -O /tmp/checksums.txt && \
sha256sum /lib/libwasmvm_muslc.a | grep $(cat /tmp/checksums.txt | grep libwasmvm_muslc.$ARCH | cut -d ' ' -f 1)
sha256sum /lib/libwasmvm_muslc.$ARCH.a | grep $(cat /tmp/checksums.txt | grep libwasmvm_muslc.$ARCH | cut -d ' ' -f 1)

# Copy the remaining files
COPY . .
Expand Down Expand Up @@ -65,7 +61,7 @@ FROM ${RUNNER_IMAGE}

COPY --from=builder /seda-chain/build/sedad /bin/sedad

ENV HOME /seda-chain
ENV HOME=/seda-chain

WORKDIR $HOME

Expand Down
6 changes: 3 additions & 3 deletions dockerfiles/Dockerfile.static
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ RUN --mount=type=cache,target=/root/.cache/go-build \
go mod download

# Cosmwasm - Download correct libwasmvm version
RUN ARCH=$(uname -m) && WASMVM_VERSION=$(go list -m github.com/CosmWasm/wasmvm | sed 's/.* //') && \
RUN ARCH=$(uname -m) && WASMVM_VERSION=$(go list -m github.com/CosmWasm/wasmvm/v2 | sed 's/.* //') && \
wget https://github.com/CosmWasm/wasmvm/releases/download/$WASMVM_VERSION/libwasmvm_muslc.$ARCH.a \
-O /lib/libwasmvm_muslc.a && \
-O /lib/libwasmvm_muslc.$ARCH.a && \
# verify checksum
wget https://github.com/CosmWasm/wasmvm/releases/download/$WASMVM_VERSION/checksums.txt -O /tmp/checksums.txt && \
sha256sum /lib/libwasmvm_muslc.a | grep $(cat /tmp/checksums.txt | grep libwasmvm_muslc.$ARCH | cut -d ' ' -f 1)
sha256sum /lib/libwasmvm_muslc.$ARCH.a | grep $(cat /tmp/checksums.txt | grep libwasmvm_muslc.$ARCH | cut -d ' ' -f 1)

# Download SEDA Wasm VM static library for aarch64
RUN ARCH=$(uname -m) && TALLYVM_VERSION=$(go list -m github.com/sedaprotocol/seda-wasm-vm/tallyvm | sed 's/.* //') && \
Expand Down
3 changes: 1 addition & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ require (
cosmossdk.io/x/tx v0.13.4
cosmossdk.io/x/upgrade v0.1.4
github.com/CosmWasm/wasmd v0.53.0
github.com/CosmWasm/wasmvm v1.5.4
github.com/CosmWasm/wasmvm/v2 v2.1.3
github.com/aws/aws-sdk-go v1.55.5
github.com/cometbft/cometbft v0.38.12
github.com/cosmos/cosmos-db v1.0.2
Expand Down Expand Up @@ -70,7 +70,6 @@ require (
github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect
github.com/99designs/keyring v1.2.2 // indirect
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect
github.com/CosmWasm/wasmvm/v2 v2.1.3 // indirect
github.com/DataDog/datadog-go v4.8.3+incompatible // indirect
github.com/DataDog/zstd v1.5.5 // indirect
github.com/Microsoft/go-winio v0.6.2 // indirect
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,6 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/CosmWasm/wasmd v0.53.0 h1:kdaoAi20bIb4VCsxw9pRaT2g5PpIp82Wqrr9DRVN9ao=
github.com/CosmWasm/wasmd v0.53.0/go.mod h1:FJl/aWjdpGof3usAMFQpDe07Rkx77PUzp0cygFMOvtw=
github.com/CosmWasm/wasmvm v1.5.4 h1:Opqy65ubJ8bMsT08dn85VjRdsLJVPIAgIXif92qOMGc=
github.com/CosmWasm/wasmvm v1.5.4/go.mod h1:Q0bSEtlktzh7W2hhEaifrFp1Erx11ckQZmjq8FLCyys=
github.com/CosmWasm/wasmvm/v2 v2.1.3 h1:CSJTauZqkHyb9yic6JVYCjiGUgxI2MJV2QzfSu8m49c=
github.com/CosmWasm/wasmvm/v2 v2.1.3/go.mod h1:bMhLQL4Yp9CzJi9A83aR7VO9wockOsSlZbT4ztOl6bg=
github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ=
Expand Down
Loading

0 comments on commit bb8b147

Please sign in to comment.