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 Zokrates in Dockerfile #404

Merged
merged 6 commits into from
Feb 7, 2022
Merged

Conversation

IlyasRidhuan
Copy link
Contributor

This PR closes #399 and superseded #396.

Zokrates 0.7.10 is now directly built in optimist and worker containers. This is achieved by using the rust image in the first build stage and cloning the appropriate Zokrates release.

There is a constraint when compiling rust binaries; in particular, glibc is dynamically linked at compile time and the binary expects to have the same version of glibc when the binary is compiled and when it is run. As we require a slightly later version of rust to compile Zokrates successfully for ARM, we also need an image in stage 2 of the build that has a later version of glibc - the result is the following:

  1. In optimist we use a later version of the mongo image (based on ubuntu focal - 20.04).
  2. In worker, I'm hesitant to bump the node version past node@14, so instead we pull in the ubuntu:20.04 image and install node@14. This does lead to a slightly larger final image, but if that becomes a future issue we can use a slimmer version or alpine.

Finally, after Zokrates 0.7.9, the --light flag has been removed from the compile command as it is now default behaviour. It has been removed.

@Westlad
Copy link
Contributor

Westlad commented Jan 26, 2022

I made a PR #428 that tweaks this build to creat a zokrates container image, from which the binary is copied. Saves about 10 mins on my machine because the binary is only built once

@Westlad
Copy link
Contributor

Westlad commented Jan 27, 2022

My PR breaks the wallet tests so maybe leave it for now.

@IlyasRidhuan
Copy link
Contributor Author

It's not clear to me why it is breaking the tests though.. I experienced the same thing with this PR so I have re-run the workflow just in case

@Westlad
Copy link
Contributor

Westlad commented Jan 27, 2022

ooh - it works now. Must be a timing thing. @druiz0992 has changed the timing in the wallet tests in PR #429 so hopefully this is a temporary issue and will go away when the ping-pong tests are merged.

@IlyasRidhuan IlyasRidhuan added the One more approval needed One reviewer has approved this PR but another is needed label Jan 27, 2022
@ChaitanyaKonda ChaitanyaKonda merged commit d68f3b0 into master Feb 7, 2022
@ChaitanyaKonda ChaitanyaKonda deleted the ilyas/zokrates-source branch February 7, 2022 15:11
@github-actions
Copy link

github-actions bot commented Feb 7, 2022

🎉 This PR is included in version 1.15.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
One more approval needed One reviewer has approved this PR but another is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

M1 Mac compatibility
3 participants