Skip to content

Ensure the avalanchego binary is always current with a version-checked install #2015

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 11 commits into from
Apr 15, 2025

Conversation

maru-ava
Copy link
Contributor

@maru-ava maru-ava commented Apr 5, 2025

Previously the morpheusvm run script relied on manually building avalanchego from source. To ensure the required version of avalanchego is always used, a new script wrapping a version-checked install of avalanchego at the required version is introduced and the run script is updated to use it.

TODO

@maru-ava maru-ava self-assigned this Apr 5, 2025
@maru-ava maru-ava requested a review from aaronbuchwald as a code owner April 5, 2025 23:42
@maru-ava maru-ava moved this from Backlog 🗄️ to In Review 👀 in Platform Engineering Group Apr 5, 2025
@maru-ava maru-ava requested a review from Elvis339 April 6, 2025 00:17
@aaronbuchwald
Copy link
Collaborator

Getting these warnings locally due to go run producing a message before the version:

   WARN unable to check rpcchainvm version for avalanchego      {"error": "failed to unmarshal output from command \"/Users/aaronbuchwald/go/src/github.com/ava-labs/hypersdk/scripts/run_avalanchego.sh\": invalid character 'g' looking for beginning of value, output: go: github.com/ava-labs/[email protected] requires go >= 1.23.6; switching to go1.23.8\n{\n  \"application\": \"avalanchego/1.13.0\",\n  \"database\": \"v1.4.5\",\n  \"rpcchainvm\": 39,\n  \"commit\": \"\",\n  \"go\": \"1.23.8\"\n}\n"}
   INFO started local node      {"nodeID": "NodeID-BUkMnXttASmjiW4EGS5itwcTuMLjFmEwW", "dataDir": "/Users/aaronbuchwald/.tmpnet/networks/20250408-152129.146253-morpheusvm-e2e-tests/NodeID-BUkMnXttASmjiW4EGS5itwcTuMLjFmEwW", "isEphemeral": false}

@maru-ava
Copy link
Contributor Author

maru-ava commented Apr 8, 2025

Getting these warnings locally due to go run producing a message before the version:

   WARN unable to check rpcchainvm version for avalanchego      {"error": "failed to unmarshal output from command \"/Users/aaronbuchwald/go/src/github.com/ava-labs/hypersdk/scripts/run_avalanchego.sh\": invalid character 'g' looking for beginning of value, output: go: github.com/ava-labs/[email protected] requires go >= 1.23.6; switching to go1.23.8\n{\n  \"application\": \"avalanchego/1.13.0\",\n  \"database\": \"v1.4.5\",\n  \"rpcchainvm\": 39,\n  \"commit\": \"\",\n  \"go\": \"1.23.8\"\n}\n"}
   INFO started local node      {"nodeID": "NodeID-BUkMnXttASmjiW4EGS5itwcTuMLjFmEwW", "dataDir": "/Users/aaronbuchwald/.tmpnet/networks/20250408-152129.146253-morpheusvm-e2e-tests/NodeID-BUkMnXttASmjiW4EGS5itwcTuMLjFmEwW", "isEphemeral": false}

Would you prefer the script doesn't produce that output, or that the rpc version ignore lines that aren't json?

@aaronbuchwald
Copy link
Collaborator

Getting these warnings locally due to go run producing a message before the version:

   WARN unable to check rpcchainvm version for avalanchego      {"error": "failed to unmarshal output from command \"/Users/aaronbuchwald/go/src/github.com/ava-labs/hypersdk/scripts/run_avalanchego.sh\": invalid character 'g' looking for beginning of value, output: go: github.com/ava-labs/[email protected] requires go >= 1.23.6; switching to go1.23.8\n{\n  \"application\": \"avalanchego/1.13.0\",\n  \"database\": \"v1.4.5\",\n  \"rpcchainvm\": 39,\n  \"commit\": \"\",\n  \"go\": \"1.23.8\"\n}\n"}
   INFO started local node      {"nodeID": "NodeID-BUkMnXttASmjiW4EGS5itwcTuMLjFmEwW", "dataDir": "/Users/aaronbuchwald/.tmpnet/networks/20250408-152129.146253-morpheusvm-e2e-tests/NodeID-BUkMnXttASmjiW4EGS5itwcTuMLjFmEwW", "isEphemeral": false}

Would you prefer the script doesn't produce that output, or that the rpc version ignore lines that aren't json?

Just noting it when I run. Ideally, a normal run does not produce a warn log imo

aaronbuchwald
aaronbuchwald previously approved these changes Apr 9, 2025
Elvis339
Elvis339 previously approved these changes Apr 9, 2025
@maru-ava maru-ava dismissed stale reviews from Elvis339 and aaronbuchwald via 5af8f69 April 9, 2025 15:59
@maru-ava
Copy link
Contributor Author

maru-ava commented Apr 9, 2025

Before this PR is merged, ava-labs/avalanchego#3869 needs to merge and then this PR updated with a commit has merged to master.

Previously the morpheusvm run script relied on manually building
avalanchego from source. To ensure the required version of avalanchego
is always used, a new script wrapping `go run` of avalanchego at the
required version is introduced and the run script updated to use
it.
@maru-ava maru-ava changed the title Ensure the avalanchego binary is always current by using go run Ensure the avalanchego binary is always current with a version-checked install Apr 14, 2025
@maru-ava maru-ava force-pushed the run-avalanchego branch 2 times, most recently from 627f4ea to e7302da Compare April 14, 2025 23:48
aaronbuchwald
aaronbuchwald previously approved these changes Apr 15, 2025
Copy link
Collaborator

@aaronbuchwald aaronbuchwald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM after merging #2022

@maru-ava
Copy link
Contributor Author

Updated to install to a central location (~/.cache/versioned-binaries) so that worktrees (or other repos) can reuse an installed binary.

@Elvis339 Elvis339 merged commit 8ad3eb4 into main Apr 15, 2025
11 checks passed
@Elvis339 Elvis339 deleted the run-avalanchego branch April 15, 2025 17:49
@github-project-automation github-project-automation bot moved this from In Review 👀 to Done ✅ in Platform Engineering Group Apr 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done ✅
Development

Successfully merging this pull request may close these issues.

3 participants