-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error in CloudFormation Stack: InvalidVersion Exception in User Data Script #104
Comments
Hello, when you click on the "launch cloudformation" button in the markdown docs, what really happens is that you've being sent to the CF console with a template URL precompiled. You can see the template URL in the first page of the CF wizard, it is this one: https://panorama-starter-kit.s3.amazonaws.com/public/v2/Models/ec2-instance-panorama.yml. Downloading the template file you can see that what it really does is to provision an EC2 instance with an ARM processor in your account, and than executes an shell script in-line directly in the CF template (starting at line 62 in the yaml file). The error is happening in this script. Now, if you open the Just re-executing the script solved my problem. I'll attach the script here for your convenience. #!/bin/bash -xe
HOME=/home/ubuntu
echo $HOME > $HOME/user_data.txt
apt -y update && apt -y upgrade
apt -y install \
wget \
build-essential \
checkinstall \
libreadline-gplv2-dev \
libncursesw5-dev \
libssl-dev \
libsqlite3-dev \
tk-dev \
libgdbm-dev \
libc6-dev \
libbz2-dev \
libffi-dev \
zlib1g-dev \
python3 \
python3-dev \
python3-pip \
python3-numpy \
python3-distutils \
python3-testresources \
cmake \
git \
libgtk2.0-dev \
pkg-config \
libavcodec-dev \
libavformat-dev \
libswscale-dev \
libtbb2 \
libtbb-dev \
libjpeg-dev \
libpng-dev \
libtiff-dev \
libdc1394-22-dev \
protobuf-compiler \
libgflags-dev \
libgoogle-glog-dev \
libblas-dev \
libhdf5-serial-dev \
liblmdb-dev \
libleveldb-dev \
liblapack-dev \
libsnappy-dev \
libprotobuf-dev \
libopenblas-dev \
libboost-dev \
libboost-all-dev \
libeigen3-dev \
libatlas-base-dev \
libne10-10 \
libne10-dev \
curl \
ca-certificates
echo 'installing jupyterlab'
pip3 install -U pip setuptools wheel
pip3 install panoramacli
pip3 install jupyterlab==4.0.9
pip3 install boto3
pip3 install matplotlib
pip3 install 'attrs==23.1.0' --force-reinstall
# https://stackoverflow.com/questions/49911550/how-to-upgrade-disutils-package-pyyaml
pip3 install 'PyYAML==6.0.1' --ignore-installed
pip3 install 'sagemaker==2.200.1'
pip3 install awscli
pip3 install numpy
pip3 install opencv-python boto3
pip3 install neon
# need to split libneon27-dev and libneon27-gnutls-dev into two lines for some dependency issue.
apt -y install libneon27-dev
apt -y install libneon27-gnutls-dev unzip
jupyter lab --generate-config
echo 'cloning sample repository and download video files'
cd
sudo su - ubuntu -c "git clone https://github.com/aws-samples/aws-panorama-samples.git"
wget https://panorama-starter-kit.s3.amazonaws.com/public/v2/Models/sample-videos.zip
sudo su - ubuntu -c "unzip sample-videos.zip"
mv videos/* ./aws-panorama-samples/samples/common/test_utility/videos/
rmdir videos
rm sample-videos.zip
mkdir /opt/aws
mkdir /opt/aws/panorama
mkdir /opt/aws/panorama/logs
mkdir /opt/aws/panorama/storage
echo 'installing neo'
pip3 install dlr==1.10.0
echo 'Install Docker'
apt install \
apt-transport-https \
gnupg \
lsb-release \
docker.io -y
usermod -aG docker ubuntu
sudo -u ubuntu bash -c 'newgrp docker'
aws ecr get-login-password --region us-west-2 | docker login --username AWS --password-stdin 500245141608.dkr.ecr.us-west-2.amazonaws.com
echo "INSTALLATION COMPLETE" > $HOME/INSTALLATION_COMPLETE.txt |
I encountered an issue while launching the samples. The stack is supposed to execute user data code during the instance initialization, but it fails with an error when executing the command tail -f /var/log/cloud-init-output.log. The specific error is as follows:
self.version = parse_version(version) # type: _BaseVersion
File "/usr/local/lib/python3.8/dist-packages/setuptools/_vendor/packaging/version.py", line 56, in parse
return Version(version)
File "/usr/local/lib/python3.8/dist-packages/setuptools/_vendor/packaging/version.py", line 202, in init
raise InvalidVersion(f"Invalid version: '{version}'")
packaging.version.InvalidVersion: Invalid version: '0.8.0-final0'
Cloud-init v. 23.3.1-0ubuntu1
20.04.1 running 'modules:final' at Tue, 03 Sep 2024 09:30:45 +0000. Up 18.54 seconds.20.04.1 finished at Tue, 03 Sep 2024 09:34:51 +0000. Datasource DataSourceEc2Local. Up 264.04 seconds2024-09-03 09:34:51,100 - cc_scripts_user.py[WARNING]: Failed to run module scripts_user (scripts in /var/lib/cloud/instance/scripts)
2024-09-03 09:34:51,100 - util.py[WARNING]: Running module scripts_user (<module 'cloudinit.config.cc_scripts_user' from '/usr/lib/python3/dist-packages/cloudinit/config/cc_scripts_user.py'>) failed
Cloud-init v. 23.3.1-0ubuntu1
The text was updated successfully, but these errors were encountered: