Skip to content
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

Instead of reaching 'controller' as a hostname, will need to reach '172.17.0.1' #17

Closed
maggie44 opened this issue Dec 11, 2020 · 9 comments
Assignees
Labels
priority - high Issues with higher priority priority Issues with priority

Comments

@maggie44
Copy link
Contributor

At the moment, the app calls the Controller API by using http://controller:9090/v1/...

This will need to change to http://172.17.0.1:9090/v1/...

This IP address will always be static, so no risk of it changing.

The difference is caused by the way the networks are setup in the production environment as opposed to the dev environment, and unfortunately we need it to run the prod way as it is required for wifi-connect to work. I have amended the dev-env to reflect the same as the prod environment so can be tested.

@maximilianoertel
Copy link
Member

@Maggie0002 not sure if I got that right: does the dev env still use "controller:9090" or does it use the new production IP as well? I can easily add a conditional to switch the hostname depending on whether the interface runs in production or not, so just need to know

@maggie44
Copy link
Contributor Author

Both prod and dev will now need the ip.

@maximilianoertel maximilianoertel transferred this issue from another repository Jan 16, 2021
@maximilianoertel maximilianoertel added priority Issues with priority priority - high Issues with higher priority labels Jan 16, 2021
@maximilianoertel
Copy link
Member

Just tried to tackle this, but I cannot reach the controller. Even just to try, I added EXPOSE 9090 to the controller Dockerfile.dev and the ports to the docker-compose configuration, and I connect to the controller then using http://controller:9090 but every API route returns a 404.

Can you please check if it works on your side? I didn't touch anything from the controller Docker configuration in this env – just had it temporarily disabled but re-enabled it now in PR #3

@maximilianoertel
Copy link
Member

Okay, wait – I'm an idiot. The endpoints changed and I didn't update them in the backend so obviously some of those returne a 404. 🤦‍♂️ Let me try again…

@maximilianoertel
Copy link
Member

maximilianoertel commented Jan 16, 2021

Impossible for me to connect on http://172.17.0.1:9090/v1/ in the dev env. Is there anything I need to do / configure first @Maggie0002 ?

@maximilianoertel
Copy link
Member

To be clear: I can make the necessary changes in the dev env to get it working on dev and run tests I need to work now. The backend uses the .env file to define which URL it needs to call on the controller, so if it's not working on the dev env right now that's fine for now. We can then just test it on device by changing the env variable in the .env file

@maggie44
Copy link
Contributor Author

maggie44 commented Jan 16, 2021

host.docker.internal for use on Mac, 172.17.01 on Linux.

@maximilianoertel
Copy link
Member

Only works with kubernetes.docker.internal on my mac – probably related to one of the following:

docker/for-mac#2965
docker/for-mac#4442

@maximilianoertel
Copy link
Member

Opened a ticket to document the needed production configurations as those will need to be injected as .env during the build: #17

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority - high Issues with higher priority priority Issues with priority
Projects
None yet
Development

No branches or pull requests

2 participants