-
-
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) * Move install-vscode to home * Enable object files clean-up by default * Move cleanup steps to cleanup.sh * Add GitHub action to lint shell scripts (#18) * Add GitHub action for vagrant up + a few fixes (#19) * Add code_aster (#20) * Disable screensaver and screen lock (#21) * Update README, add instructions for testing * Add alias for config-visualizer
- Loading branch information
Showing
21 changed files
with
333 additions
and
146 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Build and package | ||
on: | ||
pull_request: | ||
types: [ready_for_review] | ||
jobs: | ||
vagrant-up: | ||
runs-on: macos-10.15 | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Cache Vagrant boxes | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.vagrant.d/boxes | ||
key: ${{ runner.os }}-vagrant-${{ hashFiles('Vagrantfile') }} | ||
restore-keys: | | ||
${{ runner.os }}-vagrant- | ||
- name: Show Vagrant version | ||
run: vagrant --version | ||
|
||
- name: Run vagrant up | ||
run: vagrant up | ||
|
||
- name: Package Vagrant box | ||
run: vagrant package --base "preCICE-VM" --output preCICE.box | ||
|
||
- name: Generate Vagrant box SHA256 hash | ||
run: shasum -a 256 preCICE.box | ||
|
||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: precice-vagrant-box | ||
path: preCICE.box | ||
retention-days: 7 | ||
|
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,12 @@ | ||
name: Lint scripts | ||
on: [push, pull_request] | ||
jobs: | ||
check_shell: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v2 | ||
- name: Lint shell scripts (shellcheck) | ||
uses: ludeeus/action-shellcheck@master | ||
with: | ||
ignore: Vagrantfile |
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,12 @@ | ||
# preCICE config visualizer | ||
function config-visualizer-pdf(){ | ||
cat $1 | precice-config-visualizer | dot -Tpdf > precice-config.pdf | ||
} | ||
|
||
function config-visualizer-svg(){ | ||
cat $1 | precice-config-visualizer | dot -Tsvg > precice-config.svg | ||
} | ||
|
||
function config-visualizer(){ | ||
cat $1 | precice-config-visualizer | dot -Tpng > precice-config.png | ||
} |
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}" -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,23 @@ | ||
#!/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 | ||
rm -fv 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=\"\${HOME}/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 |
---|---|---|
@@ -0,0 +1,77 @@ | ||
#!/usr/bin/env bash | ||
set -ex | ||
|
||
# Install dependencies | ||
sudo apt-get install -y bison cmake make flex g++ gcc gfortran \ | ||
grace liblapack-dev libblas-dev \ | ||
libboost-numpy-dev libboost-python-dev \ | ||
python3 python3-dev python3-numpy \ | ||
tk zlib1g-dev | ||
|
||
# Install code_aster 14.6 - skip to save time if target dir exists | ||
if [ ! -d "code_aster/" ]; then | ||
wget --quiet https://www.code-aster.org/FICHIERS/aster-full-src-14.6.0-1.noarch.tar.gz | ||
tar xvzf aster-full-src-14.6.0-1.noarch.tar.gz && rm -fv aster-full-src-14.6.0-1.noarch.tar.gz | ||
( | ||
cd aster-full-src-14.6.0 | ||
yes | python3 setup.py install --prefix="${HOME}/code_aster" | ||
) | ||
echo ". ${HOME}/code_aster/etc/codeaster/profile.sh" >>~/.bashrc | ||
rm -rf ./aster-full-src-14.6.0/ | ||
fi | ||
|
||
# Get the code_aster-preCICE adapter | ||
if [ ! -d "code_aster-adapter/" ]; then | ||
git clone --depth=1 --branch master https://github.com/precice/code_aster-adapter.git | ||
fi | ||
( | ||
cd "${HOME}/code_aster/14.6/lib/aster/Execution" | ||
ln -sf "${HOME}/code_aster-adapter/cht/adapter.py" . | ||
) | ||
|
||
# Optional: Update the tutorials exchange directory (needs to be absolute) and generate the export file. | ||
( | ||
cd "${HOME}/tutorials/flow-over-heated-plate-steady-state" | ||
|
||
sed -i "s|exchange-directory=\"..\"|exchange-directory=\"$(pwd)\"|g" precice-config.xml | ||
|
||
cd ./solid-codeaster | ||
if [ ! -f "solid.export" ]; then | ||
{ | ||
echo "P actions make_etude" | ||
echo "P aster_root /code_aster" | ||
echo "P consbtc oui" | ||
echo "P debug nodebug" | ||
echo "P display precicevm:0" | ||
echo "P follow_output yes" | ||
echo "P mclient precicevm" | ||
echo "P memjob 524288" | ||
echo "P memory_limit 512.0" | ||
echo "P mode interactif" | ||
echo "P ncpus 1" | ||
echo "P nomjob linear-thermic" | ||
echo "P origine salomemeca_asrun 1.10.0" | ||
echo "P protocol_copyfrom asrun.plugins.server.SCPServer" | ||
echo "P protocol_copyto asrun.plugins.server.SCPServer" | ||
echo "P protocol_exec asrun.plugins.server.SSHServer" | ||
echo "P rep_trav /tmp/root-23129e00f0db-interactif_4800" | ||
echo "P serveur localhost" | ||
echo "P soumbtc oui" | ||
echo "P time_limit 600.0" | ||
echo "P tpsjob 11" | ||
echo "P uclient precicevm" | ||
echo "P username precicevm" | ||
echo "P version stable" | ||
echo "A memjeveux 64.0" | ||
echo "A tpmax 600.0" | ||
echo "F comm ${HOME}/code_aster-adapter/cht/adapter.comm D 1" | ||
echo "F libr $(pwd)/config.comm D 90" | ||
echo "F libr $(pwd)/def.comm D 91" | ||
echo "F mmed $(pwd)/solid.mmed D 20" | ||
echo "R repe $(pwd)/REPE_OUT D 0" | ||
echo "R repe $(pwd)/REPE_OUT R 0" | ||
echo "F mess $(pwd)/solid.mess R 6" | ||
echo "F resu $(pwd)/solid.resu R 8" | ||
} >>solid.export | ||
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,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=\"\${HOME}/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 |
Oops, something went wrong.