davidrmiller / biosim4

Biological evolution simulator
Other
3.21k stars 460 forks source link

docker and github actions #8

Closed mathematicalmichael closed 3 years ago

mathematicalmichael commented 3 years ago

First, thanks for this repo! I really enjoyed your youtube video and was excited at the opportunity to play around with the code.

I am hoping to contribute a helpful compilation option, and also set up some (free) CI testing courtesy of Github (the actions file).

I was able to simulate a couple dozen generations, cut the program, and then still make some movie files, so it seems to be fully working as far as I can tell.

Got it working with docker on both an intel-based x86 home server and just for kicks, a raspberry pi 4 as well. The ubuntu base image specified is architecture-aware. verified that it compiles on an M1 mac as well with this same Dockerfile. Took some time to build, especially on the ARM machines, so I uploaded some images:

changes are made to support this execution pattern (paths relative to root directory of repo), I wanted to have the README instructions not yield any warnings/errors.

docker build -t biosim4
docker run --rm -ti -v `pwd`:/app --name biosim biosim4 make
docker run --rm -ti -v `pwd`:/app --name biosim biosim4 ./bin/Release/biosim4 biosim4.ini

dumb-init needed to be added to handle Ctrl-c for the command above which invokes the executable. I noticed I got the sensorVal message repeatedly on amd64 but not arm64. I had to comment it out in order to get a readable stdout.

If I added any packages that are not actually required, please do let me know. I like to keep images slim in size but the priority here was just getting something that worked out the door. I suppose mpi is missing and it does occur to me you mentioned you did get that working in your narration, but ... one step at a time =) I figure if people land on the repo, this provides a relatively low-friction entry point to reproducing the work.

davidrmiller commented 3 years ago

@mathematicalmichael , this is impressive work. Thanks for making the images available.

mathematicalmichael commented 3 years ago

@davidrmiller what's impressive was your simulations. I just wanted to run them conveniently. Today I got to actually dig in to the config =)

my changes appear to be settled, do you have anything you'd like me to change to get this merged?