我正在尝试使用bash脚本安装私有github存储库。该脚本执行以下操作:
这一切都是通过生命周期配置在SageMaker AWS EC2实例中发生的。实现看起来像这样:
HOME=/home/ec2-user/
ENVPIP=$HOME/anaconda3/envs/tensorflow2_p36/bin/pip
eval "$(ssh-agent -s)"
ssh-add ${HOME}SageMaker/Setup/id_rsa
yes | $ENVPIP install git+ssh://git@github.com/...
运行此命令,出现以下错误:
ERROR: Command errored out with exit status 128: git clone -q 'ssh://****@github.com/...' /tmp/pip-req-build-ysacff_l Check the logs for full command output.
这是cloudwatch的所有相关输出:
Agent pid 5146
Identity added: /home/ec2-user/SageMaker/Setup/id_rsa (/home/ec2user/SageMaker/Setup/id_rsa)
2020-09-07T17:11:00.605-04:00
Collecting git+ssh://****@github.com/********1/*****-*****Library
Cloning ssh://****@github.com/********1/*****-*****Library to /tmp/pip-req-build-ysacff_l
2020-09-07T17:11:00.605-04:00
Copy
ERROR: Command errored out with exit status 128: git clone -q 'ssh://****@github.com/********1/*****-*****Library' /tmp/pip-req-build-ysacff_l Check the logs for full command output.
this seems like an issue with the cloning protocol,但我找不到与ssh相关的任何东西。
...
yum install git
更新git。显然我的版本是最新的,因此执行此操作会导致相同的错误。curl http://www.google.com
,这产生了一堆html。这样看来,至少在EC2实例启动后,才允许出站流量。curl http://www.google.com
会产生相同的html输出,并且实例可以完美启动。这使我相信,实例启动时确实存在出站流量eval "$(ssh-agent -s)"
和yes | $ENVPIP install git+ssh://git@github.com/...
之间的竞争条件吗?