Skip to content

Commit

Permalink
refactor (backend): make use of project_id from app_variant when sett…
Browse files Browse the repository at this point in the history
…ing deployment uri path for docker container
  • Loading branch information
aybruhm committed Sep 24, 2024
1 parent 2704959 commit 920ec3c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions agenta-backend/agenta_backend/services/app_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ async def start_variant(
"http://host.docker.internal" # unclear why this stopped working
)
# domain_name = "http://localhost"

env_vars = {} if env_vars is None else env_vars # type: ignore
env_vars.update(
{
Expand Down
6 changes: 3 additions & 3 deletions agenta-backend/agenta_backend/services/deployment_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ async def start_service(
"""

if isCloudEE():
uri_path = f"{app_variant_db.organization.id}/{app_variant_db.app.app_name}/{app_variant_db.base_name}"
container_name = f"{app_variant_db.app.app_name}-{app_variant_db.base_name}-{app_variant_db.organization.id}"
uri_path = f"{app_variant_db.project_id}/{app_variant_db.app.app_name}/{app_variant_db.base_name}"
container_name = f"{app_variant_db.app.app_name}-{app_variant_db.base_name}-{app_variant_db.project_id}"
else:
uri_path = f"{app_variant_db.project_id}/{app_variant_db.app.app_name}/{app_variant_db.base_name}"
container_name = f"{app_variant_db.app.app_name}-{app_variant_db.base_name}-{app_variant_db.project_id}"
Expand Down Expand Up @@ -137,7 +137,7 @@ async def validate_image(image: Image) -> bool:
raise ValueError(msg)

if isCloudEE():
image = Image(**image.model_dump(exclude={"workspace", "organization"}))
image = Image(**image.model_dump())

if not image.tags.startswith(agenta_registry_repo):
raise ValueError(
Expand Down

0 comments on commit 920ec3c

Please sign in to comment.