-
Notifications
You must be signed in to change notification settings - Fork 148
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
Feature Request: Define persistent docker network #525
Comments
Thanks for the feedback and providing the details of your use case. What you're asking for makes total sense and I don't think it would be a huge amount of effort to implement. My initial thought is that we add an additional field when creating a new Polar network. This field would allow you to specify an external Docker network to use. If a value is entered, then it will be paced into the docker-compose.yml file created by Polar, similar to what yo have above. Since the Docker network is external, Docker shouldn't attempt to delete it when stopping the Polar network. Does this sound like a reasonable UX to you? |
Thanks! That sounds fantastic and would be very helpful to me! |
I'm going to take a stab at this. |
@bjarnemagnussen @jamaljsr
|
A branch for testing this prototype is here. @jamaljsr @bjarnemagnussen Looking forward to feedback and suggestions. |
Thanks for the sneak peak @amovfx. I don't think this value needs to be changed multiple times. My suggestion would be to only allow setting this option when the network is initially created. In the New Network form, there could be an Advanced Options collapsed section which contains the checkbox to make the docker network external. What do you think?
Using the network name in the YAML file is a bit risky. The user could put in characters which make the syntax invalid, such as |
From my personal experience, I disagree. I've been in the situation in the past where I have built a network I liked with polar and then decided I needed an external network for further experiments attaching other services.
I like it. I can see this being a bit tricky when working with a lot of networks though. Perhaps this is feature creep, but what do you think of an option in the network hamburger menu, the place where you export the network, an option to copy the external docker network name or display other information? |
I just re-read the initial request and my response. AFAICT the goal is to have Polar use a docker network that has already been pre-created by the user. So they would need to specify the name of the existing network somewhere in Polar. That's why I suggested placing this input on the New Network form. If this is the intent then Polar doesn't need to generate the network name, it's user-specified. This is why I didn't think there was a need to toggle it after the network was created. My initial suggestion was solely focused on @bjarnemagnussen's use case. It sounds like you're solving for a different, but similar, scenario. It would be great if we can tackle both in one update. Maybe it would make sense to add the option to the hamburger dropdown menu labeled "External Docker Network" which would show a modal popup that allows the user to toggle the feature as well as specify the network name. The input could be pre-filled with |
I mis understood as well. Big fan. I'll do this. |
I've updated the workflow. Sorry for the delay. Diablo 4 has captured my attention as of late. I didn't add the placeholder of polar-network-${network.id} instead I let the user know that they can clear, attach or set the network. I'm happy to refill it if you think it's best though. A blank entry clears the network back to default. |
@amovfx Thanks for the update. Can you open a PR so we can discuss the changes there? |
You bet. |
Is your feature request related to a problem? Please describe.
I am trying out LND's remote db backend support (using postgres). However, since I cannot just via the GUI add a postgres service (or any other external service that may be supported in the future) and supporting each such service feels a bit overkill, I was thinking about an easy way to handle this better.
Describe the solution you'd like
It may therefore be nice to be able to define a persistent external docker network that must be used for a Polar environment, instead of Polar creating and deleting a specific default network with each start and stop. This would allow for additional services (e.g. postgres) to be spun up external/independent to Polar, while the nodes in the polar environment can make use of it.
Additional context
Currently I have solved this by creating a standalone docker-compose file that spins up postgres and uses the docker network created by Polar automatically (e.g.
2_default
for environment 2).This requires that I always first start Polar, as otherwise the network will not be created.
When I want to stop the environment I have to first stop postgres, as Polar will try to delete the network it created when pressing the STOP button, which is impossible if any service is still running in this network.
Docker-compose file for my postgres service, which assumes polar network 2 exists:
The text was updated successfully, but these errors were encountered: