-
Notifications
You must be signed in to change notification settings - Fork 89
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
Export web.* host environment variables #382
Comments
Correct me if I'm wrong @lyondhill, but you wouldn't actually want the IP of your web container. You'd want the IP of portal (the router), which acts as the http endpoint for your web. We auto-generate the |
You wouldn't have Portal with |
Correct. I could use |
Ah, gotcha. In that case a web container wouldn't be created either, so to hit the app with an http requests, you'd have to have the "Env IP". This is currently available in the |
we are not currently creating evars in data components. I believe the hook structure does not support this behavior. Adding the ENV_HOST (in a run that is the running container and in dry-run it is the portal vm) would work. The other idea of adding WEB_*_HOST wont work since we need the data components up before we can start the webs/workers. It is a chicken egg problem. |
I see the problem here. You cannot inject environment variables into containers after they have been started? |
Although it is possible to inject env vars into the container we made a decision not to since that would require all the data components to be reconfigured. And at that point a failure in a the reconfigure would be nearly impossible to undo. |
There's no mechanism for adding env vars to an already-running system; they're handled by the shell, which means (at the very minimum) restarting the shell, and all its child processes - including your server process(es) - to bring in those new values. For many engines, the environment is only consulted on the first run, and ignored after that, so even then the changes would be ignored. That, I'm sure, is part of why the current architecture actually requires a full rebuild to get the updated env vars into your components. It would probably be a good idea to add the ENV_HOST var, though, since that should be known before even the data components come up... Also, as a side note, the only reason a data component is in need of such values in this case is because there are no local-only component types - this one is being used to bring in Docker images for testing purposes (though there are other potential uses of such containers, of course). |
It would be useful if there where
WEB_*_HOST
environment variables in addition to the existingDATA_*_HOST
environment variables.Background: I'm trying to use Nanobox to run acceptance tests using Selenium. Adding a data component for selenium was easy (see #365):
Afterwards I see a
DATA_CHROME_HOST
environment variable in my app container. This is good to instruct my testing framework (CodeCeption) how to talk to Selenium via the WebDriver protocol.However, I'd also need a way to expose the IP address of the app container with its running web server to the Selenium container since Chrome needs to perform HTTP requests against the app container.
Thus basically an environment variable
WEB_SITE_HOST
(for a componentweb.site
) needs to be exported in thedata.chrome
container. These are the environment variables currently available within data containers:(Taken from a
mysql
container, consoling into custom containers currently does not work, see #383)The text was updated successfully, but these errors were encountered: