Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot build docker image because of a PyYAML issue. #350

Open
cormac-yobota opened this issue Oct 23, 2023 · 0 comments
Open

Cannot build docker image because of a PyYAML issue. #350

cormac-yobota opened this issue Oct 23, 2023 · 0 comments

Comments

@cormac-yobota
Copy link

Looks like the docker build is broken because of a PyYAML issue.

I have cloned the project and when i run docker build . I get the following.

➜  docker build .                                                                                                                                                                                  
Sending build context to Docker daemon  3.072kB                                                       
Step 1/5 : FROM python:3.8.13-alpine3.15                                                                                                                                                                    
 ---> 4f8aa9cb1a05                                                                                    
Step 2/5 : RUN apk add --no-cache python3-dev~3.9 gcc~10 libc-dev~0.7 nodejs~16 npm~8 && rm -rf /var/cache/apk/*                                                                                            
 ---> Using cache                                                                                     
 ---> ee3a1e3e1455
Step 3/5 : RUN pip3 install --upgrade pip
 ---> Using cache
 ---> b53ed27bdc04
Step 4/5 : RUN pip3 install taskcat==0.9.40
 ---> Running in 7a1e8ce3586f
Collecting taskcat==0.9.40
  Downloading taskcat-0.9.40.tar.gz (124 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 124.8/124.8 kB 1.7 MB/s eta 0:00:00
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
  Preparing metadata (pyproject.toml): started
  Preparing metadata (pyproject.toml): finished with status 'done'
Collecting pathspec==0.10.3 (from taskcat==0.9.40)
  Downloading pathspec-0.10.3-py3-none-any.whl (29 kB)
Collecting reprint (from taskcat==0.9.40)
  Downloading reprint-0.6.0-py2.py3-none-any.whl (6.0 kB)
Collecting tabulate<1.0,>=0.8.2 (from taskcat==0.9.40)
  Downloading tabulate-0.9.0-py3-none-any.whl (35 kB)
Collecting cfn-lint<1.0,>=0.72.0 (from taskcat==0.9.40)
  Downloading cfn_lint-0.83.0-py3-none-any.whl.metadata (16 kB)
Requirement already satisfied: setuptools>=40.4.3 in /usr/local/lib/python3.8/site-packages (from taskcat==0.9.40) (57.5.0)
Collecting boto3<2.0,>=1.9.21 (from taskcat==0.9.40)
  Downloading boto3-1.28.68-py3-none-any.whl.metadata (6.7 kB)
Collecting botocore<2.0,>=1.12.21 (from taskcat==0.9.40)
  Downloading botocore-1.31.68-py3-none-any.whl.metadata (6.1 kB)
Collecting yattag<2.0,>=1.10.0 (from taskcat==0.9.40)
  Downloading yattag-1.15.1.tar.gz (28 kB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Collecting PyYAML~=5.1 (from taskcat==0.9.40)
  Downloading PyYAML-5.4.1.tar.gz (175 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 175.1/175.1 kB 2.1 MB/s eta 0:00:00
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'error'
  error: subprocess-exited-with-error
                                                                                                                                                                                                            
  × Getting requirements to build wheel did not run successfully.                                     
  │ exit code: 1                                                                                                                                                                                            
  ╰─> [62 lines of output]                                                                            
      running egg_info                                                                                                                                                                                      
      writing lib3/PyYAML.egg-info/PKG-INFO                                                           
      writing dependency_links to lib3/PyYAML.egg-info/dependency_links.txt                                                                                                                                 
      writing top-level names to lib3/PyYAML.egg-info/top_level.txt                                   
      /tmp/pip-build-env-7mupscpq/overlay/lib/python3.8/site-packages/setuptools/config/setupcfg.py:293: _DeprecatedConfig: Deprecated config in `setup.cfg`                                                
      !!                                                                                              
                  
              ********************************************************************************
              The license_file parameter is deprecated, use license_files instead.
                  
              By 2023-Oct-30, you need to update your project and remove deprecated calls
              or your builds will no longer be supported.
                          
              See https://setuptools.pypa.io/en/latest/userguide/declarative_config.html for details.
              ********************************************************************************
                                        
      !!                                                                                              
        parsed = self.parsers.get(option_name, lambda x: x)(value)
      Traceback (most recent call last):                                                              
        File "/usr/local/lib/python3.8/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()                                                                                      
        File "/usr/local/lib/python3.8/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/usr/local/lib/python3.8/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)                                                                
        File "/tmp/pip-build-env-7mupscpq/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 355, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
        File "/tmp/pip-build-env-7mupscpq/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 325, in _get_build_requires
          self.run_setup()                                                                            
        File "/tmp/pip-build-env-7mupscpq/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 341, in run_setup
          exec(code, locals())                                                                        
        File "<string>", line 271, in <module>                                                        
        File "/tmp/pip-build-env-7mupscpq/overlay/lib/python3.8/site-packages/setuptools/__init__.py", line 103, in setup
          return distutils.core.setup(**attrs)                                                                                                                                                              
        File "/tmp/pip-build-env-7mupscpq/overlay/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 185, in setup                                                                            
          return run_commands(dist)                                                                                                                                                                         
        File "/tmp/pip-build-env-7mupscpq/overlay/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 201, in run_commands                                                                     
          dist.run_commands()                                                                                                                                                                               
        File "/tmp/pip-build-env-7mupscpq/overlay/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands                                                                     
          self.run_command(cmd)                                                                                                                                                                             
        File "/tmp/pip-build-env-7mupscpq/overlay/lib/python3.8/site-packages/setuptools/dist.py", line 989, in run_command                                                                                 
          super().run_command(command)                                                                                                                                                                      
        File "/tmp/pip-build-env-7mupscpq/overlay/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 988, in run_command                                                                      
          cmd_obj.run()                                                                                                                                                                                     
        File "/tmp/pip-build-env-7mupscpq/overlay/lib/python3.8/site-packages/setuptools/command/egg_info.py", line 318, in run                                                                             
          self.find_sources()                                                                                                                                                                               
        File "/tmp/pip-build-env-7mupscpq/overlay/lib/python3.8/site-packages/setuptools/command/egg_info.py", line 326, in find_sources                                                                    
          mm.run()                                                                                    
        File "/tmp/pip-build-env-7mupscpq/overlay/lib/python3.8/site-packages/setuptools/command/egg_info.py", line 548, in run                                                                             
          self.add_defaults()                                                                         
        File "/tmp/pip-build-env-7mupscpq/overlay/lib/python3.8/site-packages/setuptools/command/egg_info.py", line 586, in add_defaults                                                                    
          sdist.add_defaults(self)                                                                    
        File "/tmp/pip-build-env-7mupscpq/overlay/lib/python3.8/site-packages/setuptools/command/sdist.py", line 113, in add_defaults                                                                       
          super().add_defaults()                                                                      
        File "/tmp/pip-build-env-7mupscpq/overlay/lib/python3.8/site-packages/setuptools/_distutils/command/sdist.py", line 251, in add_defaults                                                            
          self._add_defaults_ext()                                                                    
        File "/tmp/pip-build-env-7mupscpq/overlay/lib/python3.8/site-packages/setuptools/_distutils/command/sdist.py", line 336, in _add_defaults_ext
          self.filelist.extend(build_ext.get_source_files())                                  
        File "<string>", line 201, in get_source_files                            
        File "/tmp/pip-build-env-7mupscpq/overlay/lib/python3.8/site-packages/setuptools/_distutils/cmd.py", line 107, in __getattr__
          raise AttributeError(attr)                                                                  
      AttributeError: cython_sources                                                                  
      [end of output]     
                                                                                                                                                                                                            
  note: This error originates from a subprocess, and is likely not a problem with pip.                                                                                                                      
error: subprocess-exited-with-error                                                                                                                                                                         
                                                                                                                                                                                                            
× Getting requirements to build wheel did not run successfully.                                                                                                                                             
│ exit code: 1                                                                                                                                                                                              
╰─> See above for output.                                                                                                                                                                                   
                                                                                                                                                                                                            
note: This error originates from a subprocess, and is likely not a problem with pip.                                                                                                                        
The command '/bin/sh -c pip3 install taskcat==0.9.40' returned a non-zero code: 1                                                                                                                           

I have forked the repo and this can be fixed with the following update to the Dockerfile:

FROM python:3.8.13-alpine3.15

RUN apk add --no-cache python3-dev~3.9 gcc~10 libc-dev~0.7 nodejs~16 npm~8 && rm -rf /var/cache/apk/*

RUN pip3 install --upgrade pip && \
    pip3 install "Cython<3.0" "pyyaml<6" --no-build-isolation && \
    pip3 install taskcat==0.9.23 --upgrade

COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh

COPY dist/index.js /dist/index.js

ENTRYPOINT ["/entrypoint.sh"]

It does look as if the latest version of taskcat will support PyYAML~=6.0 which also fixes the issue, However it hasn't been published yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant