GMLC-TDC / HELICS-Examples

Examples for using HELICS with a variety of the supported programming languages
BSD 3-Clause "New" or "Revised" License
21 stars 20 forks source link

Support for running examples using Docker. #6

Closed activeshadow closed 6 years ago

activeshadow commented 6 years ago

This is working for the new multi-node-pi-exchange example I added. It's essentially just a copy of the pi-exchange example with broker startup code removed from pisender.py and both pisender.py and pireceiver.py updated to determine what their local IP is since by and large it's difficult to know what the IP address of a Docker container will be ahead of time.

To run this example, simply run docker-compose up from the python/multi-node-pi-exchange directory.

See gmlc-tdc/helics-tutorial#5 for additional details.

kdheepak commented 6 years ago

Works great! screen shot 2018-09-20 at 9 42 34 pm

kdheepak commented 6 years ago

Is this WIP? What are you planning to add beyond this? I'm willing to merge this right now.

activeshadow commented 6 years ago

I just tested a few more things to flesh out my understanding and to confirm what @phlptp said about the local port for the federates (they don't have to be specified, and if they are specified they can be the same as long as they're on different hosts). Let me add some comments real quick then I'll squash and remove the WIP.

activeshadow commented 6 years ago

I also meant to ask if you want me to update the Dockerfile used here to reference a specific commit hash from the helics-src repo. Right now it's just going to build from the head of the master branch.

kdheepak commented 6 years ago

That would ideal. Alternatively we can pin it to a version of helics, e.g. v1.3.0.

activeshadow commented 6 years ago

OK, let me do that real quick and I'll push again.

activeshadow commented 6 years ago

OK, all done. Pinned to v1.3.0 of HELICS and tested to confirm it still works. :+1:

kdheepak commented 6 years ago

Works great!

kdheepak commented 6 years ago

Thanks for contributing @activeshadow! This is great!

activeshadow commented 6 years ago

Whoa... my first merged pull request. Probably not my last. :wink:

kdheepak commented 6 years ago

If this PR is anything to judge by, I hope it's not the last! And congrats!