Skip to content

Commit 62f6479

Browse files
committed
fix dockerfiles everywhere, add axelar to github workflows
1 parent fe12854 commit 62f6479

12 files changed

+76
-32
lines changed

.github/workflows/axelar.yml

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Build and Push Axelar Docker Image
2+
3+
on:
4+
push:
5+
tags:
6+
- "axelar-v[0-9]+.[0-9]+.[0-9]+"
7+
workflow_dispatch:
8+
9+
env:
10+
REGISTRY: ghcr.io
11+
IMAGE_NAME: ${{ github.repository }}
12+
INFRA_TOOLKIT: v0.1.6
13+
14+
jobs:
15+
build-and-push-axelar:
16+
runs-on: ubuntu-latest
17+
permissions:
18+
contents: read
19+
packages: write
20+
21+
steps:
22+
- name: Checkout repository
23+
uses: actions/checkout@v2
24+
25+
- name: Set up Go
26+
uses: actions/setup-go@v3
27+
with:
28+
go-version: '1.21'
29+
30+
- name: Log in to the Container registry
31+
uses: docker/login-action@v1
32+
with:
33+
registry: ${{ env.REGISTRY }}
34+
username: ${{ github.actor }}
35+
password: ${{ secrets.GITHUB_TOKEN }}
36+
37+
- name: Build Heighliner binary
38+
run: |
39+
go build -o heighliner
40+
41+
- name: Extract version from tag
42+
id: extract_version
43+
run: echo "VERSION=${GITHUB_REF#refs/tags/axelar-}" >> $GITHUB_ENV
44+
45+
- name: Manually pull the base Docker image
46+
run: |
47+
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin
48+
docker pull ghcr.io/p2p-org/cosmos-heighliner:infra-toolkit-${{ env.INFRA_TOOLKIT }}
49+
50+
- name: Build and push Axelar Docker image
51+
run: |
52+
./heighliner build -c axelar --alpine-version 3.18 --git-ref ${{ env.VERSION }}
53+
54+
- name: Tag and push Docker image
55+
run: |
56+
docker tag axelar:${{ env.VERSION }} ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:axelar-${{ env.VERSION }}
57+
docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:axelar-${{ env.VERSION }}

README.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -90,22 +90,22 @@ Docker image `somegaia:v8.0.0-somefork` will be built and stored in your local d
9090

9191
```shell
9292
# docker login ...
93-
heighliner build -r ghcr.io/p2p-org/heighliner -c gaia -g v6.0.0
93+
heighliner build -r ghcr.io/p2p-org/cosmos-heighliner -c gaia -g v6.0.0
9494
```
9595

96-
Docker image `ghcr.io/p2p-org/heighliner/gaia:v6.0.0` will be built and pushed to ghcr.io
96+
Docker image `ghcr.io/p2p-org/cosmos-heighliner/gaia:v6.0.0` will be built and pushed to ghcr.io
9797

9898
#### Example: build and push last n releases of osmosis chain
9999

100100
```shell
101101
# docker login ...
102-
heighliner build -r ghcr.io/p2p-org/heighliner -c osmosis -n 3
102+
heighliner build -r ghcr.io/p2p-org/cosmos-heighliner -c osmosis -n 3
103103
```
104104

105105
heighliner will fetch the last 3 osmosis release tags from github, build docker images, and push them, e.g.:
106-
- `ghcr.io/p2p-org/heighliner/osmosis:v6.1.0`
107-
- `ghcr.io/p2p-org/heighliner/osmosis:v6.0.0`
108-
- `ghcr.io/p2p-org/heighliner/osmosis:v5.0.0`
106+
- `ghcr.io/p2p-org/cosmos-heighliner/osmosis:v6.1.0`
107+
- `ghcr.io/p2p-org/cosmos-heighliner/osmosis:v6.0.0`
108+
- `ghcr.io/p2p-org/cosmos-heighliner/osmosis:v5.0.0`
109109

110110
#### Example: build and push last n releases of all chains
111111

@@ -114,7 +114,7 @@ This will make a request to each chain's Github repository to fetch all recent r
114114
```shell
115115
# docker login ...
116116
export GH_USER=github_username GH_PAT=github_personal_access_token
117-
heighliner build -r ghcr.io/p2p-org/heighliner -n 3
117+
heighliner build -r ghcr.io/p2p-org/cosmos-heighliner -n 3
118118
```
119119

