Skip to content

Commit

Permalink
Merge branch 'osmosis-labs:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
DongLieu authored Nov 30, 2023
2 parents f25cb16 + 4984c88 commit 46fead6
Show file tree
Hide file tree
Showing 1,069 changed files with 47,674 additions and 24,523 deletions.
2 changes: 0 additions & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ build/
docs/
networks/
proto/
scripts/
tools/
tests/localosmosis/
tests/localrelayer/
tests/cl-genesis-positions
tests/cl-go-client
Expand Down
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ updates:
labels:
- "A:no-changelog"
ignore:
- dependency-name: "github.com/tendermint/tendermint"
- dependency-name: "github.com/cometbft/cometbft"
update-types: ["version-update:semver-major", "version-update:semver-minor"]
ignore:
- dependency-name: "github.com/cosmos/ibc-go"
Expand Down
10 changes: 9 additions & 1 deletion .github/mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ queue_rules:
pull_request_rules:
- name: automerge to the base branch with label automerge and branch protection passing
conditions:
- "#approved-reviews-by>=1"
- "#approved-reviews-by>=2"
- base=main
- label=A:automerge
actions:
Expand Down Expand Up @@ -142,3 +142,11 @@ pull_request_rules:
backport:
branches:
- v20.x
- name: backport patches to v21.x branch
conditions:
- base=main
- label=A:backport/v21.x
actions:
backport:
branches:
- v21.x
99 changes: 99 additions & 0 deletions .github/workflows/build-push-sqs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
# This workflow pushes new docker images to osmolabs/sqs-dev on these events:
# 2. Every new commit to the roman/sqs-poc-v20 branch,
# tag with: sqs-v[0-9]+.[0-9]+.[0-9],
# branch push with sqs-v[0-9]+.x
# `osmolabs/sqs-dev:{SHORT_SHA}-$(date +%s)` is pushed.
# All the images above have support for linux/amd64 (not linux/arm64)
# All the images are based on an alpine image for easy debugging.

name: Build and Push SQS Images

on:
workflow_dispatch:
push:
tags:
- sqs-v[0-9]+.[0-9]+.[0-9]
branches:
- roman/sqs-poc-v20
- sqs-v[0-9]+.x

env:
RUNNER_BASE_IMAGE_ALPINE: alpine:3.17
SQS_DEV_IMAGE_REPOSITORY: osmolabs/sqs-dev
SQS_PROD_IMAGE_REPOSITORY: osmolabs/sqs

jobs:
docker:
runs-on: self-hosted
steps:
- name: Check out repo
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Find go version
run: |
GO_VERSION=$(cat go.mod | grep -E 'go [0-9].[0-9]+' | cut -d ' ' -f 2)
echo "GO_VERSION=$GO_VERSION" >> $GITHUB_ENV
- name: Create Docker Image Tag for release candidate on Tag Push
if: startsWith(github.ref, 'refs/tags/sqs-v')
run: |
GITHUB_TAG=${{ github.ref_name }}
echo "DOCKER_IMAGE_TAG=${GITHUB_TAG#v}" >> $GITHUB_ENV
echo "OSMOSIS_VERSION=${{ github.ref_name }}" >> $GITHUB_ENV
- name: Create Docker Image Tag for sqs-vx.x.x branch
if: startsWith(github.ref, 'sqs-v')
run: |
GITHUB_TAG=${{ github.ref_name }}
echo "DOCKER_IMAGE_TAG=${SHORT_SHA}-$(date +%s)" >> $GITHUB_ENV
echo "OSMOSIS_VERSION=${{ github.ref_name }}" >> $GITHUB_ENV
- name: Create Docker Image Tag for roman/sqs-poc-v20 branch
if: github.ref == 'refs/heads/roman/sqs-poc-v20'
run: |
SHORT_SHA=$(echo ${GITHUB_SHA} | cut -c1-8)
echo "DOCKER_IMAGE_TAG=${SHORT_SHA}-$(date +%s)" >> $GITHUB_ENV
echo "OSMOSIS_VERSION=$SHORT_SHA" >> $GITHUB_ENV
- name: Build and Push Docker Images Dev
uses: docker/build-push-action@v5
with:
file: Dockerfile
context: .
push: true
platforms: linux/amd64
build-args: |
GO_VERSION=${{ env.GO_VERSION }}
RUNNER_IMAGE=${{ env.RUNNER_BASE_IMAGE_ALPINE }}
GIT_VERSION=${{ env.OSMOSIS_VERSION }}
GIT_COMMIT=${{ github.sha }}
tags: |
${{ env.SQS_DEV_IMAGE_REPOSITORY }}:${{ env.DOCKER_IMAGE_TAG }}
${{ env.SQS_DEV_IMAGE_REPOSITORY }}:sqs-latest
- name: Build and Push Docker Images Prod
uses: docker/build-push-action@v5
with:
file: Dockerfile
context: .
push: true
platforms: linux/amd64
build-args: |
GO_VERSION=${{ env.GO_VERSION }}
RUNNER_IMAGE=${{ env.RUNNER_BASE_IMAGE_ALPINE }}
GIT_VERSION=${{ env.OSMOSIS_VERSION }}
GIT_COMMIT=${{ github.sha }}
tags: |
${{ env.SQS_PROD_IMAGE_REPOSITORY }}:${{ env.DOCKER_IMAGE_TAG }}
${{ env.SQS_PROD_IMAGE_REPOSITORY }}:sqs-latest
30 changes: 14 additions & 16 deletions .github/workflows/check-generated.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ on:
workflow_dispatch:
pull_request:
paths:
- 'proto/**'
- '**/**.proto'
- '**/**.pb.go'
- '**/**.sum'
- '**/client/**.go'
- 'scripts/ci/**'
- 'Makefile'
- 'Dockerfile'
- '.github/workflows/check-generated.yml'
- "proto/**"
- "**/**.proto"
- "**/**.pb.go"
- "**/**.sum"
- "**/client/**.go"
- "scripts/ci/**"
- "Makefile"
- "Dockerfile"
- ".github/workflows/check-generated.yml"

