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

Install and setup spin cli #6810

Merged
merged 5 commits into from
May 13, 2024
Merged

Install and setup spin cli #6810

merged 5 commits into from
May 13, 2024

Conversation

jandubois
Copy link
Member

Puts spin on the PATH and installs default templates and plugins if there are none installed at all yet.

@jandubois jandubois force-pushed the spin branch 18 times, most recently from 494a720 to 7be2d84 Compare May 8, 2024 20:02
@jandubois jandubois marked this pull request as ready for review May 8, 2024 20:59
@jandubois jandubois requested a review from mook-as May 8, 2024 20:59
// maybe use 'static-linux' if we run into GLIBC compat issues with the default Linux build
const platform = context.goPlatform === 'darwin' ? 'macos' : context.goPlatform;
const baseURL = `https://github.com/${ this.githubOwner }/${ this.githubRepo }/releases/download/v${ context.versions.spinCLI }`;
const archiveName = `spin-v${ context.versions.spinCLI }-${ platform }-${ arch }${ context.goPlatform.startsWith('win') ? '.zip' : '.tar.gz' }`;
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we have an issue about the vcruntime dependency on Windows? (Don't need to solve it in this PR, but we should track it.)

Copy link
Member Author

Choose a reason for hiding this comment

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

There is fermyon/spin#1504 to track this upstream. I don't know what we can do about it right now. I'm hoping upstream will switch to a static build. If they don't, then I think we should add a diagnostic checking for it.

Copy link
Member Author

Choose a reason for hiding this comment

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

I've since created #6862 to track this here as well.

pkg/rancher-desktop/backend/lima.ts Outdated Show resolved Hide resolved
resources/setup-spin Show resolved Hide resolved
resources/setup-spin Show resolved Hide resolved
resources/setup-spin Outdated Show resolved Hide resolved
resources/setup-spin Show resolved Hide resolved
@jandubois
Copy link
Member Author

I just did another force-push because I wanted to rebase on latest main to get rid of go.work.sum, and more important I wanted to bump spin to 2.5.0 because the 2.4.3 release for macos-x86_64 actually contains an aarch64 binary: fermyon/spin#2502

Copy link
Contributor

@mook-as mook-as left a comment

Choose a reason for hiding this comment

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

We're always installing from main; do we not want to pin it (to a hash or tag or something) instead?

I still don't like the shell script, but we can change that later I guess. I just worry that untangling it in a later release will be annoying.

I am not very confident in my review; if the things I bring up are not a thing, let me know.

pkg/rancher-desktop/backend/lima.ts Outdated Show resolved Hide resolved
pkg/rancher-desktop/backend/wsl.ts Outdated Show resolved Hide resolved
Copy link
Member Author

@jandubois jandubois left a comment

Choose a reason for hiding this comment

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

We're always installing from main; do we not want to pin it (to a hash or tag or something) instead?

I know, it bothers me too, but that is what Fermyon is doing in their own installer, even when you specify a specific version of the spin app to be installed (see https://developer.fermyon.com/downloads/install.sh):

./spin templates install --git "https://github.com/fermyon/spin" --upgrade
./spin templates install --git "https://github.com/fermyon/spin-python-sdk" --upgrade
./spin templates install --git "https://github.com/fermyon/spin-js-sdk" --upgrade

We can revisit this in the context of #6715.

I still don't like the shell script, but we can change that later I guess. I just worry that untangling it in a later release will be annoying.

Not sure what that means; what needs to be untangled?

pkg/rancher-desktop/backend/lima.ts Outdated Show resolved Hide resolved
// maybe use 'static-linux' if we run into GLIBC compat issues with the default Linux build
const platform = context.goPlatform === 'darwin' ? 'macos' : context.goPlatform;
const baseURL = `https://github.com/${ this.githubOwner }/${ this.githubRepo }/releases/download/v${ context.versions.spinCLI }`;
const archiveName = `spin-v${ context.versions.spinCLI }-${ platform }-${ arch }${ context.goPlatform.startsWith('win') ? '.zip' : '.tar.gz' }`;
Copy link
Member Author

Choose a reason for hiding this comment

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

I've since created #6862 to track this here as well.

@jandubois jandubois requested a review from mook-as May 11, 2024 00:09
mook-as
mook-as previously approved these changes May 11, 2024
@jandubois
Copy link
Member Author

@mook-as I've only amended the last commit since your previous approval, so you can just re-review 328639d to see the updated bits.

jandubois added 5 commits May 11, 2024 00:08
Signed-off-by: Jan Dubois <[email protected]>
We only install templates and plugins when the there are non installed
before. If the user has already configured spin, then we don't want to
modify their setup, as we would overwrite them on each app start.

Signed-off-by: Jan Dubois <[email protected]>
Signed-off-by: Jan Dubois <[email protected]>
Signed-off-by: Jan Dubois <[email protected]>
@mook-as mook-as merged commit 0a6d6a2 into rancher-sandbox:main May 13, 2024
15 checks passed
@jandubois jandubois deleted the spin branch May 15, 2024 01:47
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.

2 participants