Skip to content

Allow any published dagger version to be installed via install.sh - #1819

Merged
gerhard merged 1 commit into
dagger:mainfrom
gerhard:install-sh-any-published-version
Mar 24, 2022
Merged

gerhard merged 1 commit into
dagger:mainfrom
gerhard:install-sh-any-published-version

Conversation

@gerhard

@gerhard gerhard commented Mar 18, 2022 •

Copy link
Copy Markdown
Contributor

I wanted to try different versions of dagger on Linux, and this was the easiest way of doing that:

    curl -L https://dl.dagger.io/dagger/install.sh -O
    # make this change, and then:

    DAGGER_VERSION=0.2.0 sh install.sh
    # ...
    ./bin/dagger version
    dagger 0.2.0 (e499297e) linux/amd64

    DAGGER_VERSION=0.2.1 sh install.sh
    # ...
    ./bin/dagger version
    dagger 0.2.1 (69b4845d) linux/amd64

This change enables anyone to do the following instead:

    curl -L https://dl.dagger.io/dagger/install.sh \
    | DAGGER_VERSION=0.2.0 sh

Until this gets merged, you can test how this change works in practice via this temporary file:

    curl -L https://dl.dagger.io/dagger/install-pr-1819.sh \
    | DAGGER_VERSION=0.2.0 sh

One thing which I was not sure about is how the file from this repository ends up on https://dl.dagger.io/dagger/install.sh.
I think this is a manual process today, but I need to confirm this assumption. Maybe @aluzzardi knows. @samalba knows.

@gerhard
gerhard requested a review from aluzzardi March 18, 2022 18:05
@aluzzardi

Copy link
Copy Markdown
Contributor

One thing which I was not sure about is how the file from this repository ends up on https://dl.dagger.io/dagger/install.sh. I think this is a manual process today, but I need to confirm this assumption. Maybe @aluzzardi knows.

Paging @samalba -- I believe you were the one managing install.sh

@netlify

netlify Bot commented Mar 18, 2022 •

Copy link
Copy Markdown

✅ Deploy Preview for devel-docs-dagger-io ready!

Name Link
🔨 Latest commit 6db19fc
🔍 Latest deploy log https://app.netlify.com/sites/devel-docs-dagger-io/deploys/623cfea4db8fdc0009489787
😎 Deploy Preview https://deploy-preview-1819--devel-docs-dagger-io.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@gerhard
gerhard requested review from samalba and removed request for aluzzardi March 18, 2022 18:12
@gerhard

gerhard commented Mar 18, 2022 •

Copy link
Copy Markdown
Contributor Author

I know that install.sh works on macOS too. I am wondering if we should mention it on the macOS tab too:
https://deploy-preview-1819--devel-docs-dagger-io.netlify.app/

image

WDYT @shykes?

@shykes

shykes commented Mar 18, 2022

Copy link
Copy Markdown
Contributor

I know that install.sh works on macOS too. I am wondering if we should mention it on the macOS tab too: https://deploy-preview-1819--devel-docs-dagger-io.netlify.app/

image

WDYT @shykes?

Yes I think it makes sense. Eventually we will want a native mac installer too (not everyone uses brew).

@samalba

samalba commented Mar 18, 2022

Copy link
Copy Markdown
Contributor

One thing which I was not sure about is how the file from this repository ends up on https://dl.dagger.io/dagger/install.sh.
I think this is a manual process today, but I need to confirm this assumption. Maybe @aluzzardi knows. @samalba knows.

Since this file barely ever changed, I simply copied it to the s3 bucket, the dl.dagger.io domain is the cloudfront distribution in front of it. Let me know if you need help with this.

@gerhard

gerhard commented Mar 19, 2022

Copy link
Copy Markdown
Contributor Author

Yes I think it makes sense.

OK, I will make that change now.

Eventually we will want a native mac installer too (not everyone uses brew).

I use nix (the package manager) on my newest Mac, and brew on my previous Mac (I run two of everything).

