From b96b99fce7c19f92386385239435af3c226558c3 Mon Sep 17 00:00:00 2001 From: Niccolo Raspa Date: Wed, 12 Jul 2023 14:43:17 +0200 Subject: [PATCH 01/12] Add sudo option on Linux --- .github/workflows/test-client.yaml | 9 ++++----- installer.py | 6 +++++- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test-client.yaml b/.github/workflows/test-client.yaml index 0223fdb..983eb99 100644 --- a/.github/workflows/test-client.yaml +++ b/.github/workflows/test-client.yaml @@ -15,14 +15,11 @@ jobs: name: test-installer-client runs-on: ${{ matrix.os }} - env: - TERM: xterm - strategy: matrix: - # os: [ubuntu-latest, macos-latest] + os: [ubuntu-latest, macos-latest] # Can't execute on runner due to permission issues - os: [macos-latest] + # os: [macos-latest] network: [osmosis-1, osmo-test-5] fail-fast: false @@ -37,6 +34,8 @@ jobs: python-version: '3.10' - name: Run Installer + env: + TERM: xterm run: | python installer.py \ --install client \ diff --git a/installer.py b/installer.py index 8041617..983ac98 100644 --- a/installer.py +++ b/installer.py @@ -655,7 +655,11 @@ def download_binary(network): subprocess.run(["wget", binary_url,"-q", "-O", "/tmp/osmosisd"], check=True) os.chmod("/tmp/osmosisd", 0o755) - subprocess.run(["mv", "/tmp/osmosisd", binary_path], check=True) + + if platform.system() == "Linux": + subprocess.run(["sudo", "mv", "/tmp/osmosisd", binary_path], check=True) + else: + subprocess.run(["mv", "/tmp/osmosisd", binary_path], check=True) # Test binary subprocess.run(["osmosisd", "version"], check=True) From 9e0e143071d4883094fed6b72b4b454ce1e5e54d Mon Sep 17 00:00:00 2001 From: Niccolo Raspa Date: Wed, 12 Jul 2023 14:46:21 +0200 Subject: [PATCH 02/12] add more options to debug --- installer.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/installer.py b/installer.py index 983ac98..122b84a 100644 --- a/installer.py +++ b/installer.py @@ -658,10 +658,12 @@ def download_binary(network): if platform.system() == "Linux": subprocess.run(["sudo", "mv", "/tmp/osmosisd", binary_path], check=True) + subprocess.run(["sudo", "chmod", "+x", binary_path], check=True) else: subprocess.run(["mv", "/tmp/osmosisd", binary_path], check=True) # Test binary + subprocess.run(["which", "osmosisd"], check=True) subprocess.run(["osmosisd", "version"], check=True) print("Binary downloaded successfully.") From c0eea27b58f9eb8d1d332936d6f55a13307c27b4 Mon Sep 17 00:00:00 2001 From: Niccolo Raspa Date: Wed, 12 Jul 2023 14:48:16 +0200 Subject: [PATCH 03/12] test self-hosted --- .github/workflows/test-client.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-client.yaml b/.github/workflows/test-client.yaml index 983eb99..3781a87 100644 --- a/.github/workflows/test-client.yaml +++ b/.github/workflows/test-client.yaml @@ -17,7 +17,7 @@ jobs: strategy: matrix: - os: [ubuntu-latest, macos-latest] + os: [self-hosted, macos-latest] # Can't execute on runner due to permission issues # os: [macos-latest] network: [osmosis-1, osmo-test-5] From 98de15868c8842365de1fe4069d7c97e97038747 Mon Sep 17 00:00:00 2001 From: Niccolo Raspa Date: Wed, 12 Jul 2023 14:49:27 +0200 Subject: [PATCH 04/12] test sudo in github action --- .github/workflows/test-client.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-client.yaml b/.github/workflows/test-client.yaml index 3781a87..9cfa53b 100644 --- a/.github/workflows/test-client.yaml +++ b/.github/workflows/test-client.yaml @@ -37,7 +37,7 @@ jobs: env: TERM: xterm run: | - python installer.py \ + sudo python installer.py \ --install client \ --network ${{ matrix.network }} \ --home ${{ runner.temp }}/.osmosisd \ From c56e5c4df52241f2e579efb9920babdb103d5d9a Mon Sep 17 00:00:00 2001 From: Niccolo Raspa Date: Wed, 12 Jul 2023 14:50:44 +0200 Subject: [PATCH 05/12] Revert to ubuntu-latest --- .github/workflows/test-client.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-client.yaml b/.github/workflows/test-client.yaml index 9cfa53b..5392a71 100644 --- a/.github/workflows/test-client.yaml +++ b/.github/workflows/test-client.yaml @@ -17,7 +17,7 @@ jobs: strategy: matrix: - os: [self-hosted, macos-latest] + os: [ubuntu-latest, macos-latest] # Can't execute on runner due to permission issues # os: [macos-latest] network: [osmosis-1, osmo-test-5] From 0b4627748c7fcb2382f86df0227a081217bd50ac Mon Sep 17 00:00:00 2001 From: Niccolo Raspa Date: Wed, 12 Jul 2023 14:51:54 +0200 Subject: [PATCH 06/12] Change binary --- installer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/installer.py b/installer.py index 122b84a..ca232dc 100644 --- a/installer.py +++ b/installer.py @@ -160,11 +160,11 @@ def __init__(self, chain_id, version, genesis_url, binary_url, peers, rpc_node, genesis_url = "https://osmosis.fra1.digitaloceanspaces.com/osmosis-1/genesis.json", binary_url = { # "linux": { - # "amd64": "https://github.com/osmosis-labs/osmosis/releases/download/v15.2.0/osmosisd-15.2.0-linux-amd64", + # "amd64": "", # "arm64": "https://github.com/osmosis-labs/osmosis/releases/download/v15.2.0/osmosisd-15.2.0-linux-arm64", # } "linux": { - "amd64": "https://github.com/niccoloraspa/osmosis/releases/download/v16.0.0/osmosisd-16.0.0-linux-amd64", + "amd64": "https://github.com/osmosis-labs/osmosis/releases/download/v15.2.0/osmosisd-15.2.0-linux-amd64", "arm64": "https://github.com/niccoloraspa/osmosis/releases/download/v16.0.0/osmosisd-16.0.0-linux-arm64" }, "darwin": { From 95b88905f147a4aabd14872f81fc8cc038c15df4 Mon Sep 17 00:00:00 2001 From: Niccolo Raspa Date: Wed, 12 Jul 2023 14:55:36 +0200 Subject: [PATCH 07/12] add chown --- .github/workflows/test-client.yaml | 2 +- installer.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-client.yaml b/.github/workflows/test-client.yaml index 5392a71..983eb99 100644 --- a/.github/workflows/test-client.yaml +++ b/.github/workflows/test-client.yaml @@ -37,7 +37,7 @@ jobs: env: TERM: xterm run: | - sudo python installer.py \ + python installer.py \ --install client \ --network ${{ matrix.network }} \ --home ${{ runner.temp }}/.osmosisd \ diff --git a/installer.py b/installer.py index ca232dc..4c73f2b 100644 --- a/installer.py +++ b/installer.py @@ -658,6 +658,7 @@ def download_binary(network): if platform.system() == "Linux": subprocess.run(["sudo", "mv", "/tmp/osmosisd", binary_path], check=True) + subprocess.run(["sudo", "chown", f"{os.getlogin()}:{os.getlogin()}", binary_path], check=True) subprocess.run(["sudo", "chmod", "+x", binary_path], check=True) else: subprocess.run(["mv", "/tmp/osmosisd", binary_path], check=True) From 67caf5957165a6cfc1fc7eae4fde7454a6cf4112 Mon Sep 17 00:00:00 2001 From: Niccolo Raspa Date: Wed, 12 Jul 2023 14:57:20 +0200 Subject: [PATCH 08/12] add chown with os.environ --- installer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/installer.py b/installer.py index 4c73f2b..af590a8 100644 --- a/installer.py +++ b/installer.py @@ -658,7 +658,7 @@ def download_binary(network): if platform.system() == "Linux": subprocess.run(["sudo", "mv", "/tmp/osmosisd", binary_path], check=True) - subprocess.run(["sudo", "chown", f"{os.getlogin()}:{os.getlogin()}", binary_path], check=True) + subprocess.run(["sudo", "chown", f"{os.environ['USER']}:{os.environ['USER']}", binary_path], check=True) subprocess.run(["sudo", "chmod", "+x", binary_path], check=True) else: subprocess.run(["mv", "/tmp/osmosisd", binary_path], check=True) From 387b5b0cd7fea0e579c7b863d2ece71d56f6f4d8 Mon Sep 17 00:00:00 2001 From: Niccolo Raspa Date: Wed, 12 Jul 2023 14:58:07 +0200 Subject: [PATCH 09/12] specify home --- installer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/installer.py b/installer.py index af590a8..582a708 100644 --- a/installer.py +++ b/installer.py @@ -226,7 +226,7 @@ def client_complete_message(): ✨ Congratulations! You have successfully completed setting up an Osmosis client! ✨ """ + bcolors.ENDC) - print("🧪 Try running: " + bcolors.OKGREEN + "osmosisd status" + bcolors.ENDC) + print("🧪 Try running: " + bcolors.OKGREEN + f"osmosisd status --home {args.home}" + bcolors.ENDC) print() # Options From 96cfd36e40f8e55dca7e227e2f6985327bb17057 Mon Sep 17 00:00:00 2001 From: Niccolo Raspa Date: Wed, 12 Jul 2023 14:59:39 +0200 Subject: [PATCH 10/12] Use official release binaries --- installer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/installer.py b/installer.py index 582a708..07bda41 100644 --- a/installer.py +++ b/installer.py @@ -164,8 +164,8 @@ def __init__(self, chain_id, version, genesis_url, binary_url, peers, rpc_node, # "arm64": "https://github.com/osmosis-labs/osmosis/releases/download/v15.2.0/osmosisd-15.2.0-linux-arm64", # } "linux": { - "amd64": "https://github.com/osmosis-labs/osmosis/releases/download/v15.2.0/osmosisd-15.2.0-linux-amd64", - "arm64": "https://github.com/niccoloraspa/osmosis/releases/download/v16.0.0/osmosisd-16.0.0-linux-arm64" + "amd64": "https://github.com/osmosis-labs/osmosis/releases/download/v16.0.0/osmosisd-16.0.0-linux-amd64", + "arm64": "https://github.com/osmosis-labs/osmosis/releases/download/v16.0.0/osmosisd-16.0.0-linux-arm64" }, "darwin": { "amd64": "https://github.com/niccoloraspa/osmosis/releases/download/v16.0.0/osmosisd-16.0.0-darwin-amd64", From 4589f2c076b897f57a4b00cbd6ad377eadfa74c8 Mon Sep 17 00:00:00 2001 From: Niccolo Raspa Date: Wed, 12 Jul 2023 15:01:18 +0200 Subject: [PATCH 11/12] Use official release binaries for testnet --- installer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/installer.py b/installer.py index 07bda41..bedda5c 100644 --- a/installer.py +++ b/installer.py @@ -134,8 +134,8 @@ def __init__(self, chain_id, version, genesis_url, binary_url, peers, rpc_node, genesis_url = "https://osmosis.fra1.digitaloceanspaces.com/osmo-test-5/genesis.json", binary_url = { "linux": { - "amd64": "https://github.com/niccoloraspa/osmosis/releases/download/v16.0.0-rc2-testnet/osmosisd-16.0.0-rc2-testnet-linux-amd64", - "arm64": "https://github.com/niccoloraspa/osmosis/releases/download/v16.0.0-rc2-testnet/osmosisd-16.0.0-rc2-testnet-linux-arm64" + "amd64": "https://github.com/osmosis-labs/osmosis/releases/download/v16.0.0-rc2/osmosisd-16.0.0-rc2-testnet-linux-amd64", + "arm64": "https://github.com/osmosis-labs/osmosis/releases/download/v16.0.0-rc2/osmosisd-16.0.0-rc2-testnet-linux-arm64" }, "darwin": { "amd64": "https://github.com/niccoloraspa/osmosis/releases/download/v16.0.0-rc2-testnet/osmosisd-16.0.0-rc2-testnet-darwin-amd64", From 5b2d6c129222f7c406146c3f1e1fe0a699de2b06 Mon Sep 17 00:00:00 2001 From: Niccolo Raspa Date: Wed, 12 Jul 2023 15:01:57 +0200 Subject: [PATCH 12/12] remove comment --- .github/workflows/test-client.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/test-client.yaml b/.github/workflows/test-client.yaml index 983eb99..6f60075 100644 --- a/.github/workflows/test-client.yaml +++ b/.github/workflows/test-client.yaml @@ -18,8 +18,6 @@ jobs: strategy: matrix: os: [ubuntu-latest, macos-latest] - # Can't execute on runner due to permission issues - # os: [macos-latest] network: [osmosis-1, osmo-test-5] fail-fast: false