Skip to content

Updates #13

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

Merged
merged 2 commits into from
Oct 18, 2017
Merged

Updates #13

merged 2 commits into from
Oct 18, 2017

Conversation

pointlessone
Copy link
Contributor

  • Bump up deps
  • Stop packaging test deps, tests and some other support files into the final image

Also move test deps into its own group.
Makefile Outdated
--workdir /usr/src/app \
--volume $(PWD)/spec:/usr/src/app/spec \
$(IMAGE_NAME) \
sh -c "bundle install --with=test && rspec"

Choose a reason for hiding this comment

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

This approach doesn't seem very desirable either, since it means reinstalling test deps on every test run.

We ship lots of engines with test deps installed, so personally I think the old way was fine: the test deps are usually a pretty negligible size increase.

I understand wanting to minimize the shipped engine size. If you want to keep test deps out of the shipped image, you could have a second codeclimate-grep:test image that gets built here and includes test deps, though it would have to be a separate docker image, not an image built on top of the existing one (otherwise you'd lose the cache everytime you changed a file & reinstall tests anyway, defeating the idea of keeping local test runs fairly fast).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think the issue can be partially avoided if tests are not copied into the image but mounted instead. It would still trigger image rebuild when engine source is changed but so will do the build-all approach. Test mounting is, actually, faster than rebuilding so with this approach you can iterate faster on tests.

Check out the last commit.

I don't think a whole separate test image is not a viable alternative. It would test a completely different image. You may miss some essential files from prod image but still can pass tests because test image is built completely from scratch. There's a decent chance Dockerfiles may drift apart over time since the prod one is not actually tested with this approach.

I think building on top of prod image is less error prone.

@pointlessone
Copy link
Contributor Author

@wfleming This engine doesn't have patrick set up. Should I add it?

Copy link

@wfleming wfleming left a comment

Choose a reason for hiding this comment

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

Clever solution, @pointlessone.

One small style nit. And I saw a fixup commit so please make sure you squash when merging.

This engine doesn't have patrick set up. Should I add it?

Sure! But I think that can be a separate PR.


COPY . ./

RUN chown -R app:app . && \
ln engine.json /

Choose a reason for hiding this comment

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

💄 extra blank line here, we usually only use single blank lines between blocks in dockerfiles.

Don't package test deps, tests and a few other support files.
@pointlessone pointlessone merged commit c2120c4 into master Oct 18, 2017
@pointlessone pointlessone deleted the updates branch October 18, 2017 11:36
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