nrdg/cloudknot

BuildError 2.0

Closed this issue · 5 comments

36000 commented

When trying to run pyafq with cloudknot I get this error:

BuildError: The command '/bin/sh -c pip install --no-cache-dir -r /tmp/requirements.txt     && pip install --no-cache-dir git+https://github.com/bloomdt-uw/pyAFQ.git@enh-callosum-rois' returned a non-zero code: 1

I looked at requirements.txt, and tried to pip install it in a temporary docker container based on python:3.8 . It gets this error:

ERROR: Cannot install boto3==1.16.30 and s3fs because these package versions have conflicting dependencies.

The contents of requirements.txt are:

cloudpickle==1.6.0
s3fs==0.5.1
numpy==1.19.4
boto3==1.16.30

My guess is the latest boto3 and s3fs are conflicting, and that's causing the problem. But I could be wrong. Also, if I am right, then I am not sure why the error just started happening today, because I think boto3 would have to go all the way back to 1.14 to start playing nice with s3fs.

The imports in the function I am passing into the knot look like this:

    import logging
    import s3fs

    from AFQ.data import fetch_hcp
    import AFQ.api as api
    import AFQ.mask as afm
    import numpy as np
    import os.path as op

I realize that you mentioned that you were building off of a Python 3.8 image. Is there any chance that this has to do with the recent release of Python 3.9? I ran into some gnarly dependency issues because of that last week (not on CK, just using conda locally).

36000 commented

It's possible. Numpy also recently upgraded to not support 3.6 anymore. I have tried using 3.7, 3.8, and 3.9 as base images, all with the same result.

36000 commented

Here is the full error:

---------------------------------------------------------------------------
BuildError                                Traceback (most recent call last)
<ipython-input-13-6130c613b3e8> in <module>
      8     volume_size=64,
      9     max_vcpus=256,
---> 10     memory=128000)

~/cloudknot/cloudknot/cloudknot.py in __init__(self, name, pars, pars_policies, docker_image, base_image, func, image_script_path, image_work_dir, image_github_installs, username, repo_name, image_tags, job_definition_name, job_def_vcpus, memory, retries, compute_environment_name, instance_types, min_vcpus, max_vcpus, desired_vcpus, volume_size, image_id, ec2_key_pair, bid_percentage, job_queue_name, priority, aws_resource_tags)
   1484 
   1485             self._docker_image, self._docker_repo, repo_cleanup = futures[
-> 1486                 "docker-image"
   1487             ].result()
   1488 

~/miniconda3/envs/afq/lib/python3.7/concurrent/futures/_base.py in result(self, timeout)
    433                 raise CancelledError()
    434             elif self._state == FINISHED:
--> 435                 return self.__get_result()
    436             else:
    437                 raise TimeoutError()

~/miniconda3/envs/afq/lib/python3.7/concurrent/futures/_base.py in __get_result(self)
    382     def __get_result(self):
    383         if self._exception:
--> 384             raise self._exception
    385         else:
    386             return self._result

~/miniconda3/envs/afq/lib/python3.7/concurrent/futures/thread.py in run(self)
     55 
     56         try:
---> 57             result = self.fn(*self.args, **self.kwargs)
     58         except BaseException as exc:
     59             self.future.set_exception(exc)

~/cloudknot/cloudknot/cloudknot.py in set_dockerimage(knot_name, input_docker_image, func_, script_path, work_dir, base_image_, github_installs, username_, tags, repo_name_)
   1411 
   1412                 if not di.images:
-> 1413                     di.build(tags=tags)
   1414                     mod_logger.info(
   1415                         "knot {name:s} built docker image {i!s}"

~/cloudknot/cloudknot/dockerimage.py in build(self, tags, image_name)
    640                 path=self.build_path,
    641                 dockerfile=self.docker_path,
--> 642                 tag=im["name"] + ":" + im["tag"],
    643             )
    644 

~/miniconda3/envs/afq/lib/python3.7/site-packages/docker/models/images.py in build(self, **kwargs)
    285         for chunk in internal_stream:
    286             if 'error' in chunk:
