8000 add intermediary halmos-builder image and dockerize more workflows by 0xkarmacoma · Pull Request #308 · a16z/halmos · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

add intermediary halmos-builder image and dockerize more workflows #308

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 31 commits into from
Jul 19, 2024

Conversation

0xkarmacoma
Copy link
Collaborator

halmos-builder:

  • based on solvers
  • adds dev dependencies like python, git, wget, foundry, uv, etc.

halmos:

  • based on halmos-builder, just does a uv pip install of a halmos checkout

For test-long and test-ffi, we:

  • check out the latest halmos commit
  • build a new halmos image based on that
  • runs pytest inside the resulting halmos container

@0xkarmacoma
Copy link
Collaborator Author

note: we may eventually want to have a halmos-dev package that contains pytest and everything necessary to run halmos tests in our own workflows (~600MB image), and a slim halmos package without the tests folder, pytest, etc (can probably get it down to <300MB)

@0xkarmacoma 0xkarmacoma requested a review from daejunpark June 7, 2024 23:15
Comment on lines +74 to +78
- name: Install Vyper
if: ${{ matrix.project.dir == 'snekmate' }}
run: |
docker run --name halmos-vyper --entrypoint uv halmos-image pip install vyper
docker commit --change 'ENTRYPOINT ["halmos"]' halmos-vyper halmos-image
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

shows that we can layer vyper on top of the existing halmos image fairly easily in github workflows

@@ -22,43 +24,59 @@ jobs:
project:
- repo: "morpho-org/morpho-data-structures"
dir: "morpho-data-structures"
cmd: "halmos --function testProve --loop 4 --symbolic-storage"
cmd: "--function testProve --loop 4 --symbolic-storage"
Copy link
Collaborator

Choose a reason for hiding this comment

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

is the yices solver not used here due to the weird failure you mentioned?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes :(

sudo mv yices-2.6.4/include/* /usr/local/include/
rm -rf yices-2.6.4
- name: Print halmos version
run: docker run -v .:/workspace halmos-image --version
Copy link
Collaborator
@daejunpark daejunpark Jul 19, 2024

Choose a reason for hiding this comment

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

i tried to print the halmos version to double check the correct halmos version is running, but the version printed here is quite different from what we get locally.

Run docker run -v .:/workspace halmos-image --version
halmos 0.1.dev1+g81b7ae5

https://github.com/a16z/halmos/actions/runs/10014074545/job/27683005509

in my local machine, the version is:

(.venv) DParkMBP14:halmos dpark$ halmos --version
halmos 0.1.12.dev9+g3f5d10c

can we improve the dockerfile to contain the consistent halmos version?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

the only difference I can see is that we install halmos via uv pip install in the Dockerfile instead of pip install

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

oh and actually the other big difference is the sparse checkout we do in github actions, which explains the 0.1.dev1 part. I think it's fine, the git hash has the information we need really

Note: during CI builds, we only perform a sparse checkout so we expect the printed version to be slightly wonky, e.g. `halmos 0.1.dev1+g81b7ae5`

(base tag is wrong, number of commits ahead is wrong, but git hash is correct)

For released images, we expect the version string to be correct (e.g. `halmos 0.1.14`)
@0xkarmacoma 0xkarmacoma merged commit fcadd92 into main Jul 19, 2024
53 checks passed
@0xkarmacoma 0xkarmacoma deleted the chore-workflows branch July 19, 2024 23:31
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
0