From 4f6f8a5e1a02a2aa30d86323f5f9879d7ff433fc Mon Sep 17 00:00:00 2001 From: Daniel Sotirhos Date: Mon, 6 Jul 2026 14:04:22 -0700 Subject: [PATCH] [H] Fix: Verbatim PFB manifest fails for some datasets in anvil14 (#8134) --- lambdas/service/.chalice/config.json.template.py | 9 ++++++++- src/azul/infra/terraform.py | 12 ++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/lambdas/service/.chalice/config.json.template.py b/lambdas/service/.chalice/config.json.template.py index 374cd7c836..9967ed57ee 100644 --- a/lambdas/service/.chalice/config.json.template.py +++ b/lambdas/service/.chalice/config.json.template.py @@ -35,7 +35,14 @@ "api_handler": chalice.vpc_lambda_config(app_name), service.generate_manifest.name: { "lambda_timeout": config.service_lambda_timeout, - "lambda_memory_size": 3009 if config.deployment.is_stable else 2048, + # Creating verbatim PFB manifests for large AnVIL datasets + # requires more memory than the default, so we raise it to + # the maximum. + "lambda_memory_size": ( + 10240 if config.deployment.is_stable and config.is_anvil_enabled() + else 3009 if config.deployment.is_stable + else 2048 + ), }, service.update_health_cache.name: { "lambda_memory_size": 160, diff --git a/src/azul/infra/terraform.py b/src/azul/infra/terraform.py index aa79821d90..82cb2ff51f 100644 --- a/src/azul/infra/terraform.py +++ b/src/azul/infra/terraform.py @@ -785,6 +785,18 @@ def resource_items(resource_type: str) -> Iterable[tuple[str, MutableJSON]]: package_zip = str(self.package_zip_path(app_name)) resource['source_code_hash'] = '${filebase64sha256("%s")}' % package_zip resource['filename'] = package_zip + # Creating verbatim PFB manifests for large AnVIL datasets requires + # more ephemeral storage than the default, so we raise it to the + # maximum. We have to inject this here since Chalice doesn't support + # configuring the ephemeral storage. + if ( + app_name == 'service' + and resource_name == f'{app_name}_{config.manifest_sfn}' + and config.deployment.is_stable + and config.is_anvil_enabled() + ): + assert 'ephemeral_storage' not in resource + resource['ephemeral_storage'] = {'size': 10240} # Replace any references to unqualified function ARNs in the OpenAPI # spec emitted by Chalice with references to the alias.