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

remove Foreman from Gemfile #330

Closed

Conversation

seamusabshere
Copy link
Contributor

per @ddollar in ddollar/foreman#437 (comment)

You should not put foreman into your Gemfile as the dependencies of a developer utility should not be able to interfere with the dependencies of your app.

later I told him I was using suspenders:

Interesting I have always wondered where that trend got started. Having foreman be run inside the app using whatever random version of Ruby the user has installed is quite a pain point.

@rossmeissl
Copy link

👍

@mjankowski
Copy link
Contributor

I'm sympathetic to that point of not letting what is mostly a local dev tool impact the app's more core dependencies, but a) we do already put the foreman gem only in the :development group in the Gemfile to minimize those effects, b) I think foreman is in a grey area on the dev tool spectrum, because we're using it mostly to locally mimic the behavior we'll see on the Heroku platform, and not "just" as a local dev tool (thus, unlike other local dev tools which cause unexpected differences from the production environment, the purpose of using foreman is to achieve the opposite).

If we do remove it from the Gemfile, I think I'd prefer to include installation of the foreman gem in the generated bin/setup file, instead of (or maybe in addition to?) that note in the README.

@rossmeissl
Copy link

@mjankowski I like the idea of putting it in bin/setup 👍

@ddollar
Copy link

ddollar commented Apr 29, 2014

+1 to bin/setup

You may even want to check out github.com/ddollar/forego which is a single
binary with no dependencies.

@jferris
Copy link
Contributor

jferris commented Apr 29, 2014

Is there a simple, cross-system way to install foreman/forego in bin/setup? If not, I'd prefer to just check for it in bin/setup and fail with a useful message if you haven't installed it.

@croaky
Copy link
Contributor

croaky commented Apr 29, 2014

Other Go-based tools are using a technique like this to detect your OS and CPU architecture based on the User-Agent, then redirect you to the latest release for your platform.:

$ L=/usr/local/bin/hk && curl -sL -A "`uname -sp`" https://hk.heroku.com/hk.gz | zcat >$L && chmod +x $L

It doesn't look like forego has that yet.

@croaky
Copy link
Contributor

croaky commented Apr 29, 2014

I agree with moving this into bin/setup wrapped in something like:

if ! command -v forego &>/dev/null; then
  L=/usr/local/bin/forego && curl -sL -A "`uname -sp`" https://forego.heroku.com/forego.gz | zcat >$L && chmod +x $L
fi

@ddollar Any thoughts on a hosted OS/CPU detector like hk?

@rossmeissl
Copy link

What's wrong with just gem install foreman in bin/setup?

@mike-burns
Copy link
Contributor

Let's keep it to Ruby. I don't feel comfortable running arbitrary binaries on my machine.

@seamusabshere can you update the pull request?

@jferris
Copy link
Contributor

jferris commented May 7, 2014

In bin/setup, I think it would be best to only change the user's machine in really predictable ways, like installing gems using bundle install. Beyond that, I'd prefer to just detect if something is installed and then fail with a nice error message.

@mike-burns
Copy link
Contributor

It's not possible to install foreman using laptop, because the foreman binary is installed using Rubygems. Right? 'Cause I think that'd be the best solution for this.

Maybe the first step to this should be to submit a PR to foreman for Debian and Homebrew packaging.

@jferris
Copy link
Contributor

jferris commented May 7, 2014

You're supposed to install foreman as part of the Heroku Toolbelt, which we already install as part of laptop.

@rossmeissl
Copy link

Maybe I'm missing something but I think this is as simple as adding the following line to bin/setup:

gem install foreman

. . . which I'm sure @seamusabshere will add to this PR presently

@mike-burns
Copy link
Contributor

I do indeed have foreman installed into /usr/bin/foreman, so @jferris must be right. We can just remove the foreman gem from suspenders, as @seamusabshere first submitted.

@rossmeissl
Copy link

Bravo!

@gabebw
Copy link
Contributor

gabebw commented May 15, 2014

Hmmm. I installed the Heroku toolbelt via homebrew, and I don't see foreman installed:

$ ls /usr/local/Cellar/heroku-toolbelt/3.7.2/bin
heroku
$

