-
Notifications
You must be signed in to change notification settings - Fork 989
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
🐳 Dockerize spec tests #3475
🐳 Dockerize spec tests #3475
Conversation
docker/Dockerfile
Outdated
|
||
COPY . . | ||
|
||
RUN pip install -r requirements-dev.txt -r requirements_preinstallation.txt |
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.
requirements_preinstallation.txt
should be installed beforerequirements-dev.txt
- Can
python -m pip install -e .[test]
replacepip install -r requirements-dev.txt
so that we don't need to maintainrequirements-dev.txt
file?
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.
requirements_preinstallation.txt
should be installed beforerequirements-dev.txt
You are right indeed.
- Can
python -m pip install -e .[test]
replacepip install -r requirements-dev.txt
so that we don't need to maintainrequirements-dev.txt
file?
Indeed good idea !
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.
Good job! It looks like it was run successfully with GitHub Action?
/cc @michaelneuder if you have some suggestions. :)
Co-authored-by: Hsiao-Wei Wang <[email protected]>
What the GitHub action is doing is to run pylint on the folder |
Yes it runs successfully 😄
|
Is there any additional help you need here? I'm wanting to work on an issue with the tests and am new to consensus-specs so it would be awesome if I can use a docker version of the spec-tests. |
IDK, there are works done here #3477 by @parithosh regarding the CI. |
@@ -76,6 +76,18 @@ Options: | |||
- `--disable-bls`, to disable BLS (only for tests that can run without) | |||
- `--bls-type`, `milagro` or `py_ecc` (default) | |||
|
|||
#### With Docker | |||
|
|||
Run `docker build -f ./docker/Dockerfile -t consensus-specs .` from the root of the specs repository to build the test image. |
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.
When I ran the docker command, I first thought the sentence meant that the docker command should run inside spec/ and not the root folder of the repo. Not sure if you want to clarify that but just thought it worth mentioning.
Great work on this!
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.
Understood, does replacing from the root of the specs repository
by from the repository root
make it more understandable?
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.
Yes! That makes sense to me.
Not needed anymore. |
Thank you very much for the initial PR! happy to iterate on the approach taken in the merged one |
Associated to #3395
Docker may help us to facilitate the test running accros system and python versions.
First you need to build the image; be at the root of the project and run
docker build -f ./docker/Dockerfile -t consensus-specs .
.Then you can locate yourself in "./scripts" and run "run_test.sh".
What was added
Dockerfile
that contains the consensus-specs project..dockerfile
to ignore potentialvenv
folders.run_test.sh
to run project tests.arequirements-dev.txt
containing all dependencies to run the tests.a scriptdockerfile_test.sh
to test theDockerfile
consistency.TODO
add a CircleCI process to testDockerfile
consistencyDockerfile
consistency