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

Docker environment #310

Merged
merged 61 commits into from
Nov 18, 2024
Merged

Docker environment #310

merged 61 commits into from
Nov 18, 2024

Conversation

iamnp
Copy link
Contributor

@iamnp iamnp commented Oct 25, 2024

Goal

Develop a well-defined process where a user clones the scripts repository, runs a docker command and gets a working environment to run & test scripts on any machine with no other requirements.

Solution overview

The Dockerfile will:

  1. Use a pre-built image with Python and Nodejs on Debian 12
  2. Install prerequisites
  3. For arm64: compile solc compilers and manually install vyper
  4. for amd64: brownie will automatically download pre-built versions of solc & vyper
  5. Create an init script to init the repo the first time the container is started
  6. Install & configure sshd
  7. Perform an integrity check - check the versions for python, pip, node, npm, poetry, yarn, poetry, solc and vyper. If any of the versions differ from the pre-tested ones, the build will fail.
  8. Open ssh port (22)
  9. Run sshd on container startup

Testing results

  • amd64 Ubuntu 24.04 VM: poetry run brownie test
  • arm64 Ubuntu 24.04 VM: poetry run brownie test
  • amd64 Ubuntu 24.04 WSL: poetry run brownie test
  • arm64 MacOS 15.0.1 M1 Max: poetry run brownie test

docker build on arm64: up to 2 hours
docker build on amd64: 5-10 minutes

There was no noticeable drop in performance. There was a slight increase in memory usage.

@iamnp iamnp self-assigned this Oct 25, 2024
@iamnp iamnp requested review from Psirex and katamarinaki October 28, 2024 10:15
@iamnp iamnp marked this pull request as ready for review October 28, 2024 10:15
@iamnp iamnp requested a review from mkurayan October 28, 2024 10:18
@iamnp iamnp changed the title [WIP] Docker environment Docker environment Oct 29, 2024
@iamnp iamnp requested a review from BATMAH69 October 30, 2024 22:30
@iamnp iamnp requested a review from a team as a code owner October 31, 2024 12:41
@iamnp iamnp changed the base branch from master to feat/next-vote October 31, 2024 12:42
Copy link
Contributor

@katamarinaki katamarinaki left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@iamnp iamnp merged commit 85925e1 into feat/next-vote Nov 18, 2024
1 check failed
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.

3 participants