Skip to content

Commit 68787e7

Browse files
authored
Merge pull request #23 from p2p-org/Amine/0G-images
feat: Add 0G support for aristotle & galileo
2 parents 9ef26e0 + c4b5fc8 commit 68787e7

10 files changed

Lines changed: 405 additions & 6 deletions

File tree

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Build and Push 0g-aristotle-geth Docker Image
2+
3+
on:
4+
push:
5+
tags:
6+
- "0g-aristotle-geth-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-0g-aristotle-geth:
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.23'
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/0g-aristotle-geth-}" >> $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 0g-aristotle-geth Docker image
51+
run: |
52+
./heighliner build -c 0g-aristotle-geth --git-ref ${{ env.VERSION }} --go-version 1.23
53+
54+
- name: Tag and push Docker image
55+
run: |
56+
docker tag 0g-aristotle-geth:${{ env.VERSION }} ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:0g-aristotle-geth-${{ env.VERSION }}
57+
docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:0g-aristotle-geth-${{ env.VERSION }}

.github/workflows/0g-aristotle.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Build and Push 0g-aristotle Docker Image
2+
3+
on:
4+
push:
5+
tags:
6+
- "0g-aristotle-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-0g-aristotle:
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.23'
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/0g-aristotle-}" >> $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 0g-aristotle Docker image
51+
run: |
52+
./heighliner build -c 0g-aristotle --git-ref ${{ env.VERSION }} --go-version 1.23
53+
54+
- name: Tag and push Docker image
55+
run: |
56+
docker tag 0g-aristotle:${{ env.VERSION }} ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:0g-aristotle-${{ env.VERSION }}
57+
docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:0g-aristotle-${{ env.VERSION }}
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Build and Push 0g-galileo-geth Docker Image
2+
3+
on:
4+
push:
5+
tags:
6+
- "0g-galileo-geth-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-0g-galileo-geth:
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.23'
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/0g-galileo-geth-}" >> $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 0g-galileo-geth Docker image
51+
run: |
52+
./heighliner build -c 0g-galileo-geth --git-ref ${{ env.VERSION }} --go-version 1.23
53+
54+
- name: Tag and push Docker image
55+
run: |
56+
docker tag 0g-galileo-geth:${{ env.VERSION }} ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:0g-galileo-geth-${{ env.VERSION }}
57+
docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:0g-galileo-geth-${{ env.VERSION }}

.github/workflows/0g-galileo.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Build and Push 0g-galileo Docker Image
2+
3+
on:
4+
push:
5+
tags:
6+
- "0g-galileo-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-0g-galileo:
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.23'
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/0g-galileo-}" >> $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 0g-galileo Docker image
51+
run: |
52+
./heighliner build -c 0g-galileo --git-ref ${{ env.VERSION }} --go-version 1.23
53+
54+
- name: Tag and push Docker image
55+
run: |
56+
docker tag 0g-galileo:${{ env.VERSION }} ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:0g-galileo-${{ env.VERSION }}
57+
docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:0g-galileo-${{ env.VERSION }}

README.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,51 @@ heighliner will fetch the last 3 osmosis release tags from github, build docker
117117
- `ghcr.io/p2p-org/cosmos-heighliner/osmosis:v6.0.0`
118118
- `ghcr.io/p2p-org/cosmos-heighliner/osmosis:v5.0.0`
119119

