Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Can';t pip使用bash脚本安装私有Github repo_Bash_Git_Github_Amazon Ec2_Amazon Sagemaker - Fatal编程技术网

Can';t pip使用bash脚本安装私有Github repo

Can';t pip使用bash脚本安装私有Github repo,bash,git,github,amazon-ec2,amazon-sagemaker,Bash,Git,Github,Amazon Ec2,Amazon Sagemaker,我正试图用bash脚本安装一个私有的github repo。该脚本执行以下操作: 确保有一个ssh代理处于活动状态 从内存的持久部分添加ssh密钥 尝试安装github repo 这一切都是通过生命周期配置在SageMaker AWS EC2实例中发生的。实现如下所示: HOME=/home/ec2-user/ ENVPIP=$HOME/anaconda3/envs/tensorflow2_p36/bin/pip eval "$(ssh-agent -s)" ssh-a

我正试图用bash脚本安装一个私有的github repo。该脚本执行以下操作:

  • 确保有一个ssh代理处于活动状态
  • 从内存的持久部分添加ssh密钥
  • 尝试安装github repo
这一切都是通过生命周期配置在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.
调查了一下,但我找不到任何与ssh相关的东西


附笔。
  • 在航站楼工程中运行相同的几条线路
  • 我检查了repo的url,直接找到了它,所以我认为在

更新:
  • 尝试使用
    yum安装git
    更新git。显然,我的版本是最新的,所以这样做会导致相同的错误
  • 我注释掉了pip安装,以便EC2实例能够成功启动,然后运行
    curlhttp://www.google.com
    ,这导致了一堆html。看来,至少在EC2实例引导之后,出站流量是允许的
  • 运行
    curlhttp://www.google.com
    在bash脚本中(生命周期配置,有问题的代码被注释掉)会产生相同的html输出,并且实例可以完美地启动。这让我相信,在实例启动时确实允许出站流量
  • 很多人都看过这个问题,但没有人回答。我并没有采用我试图安装回购协议的具体方式,所以如果有任何可行的替代方案,我很乐意接受它们
  • 有没有可能我遇到了与其他系统的竞争条件?这是在实例启动时发生的。他们是否有办法检查所有相关系统是否都在运行
  • 在做其他事情时,在控制台中,我得到了相同的错误。我重新初始化了ssh代理,添加了密钥,它成功了。我想知道这是否是
    eval“$(ssh-agent-s)”
    yes |$ENVPIP install git之间的竞争条件+ssh://git@github.com/…

请显示日志。此外,您的实例是否可以发送出站流量?也许可以试试卷曲http://example.com?我添加了cloudwatch输出,但我不确定如何
检查日志以获得完整的命令输出。
在启动失败的EC2实例上。目前正在处理卷曲,我将把它添加到更新中EC2实例上git的版本是什么?公共还是私有repo?如果是公共的,为什么不尝试回购协议的
https://
版本而不是
ssh://
版本呢?如果是私有的,则使用ssh-vvv-T进行调试git@github.org