-
Notifications
You must be signed in to change notification settings - Fork 274
Introduction of Dockerfile for building and running CBMC in a Docker container. #5715
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
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #5715 +/- ##
========================================
Coverage 69.50% 69.50%
========================================
Files 1243 1243
Lines 100690 100690
========================================
Hits 69989 69989
Misses 30701 30701
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report at Codecov.
|
So, updates on some of the points raised so far, and the future direction of it:
|
e6cccbe
to
cf15527
Compare
Update: yesterday we (me and @thomasspriggs) managed to get multi-stage builds enabled. The PR is more or less good for proper reviews now, but there's at least one more thing I would like to do to feel like this is ready (that is, add documentation for using the Dockerfile). |
545ae4d
to
0b2fb74
Compare
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.
I thought you'd add the CI tests for this in this PR, I know we track these as separate work items but that doesn't mean we need to create a PR for each right? Problem with merging as is is that right now it's untested code.
0b2fb74
to
92acbbc
Compare
ce33d7e
to
eaef117
Compare
@@ -349,3 +349,24 @@ jobs: | |||
- uses: actions/checkout@v2 | |||
- name: Check for unused irep ids | |||
run: ./scripts/string_table_check.sh | |||
|
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.
⛏️ Might be worth stating in the commit title that this is PR check. Otherwise it might be confused with the release actions when looking through the commit history later. Something like - "Add github action on PRs to check the Dockerfile"
⛏️ The commit title should not end with a full stop. See point "4. Do not end the subject line with a period", here - How to Write a Git Commit Message
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.
LGTM
510e8bb
to
9e27b60
Compare
You might be interested in #5646. |
dpkg-dev | ||
COPY . /tmp/cbmc | ||
WORKDIR /tmp/cbmc | ||
RUN cmake -S . -Bbuild -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=/usr/bin/gcc -DCMAKE_CXX_COMPILER=/usr/bin/g++ && cd build; ninja -j2 |
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.
I don't think we need the -DCMAKE_*_COMPILER
settings as those will be no different from the system defaults. And ninja -C build -j2
would spare you the cd build
.
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.
Or cmake --build build
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.
Hm, when it comes to the WORKDIR
I think it might be better to actually keep it. From the docker documentation it seems there's no longer any massive need to avoid extraneous instructions, as only a few introduce new layers, and I think it's cleaner this way.
What do you think about this?
Add a Dockerfile that allows CBMC to be built and run in a Docker container. The Dockerfile is setup in a way that allows multi-stage builds, so that it's built in one container, and then the build artifacts are being copied in another.
This adds a github action that builds CBMC in a Docker container, and then exercises a small suite of smoke tests on it to make sure that the image is sound.
9e27b60
to
fbcc05b
Compare
@NlightNFotis : what is the use-case for this? If it is intended to be a way to distribute CBMC then should creating it be added to the CI or release automation? |
Hi @martin-cs Yes, my understanding is that this is one potential distribution method for us to maintain. The plan for this is is as follows:
Step 1 is present in this PR if you want to review it (it's the last commit). |
@NlightNFotis Thanks for the fast response. At the risk of showing my ignorance about docker...
How often will the docker image be produced and 'released' to dockerhub? Every PR? Every merge? Every release? |
Hi @martin-cs, no problem all of these are good questions. Regarding:
|
Out of interest and a desire to keep a vague track of how people use CBMC, is this driven by specific user requests or because "we" feel like it is something that should be available? |
Hi @martin-cs,
Moving the binaries from the other build into the container is a lot harder though, as that would involve different VMs (the ones spawned by the different github actions) so we would need to find a different way to store these binaries before they are either copied to the container or mounted to it from another directory.
As an aside, we were experimenting with potentially speeding up the build inside the container by using |
@NlightNFotis This all sounds good, thanks. I would dispute a little bit that consistency is a good thing in the CI builds. I think we want diverse builds. As it would be infeasibly expensive to try all possible combinations but I think having the set of build cover all of the options (but not all of the combinations). Michael has tow commits for this happening with SAT solvers, I believe some of the build options have this kind of diversity as well. So I would be OK with one of the Linux builds being in a docker container we then kept. |
@martin-cs Would that be okay if we do it at a later time? My plan for this is to get |
@NlightNFotis Sure! I'm not in charge of CI or release, so, do as you wish. 😄 |
Hi,
This PR adds support for building and running CBMC in a docker container.
I would appreciate all feedback.