forked from cosmos/cosmos-sdk
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
126 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: Build and Push Fxcorevisor image | ||
|
||
on: | ||
push: | ||
tags: | ||
- "fxcorevisor/v7.*.*" | ||
|
||
jobs: | ||
push_to_registries: | ||
name: Push Docker image to ghcr | ||
runs-on: ubuntu-latest | ||
permissions: | ||
packages: write | ||
contents: read | ||
steps: | ||
- name: Check out the repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: Get Github tag | ||
id: meta | ||
run: | | ||
echo "TAG=$(git describe --always --tags --match='fxcorevisor/v*'|awk '{split($1, arr, "/"); print arr[2]}' | sed -e 's/^v//')" >> $GITHUB_OUTPUT | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Login to Container registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and push images | ||
uses: docker/build-push-action@v3 | ||
with: | ||
context: . | ||
file: ./tools/cosmovisor/Dockerfile_v7 | ||
push: true | ||
platforms: linux/amd64, linux/arm64 | ||
tags: | | ||
ghcr.io/functionx/fxcorevisor:${{ steps.meta.outputs.TAG }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
# compile cosmovisor | ||
FROM golang:1.21.4-alpine3.18 as builder | ||
|
||
RUN apk add --no-cache git build-base linux-headers | ||
|
||
WORKDIR /app | ||
|
||
COPY . . | ||
|
||
RUN go env -w GO111MODULE=on && cd /app/tools/cosmovisor && go mod download && make cosmovisor | ||
|
||
FROM functionx/fx-core:1.1.2 as fxv1 | ||
FROM functionx/fx-core:2.4.2 as fxv2 | ||
FROM functionx/fx-core:3.1.0 as fxv3 | ||
FROM functionx/fx-core:4.0.0-rc1 as fxv4 | ||
FROM functionx/fx-core:4.1.0-rc0 as fxv4_1 | ||
FROM functionx/fx-core:4.2.2 as fxv4_2 | ||
FROM functionx/fx-core:5.0.0 as fxv5 | ||
FROM functionx/fx-core:6.0.0 as fxv6 | ||
FROM functionx/fx-core:7.0.0-rc0 as fxv7 | ||
|
||
# build fxcorevisor | ||
FROM alpine:3.18 | ||
|
||
WORKDIR root | ||
|
||
ENV DAEMON_HOME=/root/.fxcore | ||
ENV DAEMON_NAME=fxcored | ||
|
||
# optional | ||
ENV DAEMON_ALLOW_DOWNLOAD_BINARIES=false | ||
ENV DAEMON_RESTART_AFTER_UPGRADE=true | ||
ENV DAEMON_RESTART_DELAY=1s | ||
ENV DAEMON_POLL_INTERVAL=3s | ||
ENV DAEMON_DATA_BACKUP_DIR=/root/.fxcore | ||
ENV UNSAFE_SKIP_BACKUP=true | ||
ENV DAEMON_PREUPGRADE_MAX_RETRIES=3 | ||
|
||
ENV DAEMON_CHOOSE_VERSION=true | ||
ENV DAEMON_COSMOVISOR_REPLACE=true | ||
ENV DAEMON_BINARY_PATH=/cosmovisor/binary | ||
ENV DAEMON_UPGRADES_INFO_PATH=/cosmovisor/upgrades-info | ||
|
||
RUN mkdir -p /cosmovisor/binary/genesis/bin && \ | ||
mkdir -p /cosmovisor/binary/upgrades/fxv2/bin && \ | ||
mkdir -p /cosmovisor/binary/upgrades/fxv3/bin && \ | ||
mkdir -p /cosmovisor/binary/upgrades/fxv4/bin && \ | ||
mkdir -p /cosmovisor/binary/upgrades/v4.1.x/bin && \ | ||
mkdir -p /cosmovisor/binary/upgrades/v4.2.x/bin && \ | ||
mkdir -p /cosmovisor/binary/upgrades/v5.0.x/bin && \ | ||
mkdir -p /cosmovisor/binary/upgrades/v6.0.x/bin && \ | ||
mkdir -p /cosmovisor/binary/upgrades/v7.0.x/bin | ||
|
||
COPY --from=builder /app/tools/cosmovisor/upgrades-info/fxv2 /cosmovisor/upgrades-info | ||
COPY --from=builder /app/tools/cosmovisor/upgrades-info/fxv3 /cosmovisor/upgrades-info | ||
COPY --from=builder /app/tools/cosmovisor/upgrades-info/fxv4 /cosmovisor/upgrades-info | ||
COPY --from=builder /app/tools/cosmovisor/upgrades-info/v4.1.x /cosmovisor/upgrades-info | ||
COPY --from=builder /app/tools/cosmovisor/upgrades-info/v4.2.x /cosmovisor/upgrades-info | ||
COPY --from=builder /app/tools/cosmovisor/upgrades-info/v5.0.x /cosmovisor/upgrades-info | ||
COPY --from=builder /app/tools/cosmovisor/upgrades-info/v6.0.x /cosmovisor/upgrades-info | ||
COPY --from=builder /app/tools/cosmovisor/upgrades-info/v7.0.x /cosmovisor/upgrades-info | ||
|
||
COPY --from=fxv1 /usr/bin/fxcored /cosmovisor/binary/genesis/bin | ||
COPY --from=fxv2 /usr/bin/fxcored /cosmovisor/binary/upgrades/fxv2/bin | ||
COPY --from=fxv3 /usr/bin/fxcored /cosmovisor/binary/upgrades/fxv3/bin | ||
COPY --from=fxv4 /usr/bin/fxcored /cosmovisor/binary/upgrades/fxv4/bin | ||
COPY --from=fxv4_1 /usr/bin/fxcored /cosmovisor/binary/upgrades/v4.1.x/bin | ||
COPY --from=fxv4_2 /usr/bin/fxcored /cosmovisor/binary/upgrades/v4.2.x/bin | ||
COPY --from=fxv5 /usr/bin/fxcored /cosmovisor/binary/upgrades/v5.0.x/bin | ||
COPY --from=fxv6 /usr/bin/fxcored /cosmovisor/binary/upgrades/v6.0.x/bin | ||
COPY --from=fxv7 /usr/bin/fxcored /cosmovisor/binary/upgrades/v7.0.x/bin | ||
|
||
COPY --from=builder /app/tools/cosmovisor/cosmovisor /usr/bin/cosmovisor | ||
|
||
EXPOSE 26656/tcp 26657/tcp 26660/tcp 9090/tcp 1317/tcp 8545/tcp 8546/tcp | ||
|
||
VOLUME ["/root"] | ||
|
||
ENTRYPOINT ["cosmovisor"] |
1 change: 1 addition & 0 deletions
1
tools/cosmovisor/upgrades-info/v7.0.x/dhobyghaut/upgrades/v7.0.x/upgrade-info.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"name":"v7.0.x","height":12961500} |
1 change: 1 addition & 0 deletions
1
tools/cosmovisor/upgrades-info/v7.0.x/fxcore/upgrades/v7.0.x/upgrade-info.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"name":"v7.0.x","height":9223372036854775807} |