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 jq #854

Merged
merged 4 commits into from
Nov 4, 2020
Merged

Remove jq #854

merged 4 commits into from
Nov 4, 2020

Conversation

lillianzhang331
Copy link
Contributor

jq is now added to the build stack so we are able to remove the dependency when cedar-14 gets deprecated. The $JQ environment variable is reassigned to the binary path, in case someone has scripts that reference the variable. Until Cedar-14 gets deprecated, we will have to check for jq existence on the stack image and download if missing.

@lillianzhang331 lillianzhang331 requested a review from a team as a code owner October 27, 2020 17:08
@edmorley
Copy link
Member

Since node, I'll defer to Danielle for review - so removing the languages-review label for now :-)

@lillianzhang331 lillianzhang331 merged commit 41d6641 into main Nov 4, 2020
@lillianzhang331 lillianzhang331 deleted the remove-jq branch November 4, 2020 20:12
JQ="$BP_DIR/lib/vendor/jq-$(get_os)"
JQ="/usr/bin/jq"
if ! test -f "$JQ"; then
curl -Ls https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64 > "/usr/bin/jq" \
Copy link
Member

@edmorley edmorley Nov 9, 2020

Choose a reason for hiding this comment

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

jq is always available on all Heroku stack images as of heroku/base-images/pull/174, meaning this codepath is unused for Heroku builds.

The reason this is needed to make the unit tests pass for this repo, is that the unit tests (unlike the Hatchet tests) use the Docker images, which in the case of Cedar-14 haven't been updated for some time (due to restrictions about distributing ESM updates), so the heroku/cedar:14 docker image doesn't have heroku/base-images/pull/174 so doesn't have jq.

Also /usr/bin can only be written to by root, so this line would fail should it ever be needed for builds on the Heroku platform. It seems that Dokku doesn't run builds as root either, and also doesn't have jq, which is why there were reports of failures in #789.

Other options for this implementation would be:

  1. To assume jq always exists (since it does on Heroku), so remove this download and instead modify the tests to apt-get update && apt-get install jq on Cedar-14 only, here
  2. Or, to update the step to install into the buildpack directory (or build directory) instead of /usr/bin, and ensure that that chosen directory is on PATH

For reduced complexity I would lean towards (1). Dokku users will still need to update their base images to include jq (for parity with the Heroku stack images), but at least the error message they get would be clearer ("jq not found" etc).

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for this insight!

Copy link
Member

Choose a reason for hiding this comment

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

Dokku users will still need to update their base images to include jq (for parity with the Heroku stack images)

Hmm looks like they do base their images on the Heroku stack images:
https://github.com/gliderlabs/herokuish/blob/master/Dockerfile

...so perhaps it just needs a new herokuish release, or for Dokku users to update their install to a newer version?

Either way, this sounds like something Dokku users should file against dokku (needing jq/newer image) :-)

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.

3 participants