instance.cfg 4.79 KB
Newer Older
1 2 3 4 5 6
# 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})

iv's avatar
iv committed
7 8
[buildout]
parts =
9
  monitor-base
iv's avatar
iv committed
10
  parameters
11
  promise-sudo-on-host
12
  template-full-build-script
13 14
  template-sudo-wrapper
  template-cros-sdk-wrapper
iv's avatar
iv committed
15

16
extends = {{ monitor_template }}
17
# standard declaration of eggs directories
iv's avatar
iv committed
18 19 20 21 22
eggs-directory = {{ eggs_directory }}
develop-eggs-directory = {{ develop_eggs_directory }}

#################################### Tools, sources getter ##################################

23
[depot-tools]
iv's avatar
iv committed
24 25 26 27
# needed for the "repo" command (to download many git repositories)
recipe = slapos.recipe.build:gitclone
repository = https://chromium.googlesource.com/chromium/tools/depot_tools.git
branch = master
28
git-executable = {{ git_path }}/bin/git
iv's avatar
iv committed
29

30 31 32
[customize-path]
# add depot tools directory (for cros_sdk binary among others) and git directory to the path
command =
33
  export PATH="${directory:wrapper_dir}":"{{ git_path }}/bin":"{{ curl_path }}/bin":"${depot-tools:location}":"{{thin_provisioning_tools}}/sbin":"$PATH";
34 35 36 37

[nayuos-ebuilds]
recipe = slapos.recipe.build:gitclone
repository = https://lab.nexedi.com/nexedi/nayuos-ebuilds.git
iv's avatar
iv committed
38
branch = master
39
git-executable = {{ git_path }}/bin/git
iv's avatar
iv committed
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54

############################################################################################

[parameters]
# for use of the "parameters" XML configuration given from the
# webrunner interface
# if needed, .serialized => json (more complex structures are OK, but need another 
# jinja template for reading the content of the parameters)
recipe = slapos.cookbook:slapconfiguration
computer = ${slap_connection:computer_id}
partition = ${slap_connection:partition_id}
url = ${slap_connection:server_url}
key = ${slap_connection:key_file}
cert = ${slap_connection:cert_file}

55 56 57 58
[directory]
recipe = slapos.cookbook:mkdirectory
log = ${buildout:directory}/var/log
run = ${buildout:directory}/etc/run
59
wrapper_dir = ${buildout:directory}/wrapper_bin
60
cros_location = ${buildout:directory}/parts/chromiumos
61

62
[bin]
63
# dummy section to hold references to frequently used binaries
64 65 66 67
wrapper_cros_sdk=${directory:wrapper_dir}/wrapper_cros_sdk
bash=/bin/bash
sudo=/usr/bin/sudo

68
[promise-sudo-on-host-bin]
69
recipe  = slapos.cookbook:wrapper
70
wrapper-path = ${directory:bin}/${:_buildout_section_name_}
71 72
command-line = sudo -V

73 74 75 76 77 78 79
[promise-sudo-on-host]
# assert sudo is installed, as it is required to enter the chroot 'cros_sdk'
<= monitor-promise-base
module = check_command_execute
name = ${:_buildout_section_name_}.py
config-command = ${promise-sudo-on-host-bin:wrapper-path}

80 81
[template-sudo-wrapper]
recipe = slapos.recipe.template:jinja2
82
template = {{ software_dir }}/scripts/wrapper_sudo.in
83 84 85 86 87 88 89 90 91 92
rendered = ${directory:wrapper_dir}/sudo
md5sum = ded5a92be4e37ec32eb9d3087d3e19bd
mode = 0700
context =
  key fake_cros_sdk_path bin:wrapper_cros_sdk
  key bash_path bin:bash
  key host_sudo_path bin:sudo

[template-cros-sdk-wrapper]
recipe = slapos.recipe.template:jinja2
93
template = {{ software_dir }}/scripts/wrapper_cros_sdk.in
94 95 96 97 98 99
rendered = ${bin:wrapper_cros_sdk}
md5sum = 7159fe3d5b85a283733cf686c4ee0a74
mode = 0700
context =
# XXX bash path is the one from the host
  key bash_path bin:bash
100 101
  raw git_path  {{ git_path }}/bin
  raw curl_path {{ curl_path }}/bin
102

103
[template-full-build-script]
104
# create the rendered script in the buildout-directory/etc/run
105 106
# (use jinja for templating)
recipe = slapos.recipe.template:jinja2
107
template = {{ software_dir }}/scripts/cros_full_build.in
108
rendered = ${directory:run}/cros_full_build
109
md5sum = f3b3b5408b69f752f2221d3965caf590
110
mode = 0700
111
context =
112 113 114 115 116 117 118
  key bash_path                         bin:bash
  key instance_log_dir                  directory:log
  key cros_location                     directory:cros_location
  key export_path_cmd                   customize-path:command
  key branch                            parameters:configuration.branch
  key boards_list                       parameters:configuration.boards
  key keep_cache                        parameters:configuration.keep_cache
119 120 121
  key ebuilds_dir                       nayuos-ebuilds:location
  raw scripts_dir                       {{ software_dir }}/scripts
  raw logo_dir                          {{ software_dir }}/logo
122
  raw wallpaper_dir                     {{ software_dir }}/wallpaper
123
  raw patch_dir                         {{ software_dir }}/patch
124 125
# packages to be copied from our overlay into ChromiuOS' overlay
# those packages will be marked as dependency of root filesystem
126
  raw nayu_dev_rootfs_packages          app-misc/nayuos-chromium-policy
127
# those packages will be marked as dependency of the chromium build itself
128
  raw nayu_dev_packages                 dev-vcs/git dev-python/flask dev-python/virtualenv sys-fs/cryptsetup