Commit 0773e2d5 authored by Guillaume Mella's avatar Guillaume Mella
Browse files

Initial commit

parents
1.5:d7af5964-4707-45ea-9f46-cee58e6d4112
\ No newline at end of file
1504621116
\ No newline at end of file
d7af5964-4707-45ea-9f46-cee58e6d4112
\ No newline at end of file
ba869c11938a4c9e82beb978d5ae977c
\ No newline at end of file
-----BEGIN RSA PRIVATE KEY-----
MIIEpAIBAAKCAQEA1WTBAzft3Y3cd8fKGwCEQ1TVzLGzd/tyk38XpJT4XVD2cjcu
DxvJHrVaO7ajS5HG8TD4OQM5xhwvtukzSB4BIHWpcX3uF4uOp3vt6yU5b0K/lRI0
NIIsyXNaem6Od3FnwLEg9B9WV5HRlyUMm/Pj+i7zzlhRsSxxUy0dR6SnL/eb+jnj
Y3p+YDTBUnfColZGovwv6qEau1BLmS2fpGoBAbrEh2TIlFRyEdXsJ7qGF8R9EIMQ
/JTXtuIzx9mxFaB3TJ9s4Qe9p6xR9FqrLLkLH8cnu3RyuE2tmaI69p9taUe9f2kE
v0lXki0aAP5IR2UzrDBV44HLwlBwGArJbObcpQIDAQABAoIBAQDH3iml4RGqrP9t
NTTIG7DF+8SQh3QoEdxb5/L2FQ2XIYjiq2o5fnXejE+qlELYOf7S02H6zFmlg6rx
L/T3PBskEvCUuzVw2ibQGhRaZTApVKRqdHVvJOnb+W4qNDi+CPr7kSvjWyKcvJhJ
b8simsnR/34dq71AK/csx5mgC8kH87TXMQEp7ndsLUw1358SmUgKA9W8PSIP53YK
bxQFFy5z//Ng7vT3ZFQaQKcS27lRSxdYimCmvUUlLTrlT2Y25eJIujWB3urtBfIn
qNQDQTK+JMOjRoL1Lsh2vfboZQLqiuQVOLtL4dQmMKjA8BHsxrgl5H3kxsMya53P
cVS42ighAoGBAP2wnRVFNvLDL5A6Roj6Hmq189Ae2frsT2FZ39gBc/y411i7k2i+
oAQn1RBMKBIkUO9IGTjNxOId7UBJkPQDeLxQvuhZxyMtWcEOt9qU1E3mnUNXUdHT
yDBSnwXDaLLHtEzJxyZcv7bsPibWMXQp8okP7JQ/XtU6MFvjhzqQj59JAoGBANdW
NDo8Rs0TWQ9EPf/yz5jiIJXP/qqLpbFw244oVGkOfrjPTIKFCX1SYE76opRkvPTv
K+C6USzxW63yhioIhEUIz90faI3Ib+vyFLjLwNSypBGkLFhI779sj++Hng+kG7bO
sZ5feua3nxao/i/79tOt5jIMafZbFqX8aDcf12Z9AoGALGtHJdlHpLv+UP+TKBq7
Rq3zMcalHiVQRNhqtDSU7XQj6Jp3VgjCldevm7np7jtDnJIAMIz+4ySgTPhUlBUj
h72Pn7lQf91J8N613GTgw38UnBzm65lsXOGqjGTJqTwEWsmdwB7PRqUYwM4SPKe3
mr4aC18JKMaWfxBYti1nqFkCgYEAihRU2SLdo5LMgOWZfA4O4FHf4zDEdEenr+hW
YQmrVtJcn9UNkoQMWbgA2aQNrGoMYGMdF7VhaBg8WYYyUbG0XzAPWhNRz9i/K+TH
NNgyhjEm08kaRmI+mdjbUxT7Xbw1qTtQ2eUPwfHsqXMjy1EeLQ5NlbowGDDAjR8V
FIPuc2ECgYB0o1a7pKlcE4gVgFwrpnFff7MBoBZ/5CWiT78cOQONQZRTFiRwPWcU
B3GlsYe0CQ04ZW9+q66E5FxzleJ6U8ZxsQ3uxmITAT+g4O49SHffsbxOtW2dfwP4
ry6qXy/DZICjLCSAcDVsgluSk50PCdkQFlBdnTQ/2gUZ5Nh1xdg94Q==
-----END RSA PRIVATE KEY-----
/home/mellag/Projects/ees17-school-vagrant
\ No newline at end of file
# Generated by Vagrant
default ansible_ssh_host=127.0.0.1 ansible_ssh_port=2222 ansible_ssh_user='vagrant' ansible_ssh_private_key_file='/home/mellag/Projects/ees17-school-vagrant/.vagrant/machines/default/virtualbox/private_key'
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.provider :virtualbox do |vb|
vb.memory = 2048
vb.cpus = 2
vb.gui = true
vb.customize ["modifyvm", :id, "--vram", "16"]
end
config.vm.box = "debian/stretch64"
config.vm.synced_folder '.', '/vagrant', disabled: true
config.vm.network "forwarded_port", guest: 80, host: 8081
config.vm.provision :ansible do |ansible|
# ansible.verbose = "vvv"
ansible.playbook = "ees17-playbook.yml"
end
end
---
# role to setup material required by EES17 tutorials
# visit for more details on the school : https://hraetoile2017.sciencesconf.org/
#
# 1. TP sur les perturbations atmosphériques et les techniques de traitement d’image (Frantz)
# . Images dominées par la diffraction. Limitations & solutions. Introduction aux cours suivants.
# 2. TP sur les données SPHERE (Eric)
# 3. TPs basés sur le MOOC de F. Martinache et les outils du « Jean-Marie Mariotti Center » (JMMC). Réduction et reconstruction d’image avec GRAVITY (Anthony & Florentin)
#
#
# prerequisites :
# run : ansible-galaxy install williamyeh.oracle-java
# copy jdk-8u144-linux-x64.tgz in ./files/
# run : ansible-galaxy install PeterMosmans.virtualbox-guest
- hosts: all
become: yes
vars:
# for williamyeh.oracle-java
java_download_from_oracle: false
java_install_jce: false
jdk_tarball_file: jdk-8u144-linux-x64
java_version: 8
java_subversion: 144
# for PeterMosmans.virtualbox-guest
# auto didn't work on 4.3... because debian's virtual box output returns 4.3.36_Debian (a pull request has been issued)
# jessie-backport can install 5.1.8_Debianr111374 but additional guest iso does not compile on debian stretch (5.1.26 is fine)
virtualbox_version: 5.1.26
virtualbox_x11: true
# for this playbook
user_login: ees17
sph_kit: spher-kit-0.24.0
sph_kit_tgz: "{{ sph_kit }}.tar.gz"
sph_kit_url: "ftp://ftp.eso.org/pub/dfs/pipelines/sphere/{{ sph_kit_tgz }}"
gather_facts: true
tasks:
- name: "Install owncloud from their repo"
block:
- apt_key : url="http://download.opensuse.org/repositories/isv:ownCloud:desktop/Debian_9.0/Release.key"
- apt_repository: repo="deb http://download.opensuse.org/repositories/isv:/ownCloud:/desktop/Debian_9.0/ /" filename="owncloud-client" update_cache="yes"
- apt: name="owncloud-client"
# - name: update apt cache
#apt: update_cache=yes
- name: "Install required system packages"
apt: name={{ item }}
with_items:
- xfce4
- xfce4-xkb-plugin
- xscreensaver
- firefox-esr-l10n-fr
- libx11-dev
- xemacs21
- vim-gui-common
- curl
- include_role:
name: PeterMosmans.virtualbox-guest
- include_role:
name: williamyeh.oracle-java
- name: "Install gravity pipeline"
include_role:
name: eso-pipeline-gravity
- name: "Install Sphere pipeline (http://www.eso.org/sci/software/pipelines/sphere/)"
block:
- apt: name={{ item }}
with_items:
- python-matplotlib
- python-wxgtk3.0
- python-astropy
- python-numpy
# - default-jre we prefer to install an oracle jvm before
- pkg-config
- g++
- zlib1g-dev
- make
- gzip
- tar
- yorick
- yorick-yeti
- yorick-optimpack
- shell: curl -O "{{ sph_kit_url }}"
args:
chdir: "/tmp"
- shell: tar xzf {{ sph_kit_tgz }}
args:
chdir: "/tmp"
- file: path="/usr/local/share/man/man1" state=directory # install_pipeline pre-requisite
- shell: echo \n | ./install_pipeline
args:
chdir: "/tmp/{{sph_kit}}"
- name: "Install system packages required by LITpro"
apt: name={{ item }} state=present
with_items:
- xsltproc
- xmlstarlet
- name: alternatives link for "xmlstarlet"
alternatives:
name: xml
link: /usr/bin/xml
path: "/usr/bin/xmlstarlet"
- user:
name: "{{ user_login}}"
comment: "{{ user_login | upper}} roscoff tutorial user"
uid: 1111
shell: /bin/bash
group: sudo
password: $6$DRXV8l4dQ59oXrCN$yodKJoBvN8a4cPwF4kyBTOh92utPlJJzlyUemIsordmMWiPABIVRIgfuiS80ln1yNSC0.0jJrKulacsT01Xsn/
- name: 'Account settings (PATH/bin screensaver)'
blockinfile:
dest: "/home/ees17/.bashrc"
block: |
export PATH="$PATH:$HOME/bin"
#
xset -dpms
xset s noblank
xset s off
# TODO : fix it, it does not work !!!
- name: 'Perform custom replacements'
replace:
dest: "{{item.dest}}"
regexp: "{{ item.regexp }}"
replace: "{{ item.replace }}"
with_items:
- {dest: "/etc/lightdm/lightdm.conf",regexp: "#autologin-user=",replace: "autologin-user=ees17",reason: "Auto login"}
- {dest: "/etc/default/keyboard",regexp: 'XKBLAYOUT="us"',replace: 'XKBLAYOUT="fr,us"',reason: "add fr layout in keyboard"}
- name: "Install required science packages"
apt: name={{ item }} state=present
with_items:
#apt: name={{ item }} state=present install_recommends=true
# increase disk size too much - science-astronomy
- tk
- ftools-fv
- saods9
# - topcat no packaged
- file:
path: "/home/{{user_login}}/bin"
owner: "{{ user_login }}"
state: 'directory'
- name: "Install jmmc script to launch jnlps (sphere-client is also included)"
copy:
src: files/jmmc
mode: o+x
owner: "{{ user_login }}"
dest: "/home/{{user_login}}/bin/jmmc"
# run in session './bin/jmmc --runall' before 'vagrant package'
- name: "Install LITpro local service"
synchronize:
src: files/LITproWrapper/
dest: "/home/{{user_login}}/.LITproWrapper"
become: no
# launch LITpro, generate pref file and set useremote service to false+fill local service path
# - name: "Reboot"
# shell: reboot
# Place in this directory some tutorial material
* under revision control
* jmmc simple program to install all jnlps
* to be added manually
* LITproWrapper
* jdk-8u144-linux-x64.tar.gz
#!/bin/bash
#
# Licence: Copyleft
# Authors: G.MELLA
# History:
# August 2017 : creation for EES2017 School
# Synopsis:
# Manage symlinks and or launch javawebstart for a list of jnlp urls
# Install:
# add in your path and run jmmc --install. Then some symlinks will install ins the same directory to launch associated jnlp.
## CONF
JNLPS="http://wsrdata.obs.ujf-grenoble.fr:8080/sphere-server/sphere-client/sphere-client.jnlp
http://www.jmmc.fr/apps/public/AppLauncher/AppLauncher.jnlp
http://www.jmmc.fr/apps/public/Aspro2/Aspro2.jnlp
http://www.jmmc.fr/apps/public/LITpro/LITpro.jnlp
http://www.jmmc.fr/apps/public/SearchCal/SearchCal.jnlp
http://www.jmmc.fr/apps/public/OIFitsExplorer/OIFitsExplorer.jnlp
http://www.jmmc.fr/apps/public/OImaging/OImaging.jnlp
"
## CODE
SCRIPT_PATH=$0
SCRIPT_NAME=$(basename $SCRIPT_PATH)
SCRIPT_ROOT=$(dirname $SCRIPT_NAME)
## BEGIN common functions ##
_abort()
{
RETVALUE=$1
shllibEchoInfo "$SCRIPT_NAME exited ${RETVALUE=-with error}"
exit ${RETVALUE:-1}
}
_exitProperly()
{
trap true 0 1 2 5 15
shllibEchoInfo "$SCRIPT_NAME Done"
exit
}
# this function must be called in the next following functions to trap signal
# and abort processing
_installTrap()
{
shllibEchoDebug "Install trap to abort process in case of errors"
trap _abort 0 1 2 5 15
}
# this function must be called in the next following functions to trap signal
# and abort processing
_uninstallTrap()
{
shllibEchoDebug "Uninstall trap to abort process properly"
trap _exit_properly 0 1 2 5 15
}
shllibSetDebugOn()
{
export ECHOTRACEON=true
}
shllibSetDebugOff()
{
unset ECHOTRACEON
}
shllibEchoError ()
{
ARGS=$*
if [ -n "$ECHOTRACEON" ]
then
let idx=0
for DEBUGTMP in $(caller 0)
do
v[$idx]="$DEBUGTMP"
let idx=$idx+1
done
echo -e "ERROR>: ${v[2]}:${v[0]} ${v[1]}\n $ARGS" >&2
else
echo -e "ERROR>: $ARGS" >&2
fi
}
shllibEchoInfo ()
{
ARGS=$*
echo -e "$ARGS"
}
shllibEchoDebug ()
{
ARGS=$*
local DEBUGTMP v
if [ -n "$ECHOTRACEON" ]
then
let idx=0
for DEBUGTMP in $(caller 0)
do
v[$idx]="$DEBUGTMP"
let idx=$idx+1
done
echo -e "DEBUG>: ${v[2]}:${v[0]} ${v[1]}\n $ARGS" \
>&2
fi
}
shllibShowEnv ()
{
ARGS=$*
for ARG in $ARGS
do
shllibEchoInfo "$ARG=$(eval echo \$$ARG)"
done
}
## END common functions ##
function _usage(){
# exit program if one value is given
let _EXIT_VALUE="$1"
echo
# echo "Usage: $SCRIPT_NAME [--list] [--codebase <url>] [--shared_url <url>] [--webroot <dir>] [--help] <ModuleDir>"
echo "Usage: $SCRIPT_NAME [--help] [--verbose] [--install|list|runall|remove]"
echo " --install : optional - install sym links of every applications."
echo " --remove : optional - remove sym link of every applications."
echo " --list : optional - list applications."
echo " --runall : optional - start all javawebstart applications."
# echo " --codebase <url> : optional - specify code base attribute of the generated JNLP directory."
# echo " (default value: http://<hostname>/~<username>')"
echo " --help : optional - display this help message."
echo " --verbose : optional - request verbose messages."
echo ""
echo " This command install and prepare javawebstart launcher commands."
echo " It installs some symlinks near the '$SCRIPT_NAME' command (i.e. under '$SCRIPT_ROOT')."
echo " Then you just have to launch them in command line to start the associated javawebstart"
echo ""
if [ -n "$_EXIT_VALUE" ]
then
exit $_EXIT_VALUE
fi
}
function checkEnv(){
if ! which $SCRIPT_NAME
then
echo "Please add $SCRIPT_ROOT in your PATH:"
echo " export PATH=\$PATH:$SCRIPT_ROOT"
fi
}
function install(){
for JNLP in $JNLPS
do
CMD_NAME=$(basename $JNLP .jnlp)
CMD_PATH=$SCRIPT_ROOT/$CMD_NAME
if [ ! -x $CMD_PATH ]
then
ln -sv $SCRIPT_PATH $CMD_PATH
else
shllibEchoDebug "$CMD_PATH already present"
fi
done
}
function remove(){
for JNLP in $JNLPS
do
CMD_NAME=$(basename $JNLP .jnlp)
CMD_PATH=$SCRIPT_ROOT/$CMD_NAME
if [ -e $CMD_PATH ]
then
rm -v $CMD_PATH
fi
done
}
function run(){
SEARCH_CMD=$1
for JNLP in $JNLPS
do
CMD_NAME=$(basename $JNLP .jnlp)
if [ "$CMD_NAME" = "$SEARCH_CMD" ]
then
javaws $JNLP
fi
done
}
function list(){
shllibEchoInfo "Available commands (in $SCRIPT_ROOT):"
for JNLP in $JNLPS
do
CMD_NAME=$(basename $JNLP .jnlp)
CMD_PATH=$SCRIPT_ROOT/$CMD_NAME
if [ ! -x $CMD_PATH ]
then
STATUS="installed"
else
STATUS="not installed"
fi
shllibEchoInfo " - $CMD_NAME : $JNLP ( symlink command $STATUS )"
done
}
function runall(){
shllibEchoInfo "Running all applications:"
for JNLP in $JNLPS
do
CMD_NAME=$(basename $JNLP .jnlp)
CMD_PATH=$SCRIPT_ROOT/$CMD_NAME
if [ ! -x $CMD_PATH ]
then
STATUS="installed"
else
STATUS="not installed"
fi
shllibEchoInfo " - launching $JNLP ( symlink command $STATUS )"
javaws $JNLP
done
}
function main(){
# Analyse options
#
# Note that we use `"$@"' to let each command-line parameter expand to a
# separate word. The quotes around `$@' are essential!
# We need TEMP as the `eval set --' would nuke the return value of getopt.
TEMP=`getopt -o "" --long install,list,runall,remove,verbose,help -n "$SCRIPT_NAME" -- "$@"`
if [ $? != 0 ] ; then _usage 1 >&2 ; exit 1 ; fi
# Note the quotes around `$TEMP': they are essential!
eval set -- "$TEMP"
while true ; do
case "$1" in
--list|--runall|--install|--remove ) DO_COMMAND=$1; shift ;;
# --codebase ) # CODE_BASE="$2"; shift 2 ;;
--help ) _usage 0 ;;
--verbose ) shllibSetDebugOn ; shift ;;
-- ) shift ; break ;;
* ) shllibEchoError "Internal error!" ; exit 1 ;;
esac
done
# We could Analyse arguments
# execute user command ( verbosity may have been adjusted before )
shllibEchoDebug "request to launch command for $DO_COMMAND"
case $DO_COMMAND in
--list) list ;;
--install) install ;;
--remove) remove ;;
--runall) runall ;;
*) checkEnv ;;
esac
}
case $SCRIPT_NAME in
jmmc)
main $*
;;
*)
run $SCRIPT_NAME
;;
esac
---
# Author: Guillaume Mella
# Description: install ESO Reflex + the sphere and gravity pipelines
# created for EES17 tutorial https://hraetoile2017.sciencesconf.org/
#
# Prerequisites : jdk (look at ansible-galaxy williamyeh.oracle-java )
#
- name: "Install Gravity pipeline (http://www.eso.org/sci/software/pipelines/gravity/)"
block:
- apt: name={{ item }}
with_items:
- python-matplotlib
- python-pyfits
- python-wxgtk3.0
- python-wxgtk3.0-dev
- python-wxmpl
- python-astropy
- python-numpy
# - default-jre we prefer to install an oracle jvm before
- pkg-config
- g++
- zlib1g-dev
- make
- gzip
- tar
- yorick
- yorick-yeti
- yorick-optimpack
- shell: touch toto
- file: path="/usr/local/share/man/man1" state=directory # install_pipeline pre-requisite
become: true
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment