Skip to content

Commit

Permalink
Use erigontech docker hub instead of thorax (#11985)
Browse files Browse the repository at this point in the history
  • Loading branch information
yperbasis authored Sep 13, 2024
1 parent 1eff2f4 commit 61ac5f5
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 93 deletions.
28 changes: 0 additions & 28 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,31 +112,3 @@ jobs:

- name: Test erigon-lib
run: cd erigon-lib && make test-no-fuzz

# docker-build-check:
# # don't run this on main - the PR must have run it to be merged and it misleads that this pushes the docker image
# if: (${{ github.event_name == 'push' || !github.event.pull_request.draft }}) && ${{ github.ref != 'refs/heads/main' }}
# runs-on: ubuntu-22.04
#
# steps:
# - uses: AutoModality/action-clean@v1
# - uses: actions/checkout@v4
# with:
# fetch-depth: 0 # fetch git tags for "git describe"

# - name: make docker (see dockerhub for image builds)
# run: DOCKER_TAG=thorax/erigon:ci-$GITHUB_SHA DOCKER_UID=$(id -u) DOCKER_GID=$(id -g) make docker

# check with root permissions, should be cached from previous build
# - name: sudo make docker
# run: sudo DOCKER_TAG=thorax/erigon:ci-$GITHUB_SHA DOCKER_UID=$(id -u) DOCKER_GID=$(id -g) make docker

# automated-tests:
# runs-on:
# ubuntu-22.04
# if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }}
# steps:
# - uses: actions/checkout@v4
#
# - name: run automated testing
# run: BUILD_ERIGON=1 ./tests/automated-testing/run.sh
2 changes: 0 additions & 2 deletions .github/workflows/docker-tags.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ jobs:
- run: |
make release-dry-run
docker images
# docker image push --all-tags thorax/erigon
# docker image push --all-tags ghcr.io/erigontech/erigon
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: ${GITHUB_REF#refs/tags/}
Expand Down
9 changes: 1 addition & 8 deletions .github/workflows/hive-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,10 @@ jobs:
with:
fetch-depth: 0 # fetch git tags for "git describe"

- name: build erigon image
run: DOCKER_TAG=thorax/erigon:ci-$GITHUB_SHA DOCKER_UID=$(id -u) DOCKER_GID=$(id -g) make docker

# check with root permissions, should be cached from previous build
- name: build erigon image (root permissions)
run: sudo DOCKER_TAG=thorax/erigon:ci-$GITHUB_SHA DOCKER_UID=$(id -u) DOCKER_GID=$(id -g) make docker

- name: run hive and parse output
run: |
sudo mkdir -p /results-${{ github.run_id }}
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -v ${{ github.workspace }}:/work thorax/hive:latest --sim ethereum/engine --results-root=/work/results-${{ github.run_id }} --client erigon_ci-$GITHUB_SHA --exit.fail=false
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -v ${{ github.workspace }}:/work thorax/hive:latest --sim ethereum/engine --results-root=/work/results-${{ github.run_id }} --client erigon --exit.fail=false
docker run --rm --pull always -v /var/run/docker.sock:/var/run/docker.sock -v ${{ github.workspace }}:/work --entrypoint /app/hivecioutput thorax/hive:latest --resultsdir=/work/results-${{ github.run_id }} --outdir=/work/results-${{ github.run_id }} --exclusionsfile=/work/hive/exclusions.json
- name: clean up containers
Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/test-kurtosis-assertoor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,14 @@ jobs:
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4
- name: make docker (see dockerhub for image builds)
run: DOCKER_TAG=thorax/erigon:ci-$GITHUB_SHA DOCKER_UID=$(id -u) DOCKER_GID=$(id -g) make docker

- name: Install dependencies on Linux
if: runner.os == 'Linux'
run: sudo apt update && sudo apt install build-essential

- name: download kurtosis config
run: |
wget -O kurtosis_config_with_p.yaml https://raw.githubusercontent.com/erigontech/erigon/main/.github/workflows/kurtosis/config.yaml
sed 's/<<ERIGON_IMAGE_PLACEHOLDER>>/thorax\/erigon:ci-'$GITHUB_SHA'/' kurtosis_config_with_p.yaml > kurtosis_config.yaml
sed 's/<<ERIGON_IMAGE_PLACEHOLDER>>/erigontech\/erigon:main-latest/' kurtosis_config_with_p.yaml > kurtosis_config.yaml
- name: Run Kurtosis + assertoor tests
uses: ethpandaops/kurtosis-assertoor-github-action@v1
Expand Down
28 changes: 1 addition & 27 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ERIGON_USER ?= erigon
# if using volume-mounting data dir, then must exist on host OS
DOCKER_UID ?= $(shell id -u)
DOCKER_GID ?= $(shell id -g)
DOCKER_TAG ?= thorax/erigon:latest
DOCKER_TAG ?= erigontech/erigon:latest

# Variables below for building on host OS, and are ignored for docker
#
Expand Down Expand Up @@ -294,25 +294,6 @@ release-dry-run: git-submodules
-w /go/src/$(PACKAGE_NAME) \
ghcr.io/goreleaser/goreleaser-cross:${GOLANG_CROSS_VERSION} \
--clean --skip=validate --skip=publish

.PHONY: release
release: git-submodules
@docker run \
--rm \
--privileged \
-e CGO_ENABLED=1 \
-e GITHUB_TOKEN \
-e DOCKER_USERNAME \
-e DOCKER_PASSWORD \
-v /var/run/docker.sock:/var/run/docker.sock \
-v `pwd`:/go/src/$(PACKAGE_NAME) \
-w /go/src/$(PACKAGE_NAME) \
ghcr.io/goreleaser/goreleaser-cross:${GOLANG_CROSS_VERSION} \
--clean --skip=validate

@docker image push --all-tags thorax/erigon
@docker image push --all-tags ghcr.io/erigontech/erigon

# since DOCKER_UID, DOCKER_GID are default initialized to the current user uid/gid,
# we need separate envvars to facilitate creation of the erigon user on the host OS.
ERIGON_USER_UID ?= 3473
Expand Down Expand Up @@ -342,13 +323,6 @@ user_macos:
sudo dscl . -append /Groups/admin GroupMembership $(ERIGON_USER)
sudo -u $(ERIGON_USER) mkdir -p /Users/$(ERIGON_USER)/.local/share

## hive: run hive test suite locally using docker e.g. OUTPUT_DIR=~/results/hive SIM=ethereum/engine make hive
.PHONY: hive
hive:
DOCKER_TAG=thorax/erigon:ci-local make docker
docker pull thorax/hive:latest
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -v $(OUTPUT_DIR):/work thorax/hive:latest --sim $(SIM) --results-root=/work/results --client erigon_ci-local # run erigon

## automated-tests run automated tests (BUILD_ERIGON=0 to prevent erigon build with local image tag)
.PHONY: automated-tests
automated-tests:
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ version: '2.2'

# Basic erigon's service
x-erigon-service: &default-erigon-service
image: thorax/erigon:${TAG:-latest}
image: erigontech/erigon:${TAG:-latest}
pid: service:erigon # Use erigon's PID namespace. It's required to open Erigon's DB from another process (RPCDaemon local-mode)
volumes_from: [ erigon ]
restart: unless-stopped
Expand All @@ -24,7 +24,7 @@ x-erigon-service: &default-erigon-service

services:
erigon:
image: thorax/erigon:${TAG:-latest}
image: erigontech/erigon:${TAG:-latest}
build:
args:
UID: ${DOCKER_UID:-1000}
Expand Down
2 changes: 1 addition & 1 deletion k8s/base/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ spec:
command:
- erigon
env: []
image: thorax/erigon
image: erigontech/erigon
name: erigon
ports:
- containerPort: 9090
Expand Down
30 changes: 15 additions & 15 deletions tests/automated-testing/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,35 @@ services:
erigon:
profiles:
- first
image: thorax/erigon:$ERIGON_TAG
image: erigontech/erigon:$ERIGON_TAG
command: |
--datadir=/home/erigon/.local/share/erigon --chain=dev --private.api.addr=0.0.0.0:9090 --mine --log.dir.path=/logs/node1
ports:
- "8551:8551"
volumes:
volumes:
- datadir:/home/erigon/.local/share/erigon
- ./logdir:/logs
user: ${DOCKER_UID}:${DOCKER_GID}
restart: unless-stopped
mem_swappiness: 0

erigon-node2:
profiles:
- second
image: thorax/erigon:$ERIGON_TAG
command: |
--datadir=/home/erigon/.local/share/erigon --chain=dev --private.api.addr=0.0.0.0:9090 --staticpeers=$ENODE --log.dir.path=/logs/node2
volumes:
- datadir2:/home/erigon/.local/share/erigon
- ./logdir:/logs
user: ${DOCKER_UID}:${DOCKER_GID}
restart: unless-stopped
mem_swappiness: 0
profiles:
- second
image: erigontech/erigon:$ERIGON_TAG
command: |
--datadir=/home/erigon/.local/share/erigon --chain=dev --private.api.addr=0.0.0.0:9090 --staticpeers=$ENODE --log.dir.path=/logs/node2
volumes:
- datadir2:/home/erigon/.local/share/erigon
- ./logdir:/logs
user: ${DOCKER_UID}:${DOCKER_GID}
restart: unless-stopped
mem_swappiness: 0

rpcdaemon:
profiles:
- first
image: thorax/erigon:$ERIGON_TAG
image: erigontech/erigon:$ERIGON_TAG
entrypoint: rpcdaemon
command: |
--private.api.addr=erigon:9090 --http.api=admin,eth,erigon,web3,net,debug,trace,txpool,parity --http.addr=0.0.0.0 --http.vhosts=any --http.corsdomain=* --http.port=8545 --graphql --log.dir.path=/logs/node1
Expand All @@ -44,7 +44,7 @@ services:
rpcdaemon-node2:
profiles:
- second
image: thorax/erigon:$ERIGON_TAG
image: erigontech/erigon:$ERIGON_TAG
entrypoint: rpcdaemon
command: |
--private.api.addr=erigon-node2:9090 --http.api=admin,eth,erigon,web3,net,debug,trace,txpool,parity --http.addr=0.0.0.0 --http.vhosts=any --http.corsdomain=* --http.port=8545 --log.dir.path=/logs/node2
Expand Down
12 changes: 7 additions & 5 deletions tests/automated-testing/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,17 @@ cd "$SCRIPT_DIR" || exit
#export DOCKER_UID=1000
#export DOCKER_GID=1000

# set GITHUB_SHA
# set SHORT_SHA
if [ -z "$GITHUB_SHA" ]; then
export GITHUB_SHA=local
export SHORT_SHA=latest
else
export SHORT_SHA=${GITHUB_SHA::7}
fi
echo "GITHUB_SHA=$GITHUB_SHA"
echo "SHORT_SHA=$SHORT_SHA"

# set ERIGON_TAG
if [ -z "$ERIGON_TAG" ]; then
export ERIGON_TAG=ci-$GITHUB_SHA
export ERIGON_TAG=main-$SHORT_SHA
fi
echo "ERIGON_TAG=$ERIGON_TAG"

Expand All @@ -34,7 +36,7 @@ echo "BUILD_ERIGON=$BUILD_ERIGON"

if [ "$BUILD_ERIGON" = 1 ] ; then
echo "building erigon..."
cd ../../ && DOCKER_TAG=thorax/erigon:$ERIGON_TAG DOCKER_UID=$(id -u) DOCKER_GID=$(id -g) make docker
cd ../../ && DOCKER_TAG=erigontech/erigon:$ERIGON_TAG DOCKER_UID=$(id -u) DOCKER_GID=$(id -g) make docker
fi

# move back to the script directory
Expand Down

0 comments on commit 61ac5f5

Please sign in to comment.