-
Notifications
You must be signed in to change notification settings - Fork 813
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
NewSDK configurable 'host' #3634
Comments
I don't have a particularly strong objection to making the host configurable, but it feels like even with docker-in-docker you should be able to configure the networking so that the two containers share the same network namespace. I found this medium article that explains How Can Two Containers Communicate Via localhost on Docker? and I've also found some references to using |
To second @roberthbailey - while I'm not familiar with GitLab's CI, I've definitely done For example, this Is run in Google Cloud Build (that is also DIND): As a thought, if you can share how you are running your tests on GitLab CI, we can possibly point out a path through. My gut tells me you may need to call |
Hey folks, thanks for the responses! After doing a bit more reading I think this is not a problem around DIND but rather a particularity of GitLab. That said, I think something along these lines could help in my case: https://docs.gitlab.com/ee/ci/services/#using-services-with-docker-run-docker-in-docker-side-by-side I'll give it a go later today and return with more details. |
Hi again, I've had a look and although I could not go through til the end I'm relatively confident it can work without the custom host, but it's going to affect the way I run the tests anyway. Which btw @markmandel , I've realised I haven't shared yet despite your request, it's been a busy day 😶🌫️ . Basically the way we're running tests is through a dedicated As part of my tests, I have a
My actual Setup:
Teardown:
As I mentioned above, if I go down the GitLab service route, I will then have a single GameServer running alongside my application tests, instead of the ephemeral gameservers that I was aiming to have (I know this is not efficient, but hey test code, I prefer the reliability over the efficiency). I wouldn't suggest the configurable host if it was production code, but since it's the simple server I think I'd like to maintain my request. Otherwise, if you have suggestions to harmonize GitLab's DIND + network host + ephemeral testcontainers I'll be more than happy to test it out! Again thanks for your support 👏 |
Is your feature request related to a problem? Please describe.
I'm using Docker to run containerized GameServers/SDK for local development. I'm also using GitLab's CICD with DIND to run the same automated tests. As part of the tests, we start and
agones-sdk
container inhost
network mode, with tests later creating an SDK client that would be used to test functionality. This sort works well locally. However, the SDK to connect locally (localhost:9357
) won't work on DIND since (docker:9357
) is required. I'm using Golang's SDK.Describe the solution you'd like
I would love to be able to instantiate the SDK with
NewSDK
, and modify the hardcodedlocalhost
. The actual implementation I don't feel strongly about, but for instance options could be:opts
struct with ahost
param.AGONES_SDK_GRPC_HOST
env var and override the host if present. Apparently suggested before for a different SDK: Adding AGONES_SDK_GRPC_HOST to NewSDK #1183Describe alternatives you've considered
I have researches GitLab's DIND capabilities, but my understanding is that the way docker-in-docker works, there's no way around network configuration. The
host
needs to bedocker
.Additional context
None.
The text was updated successfully, but these errors were encountered: