Commit 456bf9d5 authored by Iliya Manolov's avatar Iliya Manolov

Merge remote-tracking branch 'upstream/master' into jupyter_add_jupyterlab

parents c52de05c 8960810c
...@@ -8,7 +8,7 @@ extends = ...@@ -8,7 +8,7 @@ extends =
[file] [file]
recipe = slapos.recipe.cmmi recipe = slapos.recipe.cmmi
url = ftp://ftp.astron.com/pub/file/file-5.23.tar.gz url = http://ftp.icm.edu.pl/packages/file/file-5.23.tar.gz
md5sum = 61db35209ce71a6d576392ce6e1d2f80 md5sum = 61db35209ce71a6d576392ce6e1d2f80
configure-options = configure-options =
--disable-static --disable-static
......
...@@ -8,9 +8,9 @@ parts = ...@@ -8,9 +8,9 @@ parts =
[percona-toolkit] [percona-toolkit]
recipe = slapos.recipe.cmmi recipe = slapos.recipe.cmmi
version = 2.2.15 version = 3.0.3
url = http://www.percona.com/redir/downloads/percona-toolkit/${:version}/tarball/percona-toolkit-${:version}.tar.gz url = https://www.percona.com/downloads/percona-toolkit/${:version}/source/tarball/percona-toolkit-${:version}.tar.gz
md5sum = 022f40dadaea9025820530ea1f986192 md5sum = 8af181994fdf9aa984475637861098e9
depends = depends =
${perl-DBI:location} ${perl-DBI:location}
${perl-DBD-mariadb:location} ${perl-DBD-mariadb:location}
......
#!{{ python_executable }}
from ipykernel.kernelbase import Kernel from ipykernel.kernelbase import Kernel
from ipykernel.kernelapp import IPKernelApp from ipykernel.kernelapp import IPKernelApp
from IPython.core.display import HTML from IPython.core.display import HTML
import requests import requests
import json import json
import sys
# erp5_url from buildout erp5_url = None
erp5_url = "{{ erp5_url }}" if len(sys.argv) > 1:
if not erp5_url: erp5_url = "%s/erp5/Base_executeJupyter" % (sys.argv[1],)
erp5_url = None
else:
erp5_url = "%s/erp5/Base_executeJupyter" % erp5_url
class MagicInfo: class MagicInfo:
""" """
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
[instance-jupyter-notebook] [instance-jupyter-notebook]
filename = instance.cfg.in filename = instance.cfg.in
md5sum = fe5f82427cad1a24c2396c1684b8c411 md5sum = 9b611c1bf176ac3d088b6387b5591678
[jupyter-notebook-config] [jupyter-notebook-config]
filename = jupyter_notebook_config.py.jinja filename = jupyter_notebook_config.py.jinja
...@@ -27,13 +27,9 @@ filename = jupyter_set_password.cgi.jinja ...@@ -27,13 +27,9 @@ filename = jupyter_set_password.cgi.jinja
md5sum = b8d31441780b524a7e52d1710dd78385 md5sum = b8d31441780b524a7e52d1710dd78385
[erp5-kernel] [erp5-kernel]
filename = ERP5kernel.py.jinja filename = ERP5kernel.py
md5sum = 8bd16cc9f35b00172e8266f1cde5956f md5sum = 7d5309fe79afbcb455c0d8181b42e56c
[kernel-json] [kernel-json]
filename = kernel.json.jinja filename = kernel.json.jinja
md5sum = ab6e78ea20855e07d388b5b86d1770fe md5sum = 33547be93a67530165e079dc3ecfdac3
[custom-js]
filename = custom.js.jinja
md5sum = 0bf9e2eb1718b14307265fe05a167018
...@@ -138,13 +138,9 @@ recipe = slapos.cookbook:publish.serialised ...@@ -138,13 +138,9 @@ recipe = slapos.cookbook:publish.serialised
url = https://[${instance-parameter:host}]:${instance-parameter:port} url = https://[${instance-parameter:host}]:${instance-parameter:port}
[erp5-kernel] [erp5-kernel]
<= dynamic-jinja2-template-base recipe = slapos.cookbook:symbolic.link
template = {{ erp5_kernel_location }}/{{ erp5_kernel_filename }} link-binary = {{ erp5_kernel_location }}/{{ erp5_kernel_filename }}
rendered = ${directory:erp5_kernel_dir}/ERP5kernel.py target-directory = ${directory:erp5_kernel_dir}
# Use ipython as executable python as we'll be needing requests library in kernel
context =
raw python_executable {{ bin_directory }}/ipython
key erp5_url slapconfiguration:configuration.erp5-url
[kernel-json] [kernel-json]
<= dynamic-jinja2-template-base <= dynamic-jinja2-template-base
...@@ -153,12 +149,13 @@ rendered = ${directory:erp5_kernel_dir}/kernel.json ...@@ -153,12 +149,13 @@ rendered = ${directory:erp5_kernel_dir}/kernel.json
# Use python2.7 executable bin file for kernel config # Use python2.7 executable bin file for kernel config
context = context =
raw python_executable {{ python_executable }} raw python_executable {{ python_executable }}
key kernel_dir erp5-kernel:rendered raw kernel_dir ${erp5-kernel:target-directory}/{{ erp5_kernel_filename }}
key erp5_url slapconfiguration:configuration.erp5-url
raw display_name ERP5 raw display_name ERP5
raw language_name python raw language_name python
[custom-js] [custom-js]
<= dynamic-jinja2-template-base recipe = slapos.cookbook:symbolic.link
template = {{ custom_js_location }}/{{ custom_js_filename }} target-directory = ${directory:jupyter_custom_dir}
rendered = ${directory:jupyter_custom_dir}/custom.js link-binary = {{ custom_js_location }}/custom.js
mode = 0744
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
"argv": [ "argv": [
"{{python_executable}}", "{{python_executable}}",
"{{kernel_dir}}", "{{kernel_dir}}",
"{{erp5_url}}",
"-f", "-f",
"{connection_file}" "{connection_file}"
], ],
......
# NayuOS # NayuOS
This is a SlapOS recipe to build NayuOS. It needs to be put in the <code>/srv/slapgrid/\<part\>/srv/runner/project/slapos/software/</code> directory. The created directory is called <code>\<nayuos_build_dirname\></code> in this documentation. This is a SlapOS recipe to build NayuOS.
## License ## License
...@@ -8,42 +8,61 @@ GPL v2 or later ...@@ -8,42 +8,61 @@ GPL v2 or later
## Requirements ## Requirements
* sudo on the host (for now) * sudo on the host
* some environment variables need to be authorized to be propagated when cros_sdk calls sudo: * environment variables need to be authorized to be propagated when cros_sdk calls sudo: `: Defaults env_keep += "CROS_CACHEDIR DEPOT_TOOLS"`
* slapuser with sudo rights to execute the cros_sdk scripts (needed to access the chroot environment provided by Chromium OS)
in /etc/sudoers (replace slapuser9 by your user, and release-R48-7647.B by the release you have chosen): `: slapuser9 ALL=NOPASSWD: /srv/slapgrid/slappart9/srv/runner/instance/slappart0/parts/chromiumos/release-R48-7647.B/chromite/bin/cros_sdk, /srv/slapgrid/slappart9/srv/runner/instance/slappart0/wrapper_bin/wrapper_cros_sdk, /bin/kill`
: Defaults env_keep += "CROS_CACHEDIR DEPOT_TOOLS" It's useful to have the right to kill cros_sdk processes, when needed. ;)
* slapuser with sudo rights to execute the cros_sdk scripts (needed to access the chroot environment provided by Chromium OS) ## Technical notes
in /etc/sudoers (replace slapuser9 by your user, and release-R48-7647.B by the release you have chosen):
: slapuser9 ALL=NOPASSWD: /srv/slapgrid/slappart9/srv/runner/instance/slappart0/parts/chromiumos/release-R48-7647.B/chromite/bin/cros_sdk, /srv/slapgrid/slappart9/srv/runner/instance/slappart0/wrapper_bin/wrapper_cros_sdk, /bin/kill After any change to the build process it is necessary to delete (using sudo)
the building environment at `~/srv/runner/instance/slappart0/parts/chromiumos/<TAG>`.
BEWARE that the web runner is serving images for the [official website](https://nayuos.nexedi.com).
NayuOS and ChromiumOS is "just" a version of Gentoo. Thus it uses `ebuild` packages
and anything installable in Gentoo can be installed to NayuOS too. Of course only
during OS build phase and one has to count with limited space.
### Upgrading (building new image)
Please read **Requirements** section carefully. After selecting your desired
`release` from the list <https://chromium.googlesource.com/chromiumos/manifest/+refs>
it is **necessary** to add `sudo` rules for that release as shown there.
It's useful to have the right to kill cros_sdk processes, when needed. ;)
## Input ## Input
In the vifib parameters (softinst\<nb\>.host.vifib.net \> Services \> Parameters): In the vifib parameters (softinst\<nb\>.host.vifib.net \> Services \> Parameters):
* board / ex: peppy, swanky, ... (choosing daisy will accept all licenses for the daisy board build only, in order to use Mali drivers, see [chromium mailing list](https://groups.google.com/a/chromium.org/forum/#!topic/chromium-os-dev/Pf9ZG2itxWM)) * **board** / ex: peppy, swanky, ... (choosing daisy will accept all licenses for the daisy board build only, in order to use Mali drivers, see [chromium mailing list](https://groups.google.com/a/chromium.org/forum/#!topic/chromium-os-dev/Pf9ZG2itxWM))
* branch / ex: release-R46-7390.B (you can find the release in the [Chromium OS source tree](https://chromium.googlesource.com/chromiumos/manifest/+refs)) * **branch** / ex: release-R46-7390.B (you can find the release in the [Chromium OS source tree](https://chromium.googlesource.com/chromiumos/manifest/+refs))
* keep_cache / yes|no (choosing "no" saves about 15Go of disk space per board, choosing "yes" will makes next build faster and less expensive in term of needed ressources because of not rebuilding everything) * **keep_cache** / yes|no (choosing "no" saves about 15Go of disk space per board, choosing "yes" will makes next build faster and less expensive in term of needed ressources because of not rebuilding everything)
## Output ## Output
The image will be produced in:
<code>/srv/slapgrid/\<part\>/srv/runner/instance/\<inst_part\>/parts/chromiumos/images/</code>
and the logs are in:
<code>/srv/slapgrid/\<part\>/srv/runner/instance/\<inst_part\>/var/log/cros_sources_dl.log</code> and <code>/srv/slapgrid/\<part\>/srv/runner/instance/\<inst_part\>/var/log/cros_build.log</code>
The script that download the sources and build is located in Software release produces a build script `<instance_partition>/etc/run/cros_full_build`.
<code>/srv/slapgrid/\<part\>/srv/runner/instance/\<inst_part\>/etc/run</code>
Build produces
* Image: `<instance_partition>/parts/chromiumos/images/`
* Compilation logs: `<instance_partition>/var/log/cros_sources_dl.log`
* Build logs: `<instance_partition>/var/log/cros_build.log`
## External documents ## External documents
* [ <code>repo</code> command reference ](https://source.android.com/source/using-repo.html) * [ `repo` command reference ](https://source.android.com/source/using-repo.html)
* [ NayuOS official website ](https://www.nayuos.com) * [ NayuOS official website ](https://nayuos.nexedi.com)
* [ crouton for chroot ](https://github.com/dnschneid/crouton) ([warning about verified boot](https://github.com/dnschneid/crouton/blob/2a1fc9da380650f47e2bcf37d00962bfb68c4830/installer/main.sh#L517-L536)) * [ crouton for chroot ](https://github.com/dnschneid/crouton) ([warning about verified boot](https://github.com/dnschneid/crouton/blob/2a1fc9da380650f47e2bcf37d00962bfb68c4830/installer/main.sh#L517-L536))
## Notes for possible improvements ## Notes for possible improvements
* [ Running virtual machines on your chromebook ](https://www.chromium.org/chromium-os/developer-information-for-chrome-os-devices/running-virtual-machines-on-your-chromebook) * [ Running virtual machines on your chromebook ](https://www.chromium.org/chromium-os/developer-information-for-chrome-os-devices/running-virtual-machines-on-your-chromebook)
* to have a more common User Agent (the one of ChromiumOS/NayuOS is quite rare and identifies the user, see [studies of the EFF](https://panopticlick.eff.org/static/browser-uniqueness.pdf)), it seems possible to change the User-Agent flag for guest mode in the getOffTheRecord function, and adding a line (key "kUserAgent" , value "some common user agent" string). Then rebuild Chromium and [add it to NayuOS](https://www.chromium.org/chromium-os/developer-guide#TOC-Making-changes-to-the-Chromium-web-). * to have a more common User Agent (the one of ChromiumOS/NayuOS is quite rare and identifies the user, see [studies of the EFF](https://panopticlick.eff.org/static/browser-uniqueness.pdf)), it seems possible to change the User-Agent flag for guest mode in the getOffTheRecord function, and adding a line (key "kUserAgent" , value "some common user agent" string). Then rebuild Chromium and [add it to NayuOS](https://www.chromium.org/chromium-os/developer-guide#TOC-Making-changes-to-the-Chromium-web-).
* remove need of root priviledge for entering the chroot, maybe by using fakeroot in 'scripts/wrapper_sudo.in'? * remove need of root priviledge for entering the chroot, maybe by using fakeroot in 'scripts/wrapper_sudo.in'?
* change more options on Chromium OS "Privacy" part by default: there are [a few options](https://support.google.com/chromebook/answer/114836) which still use Google services
* provide ChromiumOS package manager [ chromebrew ](https://skycocker.github.io/chromebrew/) by default
# Jinja2 template of a buildout file to create runnable scripts
#
# Received variables
# - software_dir: location where this repository was cloned to
# - instance_dir: location where this 'instance.cfg' is gettin rendered (same as ${buildout:directory})
[buildout] [buildout]
parts = parts =
parameters parameters
promise-sudo-on-host
template-full-build-script template-full-build-script
template-sudo-wrapper template-sudo-wrapper
template-cros-sdk-wrapper template-cros-sdk-wrapper
# eggs given by software.cfg # standard declaration of eggs directories
eggs-directory = {{ eggs_directory }} eggs-directory = {{ eggs_directory }}
develop-eggs-directory = {{ develop_eggs_directory }} develop-eggs-directory = {{ develop_eggs_directory }}
...@@ -16,15 +23,18 @@ develop-eggs-directory = {{ develop_eggs_directory }} ...@@ -16,15 +23,18 @@ develop-eggs-directory = {{ develop_eggs_directory }}
recipe = slapos.recipe.build:gitclone recipe = slapos.recipe.build:gitclone
repository = https://chromium.googlesource.com/chromium/tools/depot_tools.git repository = https://chromium.googlesource.com/chromium/tools/depot_tools.git
branch = master branch = master
git-executable = {{ git_path }}/bin/git
[customize-path] [customize-path]
# add depot tools directory (for cros_sdk binary among others) and git directory to the path # add depot tools directory (for cros_sdk binary among others) and git directory to the path
command = command =
export PATH="${directory:wrapper_dir}":"{{ git_path }}":"{{ curl_path }}":"${depot-tools:location}":"$PATH"; export PATH="${directory:wrapper_dir}":"{{ git_path }}/bin":"{{ curl_path }}/bin":"${depot-tools:location}":"$PATH";
[nayuos-ebuilds] [nayuos-ebuilds]
recipe = slapos.recipe.build:gitclone recipe = slapos.recipe.build:gitclone
repository = https://lab.nexedi.com/nexedi/nayuos-ebuilds.git repository = https://lab.nexedi.com/nexedi/nayuos-ebuilds.git
branch = master
git-executable = {{ git_path }}/bin/git
############################################################################################ ############################################################################################
...@@ -44,20 +54,25 @@ cert = ${slap_connection:cert_file} ...@@ -44,20 +54,25 @@ cert = ${slap_connection:cert_file}
recipe = slapos.cookbook:mkdirectory recipe = slapos.cookbook:mkdirectory
log = ${buildout:directory}/var/log log = ${buildout:directory}/var/log
run = ${buildout:directory}/etc/run run = ${buildout:directory}/etc/run
promise = ${buildout:directory}/etc/promise
wrapper_dir = ${buildout:directory}/wrapper_bin wrapper_dir = ${buildout:directory}/wrapper_bin
cros_location = ${buildout:directory}/parts/chromiumos cros_location = ${buildout:directory}/parts/chromiumos
ebuilds_dir = ${nayuos-ebuilds:location}
scripts_dir = {{ scripts_dir }}
logo_dir = {{ logo_dir }}
[bin] [bin]
# dummy section to hold references to frequently used binaries
wrapper_cros_sdk=${directory:wrapper_dir}/wrapper_cros_sdk wrapper_cros_sdk=${directory:wrapper_dir}/wrapper_cros_sdk
bash=/bin/bash bash=/bin/bash
sudo=/usr/bin/sudo sudo=/usr/bin/sudo
[promise-sudo-on-host]
# assert sudo is installed, as it is required to enter the chroot 'cros_sdk'
recipe = slapos.cookbook:wrapper
wrapper-path = ${directory:promise}/${:_buildout_section_name_}
command-line = sudo -V
[template-sudo-wrapper] [template-sudo-wrapper]
recipe = slapos.recipe.template:jinja2 recipe = slapos.recipe.template:jinja2
template = {{ scripts_dir }}/wrapper_sudo.in template = {{ software_dir }}/scripts/wrapper_sudo.in
rendered = ${directory:wrapper_dir}/sudo rendered = ${directory:wrapper_dir}/sudo
md5sum = ded5a92be4e37ec32eb9d3087d3e19bd md5sum = ded5a92be4e37ec32eb9d3087d3e19bd
mode = 0700 mode = 0700
...@@ -68,23 +83,23 @@ context = ...@@ -68,23 +83,23 @@ context =
[template-cros-sdk-wrapper] [template-cros-sdk-wrapper]
recipe = slapos.recipe.template:jinja2 recipe = slapos.recipe.template:jinja2
template = {{ scripts_dir }}/wrapper_cros_sdk.in template = {{ software_dir }}/scripts/wrapper_cros_sdk.in
rendered = ${bin:wrapper_cros_sdk} rendered = ${bin:wrapper_cros_sdk}
md5sum = 7159fe3d5b85a283733cf686c4ee0a74 md5sum = 7159fe3d5b85a283733cf686c4ee0a74
mode = 0700 mode = 0700
context = context =
# XXX bash path is the one from the host # XXX bash path is the one from the host
key bash_path bin:bash key bash_path bin:bash
raw git_path {{ git_path }} raw git_path {{ git_path }}/bin
raw curl_path {{ curl_path }} raw curl_path {{ curl_path }}/bin
[template-full-build-script] [template-full-build-script]
# create the rendered script in the buildout-directory/etc/run # create the rendered script in the buildout-directory/etc/run
# (use jinja for templating) # (use jinja for templating)
recipe = slapos.recipe.template:jinja2 recipe = slapos.recipe.template:jinja2
template = {{ scripts_dir }}/cros_full_build.in template = {{ software_dir }}/scripts/cros_full_build.in
rendered = ${directory:run}/cros_full_build rendered = ${directory:run}/cros_full_build
md5sum = 75599e6b8418a5f3756c7c7b26600399 md5sum = 2bb9dd83260ea96dd6a6602f6faa9794
mode = 0700 mode = 0700
context = context =
key bash_path bin:bash key bash_path bin:bash
...@@ -94,7 +109,11 @@ context = ...@@ -94,7 +109,11 @@ context =
key branch parameters:configuration.branch key branch parameters:configuration.branch
key boards_list parameters:configuration.boards key boards_list parameters:configuration.boards
key keep_cache parameters:configuration.keep_cache key keep_cache parameters:configuration.keep_cache
key ebuilds_dir directory:ebuilds_dir key ebuilds_dir nayuos-ebuilds:location
key scripts_dir directory:scripts_dir raw scripts_dir {{ software_dir }}/scripts
key logo_dir directory:logo_dir raw logo_dir {{ software_dir }}/logo
raw nayu_dev_packages net-libs/nodejs net-misc/re6stnet dev-vcs/git dev-python/flask dev-python/virtualenv sys-fs/cryptsetup # packages to be copied from our overlay into ChromiuOS' overlay
# those packages will be marked as dependency of root filesystem
raw nayu_dev_rootfs_packages app-misc/nayuos-chromium-policy
# those packages will be marked as dependency of the chromium build itself
raw nayu_dev_packages net-misc/re6stnet dev-vcs/git dev-python/flask dev-python/virtualenv sys-fs/cryptsetup
This diff is collapsed.
...@@ -14,8 +14,10 @@ ORIGINAL_GRANDENET_SCRIPT=~/trunk/src/third_party/chromiumos-overlay/net-misc/re ...@@ -14,8 +14,10 @@ ORIGINAL_GRANDENET_SCRIPT=~/trunk/src/third_party/chromiumos-overlay/net-misc/re
GRANDENET_SCRIPT="usr/local/bin/grandenet" GRANDENET_SCRIPT="usr/local/bin/grandenet"
INIT_SSH_SERVER="etc/init/openssh-server.conf" INIT_SSH_SERVER="etc/init/openssh-server.conf"
BASHRC="etc/skel/.bashrc" BASHRC="etc/skel/.bashrc"
EXPECTED_ALIAS="alias git='git --exec-path=/usr/local/libexec/git-core/'" GIT_CORE="usr/local/libexec/git-core/"
GIT_EXPECTED_EXPORT="export GIT_EXEC_PATH=/usr/local/libexec/git-core"
VIRTUALENV_BIN="usr/local/bin/virtualenv" VIRTUALENV_BIN="usr/local/bin/virtualenv"
CHROMIUM_POLICY="etc/chromium/policies/recommended/nayuos_policy.json"
HAS_FAILED=0 HAS_FAILED=0
...@@ -32,14 +34,17 @@ function print_result() { ...@@ -32,14 +34,17 @@ function print_result() {
# MOUNT IMAGE AND GET INFO # MOUNT IMAGE AND GET INFO
install -d ${MOUNTPOINT} install -d "${MOUNTPOINT}"
./mount_gpt_image.sh --safe -f $( ./get_latest_image.sh --board=${BOARD} ) -r ${MOUNTPOINT} ./mount_gpt_image.sh --safe -f $( ./get_latest_image.sh --board=${BOARD} ) -r ${MOUNTPOINT}
echo $(ls "${MOUNTPOINT}/usr/local") echo $(ls "${MOUNTPOINT}/usr/local")
if [[ $(ls "${MOUNTPOINT}/usr/local") ]] ; then if [[ $(ls "${MOUNTPOINT}/usr/local") ]] ; then
my_diff=$(diff ${ORIGINAL_GRANDENET_SCRIPT} "${MOUNTPOINT}/${GRANDENET_SCRIPT}") my_diff=$(diff "${ORIGINAL_GRANDENET_SCRIPT}" "${MOUNTPOINT}/${GRANDENET_SCRIPT}")
opensshd_config=$(ls "${MOUNTPOINT}/${INIT_SSH_SERVER}") opensshd_config=$(ls "${MOUNTPOINT}/${INIT_SSH_SERVER}")
gitalias=$(grep "${EXPECTED_ALIAS}" "${MOUNTPOINT}/${BASHRC}") gitcore=$(ls "${MOUNTPOINT}/${GIT_CORE}")
gitexport=$(grep "${GIT_EXPECTED_EXPORT}" "${MOUNTPOINT}/${BASHRC}")
virtualenvbin=$(ls "${MOUNTPOINT}/${VIRTUALENV_BIN}") virtualenvbin=$(ls "${MOUNTPOINT}/${VIRTUALENV_BIN}")
chromium_policy=$(ls "${MOUNTPOINT}/${CHROMIUM_POLICY}")
else else
is_empty=1 is_empty=1
fi fi
...@@ -50,7 +55,7 @@ rmdir ${MOUNTPOINT} ...@@ -50,7 +55,7 @@ rmdir ${MOUNTPOINT}
# PRINT RESULTS # PRINT RESULTS
echo "* test if /usr/local exists" echo "* test if /usr/local exists"
if [[ ${is_empty} == 1 ]] ; then if [[ "${is_empty}" == "1" ]] ; then
print_result ${FAILURE} "/usr/local is empty." print_result ${FAILURE} "/usr/local is empty."
else else
print_result ${SUCCESS} "/usr/local is not empty." print_result ${SUCCESS} "/usr/local is not empty."
...@@ -71,10 +76,18 @@ else ...@@ -71,10 +76,18 @@ else
print_result ${SUCCESS} "opensshd config removed." print_result ${SUCCESS} "opensshd config removed."
fi fi
echo "* test git quick fix for option --exec-path" echo "* test if git core directory is not empty"
if [[ "${gitcore}" == "" ]] ; then
print_result ${FAILURE} "No git file in ${MOUNTPOINT}/${GIT_CORE}."
else
print_result ${SUCCESS} "git core directory exists and is not empty."
fi
echo "* test bashrc changes for git paths quick fix"
if [[ ${gitalias} == "" ]] ; then if [[ "${gitexport}" == "" ]] ; then
print_result ${FAILURE} "Expected alias for git command not in ${MOUNTPOINT}/${BASHRC}. Should be: ${EXPECTED_ALIAS}" print_result ${FAILURE} "Expected alias for git command not in ${MOUNTPOINT}/${BASHRC}. There should be: ${GIT_EXPECTED_EXPORT}"
else else
print_result ${SUCCESS} "git alias is correct." print_result ${SUCCESS} "git alias is correct."
fi fi
...@@ -86,6 +99,14 @@ else ...@@ -86,6 +99,14 @@ else
else else
print_result ${FAILURE} "Expected virtualenv binary not in ${MOUNTPOINT}/${VIRTUALENV_BIN}." print_result ${FAILURE} "Expected virtualenv binary not in ${MOUNTPOINT}/${VIRTUALENV_BIN}."
fi fi
echo "* test if Chromium policies are installed"
if [[ ${chromium_policy} ]] ; then
print_result ${SUCCESS} "Chromium policies are installed."
else
print_result ${FAILURE} "Expected Chromium policies file not in ${MOUNTPOINT}/${CHROMIUM_POLICY}."
fi
fi fi
exit ${HAS_FAILED} exit ${HAS_FAILED}
...@@ -4,46 +4,30 @@ extends = ...@@ -4,46 +4,30 @@ extends =
../../stack/slapos.cfg ../../stack/slapos.cfg
parts += parts +=
# use stack/slapos.cfg
slapos-cookbook slapos-cookbook
verify-packages-exist-on-host
template-instance template-instance
install-eggs-for-the-instance git
curl
versions = versions
[versions] [versions]
slapos.recipe.template = 3.0 slapos.recipe.template = 3.0
[verify-packages-exist-on-host]
recipe = plone.recipe.command
stop-on-error = true
# run the same command when installing and on updates
update-command = ${:command}
command = sudo -V
[template-instance] [template-instance]
# create the instance.cfg file in the buildout directory # jinja2 render instance.cfg file in the buildout directory
# (use jinja for templating)
recipe = slapos.recipe.template:jinja2 recipe = slapos.recipe.template:jinja2
template = ${:_profile_base_location_}/instance.cfg template = ${:_profile_base_location_}/instance.cfg
rendered = ${buildout:directory}/instance.cfg rendered = ${buildout:directory}/instance.cfg
md5sum = be6bd665c0b356a84090d200ea14b33c
mode = 0644 mode = 0644
scripts_dir = ${:_profile_base_location_}/scripts md5sum = 154882944c6a58642629c17d47b4f6fc
logo_dir = ${:_profile_base_location_}/logo
curl_path = ${curl:location}/bin
git_path = ${git:location}/bin
context = context =
# for access to the eggs from the instance key software_dir :_profile_base_location_
key instance_dir buildout:directory
key curl_path curl:location
key git_path git:location
key eggs_directory buildout:eggs-directory key eggs_directory buildout:eggs-directory
key develop_eggs_directory buildout:develop-eggs-directory key develop_eggs_directory buildout:develop-eggs-directory
key scripts_dir :scripts_dir
key logo_dir :logo_dir
key curl_path :curl_path
key git_path :git_path
[install-eggs-for-the-instance]
# after installation of the eggs, the recipes
# will be available (added to sys.path)
recipe = zc.recipe.egg
eggs = slapos.recipe.build
plone.recipe.command
...@@ -83,7 +83,7 @@ md5sum = d41d8cd98f00b204e9800998ecf8427e ...@@ -83,7 +83,7 @@ md5sum = d41d8cd98f00b204e9800998ecf8427e
[template-erp5] [template-erp5]
filename = instance-erp5.cfg.in filename = instance-erp5.cfg.in
md5sum = 64fe4800dc9430aac8e325ba4b3d97ae md5sum = 52ac560be07f254618631b84d2d58f41
[template-zeo] [template-zeo]
filename = instance-zeo.cfg.in filename = instance-zeo.cfg.in
...@@ -95,7 +95,7 @@ md5sum = a2377d5c53fd2a441ea713b428e4844b ...@@ -95,7 +95,7 @@ md5sum = a2377d5c53fd2a441ea713b428e4844b
[template-balancer] [template-balancer]
filename = instance-balancer.cfg.in filename = instance-balancer.cfg.in
md5sum = d2a339d0bc2f05f3f1f78defffae6ab6 md5sum = 25d0ebecda78d1440dacd3495d53c928
[template-haproxy-cfg] [template-haproxy-cfg]
filename = haproxy.cfg.in filename = haproxy.cfg.in
......
...@@ -219,7 +219,7 @@ path = ${directory:promise}/apache ...@@ -219,7 +219,7 @@ path = ${directory:promise}/apache
hostname = {{ ipv4 }} hostname = {{ ipv4 }}
port = {{ apache_dict.values()[0][0] }} port = {{ apache_dict.values()[0][0] }}
[publish] [{{ section('publish') }}]
recipe = slapos.cookbook:publish.serialised recipe = slapos.cookbook:publish.serialised
{% for family_name, (apache_port, scheme, _, _) in apache_dict.items() -%} {% for family_name, (apache_port, scheme, _, _) in apache_dict.items() -%}
{{ family_name ~ '-v6' }} = {% if ipv6_set %}{{ scheme ~ '://[' ~ ipv6 ~ ']:' ~ apache_port }}{% endif %} {{ family_name ~ '-v6' }} = {% if ipv6_set %}{{ scheme ~ '://[' ~ ipv6 ~ ']:' ~ apache_port }}{% endif %}
...@@ -260,7 +260,7 @@ cert = ...@@ -260,7 +260,7 @@ cert =
crl = crl =
{%- endif %} {%- endif %}
[logrotate-apache] [{{ section('logrotate-apache') }}]
< = logrotate-entry-base < = logrotate-entry-base
name = apache name = apache
log = ${apache-conf-parameter-dict:error-log} ${apache-conf-parameter-dict:access-log} log = ${apache-conf-parameter-dict:error-log} ${apache-conf-parameter-dict:access-log}
...@@ -271,7 +271,7 @@ recipe = slapos.cookbook:mkdirectory ...@@ -271,7 +271,7 @@ recipe = slapos.cookbook:mkdirectory
apache-conf = ${:etc}/apache apache-conf = ${:etc}/apache
bin = ${buildout:directory}/bin bin = ${buildout:directory}/bin
etc = ${buildout:directory}/etc etc = ${buildout:directory}/etc
promise = ${directory:etc}/promise promise = ${:etc}/promise
services = ${:etc}/run services = ${:etc}/run
var = ${buildout:directory}/var var = ${buildout:directory}/var
run = ${:var}/run run = ${:var}/run
...@@ -284,7 +284,7 @@ newcerts = ${:ca-dir}/newcerts ...@@ -284,7 +284,7 @@ newcerts = ${:ca-dir}/newcerts
crl = ${:ca-dir}/crl crl = ${:ca-dir}/crl
apachedex = ${monitor-directory:private}/apachedex apachedex = ${monitor-directory:private}/apachedex
[monitor-generate-apachedex-report] [{{ section('monitor-generate-apachedex-report') }}]
recipe = slapos.cookbook:wrapper recipe = slapos.cookbook:wrapper
wrapper-path = ${monitor-directory:reports}/${:command} wrapper-path = ${monitor-directory:reports}/${:command}
command-line = "{{ parameter_dict['run-apachedex-location'] }}" "{{ parameter_dict['apachedex-location'] }}" "${directory:apachedex}" --default "${apachedex-parameters:default}" --apache-log-list "${apachedex-parameters:apache-log-list}" --base-list "${apachedex-parameters:base-list}" --skip-base-list "${apachedex-parameters:skip-base-list}" --erp5-base-list "${apachedex-parameters:erp5-base-list}" command-line = "{{ parameter_dict['run-apachedex-location'] }}" "{{ parameter_dict['apachedex-location'] }}" "${directory:apachedex}" --default "${apachedex-parameters:default}" --apache-log-list "${apachedex-parameters:apache-log-list}" --base-list "${apachedex-parameters:base-list}" --skip-base-list "${apachedex-parameters:skip-base-list}" --erp5-base-list "${apachedex-parameters:erp5-base-list}"
...@@ -316,7 +316,4 @@ extends = ...@@ -316,7 +316,4 @@ extends =
{{ logrotate_cfg }} {{ logrotate_cfg }}
{{ parameter_dict['template-monitor'] }} {{ parameter_dict['template-monitor'] }}
parts += parts +=
publish
logrotate-apache
monitor-generate-apachedex-report
{{ part_list | join('\n ') }} {{ part_list | join('\n ') }}
{% import "root_common" as root_common with context %} {% import "root_common" as root_common with context -%}
{% set frontend_dict = slapparameter_dict.get('frontend', {}) -%} {% set frontend_dict = slapparameter_dict.get('frontend', {}) -%}
{% set has_frontend = frontend_dict.get('software-url', '') != '' -%} {% set has_frontend = frontend_dict.get('software-url', '') != '' -%}
{% set site_id = slapparameter_dict.get('site-id', 'erp5') -%} {% set site_id = slapparameter_dict.get('site-id', 'erp5') -%}
......
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