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 Script #1558

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Install Script #1558

wants to merge 3 commits into from

Conversation

chigozienri
Copy link

@chigozienri chigozienri commented Mar 5, 2024

Proposal for install.sh to reduce friction when installing cog

Run as follows:

# via curl
sh -c "$(curl -fsSL https://raw.githubusercontent.com/replicate/cog/main/tools/install.sh)"
# or via wget:
sh -c "$(wget -qO- https://raw.githubusercontent.com/replicate/cog/main/tools/install.sh)"
# or via fetch:
sh -c "$(fetch -o - https://raw.githubusercontent.com/replicate/cog/main/tools/install.sh)"

See Slack comments here https://replicatehq.slack.com/archives/C05600FDYTE/p1709142996116999

Signed-off-by: Chigozie Nri <chigozie@gmail.com>
You can run an install script which will download and install the latest release of Cog:
```
# via curl
sh -c "$(curl -fsSL https://raw.githubusercontent.com/replicate/cog/main/tools/install.sh)"
Copy link
Member

Choose a reason for hiding this comment

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

Would curl {URL} | sh also work?

That might be a bit cleaner, but maybe there are some tradeoffs there?

Copy link
Member

@zeke zeke Mar 6, 2024

Choose a reason for hiding this comment

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

Could also use a short URL like https://cog.run/installer with a redirect to this longer URL.

Copy link
Member

Choose a reason for hiding this comment

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

curl -fsSL https://cog.run/installer | sh

Copy link
Author

Choose a reason for hiding this comment

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

Yes, for some reason I thought the construction using a pipe wouldn't work with wget, but I just tested and it does.

(N.B. Part of the motivation for making this script in the first place was that my friend tried to use the existing instructions and one of his frustrations was that Ubuntu didn't have curl installed by default.)

Comment on lines +127 to +131
sh -c "$(curl -fsSL https://raw.githubusercontent.com/replicate/cog/main/tools/install.sh)"
# or via wget:
sh -c "$(wget -qO- https://raw.githubusercontent.com/replicate/cog/main/tools/install.sh)"
# or via fetch:
sh -c "$(fetch -o - https://raw.githubusercontent.com/replicate/cog/main/tools/install.sh)"
Copy link
Author

Choose a reason for hiding this comment

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

Suggested change
sh -c "$(curl -fsSL https://raw.githubusercontent.com/replicate/cog/main/tools/install.sh)"
# or via wget:
sh -c "$(wget -qO- https://raw.githubusercontent.com/replicate/cog/main/tools/install.sh)"
# or via fetch:
sh -c "$(fetch -o - https://raw.githubusercontent.com/replicate/cog/main/tools/install.sh)"
curl -fsSL https://cog.run/installer | sh
# or via wget:
wget -qO- https://cog.run/installer | sh
# or via fetch:
fetch -o - https://cog.run/installer | sh

@zeke I don't know where to make a PR to update cog.run, do you know? This does look nicer, though.

Copy link
Member

Choose a reason for hiding this comment

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

@chigozienri I think we'd need to set up a custom route handler for that in CloudFlare

Copy link
Member

Choose a reason for hiding this comment

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

I set that up:

$ curl -I "https://cog.run/installer"
HTTP/2 301 
date: Tue, 19 Mar 2024 02:49:41 GMT
location: https://raw.githubusercontent.com/replicate/cog/main/tools/install.sh

Signed-off-by: Chigozie Nri <chigozie@gmail.com>
@chigozienri chigozienri marked this pull request as ready for review March 18, 2024 11:49
@chigozienri chigozienri requested a review from zeke March 18, 2024 11:50
This reverts commit 311ea58.

Signed-off-by: Chigozie Nri <chigozie@gmail.com>
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.

None yet

2 participants