Skip to content
This repository has been archived by the owner on Sep 27, 2023. It is now read-only.

Commit

Permalink
Update setup-Linux-amzn-2.sh (#1033)
Browse files Browse the repository at this point in the history
* Update setup-Linux-amzn-2.sh

* update python3.9.6 installation

* update mono installation

* update converter support and latex installation

* append global variable PATH=PATH=/usr/local/bin into /etc/profile. This file is a place for ec2 to hold global variable

* try the final test

* set environment variable  in ec2

* update AWS ec2 reposity step in README

* update EC2 installation process in README.md

* modify README.md

* update installation process in README.md

* fix typo

* update comment

Co-authored-by: Catzzz <chuneleu@gmail.com>
  • Loading branch information
David P. Chassin and catzzz authored Jan 10, 2022
1 parent 13db67f commit 422e47c
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 13 deletions.
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,21 @@ Normally on Linux and Mac OS X developers should use the `install.sh` script to
host% git clone https://github.com/slacgismo/gridlabd gridlabd
host% gridlabd/install.sh
~~~

### AWS EC2 Installation
1) Set the path variable
~~~
host% sudo su
host% export PATH=/usr/local/bin:$PATH
~~~
2) Change work dictionary and clone GitHub repository
~~~
host% cd /usr/local/src
host% git clone https://github.com/slacgismo/gridlabd gridlabd
~~~
3) Run installation
~~~
host% gridlabd/install.sh
~~~
To rebuild the source code and install again, use the `make system` command. You can use parallel builds using the `make -j<nproc> system` command.

If you have modified the branch name or version information, you must reconfigure your build using the `make reconfigure` command before using `make system`.
Expand Down
51 changes: 39 additions & 12 deletions build-aux/setup-Linux-amzn-2.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
#!/bin/bash
#
# Install script for Amazon EC2 instance
#

# Set environment variable in EC2.
# In order to set the environment variable permanently, the system needs to be rebooted after the first time run this code.
# The other way around is to run `export PATH=/usr/local/bin:$PATH` before run `./install.sh` in the command line.
# The temporary `PATH` will be generated and used for installation.
# The `PATH` will be set permanently because of running `echo "export PATH=/usr/local/bin:$PATH" >> /etc/profile.d/setVars.sh`

echo "export PATH=/usr/local/bin:$PATH" >> /etc/profile.d/setVars.sh && \
source /etc/profile.d/setVars.sh

chmod -R 775 /usr/local
chown -R root:adm /usr/local
Expand All @@ -16,8 +24,8 @@ yum -q install ncurses-devel -y
yum -q install libcurl-devel -y

# python3.9.x support needed as of 4.2
if [ ! -x /usr/local/bin/python3 -o $(/usr/local/bin/python3 --version | cut -f-2 -d.) != "Python 3.9" ]; then
yum install openssl-devel bzip2-devel libffi-devel zlib-devel -q -y
if [ ! -x /usr/local/bin/python3 -o "$(/usr/local/bin/python3 --version | cut -f2 -d.)" != "Python 3.9" ]; then
yum install openssl-devel bzip2-devel libffi-devel zlib-devel xz-devel -q -y
cd /usr/local/src
curl https://www.python.org/ftp/python/3.9.6/Python-3.9.6.tgz | tar xz
cd Python-3.9.6
Expand All @@ -30,17 +38,29 @@ if [ ! -x /usr/local/bin/python3 -o $(/usr/local/bin/python3 --version | cut -f-
ln -sf /usr/local/bin/idle3.9 /usr/local/bin/idle
ln -sf /usr/local/bin/pip3.9 /usr/local/bin/pip3
curl -sSL https://bootstrap.pypa.io/get-pip.py | /usr/local/bin/python3
/usr/local/bin/python3 pip -m install mysql-connector mysql-client matplotlib numpy pandas Pillow networkx
#/usr/local/bin/python3 pip -m install mysql-connector mysql-client matplotlib numpy pandas Pillow networkx
/usr/local/bin/python3 -m pip install matplotlib Pillow pandas numpy networkx pytz pysolar PyGithub scikit-learn xlrd boto3
/usr/local/bin/python3 -m pip install IPython censusdata
fi


# mono
if [ ! -f /usr/bin/mono ]; then
rpmkeys --import "http://pool.sks-keyservers.net/pks/lookup?op=get&search=0x3fa7e0328081bff6a14da29aa6a19b38d3d831ef"
curl https://download.mono-project.com/repo/centos7-stable.repo > /etc/yum.repos.d/mono-centos7-stable.repo
yum -q install mono-devel -y
echo "Install mono"
cd ~
wget https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/Packages/l/libpng15-1.5.30-13.fc35.x86_64.rpm
yum install -y ~/downloads/mono_dependencies/libpng15-1.5.30-13.fc35.x86_64.rpm
yum install yum-utils
rpm --import "http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF"
yum-config-manager --add-repo http://download.mono-project.com/repo/centos/
yum clean all
yum makecache
yum install mono-complete -y
cd ~
rm -rf /tmp/mono_deps
fi

# natural_docs
# # natural_docs
if [ ! -x /usr/local/bin/natural_docs ]; then
cd /usr/local
curl https://www.naturaldocs.org/download/natural_docs/2.0.2/Natural_Docs_2.0.2.zip > natural_docs.zip
Expand All @@ -52,8 +72,15 @@ mono /usr/local/natural_docs/NaturalDocs.exe \$*' > /usr/local/bin/natural_docs
chmod a+x /usr/local/bin/natural_docs
fi

# converter support
# cd /tmp
# curl http://download-ib01.fedoraproject.org/pub/epel/7/x86_64/Packages/m/mdbtools-0.7.1-3.el7.x86_64.rpm > mdbtools-0.7.1-3.el7.x86_64.rpm
# rpm -Uvh mdbtools-0.7.1-3.el7.x86_64.rpm
# # converter support

echo "Install support"
cd ~
amazon-linux-extras install epel -y
yum-config-manager --enable epel
yum -q install mdbtools -y

# # #latex
echo "Install latex"
yum -q install texlive -y

0 comments on commit 422e47c

Please sign in to comment.