-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make provisioning scripts run in unprivileged mode + more (#17)
* Make provisioning scripts run in unprivileged mode + more * Move install-vscode to home To declutter the Desktop and avoid users just randomly clicking on it * Enable object files clean-up by default * Format files (mostly endlines) * install-su2.sh: group echo commands (shellcheck) * Move the cleanup objects step to post-install * Move cleanup steps to cleanup.sh
- Loading branch information
Showing
17 changed files
with
150 additions
and
142 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env bash | ||
set -ex | ||
|
||
# Cleanup the APT cache to save space | ||
sudo apt-get clean | ||
|
||
# Cleanup all object files from compilation | ||
find /home/vagrant/ -type f -name '*.o' -exec rm -fv {} \; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[Desktop Entry] | ||
Encoding=UTF-8 | ||
Name=Get started | ||
Type=Link | ||
URL=https://precice.org/installation-vm.html | ||
Icon=text-html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,22 @@ | ||
#!/bin/sh | ||
#!/usr/bin/env bash | ||
set -ex | ||
|
||
USER="vagrant" | ||
|
||
# Install dependencies | ||
sudo apt-get install -y libarpack2-dev libspooles-dev libyaml-cpp-dev | ||
|
||
# Install CalculiX | ||
cd /home/${USER}/ | ||
# Install CalculiX | ||
wget --quiet http://www.dhondt.de/ccx_2.16.src.tar.bz2 | ||
tar xvjf ccx_2.16.src.tar.bz2 | ||
tar xvjf ccx_2.16.src.tar.bz2 | ||
|
||
# Get the CalculiX-preCICE adapter | ||
if [ ! -d "calculix-adapter/" ]; then | ||
sudo -u ${USER} git clone --depth=1 --branch master https://github.com/precice/calculix-adapter.git | ||
git clone --depth=1 --branch master https://github.com/precice/calculix-adapter.git | ||
fi | ||
cd calculix-adapter | ||
git pull | ||
sudo -u ${USER} -s bash -c "make -j 2" | ||
( | ||
cd calculix-adapter | ||
git pull | ||
make -j 2 | ||
) | ||
|
||
# Add the CalculiX adapter to PATH | ||
echo "export PATH=\"/home/${USER}/calculix-adapter/bin:\${PATH}\"" >> /home/${USER}/.bashrc | ||
echo "export PATH=\"~/calculix-adapter/bin:\${PATH}\"" >>~/.bashrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,18 @@ | ||
#!/bin/sh | ||
#!/usr/bin/env bash | ||
set -ex | ||
|
||
USER="vagrant" | ||
|
||
# Get the config-visualizer from GitHub | ||
if [ ! -d "config-visualizer/" ]; then | ||
sudo -u ${USER} git clone --depth=1 --branch master https://github.com/precice/config-visualizer.git | ||
git clone --depth=1 --branch master https://github.com/precice/config-visualizer.git | ||
fi | ||
sudo -u ${USER} -s bash -c "pip3 install --user -e config-visualizer" | ||
pip3 install --user -e config-visualizer | ||
|
||
# Add the config-visualizer to PATH | ||
echo "export PATH=\"/home/${USER}/config-visualizer/bin:${PATH}\"" >> /home/${USER}/.bashrc | ||
echo "export PATH=\"~/config-visualizer/bin:\${PATH}\"" >>~/.bashrc | ||
|
||
# By default, there is no `python` executable, there is only `python3`, | ||
# which causes issues to the config-visualizer | ||
apt-get install -y python-is-python3 | ||
sudo apt-get install -y python-is-python3 | ||
|
||
# Install graphviz, which provides dot, an almost required package to make this useful | ||
apt-get install -y graphviz | ||
sudo apt-get install -y graphviz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,20 @@ | ||
#!/bin/sh | ||
#!/usr/bin/env bash | ||
set -ex | ||
|
||
USER="vagrant" | ||
|
||
# Install deal.II from the deal.II 9.2.0 backports PPA | ||
sudo add-apt-repository ppa:ginggs/deal.ii-9.2.0-backports | ||
sudo apt-get update | ||
sudo apt-get install -y libdeal.ii-dev | ||
|
||
# Get the deal.II-preCICE adapter | ||
if [ ! -d "dealii-adapter/" ]; then | ||
sudo -u ${USER} git clone --depth=1 --branch master https://github.com/precice/dealii-adapter.git | ||
git clone --depth=1 --branch master https://github.com/precice/dealii-adapter.git | ||
fi | ||
cd dealii-adapter | ||
git pull | ||
|
||
# Build the linear elasticity solver | ||
cd linear_elasticity | ||
sudo -u ${USER} -s bash -c "cmake . && make -j 2" | ||
( | ||
cd dealii-adapter | ||
git pull | ||
cmake . && make -j 2 | ||
) | ||
|
||
# Build the nonlinear elasticity solver | ||
cd ../nonlinear_elasticity | ||
sudo -u ${USER} -s bash -c "cmake . && make -j 2" | ||
# Add the deal.II adapter to PATH | ||
echo "export PATH=\"~/dealii-adapter:\${PATH}\"" >>~/.bashrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#!/bin/sh | ||
#!/usr/bin/env bash | ||
set -ex | ||
|
||
sudo apt-get install -y git cmake cmake-curses-gui | ||
sudo apt-get install -y build-essential git cmake cmake-curses-gui | ||
|
||
sudo apt-get install -y nano vim gedit | ||
sudo apt-get install -y nano vim gedit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,11 @@ | ||
#!/bin/sh | ||
#!/usr/bin/env bash | ||
set -ex | ||
|
||
USER="vagrant" | ||
|
||
# Install FEniCS from APT | ||
apt-get install -y software-properties-common | ||
add-apt-repository -y ppa:fenics-packages/fenics | ||
apt-get -y update | ||
apt-get -y install --no-install-recommends fenics | ||
sudo apt-get install -y software-properties-common | ||
sudo add-apt-repository -y ppa:fenics-packages/fenics | ||
sudo apt-get -y update | ||
sudo apt-get -y install --no-install-recommends fenics | ||
|
||
# Install the FEniCS-preCICE adapter from PIP | ||
sudo -u ${USER} pip3 install --user fenicsprecice | ||
# Remove a conflicting with the adapter package | ||
pip3 uninstall -y fenics-ufl | ||
pip3 install --user fenicsprecice |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
#!/bin/sh | ||
#!/usr/bin/env bash | ||
set -ex | ||
|
||
USER="vagrant" | ||
|
||
# Install Nutils from PIP (we will also need matplotlib in our examples) | ||
sudo -u ${USER} pip3 install --user matplotlib nutils | ||
pip3 install --user matplotlib nutils |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,22 @@ | ||
#!/bin/sh | ||
#!/usr/bin/env bash | ||
set -ex | ||
|
||
USER="vagrant" | ||
|
||
# Add the signing key, add the repository, update: | ||
wget -q -O - https://dl.openfoam.com/add-debian-repo.sh | sudo bash | ||
|
||
# Install OpenFOAM v2012: | ||
sudo apt-get install -y openfoam2012-dev | ||
openfoam-selector --set openfoam2012 --system | ||
# todo: Somehow the openfoam-selector is not enough - the binaries are discoverable, but the libraries not. Remedy: | ||
echo "source /etc/profile.d/openfoam-selector.sh" >> /home/vagrant/.bashrc | ||
# Enable OpenFOAM by default and apply now: | ||
echo ". /usr/lib/openfoam/openfoam2012/etc/bashrc" >> ~/.bashrc | ||
# shellcheck source=/dev/null | ||
# . /usr/lib/openfoam/openfoam2012/etc/bashrc | ||
|
||
# Get the OpenFOAM-preCICE adapter | ||
if [ ! -d "openfoam-adapter/" ]; then | ||
sudo -u ${USER} git clone --depth=1 --branch master https://github.com/precice/openfoam-adapter.git | ||
git clone --depth=1 --branch master https://github.com/precice/openfoam-adapter.git | ||
fi | ||
cd openfoam-adapter | ||
git pull | ||
sudo -u ${USER} -s bash -l ./Allwmake | ||
( | ||
cd openfoam-adapter | ||
git pull | ||
./Allwmake | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,11 @@ | ||
#!/bin/sh | ||
#!/usr/bin/env bash | ||
set -ex | ||
|
||
USER="vagrant" | ||
|
||
if [ ! -d "paraview" ]; then | ||
mkdir paraview | ||
PARAVIEW_URL="https://www.paraview.org/paraview-downloads/download.php?submit=Download&version=v5.8&type=binary&os=Linux&downloadFile=ParaView-5.8.1-MPI-Linux-Python3.7-64bit.tar.gz" | ||
wget --no-check-certificate --quiet -O - ${PARAVIEW_URL} | tar -xz -C paraview | ||
ln -sf /home/${USER}/paraview/ParaView-5.8.1-MPI-Linux-Python3.7-64bit/bin/paraview /home/${USER}/Desktop/ | ||
chown ${USER}:${USER} /home/${USER}/Desktop/paraview | ||
wget --no-check-certificate --quiet -O - "${PARAVIEW_URL}" | tar -xz -C paraview | ||
ln -sf ~/paraview/ParaView-5.8.1-MPI-Linux-Python3.7-64bit/bin/paraview ~/Desktop/ | ||
# Add ParaView to PATH | ||
echo "export PATH=\"/home/${USER}/paraview/ParaView-5.8.1-MPI-Linux-Python3.7-64bit/bin:\${PATH}\"" >> /home/${USER}/.bashrc | ||
fi | ||
echo "export PATH=\"~/paraview/ParaView-5.8.1-MPI-Linux-Python3.7-64bit/bin:\${PATH}\"" >>~/.bashrc | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,42 @@ | ||
#!/bin/sh | ||
#!/usr/bin/env bash | ||
set -ex | ||
|
||
USER="vagrant" | ||
|
||
# Get preCICE dependencies | ||
apt-get install -y build-essential cmake libeigen3-dev libxml2-dev libboost-all-dev petsc-dev python3-dev python3-numpy | ||
sudo apt-get install -y cmake libeigen3-dev libxml2-dev libboost-all-dev petsc-dev python3-dev python3-numpy | ||
|
||
# Get preCICE from GitHub: | ||
# - Always get the latest master, no need for versioning | ||
# - Build in Debug mode, so that users can report bugs | ||
if [ ! -d "precice/" ]; then | ||
sudo -u ${USER} git clone --depth=1 --branch master https://github.com/precice/precice.git | ||
git clone --depth=1 --branch master https://github.com/precice/precice.git | ||
fi | ||
( | ||
cd precice | ||
git pull | ||
sudo -u ${USER} -s bash -c "mkdir build && cd build/ && rm -fv *.deb && cmake -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Debug .. && make -j 2 && make package" | ||
apt-get install -y ./build/libprecice2_*.deb | ||
fi | ||
mkdir -p build && cd build/ | ||
cmake -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Debug -Wno-dev .. | ||
make -j 2 | ||
rm -fv ./*.deb && make package | ||
sudo apt-get install -y ./libprecice2_*.deb | ||
) | ||
|
||
# Collect examples | ||
cd /home/${USER}/Desktop | ||
sudo -u ${USER} cp -r /usr/share/precice/examples/ . | ||
if [ ! -d "tutorials/" ]; then | ||
sudo -u ${USER} git clone --branch master https://github.com/precice/tutorials.git | ||
fi | ||
cd - | ||
# Collect examples and tutorials | ||
cp -r /usr/share/precice/examples/ ./precice-examples | ||
if [ ! -d "tutorials/" ]; then | ||
git clone --depth=1 --branch master https://github.com/precice/tutorials.git | ||
ln -sf ~/tutorials ~/Desktop/ | ||
fi | ||
|
||
### OPTIONAL - preCICE Python bindings and Python example | ||
# Get PIP and the preCICE Python bindings | ||
sudo apt-get install -y python3-pip | ||
sudo -u ${USER} pip3 install --upgrade pip | ||
sudo -u ${USER} pip3 install --user pyprecice | ||
pip3 install --upgrade pip | ||
pip3 install --user pyprecice | ||
|
||
# Get the Python solverdummy into the examples | ||
cd /home/${USER}/Desktop | ||
if [ ! -d "python-bindings/" ]; then | ||
sudo -u ${USER} git clone --branch master https://github.com/precice/python-bindings.git | ||
fi | ||
sudo -u ${USER} cp -r python-bindings/solverdummy/ examples/solverdummies/python/ | ||
sudo rm -r python-bindings | ||
cd - | ||
### | ||
if [ ! -d "python-bindings/" ]; then | ||
git clone --depth=1 --branch master https://github.com/precice/python-bindings.git | ||
fi | ||
cp -r python-bindings/solverdummy/ precice-examples/solverdummies/python/ | ||
rm -r python-bindings | ||
### |
Oops, something went wrong.