$ python --version
Python 3.6.7
$ pip freeze | grep oto
aiobotocore==0.12.0
boto==2.49.0
boto3==1.12.3
botocore==1.15.3
moto==1.3.14
This comes from a test that uses the moto-server (and it's all running pytest in a container in a gitlab runner that installs everything using poetry). There is an error about a failure to start a job-container, i.e.
2020-02-28 23:28:28 - moto.batch.models - ERROR - Failed to run AWS Batch container MOTO-BATCH-20e9269b-a001-49af-8828-f5031d98104c. Error ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))
Is there a recommended way to enable docker containers to run within a gitlab runner where pytest code calls moto-batch services to run a container for a batch job?
Hi @dazza-codes, the log_stream_name-attribute is only set after a successful run. So that error is only a side effect of the FileNotFound-error, which I think indicates docker can't be started at all.
Can you verify whether Docker is installed and the service is running?
Is it a private GitLab runner, or a shared instance?
I've modified your query to reflect that it's really about Docker failing to start.
Raised a separate issue for the fact that the attribute log_stream_name is never set if the Batch job fails to run.
I'm working on a .gitlab-ci.yml solution that allows docker-in-docker (dind) so that moto-server can try to run containers for batch jobs. It's a bit of a struggle, since dind on gitlab is an alpine base image and I need python 3.6 but apk doesn't have it and the python-3.6:alpine images don't have the dind stuff out of the box. The WIP details are in
Related stuff is also noted in: