Reputation: 1075
In my requirements.txt
I am attempting to download python-ldap==3.2.0
. However, I need these dependencies. How should I download these using Google Build? I tried the following but got the errors:
Step #0 - "Dependency install": E: Unable to locate package libsasl2-dev
Step #0 - "Dependency install": E: Unable to locate package python-dev
Step #0 - "Dependency install": E: Unable to locate package libldap2-dev
Step #0 - "Dependency install": E: Unable to locate package libssl-dev
Step #0 - "Dependency install": Building dependency tree...
Step #0 - "Dependency install": Reading state information...
Finished Step #0 - "Dependency install"
2019/06/14 12:51:21 Step Step #0 - "Dependency install" finished
2019/06/14 12:51:21 status changed to "ERROR"
ERROR
ERROR: build step 0 "ubuntu" failed: exit status 100
2019/06/14 12:51:21 Error updating docker credentials: failed to update docker credentials: signal: killed
2019/06/14 12:51:21 Failed to delete homevol: exit status 1
2019/06/14 12:51:24 Build finished with ERROR status
cloudbuild.yaml
steps:
# Install Dependencies
- name: 'ubuntu'
id: Dependency install
args: ['apt-get', 'install',
'libsasl2-dev', 'python-dev', 'libldap2-dev', 'libssl-dev']
# Install Python Dependencies
- name: 'python'
id: Pip install
args: ['pip3', 'install', '-r', 'requirements.txt', '--user']
Then I tried
- name: 'ubuntu'
id: Dependency install
args: ['apt-get', 'update', '&&', 'apt-get', 'install',
'libsasl2-dev', 'python-dev', 'libldap2-dev', 'libssl-dev']
But that also failed.
Upvotes: 3
Views: 1201
Reputation: 1525
Google Cloud Functions receives only your source code and a requirements.txt
file to indicate which python dependencies it uses.
The GCF manager internally and automatically install those dependencies on the python environment that will run you function, you install system libraries to the GCF environment, but you may use the ones that are available (here is the list). The library libldap2
that you require is not available. So you can open an issue on their issue tracker to ask for it.
Now, although it won't help you, the error on GC Build is happening because only the workspace (the starting working directory and everything inside it) is shared between steps. Each step starts a docker container with the image specified in the name
parameter and with the workspace mounted.
A more obvious demonstration that system changes are not shared is that using Ubuntu in one step, CentOS in another and Alpine in yet another. System libraries for each of them are very different, so they are clearly not shared.
Upvotes: 2