Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: prysm minimal go build #217

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
15 changes: 9 additions & 6 deletions prysm/build_beacon_minimal.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ OS_NAME=$(uname -s | tr '[:upper:]' '[:lower:]')
if [ "${OS_NAME}" == "darwin" ]; then
/opt/homebrew/bin/brew install go
/opt/homebrew/bin/go install github.com/bazelbuild/bazelisk@latest
else
else
sudo apt-get update
sudo apt-get upgrade -y
sudo apt install -y ca-certificates python3
Expand All @@ -19,7 +19,7 @@ case ${build_method} in
"go")
echo "Building with Go..."
go mod tidy

# Define ldflags for version information
ldflags=$(cat <<-END
-X 'github.com/prysmaticlabs/prysm/v5/runtime/version.gitCommit=$(git rev-parse HEAD)' \
Expand All @@ -28,11 +28,11 @@ case ${build_method} in
-X 'github.com/prysmaticlabs/prysm/v5/runtime/version.buildDateUnix=$(date +%s)'
END
)

# Build with blst_enabled and blst_portable to support both amd64 and arm64. The BLST library (used for
# cryptographic operations) needs specific CPU features.
CGO_ENABLED=1 go build \
-tags=blst_enabled,blst_portable \
-tags="minimal,blst_enabled,blst_portable" \
-ldflags "${ldflags}" \
-o _beacon-chain ./cmd/beacon-chain
;;
Expand All @@ -47,8 +47,11 @@ END
;;
esac

cp ${SCRIPT_DIR}/entrypoint.sh entrypoint.sh
cp ${SCRIPT_DIR}/entrypoint_minimal.sh entrypoint.sh

docker build -t "${target_repository}:${target_tag}" -t "${target_repository}:${target_tag}-${source_git_commit_hash}" --build-arg ENTRY=/app/cmd/beacon-chain/beacon-chain -f "../${target_dockerfile}" .
docker build -t "${target_repository}:${target_tag}" \
-t "${target_repository}:${target_tag}-${source_git_commit_hash}" \
--build-arg ENTRY="/app/cmd/beacon-chain/beacon-chain" \
-f "../${target_dockerfile}" .
docker push "${target_repository}:${target_tag}"
docker push "${target_repository}:${target_tag}-${source_git_commit_hash}"
9 changes: 6 additions & 3 deletions prysm/build_validator_minimal.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ END
# Build with blst_enabled and blst_portable to support both amd64 and arm64. The BLST library (used for
# cryptographic operations) needs specific CPU features.
CGO_ENABLED=1 go build \
-tags=blst_enabled,blst_portable \
-tags="minimal,blst_enabled,blst_portable" \
-ldflags "${ldflags}" \
-o _validator ./cmd/validator
;;
Expand All @@ -47,8 +47,11 @@ END
;;
esac

cp ${SCRIPT_DIR}/entrypoint.sh entrypoint.sh
cp ${SCRIPT_DIR}/entrypoint_minimal.sh entrypoint.sh

docker build -t "${target_repository}:${target_tag}" -t "${target_repository}:${target_tag}-${source_git_commit_hash}" --build-arg ENTRY=/app/cmd/validator/validator -f "../${target_dockerfile}" .
docker build -t "${target_repository}:${target_tag}" \
-t "${target_repository}:${target_tag}-${source_git_commit_hash}" \
--build-arg ENTRY="/app/cmd/validator/validator" \
-f "../${target_dockerfile}" .
docker push "${target_repository}:${target_tag}"
docker push "${target_repository}:${target_tag}-${source_git_commit_hash}"
2 changes: 1 addition & 1 deletion prysm/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/sh
exec "${ENTRY}" "$@"
exec "${ENTRY}" "$@"
2 changes: 2 additions & 0 deletions prysm/entrypoint_minimal.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
exec "${ENTRY}" --minimal-config "$@"
Loading