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

Offer to install helm into venv #610

Merged
merged 10 commits into from
Sep 30, 2024

Conversation

mplsgrant
Copy link
Collaborator

This offers to install helm into the user's venv directory. Fixes #608

I overloaded the is_helm_installed function a bit, but I figured that even if we had to do this for every dependency it would remain manageable.

@@ -98,3 +98,8 @@
f"helm upgrade --install grafana-dashboards {CHARTS_DIR}/grafana-dashboards --namespace warnet-logging",
f"helm upgrade --install --namespace warnet-logging loki-grafana grafana/grafana --values {MANIFESTS_DIR}/grafana_values.yaml",
]

# Helm binary
HELM_LATEST_URL = "https://get.helm.sh/helm-latest-version"
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should pin a version and also commit to the expected checksums:
https://github.com/helm/helm/releases

Copy link
Collaborator Author

@mplsgrant mplsgrant Sep 21, 2024

Choose a reason for hiding this comment

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

I decided to bless v3.16.1 and always pull it: 07104ee

@pinheadmz
Copy link
Contributor

⭐️ Helm is satisfied: /Users/matthewzipkin/Desktop/work/warnet/.venv/bin/helm

This is fucking dope dude, great work

@willcl-ark
Copy link
Contributor

Yeah this is neat!

Perhaps it would help us to define the install methods we will offer/support (and stick to it!). Something like:

  1. Manual: we list the packages you need and link to their install docs. Install them how you wish.
  2. Semi-automatic: we offer to fetch bins directly into the local .venv (like here!) for all possible requirements.
  3. Fully automatic: a docker image, something like that proposed in Add docker app image #615

Each of the methods should cover all required binaries. So for example I'd propose to follow this PR here with a similar kubectl and possibley even k9s install into venv.

If a user can't/won't install using one of these three ways, then they can't use the tool.

This would hopefully stop this fiasco re-ocurring in the future (or at least, we wouldn't have to worry about it).

@bdp-DrahtBot bdp-DrahtBot mentioned this pull request Sep 19, 2024
@bdp-DrahtBot
Copy link
Collaborator

bdp-DrahtBot commented Sep 19, 2024

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

No conflicts as of last run.

@bdp-DrahtBot bdp-DrahtBot mentioned this pull request Sep 19, 2024
@willcl-ark
Copy link
Contributor

Reviewers, this pull request conflicts with the following ones:

* [#614](https://github.com/bitcoin-dev-project/warnet/pull/614) (swap out kubectl by mplsgrant)

@mplsgrant do you have a preference between which of these goes first? It looks like this one is perhaps more ready?

@pinheadmz
Copy link
Contributor

Install looks good but i got this error trying to deploy a network with logging. Not sure if this is an issue with the pinned version of Helm or something wrong with the loki chart in the repo?

warnet error:

Exception: Error: UPGRADE FAILED: "loki" has no deployed releases

So i tried to install using helm directly instead of through warnet...

$ helm upgrade --install --namespace warnet-logging --create-namespace --values ./resources/manifests/loki_values.yaml loki grafana/loki --version 5.47.2 --dry-run --debug
history.go:56: 2024-09-23 09:43:19.006541243 -0400 EDT m=+0.091649742 [debug] getting history for release loki
upgrade.go:164: 2024-09-23 09:43:19.874007994 -0400 EDT m=+0.959116488 [debug] preparing upgrade for loki
Error: UPGRADE FAILED: "loki" has no deployed releases
helm.go:86: 2024-09-23 09:43:20.456117492 -0400 EDT m=+1.541225945 [debug] "loki" has no deployed releases
UPGRADE FAILED
main.newUpgradeCmd.func2
        helm.sh/helm/v3/cmd/helm/upgrade.go:243
github.com/spf13/cobra.(*Command).execute
        github.com/spf13/[email protected]/command.go:985
github.com/spf13/cobra.(*Command).ExecuteC
        github.com/spf13/[email protected]/command.go:1117
github.com/spf13/cobra.(*Command).Execute
        github.com/spf13/[email protected]/command.go:1041
main.main
        helm.sh/helm/v3/cmd/helm/helm.go:85
runtime.main
        runtime/proc.go:271
runtime.goexit
        runtime/asm_amd64.s:1695

@mplsgrant
Copy link
Collaborator Author

Install looks good but i got this error trying to deploy a network with logging. Not sure if this is an issue with the pinned version of Helm or something wrong with the loki chart in the repo?

@pinheadmz I noticed an issue with the architecture mapping. I'm not sure if that had something to do with the error you encountered, but I fixed that and it might be worth trying again.

@mplsgrant
Copy link
Collaborator Author

do you have a preference between which of these goes first? It looks like this one is perhaps more ready?

@willcl-ark I don't have a preference about which goes first. I'm fine to rebase either one.

@pinheadmz
Copy link
Contributor

ACK ec33ace
seems to work fine now!

We no longer need the logic for the latest version of helm.
Also we don't need the NeedsHelm option in ToolStatus.
@mplsgrant
Copy link
Collaborator Author

Just wanted to remove a bit of dead code before merging.

@m3dwards
Copy link
Collaborator

On Arm Mac I got: No Helm binary candidate for arch: None

Also the question on setup is truncated:

[?] Would you like to use Warnet's downloader to install Helm into your virtual environme...:

@pinheadmz
Copy link
Contributor

Can confirm arm macos issue, but the message printed fine for me

Screenshot 2024-09-27 at 10 08 10 AM

@m3dwards
Copy link
Collaborator

m3dwards commented Sep 27, 2024

The truncation must be because I run narrow terminals. Perhaps the question could be a bit shorter? Assuming click inquirer doesn't have a wrap text option.

@mplsgrant
Copy link
Collaborator Author

On Arm Mac I got: No Helm binary candidate for arch: None

@m3dwards What happens when you run this in a python terminal?

import os
os.uname().machine

@pinheadmz
Copy link
Contributor

>>> import os
>>> os.uname()
posix.uname_result(sysname='Darwin', nodename=' ', release='23.5.0', version='Darwin Kernel Version 23.5.0: Wed May  1 20:16:51 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T8103', machine='arm64')
>>> os.uname().machine
'arm64'

@m3dwards
Copy link
Collaborator

arm64

@m3dwards
Copy link
Collaborator

Works! Great PR!

@m3dwards m3dwards merged commit d343793 into bitcoin-dev-project:main Sep 30, 2024
11 checks passed
@pinheadmz
Copy link
Contributor

post merge ACK,
tested on macos arm64 and debian x86_64

@mplsgrant mplsgrant deleted the 2024-09-install-helm branch September 30, 2024 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

setup: optionally install helm for user
5 participants