120120
heighliner will fetch the last 3 release tags from github for all chains in [chains.yaml](./chains.yaml), build docker images, and push them.
@@ -143,7 +143,7 @@ Docker images for `heighliner/gaia:v7.0.1` will now be available in your local d
143143
#### Example: Use custom buildkit server, build x64 and arm64 docker images for gaia v7.0.1, and push:
144144

145145
```shell
146-
heighliner build -b --buildkit-addr tcp://192.168.1.5:8125 -c gaia -g v7.0.1 -r ghcr.io/p2p-org/heighliner
146+
heighliner build -b --buildkit-addr tcp://192.168.1.5:8125 -c gaia -g v7.0.1 -r ghcr.io/p2p-org/cosmos-heighliner
147147
```
148148

149149
Docker images for `heighliner/gaia:v7.0.1` will be built on the remote buildkit server and then pushed to the container repository. The manifest for the tag will contain both amd64 and arm64 images.

chains.yaml

+2-15
Original file line numberDiff line numberDiff line change
@@ -180,27 +180,14 @@
180180
github-organization: axelarnetwork
181181
github-repo: axelar-core
182182
dockerfile: cosmos
183+
build-env:
184+
- BUILD_TAGS=muslc
183185
binaries:
184186
- bin/axelard
185187
build-target: |
186188
set -eux
187-
apk add --update nodejs npm jq py3-pip
188-
CONTRACT_VERSION=$(cat contract-version.json | jq -r '.gateway')
189-
git clone -b ${CONTRACT_VERSION} --single-branch https://github.com/axelarnetwork/axelar-cgp-solidity.git
190-
cd axelar-cgp-solidity
191-
# The npm commands will complain about nodejs versions but will proceed.
192-
# See issue: https://github.com/p2p-org/heighliner/issues/92
193-
npm ci
194-
npm run build
195-
# prettier + alpine + certain versions of the flatten-contracts scripts fail during prettier write, which is not fully necessary since hardhat flatten still outputs artifacts
196-
sed -i '/prettier/d' scripts/flatten-contracts.sh
197-
npm run flatten
198-
mkdir -p ../contract-artifacts/gateway
199-
mv artifacts/* ../contract-artifacts/
200-
cd ..
201189
VERSION=$(echo $(git describe --tags) | sed 's/^v//')
202190
COMMIT=$(git log -1 --format='%H')
203-
BUILD_TAGS=muslc
204191
LDFLAGS="$LDFLAGS -X github.com/cosmos/cosmos-sdk/version.Name=axelar \
205192
-X github.com/cosmos/cosmos-sdk/version.AppName=axelard \
206193
-X github.com/cosmos/cosmos-sdk/version.Version=$VERSION \

dockerfile/avalanche/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ RUN bash -c 'set -eux;\
101101
LIBRARIES_ARR=($LIBRARIES_ENV); for LIBRARY in "${LIBRARIES_ARR[@]}"; do cp $LIBRARY /root/lib/; done'
102102

103103
# Use minimal busybox from infra-toolkit image for final scratch image
104-
FROM ghcr.io/p2p-org/cosmos-infra-toolkit:v0.1.6 AS infra-toolkit
104+
FROM ghcr.io/p2p-org/cosmos-heighliner:infra-toolkit-v0.1.6 AS infra-toolkit
105105
RUN addgroup --gid 1111 -S p2p && adduser --uid 1111 -S p2p -G p2p
106106

107107
# Use ln and rm from full featured busybox for assembling final image

dockerfile/avalanche/native.Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ RUN bash -c 'set -eux;\
7878
LIBRARIES_ARR=($LIBRARIES_ENV); for LIBRARY in "${LIBRARIES_ARR[@]}"; do cp $LIBRARY /root/lib/; done'
7979

8080
# Use minimal busybox from infra-toolkit image for final scratch image
81-
FROM ghcr.io/p2p-org/cosmos-infra-toolkit:v0.1.6 AS infra-toolkit
81+
FROM ghcr.io/p2p-org/cosmos-heighliner:infra-toolkit-v0.1.6 AS infra-toolkit
8282
RUN addgroup --gid 1111 -S p2p && adduser --uid 1111 -S p2p -G p2p
8383

8484
# Use ln and rm from full featured busybox for assembling final image

dockerfile/cargo/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ RUN bash -c 'set -eux;\
146146
done'
147147

148148
# Use minimal busybox from infra-toolkit image for final scratch image
149-
FROM ghcr.io/p2p-org/cosmos-infra-toolkit:v0.1.6 AS infra-toolkit
149+
FROM ghcr.io/p2p-org/cosmos-heighliner:infra-toolkit-v0.1.6 AS infra-toolkit
150150
RUN addgroup --gid 1111 -S p2p && adduser --uid 1111 -S p2p -G p2p
151151

152152
# Use ln and rm from full featured busybox for assembling final image

dockerfile/cargo/native.Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ RUN bash -c 'set -eux;\
160160
done'
161161

162162
# Use minimal busybox from infra-toolkit image for final scratch image
163-
FROM ghcr.io/p2p-org/cosmos-infra-toolkit:v0.1.6 AS infra-toolkit
163+
FROM ghcr.io/p2p-org/cosmos-heighliner:infra-toolkit-v0.1.6 AS infra-toolkit
164164
RUN addgroup --gid 1111 -S p2p && adduser --uid 1111 -S p2p -G p2p
165165

166166
# Use ln and rm from full featured busybox for assembling final image

dockerfile/cosmos/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ RUN bash -c 'set -eux;\
119119
LIBRARIES_ARR=($LIBRARIES_ENV); for LIBRARY in "${LIBRARIES_ARR[@]}"; do cp $LIBRARY /root/lib/; done'
120120

121121
# Use minimal busybox from infra-toolkit image for final scratch image
122-
FROM ghcr.io/p2p-org/cosmos-infra-toolkit:v0.1.6 AS infra-toolkit
122+
FROM ghcr.io/p2p-org/cosmos-heighliner:infra-toolkit-v0.1.6 AS infra-toolkit
123123
RUN addgroup --gid 1111 -S p2p && adduser --uid 1111 -S p2p -G p2p
124124

125125
# Use ln and rm from full featured busybox for assembling final image

dockerfile/cosmos/local.Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ RUN set -eux; \
3333
fi;
3434

3535
# Use minimal busybox from infra-toolkit image for final scratch image
36-
FROM ghcr.io/p2p-org/cosmos-infra-toolkit:v0.1.6 AS infra-toolkit
36+
FROM ghcr.io/p2p-org/cosmos-heighliner:infra-toolkit-v0.1.6 AS infra-toolkit
3737
RUN addgroup --gid 1111 -S p2p && adduser --uid 1111 -S p2p -G p2p
3838

3939
# Use ln and rm from full featured busybox for assembling final image

dockerfile/cosmos/localcross.Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ RUN bash -c 'set -eux;\
106106
LIBRARIES_ARR=($LIBRARIES_ENV); for LIBRARY in "${LIBRARIES_ARR[@]}"; do cp $LIBRARY /root/lib/; done'
107107

108108
# Use minimal busybox from infra-toolkit image for final scratch image
109-
FROM ghcr.io/p2p-org/cosmos-infra-toolkit:v0.1.6 AS infra-toolkit
109+
FROM ghcr.io/p2p-org/cosmos-heighliner:infra-toolkit-v0.1.6 AS infra-toolkit
110110
RUN addgroup --gid 1111 -S p2p && adduser --uid 1111 -S p2p -G p2p
111111

112112
# Use ln and rm from full featured busybox for assembling final image

dockerfile/cosmos/native.Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ RUN bash -c 'set -eux;\
9393
LIBRARIES_ARR=($LIBRARIES_ENV); for LIBRARY in "${LIBRARIES_ARR[@]}"; do cp $LIBRARY /root/lib/; done'
9494

9595
# Use minimal busybox from infra-toolkit image for final scratch image
96-
FROM ghcr.io/p2p-org/cosmos-infra-toolkit:v0.1.6 AS infra-toolkit
96+
FROM ghcr.io/p2p-org/cosmos-heighliner:infra-toolkit-v0.1.6 AS infra-toolkit
9797
RUN addgroup --gid 1111 -S p2p && adduser --uid 1111 -S p2p -G p2p
9898

9999
# Use ln and rm from full featured busybox for assembling final image

dockerfile/imported/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ ARG VERSION
33
FROM $BASE_IMAGE:$VERSION AS imported
44

55
# Use minimal busybox from infra-toolkit image for final scratch image
6-
FROM ghcr.io/p2p-org/cosmos-infra-toolkit:v0.1.6 AS infra-toolkit
6+
FROM ghcr.io/p2p-org/cosmos-heighliner:infra-toolkit-v0.1.6 AS infra-toolkit
77
RUN addgroup --gid 1111 -S p2p && adduser --uid 1111 -S p2p -G p2p
88

99
# Use ln and rm from full featured busybox for assembling final image

0 commit comments

Comments
 (0)