--> 287                 raise BuildError(chunk['error'], result_stream)
    288             if 'stream' in chunk:
    289                 match = re.search(

BuildError: The command '/bin/sh -c pip install --no-cache-dir -r /tmp/requirements.txt     && pip install --no-cache-dir git+https://github.com/bloomdt-uw/pyAFQ.git@enh-callosum-rois' returned a non-zero code: 1
36000 commented

Here is the docker trace:

Sending build context to Docker daemon  10.24kB
Step 1/8 : FROM python:3.8
 ---> ffb0799a2ad9
Step 2/8 : COPY requirements.txt /tmp/
 ---> 6e87d1f39e7c
Step 3/8 : RUN pip install --no-cache-dir -r /tmp/requirements.txt     && pip install --no-cache-dir git+https://github.com/bloomdt-uw/pyAFQ.git@enh-callosum-rois
 ---> Running in 301bfe3958da
Collecting boto3==1.16.30
  Downloading boto3-1.16.30-py2.py3-none-any.whl (129 kB)
Collecting cloudpickle==1.6.0
  Downloading cloudpickle-1.6.0-py3-none-any.whl (23 kB)
Collecting numpy==1.19.4
  Downloading numpy-1.19.4-cp38-cp38-manylinux2010_x86_64.whl (14.5 MB)
Collecting s3fs==0.5.1
  Downloading s3fs-0.5.1-py3-none-any.whl (21 kB)
Collecting aiobotocore>=1.0.1
  Downloading aiobotocore-1.1.2-py3-none-any.whl (45 kB)
  Downloading aiobotocore-1.1.1-py3-none-any.whl (45 kB)
  Downloading aiobotocore-1.1.0-py3-none-any.whl (43 kB)
  Downloading aiobotocore-1.0.7-py3-none-any.whl (42 kB)
  Downloading aiobotocore-1.0.6-py3-none-any.whl (42 kB)
  Downloading aiobotocore-1.0.5-py3-none-any.whl (42 kB)
  Downloading aiobotocore-1.0.4-py3-none-any.whl (41 kB)
  Downloading aiobotocore-1.0.3-py3-none-any.whl (40 kB)
  Downloading aiobotocore-1.0.2-py3-none-any.whl (40 kB)
  Downloading aiobotocore-1.0.1-py3-none-any.whl (40 kB)
INFO: pip is looking at multiple versions of <Python from Requires-Python> to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of s3fs to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of numpy to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of cloudpickle to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of boto3 to determine which version is compatible with other requirements. This could take a while.
ERROR: Cannot install -r /tmp/requirements.txt (line 3) and s3fs because these package versions have conflicting dependencies.

The conflict is caused by:
    boto3 1.16.30 depends on botocore<1.20.0 and >=1.19.30
    aiobotocore 1.1.2 depends on botocore<1.17.45 and >=1.17.44
    boto3 1.16.30 depends on botocore<1.20.0 and >=1.19.30
    aiobotocore 1.1.1 depends on botocore<1.17.45 and >=1.17.44
    boto3 1.16.30 depends on botocore<1.20.0 and >=1.19.30
    aiobotocore 1.1.0 depends on botocore<1.17.45 and >=1.17.44
    boto3 1.16.30 depends on botocore<1.20.0 and >=1.19.30
    aiobotocore 1.0.7 depends on botocore<1.15.33 and >=1.15.32
    boto3 1.16.30 depends on botocore<1.20.0 and >=1.19.30
    aiobotocore 1.0.6 depends on botocore<1.15.33 and >=1.15.32
    boto3 1.16.30 depends on botocore<1.20.0 and >=1.19.30
    aiobotocore 1.0.5 depends on botocore<1.15.33 and >=1.15.32
    boto3 1.16.30 depends on botocore<1.20.0 and >=1.19.30
    aiobotocore 1.0.4 depends on botocore<1.15.33 and >=1.15.32
    boto3 1.16.30 depends on botocore<1.20.0 and >=1.19.30
    aiobotocore 1.0.3 depends on botocore<1.15.33 and >=1.15.32
    boto3 1.16.30 depends on botocore<1.20.0 and >=1.19.30
    aiobotocore 1.0.2 depends on botocore<1.15.33 and >=1.15.32
    boto3 1.16.30 depends on botocore<1.20.0 and >=1.19.30
    aiobotocore 1.0.1 depends on botocore<1.15.33 and >=1.15.32

To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/user_guide/#fixing-conflicting-dependencies
The command '/bin/sh -c pip install --no-cache-dir -r /tmp/requirements.txt     && pip install --no-cache-dir git+https://github.com/bloomdt-uw/pyAFQ.git@enh-callosum-rois' returned a non-zero code: 1