On my Linux bare metal instances (every primary approach should have a backup approach), I use the package manager to install GNU Make, and then have a Makefile that manages everything else. In that world, I install binaries like dagger via curl, tar & mv. If everything else fails, my last fallback is container images.

Our install.sh script is able to cater for most of the above scenarios.

A native installer is my least favourite approach because I cannot read the code to see what it does. After decades of terrible experiences, I don't use these anymore. It's either the App Store for auto-updating apps (love those!), brew casks, or just dmg files which I manually drop into Applications.

With the slow but noticeable shift to cloud environments like Codespaces & Gitpod, I am less certain about the need for a Mac native installer. I may be wrong 🙂

@gerhard

gerhard commented Mar 22, 2022 •

Copy link
Copy Markdown
Contributor Author

Reminder to automate the upload of install.sh to S3 via https://github.com/dagger/dagger/blob/main/ci/main.cue. For now, we upload it manually, which is something that I need to do after this gets merged, as discussed with @aluzzardi.


install.sh was generated by GoReleaser initially, but because @samalba made some modifications manually, this file is no longer maintained by GoReleaser.

@samalba

samalba commented Mar 23, 2022

Copy link
Copy Markdown
Contributor

Reminder to automate the upload of install.sh to S3 via https://github.com/dagger/dagger/blob/main/ci/main.cue. For now, we upload it manually, which is something that I need to do after this gets merged, as discussed with @aluzzardi.

install.sh was generated by GoReleaser initially, but because @samalba made some modifications manually, this file is no longer maintained by GoReleaser.

To give extra context: while I did that, goreleaser was not maintained anymore for quite some time, hence the manual changes. I see goreleaser had a lot of activity lately, so it might be possible to back to the generated version.

@gerhard

gerhard commented Mar 24, 2022 •

Copy link
Copy Markdown
Contributor Author

Thanks Sam for the extra context!

I see goreleaser had a lot of activity lately, so it might be possible to back to the generated version.

If we let GoReleaser manage install.sh, which I think is a good idea, then we should submit a PR to GoReleaser with this change.

I am keen on seeing this change out in our repo first - I have been using it all week and it's great! - and then go upstream.

This also updates Getting Started - CI/CD in your local dev - Linux & Mac doc.
A few other related doc changes were pulled in by this.

I wanted to try different versions of dagger on Linux, and this was the
easiest way of doing that:

    curl -L https://dl.dagger.io/dagger/install.sh -O
    # make this change, and then:

    DAGGER_VERSION=0.2.0 sh install.sh
    # ...
    ./bin/dagger version
    dagger 0.2.0 (e499297) linux/amd64

    DAGGER_VERSION=0.2.1 sh install.sh
    # ...
    ./bin/dagger version
    dagger 0.2.1 (69b4845) linux/amd64

This change enables anyone to do the following instead:

    curl -L https://dl.dagger.io/dagger/install.sh \
    | DAGGER_VERSION=0.2.0 sh

Until this gets merged, you can test how this change works in practice
via this temporary file:

    curl -L https://dl.dagger.io/dagger/install-pr-1819.sh \
    | DAGGER_VERSION=0.2.0 sh

One thing which I was not sure about is how the file from this
repository ends up on https://dl.dagger.io/dagger/install.sh. I think
this is a manual process today, but I need to confirm this assumption.

Signed-off-by: Gerhard Lazu <[email protected]>
@gerhard
gerhard merged commit 16450c3 into dagger:main Mar 24, 2022
@gerhard
gerhard deleted the install-sh-any-published-version branch March 24, 2022 23:38
@gerhard

gerhard commented Mar 24, 2022

Copy link
Copy Markdown
Contributor Author

On top of uploading install.sh to S3 manually, I also had to create an invalidation in CloudFront for /dagger/install.sh before this started working as expected:

curl -L https://dl.dagger.io/dagger/install.sh -v -o /dev/null 2>&1 | grep -i last
< last-modified: Thu, 24 Mar 2022 23:39:36 GMT

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.

4 participants