Homebrew installs the standalone version of the toolbelt, which is at this S3 URL (via their install.sh). When I untar and un-gzip that file, I see:

$ ls heroku-client/bin
heroku

So at least for the standalone version, the toolbelt does not include Foreman.

@gabebw
Copy link
Contributor

gabebw commented May 15, 2014

They actually note this on their page. You can see that the OSX native version promises to install foreman, while the standalone version does not.

@gabebw
Copy link
Contributor

gabebw commented May 15, 2014

I think that a lot of people have probably installed the toolbelt via Heroku. Therefore, we cannot rely on foreman being installed in /usr/bin.

Therefore, my vote is that we should add gem install foreman to the generated bin/setup.

@jferris
Copy link
Contributor

jferris commented May 15, 2014

I'm sort of torn on this. I guess the best thing to do for now is to add gem install foreman (maybe with a condition) to bin/setup. Any objections?

@croaky
Copy link
Contributor

croaky commented May 18, 2014

Let's keep it to Ruby. I don't feel comfortable running arbitrary binaries on my machine.

@mike-burns Can you elaborate on this? It seems like forego has advantages over foreman:

  • Faster start up.
  • One installation on our machines instead of at least one (and probably more as it gets version updates) foreman per Ruby version.

@ddollar How does Heroku the platform run the processes in Procfile? Does it install the foreman gem into the Ruby environment? Does it use forego? I'm wondering if there is a dev/production parity argument to be made.

I've personally been using forego instead of foreman for a few weeks and it's been working as expected, no problems.

@ddollar
Copy link

ddollar commented May 18, 2014

Heroku does not use foreman or forego but instead uses a custom piece of software that integrates into their dispatching service.

@mike-burns
Copy link
Contributor

Can you elaborate on this?

I'm paranoid.

I'll gladly use the forego binary when I download it from a trusted source and confirm the checksum against a known good value. In general I only trust binaries distributed by my OS.

Also, we all know and enjoy Ruby. foreman is a nice common ground. Yes, I wish they had a distribution mechanism more like gitsh; Rubygems is a terrible way to distribute a program. But that's what they chose.

@jferris
Copy link
Contributor

jferris commented May 19, 2014

Assuming forego would be easy to install on our supported systems, I think it would make sense to add that to our laptop script.

@mike-burns
Copy link
Contributor

It's worth noting that foreman is installed as part of the Heroku toolbelt.

@jferris
Copy link
Contributor

jferris commented Jul 7, 2014

@mike-burns as @gabebw noted above, there are two versions of toolbelt: the standalone version, and the full install. The standalone version does not include foreman.

@mike-burns
Copy link
Contributor

Oh.

Can we install the full version using our laptop script and then merge this PR? Is that the solution that will make everyone happy?

@rossmeissl
Copy link

@mike-burns 👍

@mike-burns
Copy link
Contributor

I've opened thoughtbot/laptop#246.

@gabebw
Copy link
Contributor

gabebw commented Jul 7, 2014

Personally, I've always installed heroku-toolbelt via Homebrew, which installs the standalone version. I don't know how to keep the OSX version of the heroku toolbelt up-to-date, while the brew-installed version is easy to keep up to date. Therefore, I'm probably going to just use the gem.

If I'm in the minority, that's fine - I'll just keep using the gem, with nobody the wiser.

@mike-burns
Copy link
Contributor

The laptop script also uses Homebrew to install heroku-toolbelt. Foreman seems to supply a foreman.pkg file for OS X. Is there a Homebrew tap that provides foreman?

@jferris
Copy link
Contributor

jferris commented Jul 7, 2014

I looked and couldn't find a Homebrew tap for foreman. Looks like we can try to install the .pkg file in the script, though: http://apple.stackexchange.com/questions/72226/installing-pkg-with-terminal

@mike-burns
Copy link
Contributor

I've added a call to installer(1) to thoughtbot/laptop#246. Would love a couple more opinions on that.

@mike-burns
Copy link
Contributor

thoughtbot/laptop#246 is merged; foreman is now installed as part of the laptop script. Is this PR good to merge now?

@croaky
Copy link
Contributor

croaky commented Jul 11, 2014

Made some edits to the documentation and merged as a1a322c.

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.

8 participants