@@ -71,19 +71,20 @@ def set_up(self) -> None:
7171
7272 def gather_resources (self ) -> None :
7373 """Build function and ZIP it into a temp file in self._zip_file"""
74- builder = ApplicationBuilder (
75- self ._build_context .collect_build_resources (self ._function_identifier ),
76- self ._build_context .build_dir ,
77- self ._build_context .base_dir ,
78- self ._build_context .cache_dir ,
79- cached = False ,
80- is_building_specific_resource = True ,
81- manifest_path_override = self ._build_context .manifest_path_override ,
82- container_manager = self ._build_context .container_manager ,
83- mode = self ._build_context .mode ,
84- )
85- LOG .debug ("%sBuilding Function" , self .log_prefix )
86- self ._artifact_folder = builder .build ().get (self ._function_identifier )
74+ with self ._get_lock_chain ():
75+ builder = ApplicationBuilder (
76+ self ._build_context .collect_build_resources (self ._function_identifier ),
77+ self ._build_context .build_dir ,
78+ self ._build_context .base_dir ,
79+ self ._build_context .cache_dir ,
80+ cached = False ,
81+ is_building_specific_resource = True ,
82+ manifest_path_override = self ._build_context .manifest_path_override ,
83+ container_manager = self ._build_context .container_manager ,
84+ mode = self ._build_context .mode ,
85+ )
86+ LOG .debug ("%sBuilding Function" , self .log_prefix )
87+ self ._artifact_folder = builder .build ().get (self ._function_identifier )
8788
8889 zip_file_path = os .path .join (tempfile .gettempdir (), "data-" + uuid .uuid4 ().hex )
8990 self ._zip_file = make_zip (zip_file_path , self ._artifact_folder )
@@ -134,4 +135,7 @@ def sync(self) -> None:
134135 os .remove (self ._zip_file )
135136
136137 def _get_resource_api_calls (self ) -> List [ResourceAPICall ]:
137- return []
138+ resource_calls = list ()
139+ for layer in self ._function .layers :
140+ resource_calls .append (ResourceAPICall (layer .full_path , ["Build" ]))
141+ return resource_calls
0 commit comments