Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 22 additions & 3 deletions coaching/pulumi/__main__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import datetime
import json
from pathlib import Path

import pulumi_aws as aws
import pulumi_docker as docker
Expand All @@ -17,8 +18,12 @@
"api_domain": "api.dev.purposepath.app",
"certificate_output": "apiDev",
"jwt_secret": "purposepath-jwt-secret-dev",
"openai_api_key_secret": "purposepath/dev/openai-api-key",
"google_vertex_credentials_secret": "purposepath/dev/google-vertex-credentials",
"jwt_issuer": "https://api.dev.purposepath.app",
"jwt_audience": "https://dev.purposepath.app",
"account_api_url": "https://api.dev.purposepath.app",
"business_api_base_url": "https://api.dev.purposepath.app/account/api/v1",
"log_level": "INFO",
"ai_debug_logging": "true", # Enable detailed AI execution logging for debugging
},
Expand All @@ -28,8 +33,12 @@
"api_domain": "api.staging.purposepath.app",
"certificate_output": "apiStaging",
"jwt_secret": "purposepath-jwt-secret-staging",
"openai_api_key_secret": "purposepath/staging/openai-api-key",
"google_vertex_credentials_secret": "purposepath/staging/google-vertex-credentials",
"jwt_issuer": "https://api.staging.purposepath.app",
"jwt_audience": "https://staging.purposepath.app",
"account_api_url": "https://api.staging.purposepath.app",
"business_api_base_url": "https://api.staging.purposepath.app/account/api/v1",
"log_level": "INFO",
},
"prod": {
Expand All @@ -38,8 +47,12 @@
"api_domain": "api.purposepath.app",
"certificate_output": "apiProd",
"jwt_secret": "purposepath-jwt-secret-prod",
"openai_api_key_secret": "purposepath/prod/openai-api-key",
"google_vertex_credentials_secret": "purposepath/prod/google-vertex-credentials",
"jwt_issuer": "https://api.purposepath.app",
"jwt_audience": "https://purposepath.app",
"account_api_url": "https://api.purposepath.app",
"business_api_base_url": "https://api.purposepath.app/account/api/v1",
"log_level": "WARNING",
},
}
Expand Down Expand Up @@ -296,15 +309,17 @@

# Build and push Docker image
auth_token = aws.ecr.get_authorization_token()
project_root = Path(__file__).resolve().parents[2]
dockerfile_path = project_root / "coaching" / "Dockerfile"

# Cache-busting: use timestamp to force rebuild
build_timestamp = datetime.datetime.utcnow().isoformat()
build_timestamp = datetime.datetime.now(datetime.UTC).isoformat()

image = docker.Image(
"coaching-image",
build=docker.DockerBuildArgs(
context="../..", # pp_ai directory
dockerfile="../Dockerfile",
context=str(project_root), # pp_ai directory
dockerfile=str(dockerfile_path),
platform="linux/amd64",
args={
"BUILD_TIMESTAMP": build_timestamp, # Force rebuild with timestamp
Expand Down Expand Up @@ -336,6 +351,10 @@
"JWT_SECRET_NAME": stack_config["jwt_secret"],
"JWT_ISSUER": stack_config["jwt_issuer"],
"JWT_AUDIENCE": stack_config["jwt_audience"],
"OPENAI_API_KEY_SECRET": stack_config["openai_api_key_secret"],
"GOOGLE_VERTEX_CREDENTIALS_SECRET": stack_config["google_vertex_credentials_secret"],
"ACCOUNT_API_URL": stack_config["account_api_url"],
"BUSINESS_API_BASE_URL": stack_config["business_api_base_url"],
"AI_DEBUG_LOGGING": stack_config.get(
"ai_debug_logging", "false"
), # Optional, defaults to false
Expand Down
5 changes: 1 addition & 4 deletions coaching/src/api/legacy_dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,9 @@ async def get_template_metadata_repository() -> TemplateMetadataRepository:
TemplateMetadataRepository instance configured with settings
"""
dynamodb = get_dynamodb_resource_singleton()
# Use a dedicated table for template metadata
# For now, using a default name - this should be in settings
table_name = getattr(settings, "template_metadata_table", "prompt_templates_metadata")
return TemplateMetadataRepository(
dynamodb_resource=dynamodb,
table_name=table_name,
table_name=settings.template_metadata_table,
)


Expand Down
Loading
Loading