a-r-j / graphein

Protein Graph Library
https://graphein.ai/
MIT License
1.03k stars 131 forks source link

added docker-compose and docker CICD for CPU and GPU #100

Closed rg314 closed 2 years ago

rg314 commented 2 years ago

Reference Issues/PRs

Fixes #69

What does this implement/fix? Explain your changes.

I have added two docker compose files that enables users to build graphein locally on CPU and GPU (given Nvidia container toolkit is installed). This makes it easy to get the code up and running in a dev and usage env. As per #69 I haven't connected the container to a jupyter notebook because I prefer to mount the container in VS code.

One important note is that graphein is not cloned and installed in the container but the local volume is mapped into the container. This means if the container fails you will still have any changes locally rather than in the contianer file system.

What testing did you do to verify the changes in this PR?

To test the PR I also created .github/workflows/code-tests-docker.yaml that will run tests on the CPU built container for CICD. I tested these changes locally on GPU by:

docker-compose up -d --build
docker exec -it $(docker-compose ps -q) bash -c 'pip install -e .'
docker exec -it $(docker-compose ps -q) bash -c 'pytest .'
docker exec -it $(docker-compose ps -q) bash -c 'grep -l smoke_test notebooks/*.ipynb | pytest --nbval-lax --current-env'

Docker & docker-compose versions:

(base) ryan@ryan:~$ docker --version && docker-compose --version
Docker version 20.10.9, build c2ea9bc
docker-compose version 1.29.2, build 5becea4c

Hardware and OS:

(base) ryan@ryan:~$ uname -a
Linux ryan 5.13.0-27-generic #29~20.04.1-Ubuntu SMP Fri Jan 14 00:32:30 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
sonarcloud[bot] commented 2 years ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

codecov-commenter commented 2 years ago

Codecov Report

:exclamation: No coverage uploaded for pull request base (master@42adaef). Click here to learn what that means. The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #100   +/-   ##
=========================================
  Coverage          ?   40.24%           
=========================================
  Files             ?       48           
  Lines             ?     2805           
  Branches          ?        0           
=========================================
  Hits              ?     1129           
  Misses            ?     1676           
  Partials          ?        0           

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 42adaef...653092d. Read the comment docs.

a-r-j commented 2 years ago

Success! Thanks for the contribution, Ryan!