120+
#### Example: build and push 0G images ( using pre-compiled binaries for Galileo & Aristotle )
121+
122+
````bash
123+
# Local build
124+
go build -o heighliner
125+
# 0G Galileo Testnet - both binaries from same release
126+
./heighliner build -c 0g-galileo --git-ref v3.0.4 --go-version 1.23
127+
./heighliner build -c 0g-galileo-geth --git-ref v3.0.4 --go-version 1.23
128+
129+
# 0G Aristotle Mainnet - both binaries from same release
130+
./heighliner build -c 0g-aristotle --git-ref v1.0.4 --go-version 1.23
131+
./heighliner build -c 0g-aristotle-geth --git-ref v1.0.4 --go-version 1.23
132+
````
133+
134+
````bash
135+
#remote build
136+
# Galileo "testnet" - both binaries extracted from galileo-v3.0.4.tar.gz
137+
git tag 0g-galileo-v3.0.4
138+
git tag 0g-galileo-geth-v3.0.4
139+
# Aristotle "mainnet" - both binaries extracted from aristotle-v1.0.4.tar.gz
140+
git tag 0g-aristotle-v1.0.4
141+
git tag 0g-aristotle-geth-v1.0.4
142+
git push origin <tag-name>
143+
````
144+
145+
#### Example: build and push Story images ( building from source )
146+
147+
````bash
148+
# Local build
149+
go build -o heighliner
150+
# Story Consensus
151+
./heighliner build -c story --git-ref v0.11.0
152+
# Story-Geth Execution Layer
153+
./heighliner build -c story-geth --git-ref v0.2.0
154+
````
155+
156+
````bash
157+
# Remote build
158+
# Story consensus
159+
git tag story-v0.11.0
160+
# Story-Geth execution
161+
git tag story-geth-v0.2.0
162+
git push origin <tag-name>
163+
````
164+
120165
#### Example: build and push last n releases of all chains
121166

122167
This will make a request to each chain's Github repository to fetch all recent releases. Github rate-limits unauthenticated requests to 60 requests per hour. Authenticated requests have either 1000 (personal) or 15000 (enterprise) per hour. To add Github API authentication, set the `GH_USER` and `GH_PAT` environment variables with your Github username and Github Personal Access Token (PAT), respectively.

builder/builder.go

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -438,11 +438,14 @@ func (h *HeighlinerBuilder) buildChainNodeDockerImage(
438438
}
439439

440440
if dockerfile == DockerfileTypeCosmos || dockerfile == DockerfileTypeAvalanche {
441-
if err != nil {
441+
// Only fail on go.mod error if no explicit go-version is provided
442+
if err != nil && buildCfg.GoVersion == "" {
442443
return fmt.Errorf("error getting mod file: %w", err)
443444
}
444445

445-
wasmvmVersion = getWasmvmVersion(modFile)
446+
if modFile != nil {
447+
wasmvmVersion = getWasmvmVersion(modFile)
448+
}
446449

447450
if h.race {
448451
race = "true"
@@ -452,9 +455,14 @@ func (h *HeighlinerBuilder) buildChainNodeDockerImage(
452455
}
453456
}
454457

455-
fmt.Printf("Go version from go.mod: %s, will build with version: %s image: %s\n", modFile.Go.Version, gv.Version, gv.Image)
458+
if modFile != nil {
459+
fmt.Printf("Go version from go.mod: %s, will build with version: %s image: %s\n", modFile.Go.Version, gv.Version, gv.Image)
460+
} else {
461+
fmt.Printf("Using explicit Go version: %s image: %s\n", gv.Version, gv.Image)
462+
}
456463
} else if dockerfile == DockerfileTypeGoBuild {
457-
if err != nil {
464+
// Only fail on go.mod error if no explicit go-version is provided
465+
if err != nil && buildCfg.GoVersion == "" {
458466
return fmt.Errorf("error getting mod file: %w", err)
459467
}
460468

@@ -466,7 +474,11 @@ func (h *HeighlinerBuilder) buildChainNodeDockerImage(
466474
}
467475
}
468476

469-
fmt.Printf("Go version from go.mod: %s, will build with version: %s image: %s\n", modFile.Go.Version, gv.Version, gv.Image)
477+
if modFile != nil {
478+
fmt.Printf("Go version from go.mod: %s, will build with version: %s image: %s\n", modFile.Go.Version, gv.Version, gv.Image)
479+
} else {
480+
fmt.Printf("Using explicit Go version: %s image: %s\n", gv.Version, gv.Image)
481+
}
470482
}
471483

472484
fmt.Printf("Building image from %s, resulting docker image tags: +%v\n", buildFrom, imageTags)

builder/go_versions.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const (
1414
Go120Version = "1.20.14"
1515
Go121Version = "1.21.13"
1616
Go122Version = "1.22.7"
17-
Go123Version = "1.23.4"
17+
Go123Version = "1.23.12"
1818
Go124Version = "1.24.1"
1919
Go125Version = "1.25.7"
2020
// ADD NEW GO VERSION [1] - latest patch release for each major/minor

0 commit comments

Comments
 (0)