permissions:
contents: write
Expand All @@ -26,21 +26,19 @@ jobs:
check-proto:
runs-on: ubuntu-latest
steps:
-
uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
-
name: "Check protobuf generated code"
- name: "Check protobuf generated code"
run: |
chmod +x ./scripts/protocgen.sh
make proto-all
make run-querygen
-
name: Commit changes
- name: Commit changes
run: |
git config user.name github-actions
git config user.email github-actions@github.com
git add *.go
git add *.proto
git commit -m "Generated protofile changes" || echo "No changes to commit"
git push
git push
37 changes: 22 additions & 15 deletions .github/workflows/check-state-compatibility.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ jobs:
should_i_run: ${{ steps.compare_versions.outputs.should_i_run }}
mainnet_major_version: ${{ steps.mainnet_version.outputs.mainnet_major_version }}
steps:
- name: Get mainnet major version
-
name: Get mainnet major version
id: mainnet_version
run: |
# Find current major version via rpc.osmosis.zone/abci_info
Expand All @@ -64,7 +65,8 @@ jobs:
echo "MAINNET_MAJOR_VERSION=$MAINNET_MAJOR_VERSION" >> $GITHUB_ENV
echo "mainnet_major_version=$MAINNET_MAJOR_VERSION" >> $GITHUB_OUTPUT
- name: Get GitHub branch major version
-
name: Get GitHub branch major version
id: compare_versions
run: |
CURRENT_BRANCH_MAJOR_VERSION=$(echo ${{ github.event.pull_request.base.ref }} | tr -dc '0-9')
Expand All @@ -86,20 +88,23 @@ jobs:
needs: compare_versions
runs-on: self-hosted
steps:
- name: Checkout branch
-
name: Checkout branch
uses: actions/checkout@v4
with:
fetch-depth: 0
-
-
name: 🐿 Setup Golang
uses: actions/setup-go@v4
with:
go-version: '^1.20'
- name: 🔨 Build the osmosisd binary
go-version-file: go.mod
-
name: 🔨 Build the osmosisd binary
run: |
make build
build/osmosisd version
- name: 🧪 Initialize Osmosis Node
-
name: 🧪 Initialize Osmosis Node
run: |
rm -rf $HOME/.osmosisd/ || true
build/osmosisd init runner -o
Expand All @@ -112,9 +117,10 @@ jobs:
# Copy genesis to config folder
cp /mnt/data/genesis/osmosis-1/genesis.json $HOME/.osmosisd/config/genesis.json
- name: ⏬ Download last pre-epoch snapshot
-
name: ⏬ Download last pre-epoch snapshot
run: |
REPO_MAJOR_VERSION=v19
REPO_MAJOR_VERSION=$(echo ${{ github.base_ref }} | sed 's/\.x//')
SNAPSHOT_INFO_URL=${{ env.SNAPSHOT_BUCKET }}/$REPO_MAJOR_VERSION/snapshots.json
# Get the latest pre-epoch snapshot information from bucket
Expand All @@ -132,12 +138,11 @@ jobs:
# Copy snapshot in Data folder
cp -R /mnt/data/snapshots/$REPO_MAJOR_VERSION/$SNAPSHOT_ID/* $HOME/.osmosisd/
- name: 🧪 Configure Osmosis Node
-
name: 🧪 Configure Osmosis Node
run: |
CONFIG_FOLDER=$HOME/.osmosisd/config
# Find last epoch block comparing repo version to current chain version
REPO_MAJOR_VERSION=19
REPO_MAJOR_VERSION=$(echo ${{ github.base_ref }} | tr -dc '0-9')
if [ $REPO_MAJOR_VERSION == $MAINNET_MAJOR_VERSION ]; then
# I'm in the latest major, fetch the epoch info from the lcd endpoint
Expand Down Expand Up @@ -170,8 +175,10 @@ jobs:
# Download addrbook
wget -q -O $CONFIG_FOLDER/addrbook.json ${{ env.ADDRBOOK_URL }}
- name: 🧪 Start Osmosis Node
-
name: 🧪 Start Osmosis Node
run: build/osmosisd start
- name: 🧹 Clean up Osmosis Home
-
name: 🧹 Clean up Osmosis Home
if: always()
run: rm -rf $HOME/.osmosisd/ || true
2 changes: 2 additions & 0 deletions .github/workflows/e2e-initialization-instructions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ permissions:

jobs:
comment:
permissions:
pull-requests: write
runs-on: ubuntu-latest
steps:
-
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ jobs:
VERSION=$(echo $(git describe --tags) | sed 's/^v//') || VERSION=${GITHUB_SHA}
TESTS=$(cat pkgs.txt.part.${{ matrix.part }})
VERSION=$VERSION SKIP_WASM_WSL_TESTS="false" go test -mod=readonly -tags='ledger test_ledger_mock norace' $TESTS
VERSION=$VERSION SKIP_WASM_WSL_TESTS="false" go test -race -mod=readonly -tags='ledger test_ledger_mock norace' $TESTS
e2e:
needs: get_diff
Expand Down
Loading

0 comments on commit 46fead6

Please sign in to comment.