-
Notifications
You must be signed in to change notification settings - Fork 225
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
Fixes local URI for deployments #1695
Conversation
@LucasTrg is attempting to deploy a commit to the mmabrouk's projects Team on Vercel. A member of the Team first needs to authorize it. |
Hi @LucasTrg, thank you for the PR. |
Hey @aakrem ! I appreciate the help I still find it quite odd that the networking would work on your end given the explanation above but I'm quite new to traefik ! |
@LucasTrg thanks for the details. Could you please try the command above to run agenta and see if you are still facing the same issues ? I would like to be sure whether the issue is related to the environment where you are running Agenta or not.
|
Yep, I can report the exact same problem. The URI using host.docker.internal is still not working, plugging in my fix does the job on my system. |
@LucasTrg I've been facing the same issue. The fix above has resolved my issue. |
@bharath97-git When you're saying you can't even access traefik itself, do you mean traefik's dashboard or the reverse proxy ? services:
reverse-proxy:
image: traefik:v2.10
command: --api.dashboard=true --api.insecure=true --providers.docker --entrypoints.web.address=:80
ports:
- "80:80"
- "8080:8080"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
networks:
- agenta-network
restart: always
hw:
image: crccheck/hello-world
ports:"8000:8000"
labels:
- "traefik.http.routers.hw.rule=PathPrefix(`/`)"
- "traefik.http.routers.hw.entrypoints=web"
- "traefik.http.services.hw.loadbalancer.server.port=8000" |
Hello @LucasTrg, This still doesn't allow celery to access the container using the host.docker.internal domain. |
…expected keyword argument 'uri'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey ! I've noticed that the network setup for self hosted agenta had to be fixed in my case, I'm not quite sure this is a shared issue for everyone.
The changes in this PR fixes issues in my case with the celery worker not able to reach deployments during evaluations.
The reasoning is that the deployment URI that are stored in the deploymentDB are of the following form http://{host}/{container_name}/{app_name}/{variant_name} and are resolved when using traefik.
When creating a new deployment, the following rule is added
f"traefik.http.routers.{container_name}.rule": f"Host('{os.environ['BARE_DOMAIN_NAME']}') && PathPrefix('/{uri_path')",
which in the case of a self host adds aHost("localhost")
rule. This will of course fail to resolve from an agenta-backend as it's trying to reach the deployment not fromlocalhost
buthost.docker.internal
.In any case, I don't believe it's necessary to complicate the traefik networking even more as all the deployments, services, etc... are in the same docker network. Instead we can rely on the DNS entries that are automatically managed by docker in a network.
I'm not too familiar with the architectures of the other ways of deploying agenta so feel free to steer this PR any way you'd like
I also took liberty to fix a typo I came across while investigating.