Docker image combined tag (#1566)

Signed-off-by: Martin Eckardt <[email protected]>
Signed-off-by: Ceyhun Onur <[email protected]>
Co-authored-by: Martin Eckardt <[email protected]>
Co-authored-by: Michael Kaplan <[email protected]>
Co-authored-by: Quentin McGaw <[email protected]>
This commit is contained in:
Ceyhun Onur
2025-04-24 11:56:27 +00:00
committed by GitHub
co-authored by Martin Eckardt Michael Kaplan Quentin McGaw
parent 9e09713625
commit 37ff0fc4d7
21 changed files with 95 additions and 92 deletions
+1 -1
View File
@@ -3,7 +3,7 @@
# - For quieter direnv output, set `export DIRENV_LOG_FORMAT=`
# Determine AVALANCHE_VERSION
source ./scripts/versions.sh
source ./scripts/constants.sh
# - Starts an avalanchego dev shell
# - Requires nix (https://github.com/DeterminateSystems/nix-installer?tab=readme-ov-file#install-nix)
+10 -5
View File
@@ -4,15 +4,20 @@ on:
workflow_dispatch:
inputs:
vm_id:
description: 'The ID of the VM (binary dst in Docker image)'
default: ''
description: "The ID of the VM (binary dst in Docker image)"
default: ""
required: false
type: string
avalanche_version:
description: 'The SHA or tag of avalanchego to use for the base image (must be compatible with the version in go.mod)'
default: ''
description: "The SHA or tag of avalanchego to use for the base image (must be compatible with the version in go.mod)"
default: ""
required: false
type: string
allow_tag_latest:
description: "Whether or not allowing to tag the image created as latest (only works for master branch)"
default: false
required: false
type: boolean
push:
tags:
@@ -31,9 +36,9 @@ jobs:
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASS: ${{ secrets.DOCKER_PASS }}
IMAGE_NAME: "avaplatform/subnet-evm"
VM_ID: ${{ inputs.vm_id }}
PUBLISH: 1
PLATFORMS: "linux/amd64,linux/arm64"
AVALANCHE_VERSION: ${{ inputs.avalanche_version }}
ALLOW_TAG_LATEST: ${{ github.event_name != 'workflow_dispatch' || inputs.allow_tag_latest }}
run: scripts/build_docker_image.sh
+38 -4
View File
@@ -2,10 +2,44 @@
## Pending Release
* * IMPORTANT: `eth_getProof` calls for historical state will be rejected by default.
* On archive nodes (`"pruning-enabled": false`): queries for historical proofs for state older than approximately 24 hours preceding the last accepted block will be rejected by default. This can be adjusted with the new option `historical-proof-query-window` which defines the number of blocks before the last accepted block which should be accepted for state proof queries, or set to `0` to accept any block number state query (previous behavior).
* On `pruning` nodes: queries for proofs past the tip buffer (32 blocks) will be rejected. This is in support of moving to a path based storage scheme, which does not support historical state proofs.
* Added `Fortuna` upgrade as optional and defaulting to a `nil` timestamp.
- Updated dockerhub image name to `avaplatform/subnet-evm_avalanchego` and tags to accommodate the new versioning scheme: {subnet-evm version}_{avalanchego version}
## [v0.7.3](https://github.com/ava-labs/subnet-evm/releases/tag/v0.7.3)
This version is backwards compatible to v0.7.0. It is optional, but encouraged.
### AvalancheGo Compatibility
The plugin version is unchanged at 39 and is compatible with AvalancheGo version v1.13.0.
### Breaking changes
- `eth_getProof` calls for historical state will be rejected by default (#1494: 4e5b9d86c617f046fd7ce36b9cbd76a6e27b4bc5)
- On archive nodes (`"pruning-enabled": false`): queries for historical proofs for state older than approximately 24 hours preceding the last accepted block will be rejected by default. This can be adjusted with the new option `historical-proof-query-window` which defines the number of blocks before the last accepted block which should be accepted for state proof queries, or set to `0` to accept any block number state query (previous behavior).
- On `pruning` nodes: queries for proofs past the tip buffer (32 blocks) will be rejected. This is in support of moving to a path based storage scheme, which does not support historical state proofs.
### Features
- Add `Fortuna` upgrade as optional and defaulting to a `nil` timestamp (#1494, #1498)
- Docker images Debian base upgraded from Bullseye (11) to Bookworm (12) (#1497)
- AvalancheGo version upgraded from `v1.12.3-0.20250218154446-f1ec9a13b90a` to `v1.13.0`
- plugin/evm/client: add `NewClientWithURL` function (#1509)
### Fixes
- Fix nil block possible bug in debug APIs (#1494: 0af9717087e6adafccf3486c770ae08cba09b751)
### Documentation
- plugin/evm: add local API docs (#1513)
- 2023 Least Authority Audit (#1499)
- precompile/contracts/warp:
- changes for 9000 upgrade (#1494)
- differentiate between L1 and Subnet self-signing optimization cases (#1529)
- simulator: fix wrong flag name `staking-enabled` -> `--sybil-protection-enabled=false` (#1476)
- typo fixes (#1491, #1506)
**Full Changelog**: <https://github.com/ava-labs/subnet-evm/compare/v0.7.2...v0.7.3>
## [v0.7.2](https://github.com/ava-labs/subnet-evm/releases/tag/v0.7.2)
-3
View File
@@ -10,9 +10,6 @@ SUBNET_EVM_PATH=$(
cd .. && pwd
)
# Load the versions
source "$SUBNET_EVM_PATH"/scripts/versions.sh
# Load the constants
source "$SUBNET_EVM_PATH"/scripts/constants.sh
-1
View File
@@ -14,7 +14,6 @@ SUBNET_EVM_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )"; cd .. && pwd )
# Assume it's necessary to build the avalanchego node image from source
# TODO(marun) Support use of a released node image if using a release version of avalanchego
source "${SUBNET_EVM_PATH}"/scripts/versions.sh
source "${SUBNET_EVM_PATH}"/scripts/constants.sh
source "${SUBNET_EVM_PATH}"/scripts/lib_avalanchego_clone.sh
-3
View File
@@ -10,9 +10,6 @@ SUBNET_EVM_PATH=$(
cd .. && pwd
)
# Load the versions
source "$SUBNET_EVM_PATH"/scripts/versions.sh
# Load the constants
source "$SUBNET_EVM_PATH"/scripts/constants.sh
+5 -9
View File
@@ -25,11 +25,10 @@ SUBNET_EVM_PATH=$(
# Load the constants
source "$SUBNET_EVM_PATH"/scripts/constants.sh
# Load the versions
source "$SUBNET_EVM_PATH"/scripts/versions.sh
# WARNING: this will use the most recent commit even if there are un-committed changes present
BUILD_IMAGE_ID=${BUILD_IMAGE_ID:-"${CURRENT_BRANCH}"}
# ALLOW_TAG_LATEST is used to tag the image as 'latest' if set to true.
# It only works if the image is built from the master branch. This is to avoid
# tagging images from a manual triggered build as 'latest' with older avalanchego versions.
ALLOW_TAG_LATEST="${ALLOW_TAG_LATEST:-}"
# buildx (BuildKit) improves the speed and UI of builds over the legacy builder and
# simplifies creation of multi-arch images.
@@ -70,9 +69,6 @@ else
fi
VM_ID=${VM_ID:-"${DEFAULT_VM_ID}"}
if [[ "${VM_ID}" != "${DEFAULT_VM_ID}" ]]; then
DOCKERHUB_TAG="${VM_ID}-${DOCKERHUB_TAG}"
fi
# Default to the release image. Will need to be overridden when testing against unreleased versions.
AVALANCHEGO_NODE_IMAGE="${AVALANCHEGO_NODE_IMAGE:-${AVALANCHEGO_IMAGE_NAME}:${AVALANCHE_VERSION}}"
@@ -112,7 +108,7 @@ ${DOCKER_CMD} -t "$IMAGE_NAME:$BUILD_IMAGE_ID" -t "$IMAGE_NAME:${DOCKERHUB_TAG}"
--build-arg CURRENT_BRANCH="$CURRENT_BRANCH" \
--build-arg VM_ID="$VM_ID"
if [[ -n "${PUBLISH}" && $CURRENT_BRANCH == "master" ]]; then
if [[ -n "${PUBLISH}" && $CURRENT_BRANCH == "master" && $ALLOW_TAG_LATEST == true ]]; then
echo "Tagging current image as $IMAGE_NAME:latest"
docker buildx imagetools create -t "$IMAGE_NAME:latest" "$IMAGE_NAME:$BUILD_IMAGE_ID"
fi
-3
View File
@@ -11,9 +11,6 @@ SUBNET_EVM_PATH=$(
cd .. && pwd
)
# Load the versions
source "$SUBNET_EVM_PATH"/scripts/versions.sh
# Load the constants
source "$SUBNET_EVM_PATH"/scripts/constants.sh
+27 -6
View File
@@ -13,8 +13,8 @@ DEFAULT_VM_ID="srEXiWaHuhNyGwPUi444Tu47ZEDwxTWrbQiuD7FmgSAQ6X7Dy"
# Avalabs docker hub
# avaplatform/avalanchego - defaults to local as to avoid unintentional pushes
# You should probably set it - export IMAGE_NAME='avaplatform/subnet-evm'
IMAGE_NAME=${IMAGE_NAME:-"subnet-evm"}
# You should probably set it - export IMAGE_NAME='avaplatform/subnet-evm_avalanchego'
IMAGE_NAME=${IMAGE_NAME:-"subnet-evm_avalanchego"}
# Shared between ./scripts/build_docker_image.sh and ./scripts/tests.build_docker_image.sh
AVALANCHEGO_IMAGE_NAME="${AVALANCHEGO_IMAGE_NAME:-avaplatform/avalanchego}"
@@ -34,17 +34,38 @@ else
SUBNET_EVM_COMMIT="$(git --git-dir="$SUBNET_EVM_PATH/.git" rev-parse HEAD || :)"
fi
# Don't export them as they're used in the context of other calls
if [[ -z ${AVALANCHE_VERSION:-} ]]; then
# Get module details from go.mod
MODULE_DETAILS="$(go list -m "github.com/ava-labs/avalanchego" 2>/dev/null)"
AVALANCHE_VERSION="$(echo "${MODULE_DETAILS}" | awk '{print $2}')"
# Check if the version matches the pattern where the last part is the module hash
# v*YYYYMMDDHHMMSS-abcdef123456
#
# If not, the value is assumed to represent a tag
if [[ "${AVALANCHE_VERSION}" =~ ^v.*[0-9]{14}-[0-9a-f]{12}$ ]]; then
MODULE_HASH="$(echo "${AVALANCHE_VERSION}" | grep -Eo '[0-9a-f]{12}$')"
# The first 8 chars of the hash is used as the tag of avalanchego images
AVALANCHE_VERSION="${MODULE_HASH::8}"
fi
fi
# Shared between ./scripts/build_docker_image.sh and ./scripts/tests.build_docker_image.sh
DOCKERHUB_TAG=${SUBNET_EVM_COMMIT::8}
DOCKERHUB_TAG="${SUBNET_EVM_COMMIT::8}_${AVALANCHE_VERSION}"
# WARNING: this will use the most recent commit even if there are un-committed changes present
BUILD_IMAGE_ID=${BUILD_IMAGE_ID:-"${CURRENT_BRANCH}_${AVALANCHE_VERSION}"}
echo "Using branch: ${CURRENT_BRANCH}"
# Static compilation
STATIC_LD_FLAGS=''
if [ "${STATIC_COMPILATION:-}" = 1 ]; then
export CC=musl-gcc
command -v $CC || (echo $CC must be available for static compilation && exit 1)
STATIC_LD_FLAGS=' -extldflags "-static" -linkmode external '
export CC=musl-gcc
command -v $CC || (echo $CC must be available for static compilation && exit 1)
STATIC_LD_FLAGS=' -extldflags "-static" -linkmode external '
fi
# Set the CGO flags to use the portable version of BLST
+2 -2
View File
@@ -9,8 +9,8 @@ set -euo pipefail
# Load AVALANCHE_VERSION
SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
# shellcheck source=/scripts/versions.sh
source "$SCRIPT_DIR"/versions.sh
# shellcheck source=/scripts/constants.sh
source "$SCRIPT_DIR"/constants.sh
# Start a dev shell with the avalanchego flake
FLAKE="github:ava-labs/avalanchego?ref=${AVALANCHE_VERSION}"
-1
View File
@@ -9,7 +9,6 @@ if ! [[ "$0" =~ scripts/generate_precompile.sh ]]; then
exit 255
fi
# Load the versions
SUBNET_EVM_PATH=$(
cd "$(dirname "${BASH_SOURCE[0]}")"
cd .. && pwd
+3 -6
View File
@@ -1,12 +1,10 @@
#!/usr/bin/env bash
set -e
# Load the versions
SUBNET_EVM_PATH=$(
cd "$(dirname "${BASH_SOURCE[0]}")"
cd .. && pwd
)
source "$SUBNET_EVM_PATH"/scripts/versions.sh
# Load the constants
source "$SUBNET_EVM_PATH"/scripts/constants.sh
@@ -51,7 +49,7 @@ if [[ -f ${AVAGO_DOWNLOAD_PATH} ]]; then
extract_archive
else
# try to download the archive if it exists
if curl -s --head --request GET "${AVAGO_DOWNLOAD_URL}" | grep "302" > /dev/null; then
if curl -s --head --request GET "${AVAGO_DOWNLOAD_URL}" | grep "302" >/dev/null; then
echo "${AVAGO_DOWNLOAD_URL} found"
echo "downloading to ${AVAGO_DOWNLOAD_PATH}"
curl -L "${AVAGO_DOWNLOAD_URL}" -o "${AVAGO_DOWNLOAD_PATH}"
@@ -79,14 +77,14 @@ else
set +e
# try to checkout the branch
git checkout origin/"${AVALANCHE_VERSION}" > /dev/null 2>&1
git checkout origin/"${AVALANCHE_VERSION}" >/dev/null 2>&1
CHECKOUT_STATUS=$?
set -e
# if it's not a branch, try to checkout the commit
if [[ $CHECKOUT_STATUS -ne 0 ]]; then
set +e
git checkout "${AVALANCHE_VERSION}" > /dev/null 2>&1
git checkout "${AVALANCHE_VERSION}" >/dev/null 2>&1
CHECKOUT_STATUS=$?
set -e
@@ -121,7 +119,6 @@ mkdir -p "${AVALANCHEGO_BUILD_PATH}"
cp "${BUILD_DIR}"/avalanchego "${AVALANCHEGO_PATH}"
echo "Installed AvalancheGo release ${AVALANCHE_VERSION}"
echo "AvalancheGo Path: ${AVALANCHEGO_PATH}"
echo "Plugin Dir: ${DEFAULT_PLUGIN_DIR}"
-3
View File
@@ -8,13 +8,10 @@ if ! [[ "$0" =~ scripts/run.sh ]]; then
exit 255
fi
# Load the versions
SUBNET_EVM_PATH=$(
cd "$(dirname "${BASH_SOURCE[0]}")"
cd .. && pwd
)
source "$SUBNET_EVM_PATH"/scripts/versions.sh
# Load the constants
source "$SUBNET_EVM_PATH"/scripts/constants.sh
-3
View File
@@ -5,7 +5,6 @@ set -e
# within the $GOPATH
# The AvalancheGo and PluginDir paths can be specified via the environment variables used in ./scripts/run.sh.
# Load the versions
SUBNET_EVM_PATH=$(
cd "$(dirname "${BASH_SOURCE[0]}")"
cd .. && pwd
@@ -13,8 +12,6 @@ SUBNET_EVM_PATH=$(
source "$SUBNET_EVM_PATH"/scripts/constants.sh
source "$SUBNET_EVM_PATH"/scripts/versions.sh
EXTRA_ARGS=()
AVALANCHEGO_BUILD_PATH="${AVALANCHEGO_BUILD_PATH:-}"
if [[ -n "${AVALANCHEGO_BUILD_PATH}" ]]; then
-3
View File
@@ -5,7 +5,6 @@ set -e
# within the $GOPATH
# The AvalancheGo and PluginDir paths can be specified via the environment variables used in ./scripts/run.sh.
# Load the versions
SUBNET_EVM_PATH=$(
cd "$(dirname "${BASH_SOURCE[0]}")"
cd .. && pwd
@@ -13,8 +12,6 @@ SUBNET_EVM_PATH=$(
source "$SUBNET_EVM_PATH"/scripts/constants.sh
source "$SUBNET_EVM_PATH"/scripts/versions.sh
TEST_SOURCE_ROOT=$(pwd)
# By default, it runs all e2e test cases!
-3
View File
@@ -6,7 +6,6 @@ set -euo pipefail
# within the $GOPATH
# The AvalancheGo and PluginDir paths can be specified via the environment variables used in ./scripts/run.sh.
# Load the versions
SUBNET_EVM_PATH=$(
cd "$(dirname "${BASH_SOURCE[0]}")"
cd .. && pwd
@@ -14,8 +13,6 @@ SUBNET_EVM_PATH=$(
source "$SUBNET_EVM_PATH"/scripts/constants.sh
source "$SUBNET_EVM_PATH"/scripts/versions.sh
EXTRA_ARGS=()
AVALANCHEGO_BUILD_PATH="${AVALANCHEGO_BUILD_PATH:-}"
if [[ -n "${AVALANCHEGO_BUILD_PATH}" ]]; then
-3
View File
@@ -11,13 +11,10 @@ if ! [[ "$0" =~ scripts/run_simulator.sh ]]; then
exit 255
fi
# Load the versions
SUBNET_EVM_PATH=$(
cd "$(dirname "${BASH_SOURCE[0]}")"
cd .. && pwd
)
source "$SUBNET_EVM_PATH"/scripts/versions.sh
# Load the constants
source "$SUBNET_EVM_PATH"/scripts/constants.sh
+1 -1
View File
@@ -18,7 +18,7 @@ SUBNET_EVM_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )"; cd .. && pwd )
# Discover the default tag that will be used for the image
source "${SUBNET_EVM_PATH}"/scripts/constants.sh
export IMAGE_TAG="${SUBNET_EVM_COMMIT::8}"
export IMAGE_TAG="${DOCKERHUB_TAG}"
# Build the images
bash -x "${SUBNET_EVM_PATH}"/scripts/build_antithesis_images.sh
+2 -5
View File
@@ -12,9 +12,6 @@ SUBNET_EVM_PATH=$(
# Load the constants
source "$SUBNET_EVM_PATH"/scripts/constants.sh
# Load the versions
source "$SUBNET_EVM_PATH"/scripts/versions.sh
build_and_test() {
local imagename="${1}"
local vm_id="${2}"
@@ -61,7 +58,7 @@ build_and_test() {
VM_ID="${VM_ID:-${DEFAULT_VM_ID}}"
echo "checking build of single-arch image"
build_and_test "subnet-evm" "${VM_ID}" false "avalanchego"
build_and_test "subnet-evm_avalanchego" "${VM_ID}" false "avalanchego"
echo "starting local docker registry to allow verification of multi-arch image builds"
REGISTRY_CONTAINER_ID="$(docker run --rm -d -P registry:2)"
@@ -81,4 +78,4 @@ function cleanup {
trap cleanup EXIT
echo "checking build of multi-arch images"
build_and_test "localhost:${REGISTRY_PORT}/subnet-evm" "${VM_ID}" true "localhost:${REGISTRY_PORT}/avalanchego"
build_and_test "localhost:${REGISTRY_PORT}/subnet-evm_avalanchego" "${VM_ID}" true "localhost:${REGISTRY_PORT}/avalanchego"
+6 -1
View File
@@ -7,6 +7,11 @@ if ! [[ "$0" =~ scripts/update_avalanchego_version.sh ]]; then
exit 255
fi
SUBNET_EVM_PATH=$(
cd "$(dirname "${BASH_SOURCE[0]}")"
cd .. && pwd
)
# If version is not provided, the existing version in go.mod is assumed
VERSION="${1:-}"
@@ -17,7 +22,7 @@ if [[ -n "${VERSION}" ]]; then
fi
# Discover AVALANCHE_VERSION
. scripts/versions.sh
. "$SUBNET_EVM_PATH"/scripts/constants.sh
# The full SHA is required for versioning custom actions.
CURL_ARGS=(curl -s)
-26
View File
@@ -1,26 +0,0 @@
#!/usr/bin/env bash
# Ignore warnings about variables appearing unused since this file is not the consumer of the variables it defines.
# shellcheck disable=SC2034
# Don't export them as they're used in the context of other calls
if [[ -z ${AVALANCHE_VERSION:-} ]]; then
# Get module details from go.mod
MODULE_DETAILS="$(go list -m "github.com/ava-labs/avalanchego" 2>/dev/null)"
# Extract the version part
AVALANCHE_VERSION="$(echo "${MODULE_DETAILS}" | awk '{print $2}')"
# Check if the version matches the pattern where the last part is the module hash
# v*YYYYMMDDHHMMSS-abcdef123456
#
# If not, the value is assumed to represent a tag
if [[ "${AVALANCHE_VERSION}" =~ ^v.*[0-9]{14}-[0-9a-f]{12}$ ]]; then
# Extract module hash from version
MODULE_HASH="$(echo "${AVALANCHE_VERSION}" | grep -Eo '[0-9a-f]{12}$')"
# The first 8 chars of the hash is used as the tag of avalanchego images
AVALANCHE_VERSION="${MODULE_HASH::8}"
fi
fi