Merge pull request #1482 from lleontop/fix_lambda_backend
Change lambda backend to support docker-py dependency changes
This commit is contained in:
commit
2a4f306bef
@ -104,7 +104,7 @@ class _DockerDataVolumeContext:
|
||||
|
||||
# It doesn't exist so we need to create it
|
||||
self._vol_ref.volume = self._lambda_func.docker_client.volumes.create(self._lambda_func.code_sha_256)
|
||||
container = self._lambda_func.docker_client.containers.run('alpine', 'sleep 100', volumes={self.name: '/tmp/data'}, detach=True)
|
||||
container = self._lambda_func.docker_client.containers.run('alpine', 'sleep 100', volumes={self.name: {'bind': '/tmp/data', 'mode': 'rw'}}, detach=True)
|
||||
try:
|
||||
tar_bytes = zip2tar(self._lambda_func.code_bytes)
|
||||
container.put_archive('/tmp/data', tar_bytes)
|
||||
@ -309,7 +309,7 @@ class LambdaFunction(BaseModel):
|
||||
finally:
|
||||
if container:
|
||||
try:
|
||||
exit_code = container.wait(timeout=300)
|
||||
exit_code = container.wait(timeout=300)['StatusCode']
|
||||
except requests.exceptions.ReadTimeout:
|
||||
exit_code = -1
|
||||
container.stop()
|
||||
|
Loading…
Reference in New Issue
Block a user