-
Notifications
You must be signed in to change notification settings - Fork 741
Cleanup anr scripts #1714
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
Merged
Merged
Cleanup anr scripts #1714
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
791184f
refactor anr scripts
ceyonur 76945e8
downgrade anr version
ceyonur 468b695
Revert "downgrade anr version"
ceyonur fd42b39
Merge branch 'dev' into e2e-anr-scripts
ceyonur 2b85be3
downgrade to 1.6.0
ceyonur 3ce7762
Merge branch 'e2e-anr-scripts' of github.com:ava-labs/avalanchego int…
ceyonur a36a6f5
downgrade to 1.5.0
ceyonur ad6a486
downgrade to 1.4.0
ceyonur 809f8b2
downgrade to 1.3.9
ceyonur ed2a997
Merge branch 'dev' into e2e-anr-scripts
StephenButtolph 13d28b7
Merge branch 'dev' into e2e-anr-scripts
StephenButtolph File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
set -o nounset | ||
set -o pipefail | ||
|
||
# Avalanche root directory | ||
AVALANCHE_PATH=$( | ||
cd "$(dirname "${BASH_SOURCE[0]}")" | ||
cd .. && pwd | ||
) | ||
|
||
# Load the constants | ||
source "$AVALANCHE_PATH"/scripts/constants.sh | ||
|
||
################################# | ||
# download avalanche-network-runner | ||
# https://github.com/ava-labs/avalanche-network-runner | ||
GOARCH=$(go env GOARCH) | ||
GOOS=$(go env GOOS) | ||
NETWORK_RUNNER_VERSION=1.3.9 | ||
anr_workdir=${ANR_WORKDIR:-"/tmp"} | ||
DOWNLOAD_PATH=${anr_workdir}/avalanche-network-runner-v${NETWORK_RUNNER_VERSION}.tar.gz | ||
DOWNLOAD_URL="https://github.com/ava-labs/avalanche-network-runner/releases/download/v${NETWORK_RUNNER_VERSION}/avalanche-network-runner_${NETWORK_RUNNER_VERSION}_${GOOS}_${GOARCH}.tar.gz" | ||
echo "Installing avalanche-network-runner ${NETWORK_RUNNER_VERSION} to ${anr_workdir}/avalanche-network-runner" | ||
|
||
# download only if not already downloaded | ||
if [ ! -f "$DOWNLOAD_PATH" ]; then | ||
echo "downloading avalanche-network-runner ${NETWORK_RUNNER_VERSION} at ${DOWNLOAD_URL} to ${DOWNLOAD_PATH}" | ||
curl --fail -L ${DOWNLOAD_URL} -o ${DOWNLOAD_PATH} | ||
else | ||
echo "avalanche-network-runner ${NETWORK_RUNNER_VERSION} already downloaded at ${DOWNLOAD_PATH}" | ||
fi | ||
|
||
rm -f ${anr_workdir}/avalanche-network-runner | ||
|
||
echo "extracting downloaded avalanche-network-runner" | ||
tar xzvf ${DOWNLOAD_PATH} -C ${anr_workdir} | ||
${anr_workdir}/avalanche-network-runner -h |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,41 +14,14 @@ fi | |
AVALANCHEGO_PATH="${1-}" | ||
if [[ -z "${AVALANCHEGO_PATH}" ]]; then | ||
echo "Missing AVALANCHEGO_PATH argument!" | ||
echo "Usage: ${0} [AVALANCHEGO_PATH]" >> /dev/stderr | ||
echo "Usage: ${0} [AVALANCHEGO_PATH]" >>/dev/stderr | ||
exit 255 | ||
fi | ||
|
||
# Set the CGO flags to use the portable version of BLST | ||
# | ||
# We use "export" here instead of just setting a bash variable because we need | ||
# to pass this flag to all child processes spawned by the shell. | ||
export CGO_CFLAGS="-O -D__BLST_PORTABLE__" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. +1 |
||
# While CGO_ENABLED doesn't need to be explicitly set, it produces a much more | ||
# clear error due to the default value change in go1.20. | ||
export CGO_ENABLED=1 | ||
|
||
################################# | ||
# download avalanche-network-runner | ||
# https://github.com/ava-labs/avalanche-network-runner | ||
# TODO: migrate to upstream avalanche-network-runner | ||
GOARCH=$(go env GOARCH) | ||
GOOS=$(go env GOOS) | ||
NETWORK_RUNNER_VERSION=1.3.5-rc.0 | ||
DOWNLOAD_PATH=/tmp/avalanche-network-runner.tar.gz | ||
DOWNLOAD_URL="https://github.com/ava-labs/avalanche-network-runner/releases/download/v${NETWORK_RUNNER_VERSION}/avalanche-network-runner_${NETWORK_RUNNER_VERSION}_${GOOS}_${GOARCH}.tar.gz" | ||
|
||
rm -f ${DOWNLOAD_PATH} | ||
rm -f /tmp/avalanche-network-runner | ||
|
||
echo "downloading avalanche-network-runner ${NETWORK_RUNNER_VERSION} at ${DOWNLOAD_URL} to ${DOWNLOAD_PATH}" | ||
curl --fail -L ${DOWNLOAD_URL} -o ${DOWNLOAD_PATH} | ||
|
||
echo "extracting downloaded avalanche-network-runner" | ||
tar xzvf ${DOWNLOAD_PATH} -C /tmp | ||
/tmp/avalanche-network-runner -h | ||
|
||
GOPATH="$(go env GOPATH)" | ||
PATH="${GOPATH}/bin:${PATH}" | ||
echo "installing avalanche-network-runner" | ||
ANR_WORKDIR="/tmp" | ||
./scripts/install_anr.sh | ||
|
||
################################# | ||
echo "building e2e.test" | ||
|
@@ -60,23 +33,23 @@ ACK_GINKGO_RC=true ginkgo build ./tests/e2e | |
################################# | ||
# run "avalanche-network-runner" server | ||
echo "launch avalanche-network-runner in the background" | ||
/tmp/avalanche-network-runner \ | ||
server \ | ||
--log-level debug \ | ||
--port=":12342" \ | ||
--disable-grpc-gateway & | ||
$ANR_WORKDIR/avalanche-network-runner \ | ||
server \ | ||
--log-level debug \ | ||
--port=":12342" \ | ||
--disable-grpc-gateway & | ||
PID=${!} | ||
|
||
################################# | ||
echo "running e2e tests against the local cluster with ${AVALANCHEGO_PATH}" | ||
./tests/e2e/e2e.test \ | ||
--ginkgo.v \ | ||
--log-level debug \ | ||
--network-runner-grpc-endpoint="0.0.0.0:12342" \ | ||
--network-runner-avalanchego-path=${AVALANCHEGO_PATH} \ | ||
--network-runner-avalanchego-log-level="WARN" \ | ||
--test-keys-file=tests/test.insecure.secp256k1.keys \ | ||
&& EXIT_CODE=$? || EXIT_CODE=$? | ||
--ginkgo.v \ | ||
--log-level debug \ | ||
--network-runner-grpc-endpoint="0.0.0.0:12342" \ | ||
--network-runner-avalanchego-path=${AVALANCHEGO_PATH} \ | ||
--network-runner-avalanchego-log-level="WARN" \ | ||
--test-keys-file=tests/test.insecure.secp256k1.keys && | ||
EXIT_CODE=$? || EXIT_CODE=$? | ||
|
||
kill ${PID} | ||
|
||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we removing this? Don't we need it to ensure this works locally on MacOS?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
install_anr.sh
includes:source "$AVALANCHE_PATH"/scripts/constants.sh
which already includes: