-
Notifications
You must be signed in to change notification settings - Fork 470
Using python private packages with ssh hangs publishing to function app #1230
Copy link
Copy link
Closed
Description
I have a python function app that I want to publish to Azure Function app. Inside the requirements.txt, I am referencing a private repo, something like:
azure-functions==1.0.0b4
azure-functions-worker==1.0.0b4
azure-storage==0.36.0
grpcio==1.14.2
grpcio-tools==1.14.2
protobuf==3.7.0
six==1.12.0
git+ssh://git@<git-host>/<my-private-repo>.git
I am deploying the function app using travis, like it is described in the doc:
sudo: required
language: python
python:
- '3.6'
node_js:
- '8'
services:
- docker
addons:
ssh_known_hosts: "<git-host>"
before_install:
- openssl aes-256-cbc -K $encrypted_xxx_key -iv $encrypted_xxx_iv -in deploy_key.enc -out deploy_key -d
- eval "$(ssh-agent -s)"
- chmod 600 ./deploy_key
- echo -e "Host *\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
- ssh-add ./deploy_key
- echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ wheezy main" | sudo tee /etc/apt/sources.list.d/azure-cli.list
- curl -L https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
- sudo apt-get install -y apt-transport-https
- sudo apt-get update && sudo apt-get install -y azure-cli
- npm i -g azure-functions-core-tools --unsafe-perm true
script:
- az login --service-principal --username "$APP_ID" --password "$PASSWORD" --tenant "$TENANT_ID"
- func azure functionapp publish <my-func> --build-native-depsDuring the build process in travis, the install step is working fine:
curl -L https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
OK
2.47s$ sudo apt-get install -y apt-transport-https
OK
19.35s$ sudo apt-get update && sudo apt-get install -y azure-cli
OK
9.13s$ npm i -g azure-functions-core-tools --unsafe-perm true
OK
23.08s$ pip install -r requirements.txt
Collecting git+ssh://git@<git-host>/<my-private-repo>.git (from -r requirements.txt (line 8))
Cloning git+ssh://git@<git-host>/<my-private-repo>.git to /tmp/pip-bi7jim1v-build
Warning: Permanently added '[secure],40.68.1.77' (ECDSA) to the list of known hosts.
....
But when reaching the actual deployment part using the docker image, the build steps just hangs there:
Getting site publishing info...
Running 'docker pull mcr.microsoft.com/azure-functions/python:2.0.12410-python3.6-buildenv'............................done
Running 'docker run --rm -d mcr.microsoft.com/azure-functions/python:2.0.12410-python3.6-buildenv sleep infinity'..done
Running 'docker cp "requirements.txt" 50d0e1:"/requirements.txt"'..done
Running 'docker cp "/tmp/tmpwpyCw1.tmp" 50d0e1:"python_docker_build.sh"'..done
Running 'docker exec -t 50d0e1 chmod +x /python_docker_build.sh'..done
Running 'docker exec -t 50d0e1 /python_docker_build.sh'........................................................................................................................................................................................................................................................................................................................................................................................................
The job exceeded the maximum time limit for jobs, and has been terminated.
Is it because the docker container does not have the ssh key to clone the private repo and is also trying to run pip install -r requirements.txt ? is there any way to give arguments to the docker container ? like giving -v ${PWD}/.ssh:/root/.ssh will be enough to pass the ssh key to the container
Reactions are currently unavailable