Commit 7a385617 authored by Alain Takoudjou's avatar Alain Takoudjou

proview: configure user environment

parent 225863e2
{% set publish_dict = {} -%} {% set publish_dict = {} -%}
{% set part_list = [] -%} {% set part_list = [] -%}
{% set ipv6 = (ipv6 | list)[0] -%} {% set ipv6 = (ipv6 | list)[0] -%}
{% set ipv4 = (ipv4 | list)[0] -%}
[directory] [directory]
recipe = slapos.cookbook:mkdirectory recipe = slapos.cookbook:mkdirectory
...@@ -9,13 +9,16 @@ etc = ${buildout:directory}/etc ...@@ -9,13 +9,16 @@ etc = ${buildout:directory}/etc
bin = ${buildout:directory}/bin bin = ${buildout:directory}/bin
srv = ${buildout:directory}/srv srv = ${buildout:directory}/srv
var = ${buildout:directory}/var var = ${buildout:directory}/var
var = ${buildout:directory}/tmp tmp = ${buildout:directory}/tmp
log = ${:var}/log log = ${:var}/log
scripts = ${:etc}/run scripts = ${:etc}/run
services = ${:etc}/service services = ${:etc}/service
ssl = ${:etc}/ssl ssl = ${:etc}/ssl
auth = ${:tmp}/auth auth = ${:tmp}/auth
pwr = ${:pwr} pwrp = ${buildout:directory}/pwrp
ca-dir = ${:srv}/ssl
novnc-conf = ${:etc}/novnc
prerm = ${:etc}/prerm
[certificate-authority] [certificate-authority]
recipe = slapos.cookbook:certificate_authority recipe = slapos.cookbook:certificate_authority
...@@ -85,46 +88,82 @@ config-port = ${novnc-instance:port} ...@@ -85,46 +88,82 @@ config-port = ${novnc-instance:port}
[x11vnc] [x11vnc]
recipe = slapos.cookbook:wrapper recipe = slapos.cookbook:wrapper
command-line = {{ x11vnc_bin }} -forever -display ${xserver:display} -ncache 10 \ command-line = {{ x11vnc_bin }} -forever -display ${xserver:display} -ncache 10
-autoport 5901 -no6 -reopen -o ${directory:log}/x11vnc.log \ -autoport 5901 -no6 -reopen -o ${directory:log}/x11vnc.log
-listen {{ ipv4 }} -flag ${proview-prepare:pwr-flag} -xkb -listen {{ ipv4 }} -flag ${proview-prepare:pwr-flag} -xkb
-auth ${directory:auth}.Xauthority
wrapper-path = ${directory:services}/x11vnc wrapper-path = ${directory:services}/x11vnc
hash-existing-files = ${buildout:directory}/software_release/buildout.cfg hash-existing-files = ${buildout:directory}/software_release/buildout.cfg
[xserver] [xserver]
recipe = slapos.cookbook:wrapper recipe = slapos.cookbook:wrapper
command-line = {{ xvfb_bin }} Xvfb ${:display} -screen 0 1280x1024x24 \ command-line = {{ xvfb_bin }} ${:display} -screen 0 1280x1024x24
-cc 4 -nolisten tcp -auth ${directory:auth} -fp {{ xorg_font_util}}/share/fonts/X11/Type1 -cc 4 -nolisten tcp -auth ${directory:auth}.Xauthority -fp {{ xorg_font_util}}/share/fonts/X11/Type1
wrapper-path = ${directory:services}/xserver wrapper-path = ${directory:services}/xserver
hash-existing-files = ${buildout:directory}/software_release/buildout.cfg hash-existing-files = ${buildout:directory}/software_release/buildout.cfg
display = :98 display = :98
[proview-prepare] [proview-prepare]
recipe = plone.recipe.command recipe = plone.recipe.command
pwr-db = ${directory:pwr}/db pwr-db = ${directory:pwrp}/db
pwr-flag = ${directory:pwr}/flag pwr-flag = ${directory:pwrp}/flag
command = command =
cp -r {{ proview_directory }}/local/adm/db/ ${:pwr-db} cp -r {{ proview_directory }}/local/adm/db/ ${:pwr-db}
echo PORT=5901 > ${:pwr-flag} echo PORT=5901 > ${:pwr-flag}
update-command = update-command =
stop-on-error = true stop-on-error = true
[proview-wrapper] [proview-environment]
recipe = collective.recipe.template recipe = collective.recipe.template
input = inline:#!/bin/bash input = inline:#!/bin/bash
export export pwra_db=${proview-prepare:pwr-db} source ${pwrp-profile:rendered}
export pwra_db=${proview-prepare:pwr-db}
source $pwra_db/pwr_setup.sh source $pwra_db/pwr_setup.sh
source export PWR_BUS_ID=999 export PWR_BUS_ID=999
export DISPLAY=${xserver:display}
export LD_LIBRARY_PATH={{ ld_library_path }} export LD_LIBRARY_PATH={{ ld_library_path }}
# start pwra if [ "$PS1" ]; then
eval `dircolors -b`
alias ls='ls --color=auto'
# set a fancy prompt
PS1='\u@\h:\w\$ '
fi
# Set Base (XXX - hard coded version)
pwrp set base V5.6.0 pwrp set base V5.6.0
DISPLAY=${xserver:display} pwra
output = ${directory:bin}/pwr output = ${buildout:directory}/.bashrc
mode = 700 mode = 600
[bash-profile]
recipe = collective.recipe.template
input = inline:#!/bin/bash
umask 022
# include .bashrc if it exists
if [ -f ~/.bashrc ]; then
source ~/.bashrc
fi
output = ${buildout:directory}/.bashrc
mode = 600
[pwrp-profile]
recipe = slapos.recipe.template:jinja2
rendered = ${directory:etc}/pwrp_profile
extensions = jinja2.ext.do
mode = 0744
template = {{ pwrp_profile }}
context =
key pwra_db proview-prepare:pwr-db
key base_directory buildout:directory
raw pwr_exp_dir {{ proview_compile_dir }}/rls/os_linux/hw_x86_64/exp
raw pwr_bus_id 999
raw java_location {{ java_location }}
[request-slave-frontend] [request-slave-frontend]
recipe = slapos.cookbook:requestoptional recipe = slapos.cookbook:requestoptional
...@@ -162,11 +201,15 @@ parts = ...@@ -162,11 +201,15 @@ parts =
publish-connection-information publish-connection-information
x11vnc x11vnc
xserver xserver
proview-wrapper websockify-sighandler
websockify-sighandler-service
novnc-promise
proview-environment
bash-profile
# Complete parts with sections # Complete parts with sections
{{ part_list | join('\n ') }} {{ part_list | join('\n ') }}
eggs-directory = {{ eggs_directory }} eggs-directory = {{ eggs_directory }}
develop-eggs-directory = {{ develop_eggs_directory }} develop-eggs-directory = {{ develop_eggs_directory }}
offline = true offline = true
\ No newline at end of file
...@@ -29,16 +29,20 @@ context = ...@@ -29,16 +29,20 @@ context =
[instance-proview-r] [instance-proview-r]
<= template-base <= template-base
template = ${template-kvm-cluster:rendered} template = ${template-proview-r:location}/${template-proview-r:filename}
rendered = $${buildout:directory}/template-proview-r.cfg rendered = $${buildout:directory}/template-proview-r.cfg
extensions = jinja2.ext.do extensions = jinja2.ext.do
extra-context = extra-context =
key novnc_location noVNC:location raw novnc_location ${noVNC:location}
raw x11vnc_bin ${x11vnc:location}/bin/x11vnc
raw websockify_executable_location ${buildout:directory}/bin/websockify raw websockify_executable_location ${buildout:directory}/bin/websockify
raw xorg_font_util ${xorg-font-util:location} raw xorg_font_util ${xorg-font-util:location}
raw xvfb_bin ${xserver:location}/bin/Xvfb raw xvfb_bin ${xserver:location}/bin/Xvfb
raw proview_directory ${pwd:location} raw java_location ${java-jdk:location}
raw ld_library_path ${pwd:ld-library-path} raw proview_directory ${pwr:location}
raw proview_compile_dir ${pwr:location}__compile__/pwr
raw ld_library_path ${pwr:ld-library-path}
raw pwrp_profile ${template-pwrp-profile:location}/${template-pwrp-profile:filename}
mode = 0644 mode = 0644
[slap-configuration] [slap-configuration]
......
bus_id="{{ pwr_bus_id }}"
if [ -e /etc/proview.cnf ]; then
bus_id=`eval cat /etc/proview.cnf | grep "\\bqcomBusId\\b" | awk '{print $2}'`
fi
if [ -e /etc/proview.cnf ]; then
web_dir=`eval cat /etc/proview.cnf | grep "\\bwebDirectory\\b" | awk '{print $2}'`
fi
export PWR_BUS_ID=$bus_id
export pwrb_root={{ pwr_exp_dir }}
export pwrp_root={{ base_directory }}/pwrp
export pwr_exe=$pwrb_root/exe
export pwr_lib=$pwrb_root/lib
export pwr_obj=$pwrb_root/obj
export pwr_inc=$pwrb_root/inc
export pwr_load=$pwrb_root/load
export pwr_lis=$pwrb_root/lis
export pwr_doc=$pwrb_root/doc
export pwrp_exe=$pwrp_root/x86_64_linux/exe
export pwrp_lib=$pwrp_root/x86_64_linux/lib
export pwrp_obj=$pwrp_root/x86_64_linux/obj
export pwrp_lis=$pwrp_root/x86_64_linux/lis
export pwrp_inc=$pwrp_root/common/inc
export pwrp_load=$pwrp_root/common/load
export pwrp_log=$pwrp_root/common/log
export pwrp_db=$pwrp_root/common/db
export pwrp_web=$web_dir
export pwra_db={{ pwra_db }}
export jdk={{ java_location }}
export JAVA_HOME={{ java_location }}
export jdk_home={{ java_location }}/bin
PATH=$PATH:$pwr_exe:$pwrp_exe:$jdk_home
#symbols to define start/stop commands for PWR
alias pwr_stop='/etc/init.d/pwr stop'
alias pwr_stop.sh="/etc/init.d/pwr stop"
alias pwr_start="/etc/init.d/pwr start"
alias pwr="/etc/init.d/pwr"
alias boot="/usr/bin/sudo /sbin/reboot"
if [ -e $pwrp_exe/profile ]; then
source $pwrp_exe/profile
fi
...@@ -5,11 +5,13 @@ extends = ...@@ -5,11 +5,13 @@ extends =
../../component/proviewR/buildout.cfg ../../component/proviewR/buildout.cfg
../../component/open62541/buildout.cfg ../../component/open62541/buildout.cfg
../../component/noVNC/buildout.cfg ../../component/noVNC/buildout.cfg
../../component/shellinabox/buildout.cfg
../../stack/monitor/buildout.cfg ../../stack/monitor/buildout.cfg
../../stack/slapos.cfg ../../stack/slapos.cfg
parts += parts +=
slapos-cookbook slapos-cookbook
eggs
open62541 open62541
pwr pwr
x11vnc x11vnc
...@@ -17,6 +19,7 @@ parts += ...@@ -17,6 +19,7 @@ parts +=
xorg-font-adobe-100dpi xorg-font-adobe-100dpi
xorg-font-type1 xorg-font-type1
template template
allow-picked-versions = true
[eggs] [eggs]
recipe = zc.recipe.egg recipe = zc.recipe.egg
...@@ -31,15 +34,24 @@ recipe = slapos.recipe.template ...@@ -31,15 +34,24 @@ recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance.cfg url = ${:_profile_base_location_}/instance.cfg
output = ${buildout:directory}/template.cfg output = ${buildout:directory}/template.cfg
mode = 0644 mode = 0644
md5sum = a27a900ce349068a15a42255f81ba0f0 #md5sum = a27a900ce349068a15a42255f81ba0f0
[download-base] [download-base]
recipe = slapos.recipe.template recipe = hexagonit.recipe.download
url = ${:_profile_base_location_}/${:filename} url = ${:_profile_base_location_}/${:filename}
download-only = true
mode = 0644 mode = 0644
[template-kvm-cluster] [template-proview-r]
<= download-base <= download-base
on-update = true md5sum = 7811559de2118066e3da524e43bd5182
md5sum = db9b805eeeb2f89abca375c1425812b7 filename = instance-proview-r.cfg.jinja2.in
filename = instance-proview-r.cfg.jinja2.in
\ No newline at end of file [template-pwrp-profile]
<= download-base
md5sum = 34b0c503d786fc59317a761175ddfc3f
filename = pwrp_profile.in
[versions]
numpy = 1.16.4
#websockify = 0.6.1
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