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

not compatible with Google Cloud Containers #348

Closed
artooro opened this issue Nov 6, 2014 · 6 comments
Closed

not compatible with Google Cloud Containers #348

artooro opened this issue Nov 6, 2014 · 6 comments
Assignees
Labels
packaging 🚨 This issue needs some love. triage me I really want to be triaged.

Comments

@artooro
Copy link

artooro commented Nov 6, 2014

I'm using the google/python-runtime Docker image to run an app on Google Managed VMs, and need to access the datastore. The obvious solution seems to be gcloud-python as it's so much easier to use than the datastore python library.

So here's what happens. In my requirements.txt file I have:
httplib2
tornado
gcloud

PIP installs everything OK except it fails when installing cffi. Here is a log:

Processing cffi-0.8.6.tar.gz

Writing /tmp/easy_install-MCEL5F/cryptography-0.6.1/temp/easy_install-ZPcCkB/cffi-0.8.6/setup.cfg

Running cffi-0.8.6/setup.py -q bdist_egg --dist-dir /tmp/easy_install-MCEL5F/cryptography-0.6.1/temp/easy_install-ZPcCkB/cffi-0.8.6/egg-dist-tmp-fmCpCO

compiling '_configtest.c':

__thread int some_threadlocal_variable_42;



gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -c _configtest.c -o _configtest.o

success!

removing: _configtest.c _configtest.o

c/_cffi_backend.c:13:17: fatal error: ffi.h: No such file or directory

compilation terminated.

Traceback (most recent call last):

  File "<string>", line 17, in <module>

  File "/env/build/gcloud/setup.py", line 49, in <module>

    'Topic :: Internet',

  File "/usr/lib/python2.7/distutils/core.py", line 112, in setup

    _setup_distribution = dist = klass(attrs)

  File "/env/local/lib/python2.7/site-packages/setuptools/dist.py", line 260, in __init__

    self.fetch_build_eggs(attrs.pop('setup_requires'))

  File "/env/local/lib/python2.7/site-packages/setuptools/dist.py", line 285, in fetch_build_eggs

    replace_conflicting=True

  File "/env/local/lib/python2.7/site-packages/pkg_resources.py", line 631, in resolve

    dist = best[req.key] = env.best_match(req, ws, installer)

  File "/env/local/lib/python2.7/site-packages/pkg_resources.py", line 871, in best_match

    return self.obtain(req, installer)

  File "/env/local/lib/python2.7/site-packages/pkg_resources.py", line 883, in obtain

    return installer(requirement)

  File "/env/local/lib/python2.7/site-packages/setuptools/dist.py", line 335, in fetch_build_egg

    return cmd.easy_install(req)

  File "/env/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 595, in easy_install

    return self.install_item(spec, dist.location, tmpdir, deps)

  File "/env/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 625, in install_item

    dists = self.install_eggs(spec, download, tmpdir)

  File "/env/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 822, in install_eggs

    return self.build_and_install(setup_script, setup_base)

  File "/env/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1028, in build_and_install

    self.run_setup(setup_script, setup_base, args)

  File "/env/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1013, in run_setup

    run_setup(setup_script, args)

  File "/env/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 50, in run_setup

    lambda: execfile(

  File "/env/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 100, in run

    return func()

  File "/env/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 52, in <lambda>

    {'__file__':setup_script, '__name__':'__main__'}

  File "setup.py", line 338, in <module>



  File "/usr/lib/python2.7/distutils/core.py", line 112, in setup

    _setup_distribution = dist = klass(attrs)

  File "/env/local/lib/python2.7/site-packages/setuptools/dist.py", line 260, in __init__

    self.fetch_build_eggs(attrs.pop('setup_requires'))

  File "/env/local/lib/python2.7/site-packages/setuptools/dist.py", line 285, in fetch_build_eggs

    replace_conflicting=True

  File "/env/local/lib/python2.7/site-packages/pkg_resources.py", line 631, in resolve

    dist = best[req.key] = env.best_match(req, ws, installer)

  File "/env/local/lib/python2.7/site-packages/pkg_resources.py", line 871, in best_match

    return self.obtain(req, installer)

  File "/env/local/lib/python2.7/site-packages/pkg_resources.py", line 883, in obtain

    return installer(requirement)

  File "/env/local/lib/python2.7/site-packages/setuptools/dist.py", line 335, in fetch_build_egg

    return cmd.easy_install(req)

  File "/env/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 595, in easy_install

    return self.install_item(spec, dist.location, tmpdir, deps)

  File "/env/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 625, in install_item

    dists = self.install_eggs(spec, download, tmpdir)

  File "/env/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 822, in install_eggs

    return self.build_and_install(setup_script, setup_base)

  File "/env/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1028, in build_and_install

    self.run_setup(setup_script, setup_base, args)

  File "/env/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1016, in run_setup

    raise DistutilsError("Setup script exited with %s" % (v.args[0],))

distutils.errors.DistutilsError: Setup script exited with error: command 'gcc' failed with exit status 1

----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /env/build/gcloud
Storing debug log for failure in /root/.pip/pip.log

This is kind of a road block for me, is there anything that can be done to make it installable on google containers?

@tseaver
Copy link
Contributor

tseaver commented Nov 6, 2014

FWIW, cffi is an indirect dependency (via pyOpenSSL and cryptography), which are required to make the OAuth flows work.

@dhermes
Copy link
Contributor

dhermes commented Nov 6, 2014

@artooro You need to apt-get install libffi-dev (and maybe also libffi6).


As for this library:

We could (should) make the crypto stuff a conditional dependency just like it is in oauth2client:
https://github.com/google/oauth2client/blob/7d3b1ae4f7a87de20dcf2a7e9517479cda6311dc/oauth2client/client.py#L43

Compare:
https://github.com/google/oauth2client/blob/7d3b1ae4f7a87de20dcf2a7e9517479cda6311dc/setup.py#L34
https://github.com/GoogleCloudPlatform/gcloud-python/blob/01a1eeab3d6d66acf4a6b83fb476a48a4c8c0247/setup.py#L20

With that fix, you'd need to get a token from the environment, which might be possible?

@silvolu
Copy link
Contributor

silvolu commented Nov 6, 2014

#335 will fix all of this, also enabling support for Compute Engine Service Accounts (no need for keys).

@artooro for the time being you should use a custom dockerfile and follow @dhermes instructions.

@artooro
Copy link
Author

artooro commented Nov 6, 2014

I'll use the suggestion from @dhermes to install the required packages. Thanks!

@dhermes
Copy link
Contributor

dhermes commented Nov 6, 2014

@artooro That's great!

The missing ffi.h file may not be the only issue, though adding libffi-dev will likely fix the cffi install issue. If you encounter more, please post here so we can have a better idea of what we're up against.

@artooro
Copy link
Author

artooro commented Nov 6, 2014

I added this to my Dockerfile with success:

RUN apt-get install -y libffi-dev
RUN /env/bin/pip install gcloud

Note: Can't have gcloud in requirements.txt because it is processed by the docker image before it runs the apt-get install.

@dhermes dhermes closed this as completed Nov 6, 2014
@jgeewax jgeewax modified the milestone: Core Stable Jan 30, 2015
@yoshi-automation yoshi-automation added triage me I really want to be triaged. 🚨 This issue needs some love. labels Apr 7, 2020
atulep pushed a commit that referenced this issue Apr 3, 2023
)

Source-Link: googleapis/synthtool@7804ade
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:eede5672562a32821444a8e803fb984a6f61f2237ea3de229d2de24453f4ae7d
atulep pushed a commit that referenced this issue Apr 6, 2023
)

Source-Link: googleapis/synthtool@7804ade
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:eede5672562a32821444a8e803fb984a6f61f2237ea3de229d2de24453f4ae7d
atulep pushed a commit that referenced this issue Apr 6, 2023
)

Source-Link: googleapis/synthtool@7804ade
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:eede5672562a32821444a8e803fb984a6f61f2237ea3de229d2de24453f4ae7d
atulep pushed a commit that referenced this issue Apr 18, 2023
)

Source-Link: googleapis/synthtool@7804ade
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:eede5672562a32821444a8e803fb984a6f61f2237ea3de229d2de24453f4ae7d
parthea added a commit that referenced this issue Jun 4, 2023
* chore(python): drop python 3.6

Source-Link: googleapis/synthtool@4f89b13
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:e7bb19d47c13839fe8c147e50e02e8b6cf5da8edd1af8b82208cd6f66cc2829c

* require python 3.7+ in setup.py

* remove python 3.6 sample configs

* add api_description to .repo-metadata.json

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Anthonios Partheniou <partheniou@google.com>
parthea pushed a commit that referenced this issue Jun 4, 2023
Source-Link: https://togithub.com/googleapis/synthtool/commit/92006bb3cdc84677aa93c7f5235424ec2b157146
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:2e247c7bf5154df7f98cce087a20ca7605e236340c7d6d1a14447e5c06791bd6
parthea pushed a commit that referenced this issue Jun 4, 2023
* chore: use gapic-generator-python 0.65.2

PiperOrigin-RevId: 444333013

Source-Link: googleapis/googleapis@f91b6cf

