-
Notifications
You must be signed in to change notification settings - Fork 7
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-based Tutorial #5
Comments
With @phlptp's help I was able to get GridDyn to completely install in a Docker image and running |
Still having a hard time compiling GridLAB-D with HELICS support. I've created a new issue (gridlab-d/gridlab-d#1148) for it in the GridLAB-D repo. |
So... I get the following from GridLAB-D when trying to run Tutorial 1.
This seems more like a GridLAB-D configuration error and less of an environment error (ie. the Docker images or the Docker Compose configuration). |
Well, you are just one step away now! I think if all publications and subscriptions in a federation are not subscribed and published i.e. they don't all have corresponding matches in other federates in a federation, gridlab-d gives this error. There should be a Python federate in there that will work with just one gridlab-d feeder. Did you try this folder? |
It does seem like you are using Tutorial 1. Let me test locally. |
The three federates are run this way: $ gridlabd DistributionSim_B2_G_1.glm $ python federate1.py $ helics_broker 2 --loglevel=5 |
@kdheepak I got that error w/ GridLAB-D before even starting up the other two federates, so I'm not sure how it can be an issue with federate pub/sub. I'm wondering if something's still just not right w/ the compilation of the GridLAB-D code with HELICS support. |
I can try building the same docker image and try. Should I just follow your instructions? Or if you can send me your image I can try in there. |
I'm running docker-compose now, I'll provide updates on this thread. |
I get the same error:
|
I've not used docker much before. How do I "ssh" into one of these containers? I want to interactively run some commands. |
Is |
The tutorial was set up to be single machine only. |
My docker skills are not up to par, I'm not able to figure out how to combine these into a single docker image. I'm going to leave it here for now, but if you are able to combine it into a single docker instance then this tutorial should work. |
@kdheepak yes, three separate containers are running. Good point on networking. I'll try host networking in the |
Okay, if you are not able to get that to work, we should be able to get it to work using multi-node feature. I think the changes on the broker side and the Python side are trivial, assuming you can ping from one container to another. We will then need to check with @afisher1 for what the status of GridLAB-D multi-node feature is and whether it can be configured using the .json file (and @phlptp for the GridDyn status). |
@kdheepak it looks like the broker listens on ports |
Or wait... maybe it's ports |
That didn't seem to help... with each container set to use host networking, all the containers have direct access to the broker listening at From what I'm needing to do with HELICS, it would be best to get the tutorial working using the multi-node feature anyway, so perhaps we can just work towards that @kdheepak? Is there any documentation around configuring multi-node? |
Excellent question. Unfortunately I haven't put together any official documentation for this yet. A lot of our "documentation" is essentially in the history of the our gitter channel. If you search, you'll be able to find a lot of information regarding this (a little annoying to do that, I know). I've marked the beginning and the end of the relevant conversation I had with @phlptp.
My recommendation is to first try the pi-exchange example instead of the HELICS-Tutorial, i.e. pisender pireceiver helics_broker in three containers. If you can get this to work then it'll help eliminate one level of complexity. We can then try adding GridLAB-D. I'll also work on improving the documentation. |
I would break it down into the following steps. The first step is to do a simple ping between containers. If that works, try running the Python client server ZMQ example in the two containers (Here is a Python2 example that I convert to Python3 everytime I want to do something like this). If this also works, then getting pireceiver and pisender to talk to each other should be straightforward. |
In the pi-exchange example, where is the broker assumed to be listening -- localhost? What port(s) -- How can I configure the Python HELICS library to use something other than localhost? |
Here's what I ran for the example: helics_broker 2 --ipv4 --loglevel=5 In pisender.py change fedinitstring to the following fedinitstring = "--federates=1 --broker_address=tcp://192.168.1.8 --localport=23501 --interface=tcp://192.168.1.9" In pireceiver.py change fedinitstring to the following fedinitstring = "--federates=1 --broker_address=tcp://192.168.1.8 --localport=23504 --interface=tcp://192.168.1.10" This is assuming the helics_broker is run on If you run three containers, you will also have to comment out the following lines where pisender creates the broker and checks that the broker is still connected. If you run three containers, pisender should not start it's own broker, and you have to start the helics_broker separately. Hope that makes sense? If you want to run just two containers, make the change for the broker init string here and run just pireceiver and pisender. Thanks for sticking through this! |
The port numbers don't matter, as long as it is not 23460 or the same port for both pisender and pireceiver. I believe the broker scans multiple ports for connections. I've ran the above example without the |
Thanks @kdheepak, you rock. I'll test this later tonight and report back here. |
If the local port is not specified it, requests an open port number from the broker and then establishes a pull socket on that port. |
and I suspect if they are actually on different machines you could use the same port number if you like. |
Depending on the type of core (e.g., tcp, udp, zmq etc) it may be slightly different. ZmqComms should use the following by default: DEFAULT_BROKER_PULL_PORT_NUMBER = 23405;
DEFAULT_BROKER_REP_PORT_NUMBER = 23404; |
Thx @kdheepak and sorry for not searching the code for that myself... I should look first then ask. |
On the contrary, I think all of this should be in our documentation! Feel free to ask, it also helps us understand what needs to be documented, when we eventually get to it :) |
OK, so I was able to get the |
Still working on Tutorial 1, I think I have the Python federate script updated to correctly connect to the broker running in a separate container (based off what I changed to get the |
This is the JSON file that is read by GridLAB-D. This is where GridLAB-D reads it and uses the information in the file to configure the HELICS GridLAB-D federate. There is a |
@kdheepak thanks for the pointers. It looks to me like |
Dang... I'm not able to trace the code well enough to see exactly how in the HELICS source code the |
For future reference, here's what I'm currently trying for tutorial 1.
The Python federate is able to establish two-way communication with the broker, so I know the networking stuff is OK. But the gridlab-d federate still fails to connect to the broker at all. |
@afisher1 any chance you have some ideas about what I should use in the GridLAB-D JSON config to get GridLAB-D to talk to a HELICS broker that's running on a different host? |
I'm working my way through these tutorials, and rather than dirty up my machine or use a VM I'm attempting to create Docker images for each of the relevant portions of the tutorials and a Docker Compose file to run them. Once I do I'll contribute everything back to this repo.
I'm having some trouble containerizing a few of the components so far, which I thought I would track here.
If anyone here can help me jump start the above two issues I'd appreciate it.
The text was updated successfully, but these errors were encountered: