|
1 | 1 | import aws_cdk as cdk |
| 2 | +from aws_cdk.aws_scheduler_alpha import ScheduleExpression |
2 | 3 |
|
3 | 4 | from openchallenges.bucket_stack import BucketStack |
4 | 5 | from openchallenges.network_stack import NetworkStack |
5 | 6 | from openchallenges.ecs_stack import EcsStack |
6 | 7 | from openchallenges.service_stack import ServiceStack |
7 | 8 | from openchallenges.service_stack import LoadBalancedServiceStack |
8 | 9 | from openchallenges.load_balancer_stack import LoadBalancerStack |
9 | | -from openchallenges.service_props import ServiceProps |
| 10 | +from openchallenges.service_props import ServiceProps, ContainerVolume |
| 11 | +from openchallenges.data_integration_stack import DataIntegrationStack |
| 12 | +from openchallenges.data_integration_props import DataIntegrationProps |
10 | 13 | import openchallenges.utils as utils |
11 | 14 |
|
12 | 15 | app = cdk.App() |
13 | 16 |
|
14 | 17 | # get the environment |
15 | 18 | environment = utils.get_environment() |
16 | 19 | stack_name_prefix = f"openchallenges-{environment}" |
17 | | -image_version = "0.0.11" |
| 20 | +image_version = "1.1.1" |
18 | 21 |
|
19 | 22 | # get VARS from cdk.json |
20 | 23 | env_vars = app.node.try_get_context(environment) |
|
45 | 48 | "MARIADB_PASSWORD": secrets["MARIADB_PASSWORD"], |
46 | 49 | "MARIADB_ROOT_PASSWORD": secrets["MARIADB_ROOT_PASSWORD"], |
47 | 50 | }, |
| 51 | + container_volumes=[ |
| 52 | + ContainerVolume( |
| 53 | + path="/data/db", |
| 54 | + size=30, |
| 55 | + ) |
| 56 | + ], |
48 | 57 | ) |
49 | 58 |
|
50 | 59 | mariadb_stack = ServiceStack( |
|
297 | 306 | f"ghcr.io/sage-bionetworks/openchallenges-app:{image_version}", |
298 | 307 | { |
299 | 308 | "API_DOCS_URL": f"https://{fully_qualified_domain_name}/api-docs", |
300 | | - "APP_VERSION": "1.0.0-alpha", |
| 309 | + "APP_VERSION": image_version, |
301 | 310 | "CSR_API_URL": f"https://{fully_qualified_domain_name}/api/v1", |
302 | | - "DATA_UPDATED_ON": "2024-10-11", |
| 311 | + "DATA_UPDATED_ON": "2024-11-27", |
303 | 312 | "ENVIRONMENT": "production", |
304 | 313 | "GOOGLE_TAG_MANAGER_ID": "GTM-NBR5XD8C", |
305 | 314 | "SSR_API_URL": "http://openchallenges-api-gateway:8082/api/v1", |
|
322 | 331 | app, f"{stack_name_prefix}-load-balancer", network_stack.vpc |
323 | 332 | ) |
324 | 333 |
|
| 334 | +data_integration_props = DataIntegrationProps( |
| 335 | + schedule=ScheduleExpression.cron( |
| 336 | + minute="*/5", |
| 337 | + hour="*", |
| 338 | + day="*", |
| 339 | + month="*", |
| 340 | + time_zone=cdk.TimeZone.AMERICA_LOS_ANGELES, |
| 341 | + ), |
| 342 | + schedule_description="This is a cron-based schedule that will run every 5 minutes", |
| 343 | +) |
| 344 | +data_integration_stack = DataIntegrationStack( |
| 345 | + app, f"{stack_name_prefix}-data-integration", data_integration_props |
| 346 | +) |
| 347 | + |
325 | 348 | api_docs_props = ServiceProps( |
326 | 349 | "openchallenges-api-docs", |
327 | 350 | 8010, |
|
0 commit comments