Source-Link: googleapis/googleapis-gen@16eb360
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMTZlYjM2MDk1YzI5NGU3MTJjNzRhMWJmMjM1NTA4MTdiNDIxNzRlNSJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
parthea pushed a commit that referenced this issue Jun 4, 2023
…mplates/python_library/.kokoro (#348)

Source-Link: googleapis/synthtool@30bd01b
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:9bc5fa3b62b091f60614c08a7fb4fd1d3e1678e326f34dd66ce1eefb5dc3267b

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
parthea pushed a commit that referenced this issue Jun 4, 2023
Source-Link: googleapis/synthtool@c4dd595
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:ce3c1686bc81145c81dd269bd12c4025c6b275b22d14641358827334fddb1d72
parthea pushed a commit that referenced this issue Jul 6, 2023
…348)

Source-Link: googleapis/synthtool@8e55b32
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:c6c965a4bf40c19011b11f87dbc801a66d3a23fbc6704102be064ef31c51f1c3
parthea pushed a commit that referenced this issue Sep 22, 2023
- [ ] Regenerate this pull request now.

PiperOrigin-RevId: 451250442

Source-Link: googleapis/googleapis@cca5e81

Source-Link: googleapis/googleapis-gen@0b219da
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMGIyMTlkYTE2MWE4YmRjYzNjNmY3YjJlZmNkODIxMDUxODJhMzBjYSJ9
parthea pushed a commit that referenced this issue Sep 22, 2023
* feat: add edition/autoscale related fields

PiperOrigin-RevId: 518584143

Source-Link: googleapis/googleapis@e4a7ae6

Source-Link: googleapis/googleapis-gen@f3e8c09
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZjNlOGMwOWQxMGM4NTlmZjRlMjY3YjdlMWEzYmNhZWNjNTZkNWJlZiJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
parthea added a commit that referenced this issue Sep 22, 2023
* chore: delete duplicates
Merge branch 'owl-bot-copy' of https://github.com/googleapis/python-dataproc into owl-bot-copy

🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

chore: use gapic-generator-python 0.63.4

chore: fix snippet region tag format
chore: fix docstring code block formatting
PiperOrigin-RevId: 430730865

Source-Link: googleapis/googleapis@ea58002

Source-Link: googleapis/googleapis-gen@ca893ff
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiY2E4OTNmZjhhZjI1ZmM3ZmUwMDFkZTE0MDVhNTE3ZDgwNDQ2ZWNjYSJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* remove redundant samples

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Anthonios Partheniou <partheniou@google.com>
parthea pushed a commit that referenced this issue Sep 22, 2023
…348)

Source-Link: https://togithub.com/googleapis/synthtool/commit/395d53adeeacfca00b73abf197f65f3c17c8f1e9
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:6c1cbc75c74b8bdd71dada2fa1677e9d6d78a889e9a70ee75b93d1d0543f96e1
parthea pushed a commit that referenced this issue Sep 22, 2023
Source-Link: https://togithub.com/googleapis/synthtool/commit/d0f51a0c2a9a6bcca86911eabea9e484baadf64b
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:240b5bcc2bafd450912d2da2be15e62bc6de2cf839823ae4bf94d4f392b451dc
parthea pushed a commit that referenced this issue Sep 22, 2023
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
parthea added a commit that referenced this issue Sep 22, 2023
* chore(deps): update all dependencies

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* Update setup.py

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Anthonios Partheniou <partheniou@google.com>
parthea added a commit that referenced this issue Oct 21, 2023
Co-authored-by: Anthonios Partheniou <partheniou@google.com>
parthea pushed a commit that referenced this issue Oct 21, 2023
* Python code samples migrated to python-doc-samples

For more details, please check GoogleCloudPlatform/python-docs-samples#8529 and http://b/257074849

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
parthea pushed a commit that referenced this issue Oct 21, 2023
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
parthea added a commit that referenced this issue Oct 21, 2023
fix(deps): require proto-plus>=1.15.0
parthea pushed a commit that referenced this issue Oct 21, 2023
Source-Link: https://togithub.com/googleapis/synthtool/commit/d0f51a0c2a9a6bcca86911eabea9e484baadf64b
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:240b5bcc2bafd450912d2da2be15e62bc6de2cf839823ae4bf94d4f392b451dc
parthea pushed a commit that referenced this issue Oct 21, 2023
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
parthea added a commit that referenced this issue Oct 21, 2023
fix(deps): require proto-plus>=1.15.0
parthea pushed a commit that referenced this issue Oct 22, 2023
)

Source-Link: googleapis/synthtool@7804ade
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:eede5672562a32821444a8e803fb984a6f61f2237ea3de229d2de24453f4ae7d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
packaging 🚨 This issue needs some love. triage me I really want to be triaged.
Projects
None yet
Development

No branches or pull requests

6 participants