I'm trying to have a lifecycle configuration that upon startup, will pull the most recent code from a github repo.
I am encountering this error (logged in CloudWatch) on the git pull.
fatal: could not read Username for 'https://github.com/toasttab/midgard': No such device or address
However, as soon as I open a terminal on the server, I am able to git pull without issue. There is no prompt for my credentials when I git pull within terminal.
Here is my lifecycle config:
#!/bin/bash
set -e
sudo -u ec2-user -i <<'EOF'
# enable conda activate & activate python3 env
source ~/anaconda3/etc/profile.d/conda.sh
conda activate python3
# configure git
git config --global user.name "Foo"
git config --global user.email "Foo@Bar.com"
# install all git repo libraries into current env
cd ~/SageMaker/my-repo
git checkout master
git pull
pip install -e .
EOF
Any ideas?