aptos-core
aptos-core copied to clipboard
Add ability to self update to aptos CLI
Description
This adds to the CLI the ability to update itself.
Test Plan
First, I changed the version of the CLI in Cargo.toml from 1.0.4 to 1.0.3 to make the CLI think it needs to update itself:
$ cargo build-p aptos
$ mv target/debug/aptos /tmp/aptos
$ /tmp/aptos --version
aptos 1.0.3
Next, run the self update subcommand:
$ /tmp/aptos -- update
Checking target-arch... MacOSX-x86_64
Checking current version... v1.0.3
Looking for tag: aptos-cli-v1.0.4
aptos release status:
* Current exe: "/Users/dport/a/core/target/debug/aptos"
* New exe release: "aptos-cli-1.0.4-MacOSX-x86_64.zip"
* New exe download url: "https://api.github.com/repos/aptos-labs/aptos-core/releases/assets/91367154"
The new release will be downloaded/extracted and the existing binary will be replaced.
Do you want to continue? [Y/n] y
Downloading...
Extracting archive... Done
Replacing binary file... Done
{
"Result": "Successfully updated from v1.0.3 to v1.0.4"
}
Confirm that the CLI has updated:
$ /tmp/aptos --version
aptos 1.0.4
I ran this test successfully on the following systems:
- MacOS (ARM)
- Arch (x86_64)
- Windows (NT) (x86_64)
- Ubuntu 22 (x86_64)
- Windows (WSL, Ubuntu 22)
Forge is running suite compat on testnet_2d8b1b57553d869190f61df1aaf7f31a8fc19a7b ==> d90015db4299148b92937f660b8ba1ddfd26861c
- Grafana dashboard (auto-refresh)
- Humio Logs
- Pyroscope Profiling
- Test runner output
- Test run is land-blocking
Forge is running suite land_blocking on d90015db4299148b92937f660b8ba1ddfd26861c
- Grafana dashboard (auto-refresh)
- Humio Logs
- Pyroscope Profiling
- Test runner output
- Test run is land-blocking
:white_check_mark: Forge suite compat success on testnet_2d8b1b57553d869190f61df1aaf7f31a8fc19a7b ==> d90015db4299148b92937f660b8ba1ddfd26861c
Compatibility test results for testnet_2d8b1b57553d869190f61df1aaf7f31a8fc19a7b ==> d90015db4299148b92937f660b8ba1ddfd26861c (PR)
1. Check liveness of validators at old version: testnet_2d8b1b57553d869190f61df1aaf7f31a8fc19a7b
compatibility::simple-validator-upgrade::liveness-check : 7466 TPS, 5163 ms latency, 8100 ms p99 latency,no expired txns
2. Upgrading first Validator to new version: d90015db4299148b92937f660b8ba1ddfd26861c
compatibility::simple-validator-upgrade::single-validator-upgrade : 4529 TPS, 9056 ms latency, 12100 ms p99 latency,no expired txns
3. Upgrading rest of first batch to new version: d90015db4299148b92937f660b8ba1ddfd26861c
compatibility::simple-validator-upgrade::half-validator-upgrade : 4454 TPS, 9539 ms latency, 12200 ms p99 latency,no expired txns
4. upgrading second batch to new version: d90015db4299148b92937f660b8ba1ddfd26861c
compatibility::simple-validator-upgrade::rest-validator-upgrade : 6180 TPS, 6397 ms latency, 9800 ms p99 latency,no expired txns
5. check swarm health
Compatibility test for testnet_2d8b1b57553d869190f61df1aaf7f31a8fc19a7b ==> d90015db4299148b92937f660b8ba1ddfd26861c passed
Test Ok
- Grafana dashboard
- Humio Logs
- Pyroscope Profiling
- Test runner output
- Test run is land-blocking
:white_check_mark: Forge suite land_blocking success on d90015db4299148b92937f660b8ba1ddfd26861c
performance benchmark with full nodes : 5911 TPS, 6709 ms latency, 10800 ms p99 latency,no expired txns
Test Ok
- Grafana dashboard
- Humio Logs
- Pyroscope Profiling
- Test runner output
- Test run is land-blocking
Just tested on WSL (Ubuntu 22) too, it works correctly.
well ... autolands aren't great....
Yeah............. I'll fix up your comments in another PR.