-
Notifications
You must be signed in to change notification settings - Fork 687
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
Requirements pinning for app code build #4435
Conversation
This should be ready for re-review, I've updated the test plan and all tests pass locally. |
my testing thus far:
|
staging build failure due to too long with no output, gonna restart once.. |
this time another timeout but later in the provisioning process:
|
Performed interactive testing post-upgrade, including:
LGTM. We're blocked here by recurring CI failures, opened #4440 to track. |
Use no-binary and require hashes option at wheel build time, and generate new requirements file (without hashes) for securedrop-app-code deb package. This is because dpkg-buildpackage modifies the zip data of the built wheel files, making it difficult to require hashes at install-time server-side. The deb package is signed and as such would be difficult to tamper with wheel contents in transit
rebased on latest develop |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
based on testing performed yesterday, approving for merge provided the staging CI job passes
@redshiftzero apologies, this will need another stamp: I had to force push another change to resolve lint failure: the develop-requirements were using bandit 1.6.0, i reverted to 1.4.0 (see #4424) . |
This will make the build process marginally faster and provide better integrity
Adds python-wheel and latest security patches
Before, build would fail due to absence of wheels in the /var/securedrop/wheelhouse, at a later step.
Due to some issues with linting in ci [1,2], I've dropped the commits that would contain the develop-requirements hashes. Let's open a follow-up task to track this to unblock merge of the app code requirements hashes. [1] : https://circleci.com/gh/freedomofpress/securedrop/27948 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
re-approving after removing the dev requirements
Status
Ready for review
Description of Changes
Towards #3270, #1617 : Pin hashes for securedrop-app-code python requirements. Until now, we were blocked by Trusty tooling (see #3477)
This should be a stopgap until we implement a more complete solution that will also offer .deb reproducibility, described in freedomofpress/securedrop-builder#34.
Testing
Test plan:
make build-debs
securedrop-app-code-requirements.txt
should make the build fail.securedrop-app-code-requirements.txt
file for a source tarball should result in build failure.Since the build process is automated, proper verification requires adding a
wait_for: timout=3600s
at the end ofinstall_files/ansible-base/roles/build-securedrop-app-code-deb-pkg/tasks/build_securedrop_app_code_deb.yml
and using diffoscope to look at build wheels in the wheelhouse vs wheels in the deb package/tmp/w.out
contains build information of the wheels (confirm that we actually built the wheels)/tmp/securedrop-app-code_0.13.0~rc1+xenial_amd64/var/securedrop/wheelhouse/
are nearly identical to those in the deb package while using diffoscope, the difference is in the zip files and metadata within.You can unzip the wheels and diff the folder contents, eg:
and
Deployment
Mostly a dev/build environment change, but all changes to prod instances will be delivered via the securedrop-app-code package.
Checklist
If you made changes to the server application code:
If you made non-trivial code changes: