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

build: pip wheel must fail when it does not build a python module #3065

Merged
merged 7 commits into from
Feb 26, 2018

Conversation

ghost
Copy link

@ghost ghost commented Feb 23, 2018

Status

Ready for review

Description of Changes

It's not a catastrophy to not fail when pip wheel fails because it will eventually fail when installed. But it's non-intuitive to see a failure during installation and much easier to debug if it fails early.

Testing

  • Add pillow==5.0.0 to securedrop/requirements/securedrop-app-code-requirements.txt
  • make build-debs # it must fail
  • Add libjpeg-dev to molecule/builder/Dockerfile
  • make build-debs # it must succeed

Deployment

N/A

@ghost ghost requested review from conorsch and msheiny as code owners February 23, 2018 12:02
@ghost ghost mentioned this pull request Feb 23, 2018
1 task
Loic Dachary added 2 commits February 23, 2018 13:41
It takes longer but works all the time. Uploading an image to a docker
repository to speed-up the build requires an additional manual step
and access to the docker repository.

A possible optimization (would be a few minutes faster) could be
implemented by storing docker layers, similar to what is done for the
Dockerfile used when testing.
@ghost ghost force-pushed the wip-dachary-wheelhouse-fail branch from 54820d8 to e598c92 Compare February 23, 2018 12:41
@ghost
Copy link
Author

ghost commented Feb 23, 2018

@msheiny this is modifying something you did, could you please disagree with me ? :-D

@codecov-io
Copy link

codecov-io commented Feb 23, 2018

Codecov Report

Merging #3065 into develop will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop    #3065   +/-   ##
========================================
  Coverage    88.22%   88.22%           
========================================
  Files           32       32           
  Lines         1852     1852           
  Branches       212      212           
========================================
  Hits          1634     1634           
  Misses         168      168           
  Partials        50       50

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0e2ceb9...85c484d. Read the comment docs.

@heartsucker
Copy link
Contributor

$ make build-debs 
/bin/bash: molecule: command not found
Makefile:108: recipe for target 'build-debs' failed

We should include setting up the venv as a dependency for make build-debs. grumbles

heartsucker
heartsucker previously approved these changes Feb 23, 2018
Copy link
Contributor

@heartsucker heartsucker left a comment

Choose a reason for hiding this comment

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

I know this is outside my assigned area of responsibility, but I had a slow day at work of building and rebuilding containers, so I was able to very the behavior matches the test criteria @dachary described in the PR.

@ghost
Copy link
Author

ghost commented Feb 23, 2018

@heartsucker thanks for the quick review :-)

@redshiftzero
Copy link
Contributor

@msheiny you cool with this one?

@msheiny
Copy link
Contributor

msheiny commented Feb 26, 2018

checking @redshiftzero ...

Copy link
Contributor

@msheiny msheiny left a comment

Choose a reason for hiding this comment

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

Got some "fixes" coming in hot... hold on one sec!

pip wheel \
-r {{ securedrop_code_filtered }}/requirements/securedrop-app-code-requirements.txt \
-w {{ securedrop_app_code_deb_dir }}/var/securedrop/wheelhouse 2>&1 | tee /tmp/w.out
! grep -i --quiet 'Failed to build' /tmp/w.out
Copy link
Contributor

Choose a reason for hiding this comment

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

Some super fancy ansible pros would gasp at the usage of error handling like this.... luckily, I think this is fine to do this here ;) Ive seen others break this logic up over two tasks (one task runs, the other task checks the output of the first and fails conditionally with text present). I honestly think the way you went makes more sense.

Copy link
Author

Choose a reason for hiding this comment

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

:-) I'm glad we agree on this.

@@ -1,4 +1,5 @@
FROM ubuntu:14.04
# ubuntu:14.04 as of 2017-12-15
FROM ubuntu@sha256:084989eb923bd86dbf7e706d464cf3587274a826b484f75b69468c19f8ae354c
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't like embedding the hash right into the Dockerfile. It's more annoying to over-ride programtically in the future if need be. I got a couple commits coming in with some slightly tweaked logic.

Copy link
Author

Choose a reason for hiding this comment

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

cool. Note that it's also used in other Docker files so maybe you'd like to fix in a uniform way.

Easier to maintain if we need to add additional platforms.
Ansible has some shoddy detection logic for determining when to rebuild
an image or layers. I've seen issues in the past with `force: yes` and
highly recommend we peg to file hashes as an intermediate way to trigger
when to kick off a new docker image.
Copy link
Contributor

@msheiny msheiny left a comment

Choose a reason for hiding this comment

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

K ! I ✨ some 🌈 on the 🐐 to make the docker 🚀 more 📦

Errr @dachary give it a glance over. i dont like hitting merge after I add additional commits.

@ghost
Copy link
Author

ghost commented Feb 26, 2018

@msheiny 👍

@redshiftzero redshiftzero merged commit d49e865 into develop Feb 26, 2018
@redshiftzero redshiftzero deleted the wip-dachary-wheelhouse-fail branch February 26, 2018 23:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants