Skip to content

Commit

Permalink
update workload launcher host url
Browse files Browse the repository at this point in the history
  • Loading branch information
kelkawi-a committed Oct 30, 2024
1 parent 8ab7886 commit b5533a8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
11 changes: 8 additions & 3 deletions src/charm_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,13 @@ def create_env(model_name, app_name, container_name, config, state):
secret_persistence = config["secret-persistence"].value

# Some defaults are extracted from Helm chart:
# https://github.com/airbytehq/airbyte-platform/tree/v0.60.0/charts/airbyte
# https://github.com/airbytehq/airbyte-platform/tree/v1.1.0/charts/airbyte
env = {
**BASE_ENV,
# Airbye services config
"LOG_LEVEL": config["log-level"].value,
"TEMPORAL_HOST": config["temporal-host"],
"WEBAPP_URL": config["webapp-url"],
"WORKLOAD_API_HOST": f"{app_name}:{WORKLOAD_API_PORT}",
# Secrets config
"SECRET_PERSISTENCE": secret_persistence,
"SECRET_STORE_GCP_PROJECT_ID": config["secret-store-gcp-project-id"],
Expand Down Expand Up @@ -139,11 +138,17 @@ def create_env(model_name, app_name, container_name, config, state):
"CONNECTOR_BUILDER_SERVER_API_HOST": f"{app_name}:{CONNECTOR_BUILDER_SERVER_API_PORT}",
"CONNECTOR_BUILDER_API_HOST": f"{app_name}:{CONNECTOR_BUILDER_SERVER_API_PORT}",
"AIRBYTE_API_HOST": f"{app_name}:{AIRBYTE_API_PORT}/api/public",
"WORKLOAD_API_HOST": f"{app_name}:{WORKLOAD_API_PORT}",
}

# https://github.com/airbytehq/airbyte/issues/29506#issuecomment-1775148609
if container_name == "airbyte-workload-launcher":
env.update({"INTERNAL_API_HOST": f"http://{app_name}:{INTERNAL_API_PORT}"})
env.update(
{
"INTERNAL_API_HOST": f"http://{app_name}:{INTERNAL_API_PORT}",
"WORKLOAD_API_HOST": f"http://{app_name}:{WORKLOAD_API_PORT}",
}
)

if config["storage-type"].value == StorageType.minio and state.minio:
minio_endpoint = construct_svc_endpoint(
Expand Down
6 changes: 4 additions & 2 deletions tests/unit/test_charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,8 +416,10 @@ def create_plan(container_name, storage_type):
},
}

if container_name == "airbyte-api-server":
want_plan["services"][container_name]["environment"].update({"INTERNAL_API_HOST": "http://airbyte-k8s:8001"})
if container_name == "airbyte-workload-launcher":
want_plan["services"][container_name]["environment"].update(
{"INTERNAL_API_HOST": "http://airbyte-k8s:8001", "WORKLOAD_API_HOST": "http://airbyte-k8s:8007"}
)

if storage_type == StorageType.minio:
want_plan["services"][container_name]["environment"].update(
Expand Down

0 comments on commit b5533a8

Please sign in to comment.