kameleon-builder 2.1.3 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.editorconfig +0 -0
- data/.env +2 -6
- data/CHANGELOG.rst +74 -1
- data/Gemfile +20 -2
- data/README.rst +35 -25
- data/Thorfile +29 -0
- data/contrib/kameleon_bashrc.sh +61 -0
- data/contrib/polipo_env.sh +3 -2
- data/kameleon-builder.gemspec +3 -10
- data/lib/kameleon.rb +10 -14
- data/lib/kameleon/cli.rb +92 -105
- data/lib/kameleon/context.rb +76 -43
- data/lib/kameleon/engine.rb +147 -103
- data/lib/kameleon/environment.rb +10 -5
- data/lib/kameleon/error.rb +1 -32
- data/lib/kameleon/persistent_cache.rb +127 -29
- data/lib/kameleon/recipe.rb +63 -106
- data/lib/kameleon/shell.rb +32 -17
- data/lib/kameleon/step.rb +18 -1
- data/lib/kameleon/ui.rb +141 -0
- data/lib/kameleon/utils.rb +9 -0
- data/templates/{debian7-chroot.yaml → chroot/debian7-amd64.yaml} +29 -21
- data/templates/{docker-debian7.yaml → docker/debian7.yaml} +5 -5
- data/templates/extend.erb +2 -2
- data/templates/{debian7-g5k.yaml → grid5000/debian7.yaml} +1 -1
- data/templates/{archlinux-desktop.yaml → qemu/archlinux-desktop-i686.yaml} +2 -2
- data/templates/qemu/archlinux-desktop-x86_64.yaml +25 -0
- data/templates/qemu/archlinux-i686.yaml +25 -0
- data/templates/{archlinux.yaml → qemu/archlinux-x86_64.yaml} +37 -34
- data/templates/qemu/centos6.5-x86_64.yaml +113 -0
- data/templates/qemu/centos7-x86_64.yaml +119 -0
- data/templates/{debian7.yaml → qemu/debian7-amd64.yaml} +45 -40
- data/templates/{debian7-desktop.yaml → qemu/debian7-desktop-amd64.yaml} +2 -3
- data/templates/{debian7-kameleon.yaml → qemu/debian7-kameleon-amd64.yaml} +3 -6
- data/templates/{debian7-oar-dev.yaml → qemu/debian7-oar-amd64.yaml} +2 -2
- data/templates/qemu/debian8-amd64.yaml +25 -0
- data/templates/{fedora20-desktop.yaml → qemu/fedora20-desktop-x86_64.yaml} +2 -2
- data/templates/qemu/fedora20-x86_64.yaml +116 -0
- data/templates/{ubuntu-12.04.yaml → qemu/ubuntu-12.04-amd64.yaml} +42 -38
- data/templates/{ubuntu-12.04-desktop.yaml → qemu/ubuntu-12.04-desktop-amd64.yaml} +3 -3
- data/templates/{ubuntu-14.04.yaml → qemu/ubuntu-14.04-amd64.yaml} +2 -2
- data/templates/{ubuntu-14.04-desktop.yaml → qemu/ubuntu-14.04-desktop-amd64.yaml} +2 -2
- data/templates/steps/aliases/defaults.yaml +19 -13
- data/templates/steps/bootstrap/archlinux/arch_bootstrap.yaml +11 -19
- data/templates/steps/bootstrap/debian/debootstrap.yaml +10 -11
- data/templates/steps/bootstrap/debian/debootstrap_arm.yaml +11 -19
- data/templates/steps/bootstrap/fedora/init_pxeboot.yaml +13 -0
- data/templates/steps/bootstrap/fedora/yum_bootstrap.yaml +45 -0
- data/templates/steps/bootstrap/initialize_disk.yaml +16 -0
- data/templates/steps/bootstrap/initialize_disk_chroot.yaml +10 -14
- data/templates/steps/bootstrap/install_requirements.yaml +3 -0
- data/templates/steps/bootstrap/prepare_docker.yaml +7 -7
- data/templates/steps/bootstrap/prepare_qemu.yaml +20 -26
- data/templates/steps/bootstrap/prepare_virtualbox.yaml +63 -0
- data/templates/steps/bootstrap/start_chroot.yaml +2 -13
- data/templates/steps/bootstrap/start_qemu.yaml +50 -53
- data/templates/steps/bootstrap/start_virtualbox.yaml +37 -0
- data/templates/steps/bootstrap/switch_context_qemu.yaml +64 -0
- data/templates/steps/bootstrap/switch_context_virtualbox.yaml +66 -0
- data/templates/steps/breakpoint.yaml +2 -1
- data/templates/steps/checkpoints/docker.yaml +14 -11
- data/templates/steps/checkpoints/qcow2.yaml +26 -24
- data/templates/steps/checkpoints/qemu.yaml +30 -36
- data/templates/steps/checkpoints/virtualbox.yaml +21 -0
- data/templates/steps/disable_checkpoint.yaml +3 -0
- data/templates/steps/enable_checkpoint.yaml +5 -0
- data/templates/steps/export/qemu_save_appliance.yaml +52 -0
- data/templates/steps/export/virtualbox_save_appliance.yaml +67 -0
- data/templates/steps/setup/archlinux/install_bootloader.yaml +23 -0
- data/templates/steps/setup/centos/6.5/configure_network.yaml +31 -0
- data/templates/steps/setup/centos/6.5/configure_system.yaml +27 -0
- data/templates/steps/setup/debian/configure_apt.yaml +1 -6
- data/templates/steps/setup/debian/configure_kernel.yaml +0 -5
- data/templates/steps/setup/debian/install_bootloader.yaml +36 -0
- data/templates/steps/setup/debian/setup_vagrant_box.yaml +48 -18
- data/templates/steps/setup/debian/upgrade_system.yaml +2 -7
- data/templates/steps/setup/fedora/configure_kernel.yaml +9 -0
- data/templates/steps/setup/fedora/configure_keyboard.yaml +12 -0
- data/templates/steps/setup/fedora/configure_network.yaml +9 -1
- data/templates/steps/setup/fedora/configure_system.yaml +20 -45
- data/templates/steps/setup/fedora/install_bootloader.yaml +58 -0
- data/templates/steps/setup/fedora/minimal_install.yaml +3 -0
- data/templates/steps/setup/fedora/update_system.yaml +13 -5
- data/templates/steps/setup/ubuntu/configure_apt.yaml +4 -9
- data/templates/vagrant/debian7-amd64.yaml +130 -0
- data/templates/virtualbox/archlinux-desktop-i686.yaml +25 -0
- data/templates/virtualbox/archlinux-desktop-x86_64.yaml +28 -0
- data/templates/virtualbox/archlinux-i686.yaml +28 -0
- data/templates/virtualbox/archlinux-x86_64.yaml +109 -0
- data/templates/virtualbox/centos6.5-i386.yaml +39 -0
- data/templates/virtualbox/centos6.5-x86_64.yaml +111 -0
- data/templates/virtualbox/centos7-x86_64.yaml +116 -0
- data/{docs/source/debian7.yaml → templates/virtualbox/debian7-amd64.yaml} +53 -52
- data/templates/virtualbox/debian7-desktop-amd64.yaml +25 -0
- data/templates/{fedora-rawhide.yaml → virtualbox/debian7-i386.yaml} +12 -11
- data/templates/virtualbox/debian7-kameleon-amd64.yaml +38 -0
- data/templates/virtualbox/debian7-oar-amd64.yaml +51 -0
- data/templates/{debian-testing.yaml → virtualbox/debian8-amd64.yaml} +3 -3
- data/templates/virtualbox/debian8-i386.yaml +31 -0
- data/templates/virtualbox/fedora20-x86_64.yaml +116 -0
- data/templates/virtualbox/ubuntu-12.04-amd64.yaml +128 -0
- data/templates/virtualbox/ubuntu-12.04-desktop-amd64.yaml +25 -0
- data/templates/virtualbox/ubuntu-14.04-amd64.yaml +25 -0
- data/templates/virtualbox/ubuntu-14.04-desktop-amd64.yaml +27 -0
- data/version.txt +1 -1
- metadata +67 -212
- data/Rakefile +0 -24
- data/docs/.gitignore +0 -1
- data/docs/Makefile +0 -181
- data/docs/README.md +0 -17
- data/docs/make.bat +0 -242
- data/docs/source/_static/.gitignore +0 -0
- data/docs/source/_static/centos.png +0 -0
- data/docs/source/_static/debian.png +0 -0
- data/docs/source/_static/kameleon-logo.png +0 -0
- data/docs/source/_static/kameleon-logo.xcf +0 -0
- data/docs/source/_static/kameleon-long.png +0 -0
- data/docs/source/_static/ubuntu.png +0 -0
- data/docs/source/_themes/sphinx_rtd_theme/__init__.py +0 -17
- data/docs/source/_themes/sphinx_rtd_theme/breadcrumbs.html +0 -19
- data/docs/source/_themes/sphinx_rtd_theme/footer.html +0 -32
- data/docs/source/_themes/sphinx_rtd_theme/layout.html +0 -160
- data/docs/source/_themes/sphinx_rtd_theme/layout_old.html +0 -205
- data/docs/source/_themes/sphinx_rtd_theme/search.html +0 -50
- data/docs/source/_themes/sphinx_rtd_theme/searchbox.html +0 -7
- data/docs/source/_themes/sphinx_rtd_theme/static/css/badge_only.css +0 -1
- data/docs/source/_themes/sphinx_rtd_theme/static/css/theme.css +0 -4
- data/docs/source/_themes/sphinx_rtd_theme/static/fonts/FontAwesome.otf +0 -0
- data/docs/source/_themes/sphinx_rtd_theme/static/fonts/fontawesome-webfont.eot +0 -0
- data/docs/source/_themes/sphinx_rtd_theme/static/fonts/fontawesome-webfont.svg +0 -414
- data/docs/source/_themes/sphinx_rtd_theme/static/fonts/fontawesome-webfont.ttf +0 -0
- data/docs/source/_themes/sphinx_rtd_theme/static/fonts/fontawesome-webfont.woff +0 -0
- data/docs/source/_themes/sphinx_rtd_theme/static/js/theme.js +0 -47
- data/docs/source/_themes/sphinx_rtd_theme/theme.conf +0 -8
- data/docs/source/_themes/sphinx_rtd_theme/versions.html +0 -37
- data/docs/source/aliases.rst +0 -31
- data/docs/source/atlas_debian_g5k.yaml +0 -36
- data/docs/source/checkpoint.rst +0 -30
- data/docs/source/commands.rst +0 -63
- data/docs/source/conf.py +0 -262
- data/docs/source/context.rst +0 -47
- data/docs/source/debian_customized.yaml +0 -28
- data/docs/source/debian_customized_g5k.yaml +0 -21
- data/docs/source/faq.rst +0 -43
- data/docs/source/getting_started.rst +0 -260
- data/docs/source/grid5000_tutorial.rst +0 -525
- data/docs/source/index.rst +0 -53
- data/docs/source/install_atlas.yaml +0 -25
- data/docs/source/install_hpl.yaml +0 -24
- data/docs/source/installation.rst +0 -51
- data/docs/source/persistent_cache.rst +0 -34
- data/docs/source/recipe.rst +0 -177
- data/docs/source/tau_install.yaml +0 -19
- data/docs/source/tau_install_g5k.yaml +0 -25
- data/docs/source/use_cases.rst +0 -93
- data/docs/source/workspace.rst +0 -13
- data/lib/kameleon/logger.rb +0 -56
- data/omnibus/.gitignore +0 -11
- data/omnibus/.kitchen.yml +0 -25
- data/omnibus/Berksfile +0 -9
- data/omnibus/Berksfile.lock +0 -25
- data/omnibus/Gemfile +0 -12
- data/omnibus/README.md +0 -94
- data/omnibus/config/projects/kameleon.rb +0 -23
- data/omnibus/config/software/kameleon.rb +0 -24
- data/omnibus/config/software/polipo.rb +0 -30
- data/omnibus/config/software/ruby.rb +0 -158
- data/omnibus/files/mac_dmg/Resources/background.png +0 -0
- data/omnibus/files/mac_dmg/Resources/icon.png +0 -0
- data/omnibus/files/mac_pkg/Resources/background.png +0 -0
- data/omnibus/files/mac_pkg/Resources/license.html +0 -1
- data/omnibus/files/mac_pkg/Resources/welcome.html +0 -9
- data/omnibus/omnibus.rb +0 -27
- data/omnibus/package-scripts/kameleon/makeselfinst +0 -27
- data/omnibus/package-scripts/kameleon/postrm +0 -9
- data/templates/fedora20.yaml +0 -105
- data/templates/steps/bootstrap/archlinux/install_bootloader.yaml +0 -46
- data/templates/steps/bootstrap/archlinux/populate_disk.yaml +0 -39
- data/templates/steps/bootstrap/fedora/liveos_bootstrap.yaml +0 -123
- data/templates/steps/bootstrap/initialize_disk_qemu.yaml +0 -72
- data/templates/steps/bootstrap/install_bootloader.yaml +0 -42
- data/templates/steps/bootstrap/ubuntu/debootstrap.yaml +0 -27
- data/templates/steps/export/save_appliance.yaml +0 -58
- data/templates/steps/export/save_vagrant_box.yaml +0 -29
- data/templates/vagrant-debian7.yaml +0 -31
data/docs/source/context.rst
DELETED
@@ -1,47 +0,0 @@
|
|
1
|
-
.. _`context`:
|
2
|
-
|
3
|
-
-------
|
4
|
-
Context
|
5
|
-
-------
|
6
|
-
|
7
|
-
To understand how Kameleon works you have to get the *context* notion. A context
|
8
|
-
is an execution environnement with its variables (like $PATH, $TERM,...), its
|
9
|
-
tools (debootstrap, yum, ...) and all its specifics (filesystem, local/remote,
|
10
|
-
...).
|
11
|
-
|
12
|
-
It also manage the connections to your context and make it easy and reliable.
|
13
|
-
When you build an appliance you deal with 3 contexts:
|
14
|
-
|
15
|
-
- The *local* context which is the Kameleon execution environnement
|
16
|
-
- The *out* context where you will bootstrap the appliance
|
17
|
-
- The *in* context which is inside the newly created appliance
|
18
|
-
|
19
|
-
These context are setup using the two globals variables: ``out_context``
|
20
|
-
and ``in_context``. They both takes 3 arguments:
|
21
|
-
|
22
|
-
cmd
|
23
|
-
The command to initialize the context
|
24
|
-
workdir (optional)
|
25
|
-
The working directory to tell to Kameleon where to execute the command
|
26
|
-
exec_prefix (optional)
|
27
|
-
The command to execute before every Kameleon command in this context
|
28
|
-
|
29
|
-
For example, you are building an appliance on your laptop and you run Kameleon
|
30
|
-
in a bash shell with this configuration:
|
31
|
-
|
32
|
-
.. code-block:: yaml
|
33
|
-
|
34
|
-
out_context:
|
35
|
-
cmd: bash
|
36
|
-
workdir: $$kameleon_cwd
|
37
|
-
|
38
|
-
in_context:
|
39
|
-
cmd: chroot $$rootfs bash
|
40
|
-
workdir: /
|
41
|
-
|
42
|
-
|
43
|
-
Your *local* context is this shell where you launch Kameleon on your laptop,
|
44
|
-
the *out* is a child bash of this context, and the *in* is inside the new
|
45
|
-
environnement accessed by the chroot. As you can see the local and the out
|
46
|
-
context are often very similar but sometimes it could be useful for the out
|
47
|
-
context to be elsewhere (in a VM for example).
|
@@ -1,28 +0,0 @@
|
|
1
|
-
#==============================================================================
|
2
|
-
# vim: softtabstop=2 shiftwidth=2 expandtab fenc=utf-8 cc=81 tw=80
|
3
|
-
#==============================================================================
|
4
|
-
#
|
5
|
-
# DESCRIPTION: <MY RECIPE DESCRIPTION>
|
6
|
-
#
|
7
|
-
#==============================================================================
|
8
|
-
|
9
|
-
---
|
10
|
-
extend: debian7
|
11
|
-
|
12
|
-
global:
|
13
|
-
# You can see the base template `debian7.yaml` to know the
|
14
|
-
# variables that you can override
|
15
|
-
# g5k_user: cruizsanabria # CHANGE ME
|
16
|
-
# g5k_site: grenoble # CHANGE ME
|
17
|
-
|
18
|
-
bootstrap:
|
19
|
-
- @base
|
20
|
-
|
21
|
-
setup:
|
22
|
-
- @base
|
23
|
-
- install_software:
|
24
|
-
- packages: >
|
25
|
-
g++ make taktuk openssh-server openmpi-bin openmpi-common openmpi-dev
|
26
|
-
# - tau_install
|
27
|
-
export:
|
28
|
-
- @base
|
@@ -1,21 +0,0 @@
|
|
1
|
-
|
2
|
-
---
|
3
|
-
extend: debian7-g5k
|
4
|
-
|
5
|
-
global:
|
6
|
-
# You can see the base template `debian7.yaml` to know the
|
7
|
-
# variables that you can override
|
8
|
-
g5k_user: cruizsanabria # CHANGE ME
|
9
|
-
g5k_site: grenoble # CHANGE ME
|
10
|
-
|
11
|
-
bootstrap:
|
12
|
-
- @base
|
13
|
-
|
14
|
-
setup:
|
15
|
-
- @base
|
16
|
-
- install_software:
|
17
|
-
- packages: >
|
18
|
-
g++ make taktuk openssh-server openmpi-bin openmpi-common openmpi-dev
|
19
|
-
- tau_install
|
20
|
-
export:
|
21
|
-
- @base
|
data/docs/source/faq.rst
DELETED
@@ -1,43 +0,0 @@
|
|
1
|
-
---
|
2
|
-
FAQ
|
3
|
-
---
|
4
|
-
|
5
|
-
.. note::
|
6
|
-
Work in progress...
|
7
|
-
|
8
|
-
Why my step file is not valid?
|
9
|
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
10
|
-
When you try to build your recipe, you gat this message::
|
11
|
-
|
12
|
-
[global]: The macrostep /path/to/my/step/step.yaml is not valid
|
13
|
-
|
14
|
-
It means your step is not a valid YAML file. Be sure that you did not use some tabulations
|
15
|
-
instead of spaces or mix dictionnary and list in the same level. It is recommended to (re)read
|
16
|
-
the :doc:`recipe` documentation.
|
17
|
-
|
18
|
-
I have some troubles with qemu-nbd, what should I do?
|
19
|
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
20
|
-
qemu-nbd is heavily used is some recipes and when the recipe crash it can be left in a
|
21
|
-
bad state. So, when you build you got this::
|
22
|
-
|
23
|
-
qemu-nbd: Failed to bdrv_open ...
|
24
|
-
nbd device /dev/nbd2 is unavailable
|
25
|
-
|
26
|
-
It means the that the ``/dev/ndb2`` device is not available anymore so go to the recipe and
|
27
|
-
change the value of ``nbd_device`` to something else like ``/dev/nbd3``.
|
28
|
-
|
29
|
-
.. note::
|
30
|
-
This is a cleaning problem and this is just a workaround. If you find an way to be clean
|
31
|
-
the nbd device correctly lest us know!
|
32
|
-
|
33
|
-
If the problem persist you can try to reboot your computer or remove the entire build directory.
|
34
|
-
|
35
|
-
What is a *mapping value*?
|
36
|
-
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
37
|
-
|
38
|
-
When you write a command and you got this error::
|
39
|
-
|
40
|
-
Error: ... mapping values are not allowed in this context at line 6 column 27
|
41
|
-
|
42
|
-
In YAML the mapping value is a ``:`` character. If you put this in a command the YAML parser
|
43
|
-
will not understand and raise an error. Just put some quotes around your command and that's it!
|
@@ -1,260 +0,0 @@
|
|
1
|
-
---------------
|
2
|
-
Getting Started
|
3
|
-
---------------
|
4
|
-
|
5
|
-
Installation
|
6
|
-
~~~~~~~~~~~~
|
7
|
-
|
8
|
-
To install Kameleon have a look at the :doc:`installation` section.
|
9
|
-
|
10
|
-
Create a new recipe from template
|
11
|
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
12
|
-
|
13
|
-
First thing to know is that Kameleon is an automation tool for bash. It brings
|
14
|
-
the ease of error handling, retry, checkpointing, easy debugging and cleaning
|
15
|
-
to your scripts to help you build your software appliance.
|
16
|
-
|
17
|
-
The template system built-in allows you quickly build a system and to understand the
|
18
|
-
Kameleon basics. Let see the template list::
|
19
|
-
|
20
|
-
kameleon templates
|
21
|
-
|
22
|
-
It shows the templates names and descriptions directly from the templates files shipped
|
23
|
-
with Kameleon::
|
24
|
-
|
25
|
-
The following templates are available in /var/lib/gems/1.9.1/gems/kameleon-builder-2.0.0/templates:
|
26
|
-
NAME | DESCRIPTION
|
27
|
-
---------------------|-----------------------------------------------------------
|
28
|
-
archlinux | Build an Archlinux base system system.
|
29
|
-
archlinux-desktop | Archlinux GNOME Desktop edition.
|
30
|
-
debian-testing | Debian Testing base system
|
31
|
-
debian7 | Debian 7 (Wheezy) base system
|
32
|
-
debian7-desktop | Debian 7 (Wheezy) GNOME Desktop edition.
|
33
|
-
debian7-kameleon | Debian 7 appliance with kameleon.
|
34
|
-
debian7-oar-dev | Debian 7 dev appliance with OAR-2.5 (node/server/frontend).
|
35
|
-
docker-debian7 | Build a debian image for docker with docker
|
36
|
-
fedora-rawhide | Fedora Rawhide base system
|
37
|
-
fedora20 | Fedora 20 base system
|
38
|
-
fedora20-desktop | Fedora 20 GNOME Desktop edition
|
39
|
-
old-debian7 | [deprecated] Build a debian wheezy appliance using chroot...
|
40
|
-
ubuntu-12.04 | Ubuntu 12.04 LTS (Precise Pangolin) base system.
|
41
|
-
ubuntu-12.04-desktop | Ubuntu 12.04 LTS (Precise Pangolin) Desktop edition.
|
42
|
-
ubuntu-14.04 | Ubuntu 14.04 LTS (Trusty Tahr) base system.
|
43
|
-
ubuntu-14.04-desktop | Ubuntu 14.04 LTS (Trusty Tahr) Desktop edition.
|
44
|
-
vagrant-debian7 | A standard Debian 7 vagrant base box
|
45
|
-
|
46
|
-
Let's pick one of these. The ``debian7`` is a good example. Now you
|
47
|
-
will create a new recipe from this template. Let's name it ``my_debian``::
|
48
|
-
|
49
|
-
kameleon new my_debian debian7
|
50
|
-
|
51
|
-
Kameleon make a direct copy of the YAML template recipe file and all
|
52
|
-
the other required files like steps or aliases ones. You can see that in the
|
53
|
-
``new`` command output::
|
54
|
-
|
55
|
-
[kameleon]: Cloning template 'debian7'...
|
56
|
-
[kameleon]: create /root/debian7.yaml
|
57
|
-
[kameleon]: create /root/steps/aliases/defaults.yaml
|
58
|
-
[kameleon]: create /root/steps/checkpoints/qemu.yaml
|
59
|
-
[kameleon]: create /root/steps/export/save_appliance.yaml
|
60
|
-
[kameleon]: create /root/steps/setup/debian/configure_apt.yaml
|
61
|
-
[kameleon]: create /root/steps/setup/debian/upgrade_system.yaml
|
62
|
-
[kameleon]: create /root/steps/setup/debian/install_software.yaml
|
63
|
-
[kameleon]: create /root/steps/setup/debian/configure_kernel.yaml
|
64
|
-
[kameleon]: create /root/steps/setup/debian/configure_system.yaml
|
65
|
-
[kameleon]: create /root/steps/setup/debian/configure_keyboard.yaml
|
66
|
-
[kameleon]: create /root/steps/setup/debian/configure_network.yaml
|
67
|
-
[kameleon]: create /root/steps/setup/create_group.yaml
|
68
|
-
[kameleon]: create /root/steps/setup/create_user.yaml
|
69
|
-
[kameleon]: create /root/steps/bootstrap/debian/debootstrap.yaml
|
70
|
-
[kameleon]: create /root/steps/bootstrap/initialize_disk_qemu.yaml
|
71
|
-
[kameleon]: create /root/steps/bootstrap/prepare_qemu.yaml
|
72
|
-
[kameleon]: create /root/steps/bootstrap/install_bootloader.yaml
|
73
|
-
[kameleon]: create /root/steps/bootstrap/start_qemu.yaml
|
74
|
-
[kameleon]: Creating extended recipe from template 'debian7'...
|
75
|
-
[kameleon]: create /root/my_debian.yaml
|
76
|
-
[kameleon]: done
|
77
|
-
|
78
|
-
You can check that you got all the files in your workspace for example with the
|
79
|
-
UNIX ``tree`` command::
|
80
|
-
|
81
|
-
tree
|
82
|
-
.
|
83
|
-
`-- debian7.yaml
|
84
|
-
`-- my_debian.yaml
|
85
|
-
`-- steps
|
86
|
-
|-- aliases
|
87
|
-
| `-- defaults.yaml
|
88
|
-
|-- bootstrap
|
89
|
-
| |-- debian
|
90
|
-
| | `-- debootstrap.yaml
|
91
|
-
| |-- initialize_disk_qemu.yaml
|
92
|
-
| |-- install_bootloader.yaml
|
93
|
-
| |-- prepare_qemu.yaml
|
94
|
-
| `-- start_qemu.yaml
|
95
|
-
|-- checkpoints
|
96
|
-
| `-- qemu.yaml
|
97
|
-
|-- export
|
98
|
-
| `-- save_appliance.yaml
|
99
|
-
`-- setup
|
100
|
-
|-- create_group.yaml
|
101
|
-
|-- create_user.yaml
|
102
|
-
`-- debian
|
103
|
-
|-- configure_apt.yaml
|
104
|
-
|-- configure_kernel.yaml
|
105
|
-
|-- configure_keyboard.yaml
|
106
|
-
|-- configure_network.yaml
|
107
|
-
|-- configure_system.yaml
|
108
|
-
|-- install_software.yaml
|
109
|
-
`-- upgrade_system.yaml
|
110
|
-
|
111
|
-
|
112
|
-
8 directories, 19 files
|
113
|
-
|
114
|
-
To understand this hierarchy please refer to the :doc:`recipe` documentation.
|
115
|
-
|
116
|
-
Build my new recipe
|
117
|
-
~~~~~~~~~~~~~~~~~~~
|
118
|
-
|
119
|
-
.. note::
|
120
|
-
Be sure to be `root` to run the following steps. It is needed for loading
|
121
|
-
modules, chrooting,...
|
122
|
-
|
123
|
-
There is no magic in Kameleon, everything is written in YAML:
|
124
|
-
from your system bootstrap to its export. It empowers you to customize anything
|
125
|
-
you want at anytime during the appliance build. But before changing anything
|
126
|
-
just build the template to see how it works::
|
127
|
-
|
128
|
-
kameleon build my_debian
|
129
|
-
|
130
|
-
Oups! Maybe you get an error like this::
|
131
|
-
|
132
|
-
...
|
133
|
-
[kameleon]: debootstrap is missing from out_context
|
134
|
-
[kameleon]: Press [c] to continue with execution
|
135
|
-
[kameleon]: Press [a] to abort execution
|
136
|
-
[kameleon]: Press [l] to switch to local_context shell
|
137
|
-
[kameleon]: Press [o] to switch to out_context shell
|
138
|
-
[kameleon]: Press [i] to switch to in_context shell
|
139
|
-
[kameleon]: answer ? [i/o/l/a/c]:
|
140
|
-
|
141
|
-
This is the interactive prompt of Kameleon.
|
142
|
-
|
143
|
-
It is a powerful tool that offers you the possibility to fix a problem if
|
144
|
-
something goes wrong during the build process. For this example, the problem is
|
145
|
-
due to the missing ``debootstrap`` binary.
|
146
|
-
|
147
|
-
So you have to install it on your ``out`` context (to read more about context
|
148
|
-
see the :doc:`context` page). Just type the ``o`` key and ``Enter``. Now you
|
149
|
-
are logged in your out context. If you are on a Debian based system install the
|
150
|
-
missing package::
|
151
|
-
|
152
|
-
(out_context) root@f4b261b5fad7: ~/build/my_debian # sudo apt-get install debootstrap
|
153
|
-
|
154
|
-
Press ``Ctrl-d`` or type ``exit`` to go back to the Kameleon prompt then press
|
155
|
-
``c`` and ``Enter`` to continue the build.
|
156
|
-
|
157
|
-
The first time it will take a while to finish the building process. But, Thanks
|
158
|
-
to the :doc:`checkpoint` mechanism you can abort with ``Ctrl-c`` anytime during
|
159
|
-
the build without problem.
|
160
|
-
|
161
|
-
Every step is backed up and if you start the build again, it will skip all the
|
162
|
-
steps already done to restart at the point you have just stopped.
|
163
|
-
|
164
|
-
Moreover, if you change anything in the recipe Kameleon will know it (using
|
165
|
-
recipe and steps hashes), so your next build will automatically restart at the
|
166
|
-
right steps. Here is a good example: The first time you built your recipe you
|
167
|
-
should have something like this::
|
168
|
-
|
169
|
-
...
|
170
|
-
[kameleon]: Build recipe 'my_debian.yaml' is completed !
|
171
|
-
[kameleon]: Build total duration : 224 secs
|
172
|
-
...
|
173
|
-
|
174
|
-
Now you can run your appliance using qemu::
|
175
|
-
|
176
|
-
qemu-system-x86_64 -enable-kvm builds/my_debian/my_debian.qcow2
|
177
|
-
|
178
|
-
.. note::
|
179
|
-
If you do not have access to a graphical server use the ``-curses`` option
|
180
|
-
|
181
|
-
How to use the checkpoint
|
182
|
-
~~~~~~~~~~~~~~~~~~~~~~~~~
|
183
|
-
|
184
|
-
You just have to run the build again and you will notice that it is much faster::
|
185
|
-
|
186
|
-
kameleon build my_debian
|
187
|
-
...
|
188
|
-
[kameleon]: Step 1 : bootstrap/_init_bootstrap/_init_0_debootstrap
|
189
|
-
[kameleon]: ---> Using cache
|
190
|
-
...
|
191
|
-
[kameleon]: Build recipe 'my_debian' is completed !
|
192
|
-
[kameleon]: Build total duration : 22 secs
|
193
|
-
...
|
194
|
-
|
195
|
-
As you can see Kameleon has used the checkpoint cache for each step and in
|
196
|
-
doing so it takes just 22 seconds to build the recipe again. Well the recipe
|
197
|
-
did not change so there is no real challenge to build it so fast. Let's change
|
198
|
-
the user name for example. Open the ``my_debian.yaml`` recipe file and in the
|
199
|
-
global section change the user name like this::
|
200
|
-
|
201
|
-
user_name: my_user
|
202
|
-
|
203
|
-
Save the file and re-build the recipe again. This is a part of the outputs you
|
204
|
-
should see::
|
205
|
-
|
206
|
-
kameleon build my_debian
|
207
|
-
...
|
208
|
-
[kameleon]: Step 29 : setup/create_user/create_group
|
209
|
-
[kameleon]: ---> Using cache
|
210
|
-
[kameleon]: Step 30 : setup/create_user/add_user
|
211
|
-
[kameleon]: ---> Running step
|
212
|
-
[kameleon]: ---> Creating checkpoint : 6bde599e7ed1
|
213
|
-
[kameleon]: Step 31 : setup/create_user/add_group_to_sudoers
|
214
|
-
[kameleon]: ---> Running step
|
215
|
-
[kameleon]: ---> Creating checkpoint : 28b7a1fae5e2
|
216
|
-
...
|
217
|
-
[kameleon]: Build recipe 'my_debian' is completed !
|
218
|
-
[kameleon]: Build total duration : 29 secs
|
219
|
-
...
|
220
|
-
|
221
|
-
This need a little explanation: You have change the ``user_name`` value in the
|
222
|
-
recipe. This variable is firstly used in the ``add_user`` :ref:`microstep`, in
|
223
|
-
the create_user :ref:`step` within the setup section.
|
224
|
-
|
225
|
-
That is why allmicrosteps before this one (the 30 in our case) are using the
|
226
|
-
cache but all the microsteps after are build again, to prevent side effects of
|
227
|
-
this change, even if they are not using the ``add_user`` value.
|
228
|
-
|
229
|
-
Add a new step
|
230
|
-
~~~~~~~~~~~~~~
|
231
|
-
|
232
|
-
Let's assume that you want to add a step to put a timestamp in your image to
|
233
|
-
know when it was built. First, you have to create a step file in the
|
234
|
-
``steps/setup`` folder because you want your timestamp to be added inside the
|
235
|
-
newly created appliance before exporting it.
|
236
|
-
|
237
|
-
Let's call it ``add_timestamp.yaml``:
|
238
|
-
|
239
|
-
.. literalinclude:: ../../contrib/steps/setup/add_timestamp.yaml
|
240
|
-
:language: yaml
|
241
|
-
|
242
|
-
Then you should have this step to the recipe at the end of the setup section::
|
243
|
-
|
244
|
-
...
|
245
|
-
setup:
|
246
|
-
...
|
247
|
-
- add_timestamp
|
248
|
-
|
249
|
-
Then build again your recipe and run it like before to see that your timestamp
|
250
|
-
has been truly added.
|
251
|
-
To get more information about steps definition and usage like default
|
252
|
-
variable and microstep selection see :ref:`step`.
|
253
|
-
|
254
|
-
Advanced Features
|
255
|
-
~~~~~~~~~~~~~~~~~
|
256
|
-
|
257
|
-
Kameleon gives you a lot of extension and customization possibilities. You can
|
258
|
-
define you own :doc:`aliases` and even your own :doc:`checkpoint` mechanism. You
|
259
|
-
are invited to go through the rest of the documentation to fully understand
|
260
|
-
Kameleon and it's great possibilities.
|
@@ -1,525 +0,0 @@
|
|
1
|
-
==================
|
2
|
-
Grid'5000 Tutorial
|
3
|
-
==================
|
4
|
-
|
5
|
-
This tutorial will introduce Kameleon, a tool to build software appliances.
|
6
|
-
With Kameleon it is possible to generate appliances that can be deployed on different virtualization hypervisors or on baremetal.
|
7
|
-
It targets an important activity in Grid'5000 which is the customization of the experimental environments.
|
8
|
-
|
9
|
-
---------------
|
10
|
-
Kameleon basics
|
11
|
-
---------------
|
12
|
-
|
13
|
-
First of all, let's see all the syntax flavors that *Kameleon* has to offer.
|
14
|
-
From this point, we assume that *Kameleon* have been installed and it's already working
|
15
|
-
in your system, otherwise go to :ref:`installation` section.
|
16
|
-
Kameleon can be seen as a shell sequencer which will boost your shell scripts.
|
17
|
-
It is based on the execution of shell scripts but it provides some syntax sugar that makes
|
18
|
-
the work with shell scripts less painful.
|
19
|
-
Let's start with the basics
|
20
|
-
|
21
|
-
Kameleon Hello world
|
22
|
-
~~~~~~~~~~~~~~~~~~~~
|
23
|
-
|
24
|
-
Everything we want to build have to be specified by a recipe. Kameleon reads this recipe
|
25
|
-
and executes the appropriate actions. Let's create a hello world recipe using Kameleon.
|
26
|
-
Open a text editor and write the following::
|
27
|
-
|
28
|
-
setup:
|
29
|
-
- first_step:
|
30
|
-
- hello_microstep:
|
31
|
-
- exec_local: echo "Hello world"
|
32
|
-
# The end
|
33
|
-
|
34
|
-
Save the previous file as a YAML file. For instance, hello_world.yaml.
|
35
|
-
|
36
|
-
.. note::
|
37
|
-
Be sure of respecting the YAML syntax and indentation `yaml`_.
|
38
|
-
|
39
|
-
.. _yaml: http://www.yaml.org/
|
40
|
-
|
41
|
-
|
42
|
-
Then, you run it like this::
|
43
|
-
|
44
|
-
kameleon build hello_world.yaml
|
45
|
-
|
46
|
-
You will have some output that looks like this::
|
47
|
-
|
48
|
-
[kameleon]: Starting recipe consistency check
|
49
|
-
[kameleon]: Resolving variables
|
50
|
-
[kameleon]: Calculating microstep identifiers
|
51
|
-
[kameleon]: Creating kameleon working directory : /home/cristian/Repositories/exptools/setup_complex_exp/tests/new_version/build/hello_world
|
52
|
-
[kameleon]: Building local context [local]
|
53
|
-
[kameleon]: Building external context [out]
|
54
|
-
[kameleon]: Building internal context [in]
|
55
|
-
[kameleon]: Starting build recipe 'hello_world.yaml'
|
56
|
-
[kameleon]: Step 1 : setup/first_step/hello_microstep
|
57
|
-
[kameleon]: ---> Running step
|
58
|
-
[kameleon]: Starting process: "bash"
|
59
|
-
[local_ctx]: The local_context has been initialized
|
60
|
-
[local_ctx]: Hello world
|
61
|
-
[kameleon]:
|
62
|
-
[kameleon]: Build recipe 'hello_world.yaml' is completed !
|
63
|
-
[kameleon]: Build total duration : 0 secs
|
64
|
-
[kameleon]: Build directory : /home/cristian/Repositories/exptools/setup_complex_exp/tests/new_version/build/hello_world
|
65
|
-
[kameleon]: Build recipe file : /home/cristian/Repositories/exptools/setup_complex_exp/tests/new_version/build/hello_world/kameleon_build_recipe.yaml
|
66
|
-
[kameleon]: Log file : /home/cristian/Repositories/exptools/setup_complex_exp/tests/new_version/kameleon.log
|
67
|
-
|
68
|
-
With this simple example, we have already introduced most of the Kameleon concepts and syntax.
|
69
|
-
First, how recipes are structured using a hierarchy composed of: sections, steps, microsteps.
|
70
|
-
|
71
|
-
* Sections: correspond to the minimal actions that have to be performed in order to have a software
|
72
|
-
stack that can be run almost anywhere. This brings to Kameleon a high degree of customizability, reuse of
|
73
|
-
code and users have total control over when and where the
|
74
|
-
sections have to take place. This minimal actions are: bootstrap, setup and export.
|
75
|
-
|
76
|
-
* Steps: It refers to a specific action to be done inside a section
|
77
|
-
(e.g., software installation, network configuration, configure kernel).
|
78
|
-
Steps can be declared in independent files that improves the degree of reusability.
|
79
|
-
|
80
|
-
* Microsteps: procedures composed of shell commands. The goal of dividing steps into microsteps is the
|
81
|
-
possibility of activating certain actions within a step and performing a better checkpoint.
|
82
|
-
|
83
|
-
Kameleon hierarchy encourages the reuse (shareability) of code and modularity of procedures.
|
84
|
-
The minimal building block are the commands *exec_* which wraps shell commands adding
|
85
|
-
a simple error handling and interactivenes in case of a problem.
|
86
|
-
These commands are executed in a given context. Which could be: local, in, out.
|
87
|
-
They can be used as follows::
|
88
|
-
|
89
|
-
setup:
|
90
|
-
- first_step:
|
91
|
-
- hello_microstep:
|
92
|
-
- exec_local: echo "Hello world"
|
93
|
-
- exec_in: echo "Hello world"
|
94
|
-
- exec_out: echo "Hello world"
|
95
|
-
# The end
|
96
|
-
|
97
|
-
|
98
|
-
* Local context: It represents the Kameleon execution environment. Normally is the user’s machine.
|
99
|
-
|
100
|
-
* OUT context: It is where the appliance will be bootstraped. Some procedures have to be carried out in
|
101
|
-
order to create the place where the software appliance is built (In context).
|
102
|
-
One example is: the same user’s machine using chroot.
|
103
|
-
Thus, in this context is where the setup of the chroot takes place.
|
104
|
-
Other examples are: setting up a virtual machine, accessing an infrastructure in order to get a reservation and be able to deploy, setting
|
105
|
-
a Docker container, etc.
|
106
|
-
|
107
|
-
* IN context: It refers to inside the newly
|
108
|
-
created appliance. It can be mapped to a chroot,
|
109
|
-
virtual machine, physical machine, Linux container, etc.
|
110
|
-
|
111
|
-
In the last example all the contexts are executed on the user's machine.
|
112
|
-
Which is the default behavior that can be customized (it will be shown later on this tutorial).
|
113
|
-
Most of the time, users take advantage of the *In context* in order to customize a given a appliance.
|
114
|
-
|
115
|
-
We can add variables as well::
|
116
|
-
|
117
|
-
setup:
|
118
|
-
- first_step:
|
119
|
-
- message: "Hello world"
|
120
|
-
- hello_microstep:
|
121
|
-
- exec_local: echo "Variable value $$message"
|
122
|
-
|
123
|
-
|
124
|
-
Let's apply the syntax to a real example in the next section.
|
125
|
-
|
126
|
-
----------------------------------------
|
127
|
-
Building a simple Debian based appliance
|
128
|
-
----------------------------------------
|
129
|
-
|
130
|
-
Kameleon already provides tested recipes for building different software appliances based
|
131
|
-
on different Linux flavors. We can take a look at the provided templates by typing::
|
132
|
-
|
133
|
-
$ kameleon templates
|
134
|
-
|
135
|
-
Which will output::
|
136
|
-
|
137
|
-
The following templates are available in /home/cristian/Repositories/kameleon_v2/templates:
|
138
|
-
NAME | DESCRIPTION
|
139
|
-
---------------------|-------------------------------------------------------------
|
140
|
-
archlinux | Build an Archlinux base system system.
|
141
|
-
archlinux-desktop | Archlinux GNOME Desktop edition.
|
142
|
-
debian-testing | Debian Testing base system
|
143
|
-
debian7 | Debian 7 (Wheezy) base system
|
144
|
-
debian7-desktop | Debian 7 (Wheezy) GNOME Desktop edition.
|
145
|
-
debian7-oar-dev | Debian 7 dev appliance with OAR-2.5 (node/server/frontend).
|
146
|
-
fedora-rawhide | Fedora Rawhide base system
|
147
|
-
fedora20 | Fedora 20 base system
|
148
|
-
fedora20-desktop | Fedora 20 GNOME Desktop edition
|
149
|
-
old-debian7 | [deprecated] Build a debian wheezy appliance using chroot...
|
150
|
-
ubuntu-12.04 | Ubuntu 12.04 LTS (Precise Pangolin) base system.
|
151
|
-
ubuntu-12.04-desktop | Ubuntu 12.04 LTS (Precise Pangolin) Desktop edition.
|
152
|
-
ubuntu-14.04 | Ubuntu 14.04 LTS (Trusty Tahr) base system.
|
153
|
-
ubuntu-14.04-desktop | Ubuntu 14.04 LTS (Trusty Tahr) Desktop edition.
|
154
|
-
vagrant-debian7 | A standard Debian 7 vagrant base box
|
155
|
-
|
156
|
-
|
157
|
-
Let's import the template debian7::
|
158
|
-
|
159
|
-
$ kameleon import debian7
|
160
|
-
|
161
|
-
This will generate the following files in the current directory::
|
162
|
-
|
163
|
-
├── debian7.yaml
|
164
|
-
├── kameleon.log
|
165
|
-
└── steps
|
166
|
-
├── aliases
|
167
|
-
| └── defaults.yaml
|
168
|
-
├── bootstrap
|
169
|
-
│ ├── debian
|
170
|
-
│ │ └── debootstrap.yaml
|
171
|
-
│ ├── initialize_disk_qemu.yaml
|
172
|
-
│ ├── install_bootloader.yaml
|
173
|
-
│ ├── prepare_qemu.yaml
|
174
|
-
│ └── start_qemu.yaml
|
175
|
-
├── checkpoints
|
176
|
-
│ └── qemu.yaml
|
177
|
-
├── export
|
178
|
-
│ └── save_appliance.yaml
|
179
|
-
└── setup
|
180
|
-
├── create_group.yaml
|
181
|
-
├── create_user.yaml
|
182
|
-
└── debian
|
183
|
-
├── configure_apt.yaml
|
184
|
-
├── configure_kernel.yaml
|
185
|
-
├── configure_keyboard.yaml
|
186
|
-
├── configure_network.yaml
|
187
|
-
├── configure_system.yaml
|
188
|
-
├── install_software.yaml
|
189
|
-
└── upgrade_system.yaml
|
190
|
-
|
191
|
-
8 directories, 19 files
|
192
|
-
|
193
|
-
Here we can observe that a directory has been generated.
|
194
|
-
This directory contains all the steps needed to build the final software appliance.
|
195
|
-
These steps are organized by sections. There is a directory checkpoints that is going
|
196
|
-
to be explained later on.
|
197
|
-
|
198
|
-
Here we can notice that all the process of building is based on steps files written with Kameleon syntax.
|
199
|
-
Separating the steps in different files gives a high degree of reusability.
|
200
|
-
|
201
|
-
The recipe looks like this:
|
202
|
-
|
203
|
-
.. literalinclude:: debian7.yaml
|
204
|
-
:lines: 69-125
|
205
|
-
:language: yaml
|
206
|
-
|
207
|
-
The previous recipe build a debian wheezy using qemu.
|
208
|
-
It looks verbose but normally you as user you wont see it.
|
209
|
-
You will use it as a template in a way that will be explained later.
|
210
|
-
The recipe specify all the steps, configurations values that are going to be used
|
211
|
-
to build the appliance. Kameleon recipes gives many details to you, few things are hidden.
|
212
|
-
Which is good for reproducibility purposes and when reporting bugs.
|
213
|
-
|
214
|
-
If we have all the dependencies required as qemu, qemu-tools and debootstrap we can start to build the appliance
|
215
|
-
doing the following::
|
216
|
-
|
217
|
-
$ kamelon build debian7.yaml
|
218
|
-
|
219
|
-
The process will start and in about few minutes
|
220
|
-
a directory called builds will be generated in the current directory,
|
221
|
-
you will have a qemu virtual disk with a base debian wheezy installed in it.
|
222
|
-
That you can try out by executing::
|
223
|
-
|
224
|
-
$ sudo qemu-system-x86_64 -enable-kvm builds/debian7/debian7.qcow2
|
225
|
-
|
226
|
-
|
227
|
-
--------------------------------
|
228
|
-
Customizing a software appliance
|
229
|
-
--------------------------------
|
230
|
-
|
231
|
-
Now, lets customize a given template in order to create a software appliance that have OpenMPI, Taktuk and tools necessary to compile source code.
|
232
|
-
Kameleon allows us to extend a given template. We will use this for adding the necessary software. Type the following::
|
233
|
-
|
234
|
-
$ kameleon new debian_customized debian7
|
235
|
-
|
236
|
-
This will create the file debian_customized.yaml which contents are::
|
237
|
-
|
238
|
-
---
|
239
|
-
extend: debian7
|
240
|
-
|
241
|
-
global:
|
242
|
-
# You can see the base template `debian7.yaml` to know the
|
243
|
-
# variables that you can override
|
244
|
-
|
245
|
-
bootstrap:
|
246
|
-
- @base
|
247
|
-
|
248
|
-
setup:
|
249
|
-
- @base
|
250
|
-
|
251
|
-
export:
|
252
|
-
- @base
|
253
|
-
|
254
|
-
If we try to build this recipe, it will generate the exact same image as before.
|
255
|
-
But the idea here is to change it in order to install the desired software.
|
256
|
-
Therefore, we will modify the setup section like this::
|
257
|
-
|
258
|
-
extend: debian7
|
259
|
-
|
260
|
-
global:
|
261
|
-
# You can see the base template `debian7.yaml` to know the
|
262
|
-
# variables that you can override
|
263
|
-
|
264
|
-
bootstrap:
|
265
|
-
- @base
|
266
|
-
|
267
|
-
setup:
|
268
|
-
- @base
|
269
|
-
- install_software:
|
270
|
-
- packages: >
|
271
|
-
g++ make taktuk openssh-server openmpi-bin openmpi-common openmpi-dev
|
272
|
-
|
273
|
-
export:
|
274
|
-
- @base
|
275
|
-
|
276
|
-
|
277
|
-
For building execute::
|
278
|
-
|
279
|
-
$ kameleon build debian_customized.yaml
|
280
|
-
|
281
|
-
Then, you can follow the same steps as before to try it out and verify that the software was installed.
|
282
|
-
Now, let's make things a little more complicated. We will now compile and install TAU in our system.
|
283
|
-
So, for that let's create a step file that will look like this:
|
284
|
-
|
285
|
-
|
286
|
-
.. literalinclude:: tau_install.yaml
|
287
|
-
:language: yaml
|
288
|
-
|
289
|
-
You have to put it under the directory *steps/setup/* and you can call it tau_install.
|
290
|
-
In order to use it in your recipe, modify it as follows::
|
291
|
-
|
292
|
-
extend: debian7
|
293
|
-
|
294
|
-
global:
|
295
|
-
# You can see the base template `debian7.yaml` to know the
|
296
|
-
# variables that you can override
|
297
|
-
|
298
|
-
bootstrap:
|
299
|
-
- @base
|
300
|
-
|
301
|
-
setup:
|
302
|
-
- @base
|
303
|
-
- install_software:
|
304
|
-
- packages: >
|
305
|
-
g++ make taktuk openssh-server openmpi-bin openmpi-common openmpi-dev
|
306
|
-
- tau_install
|
307
|
-
export:
|
308
|
-
- @base
|
309
|
-
|
310
|
-
|
311
|
-
And rebuild the image again, you will see that it wont start from the beginning.
|
312
|
-
It will take advantage of the checkpoint system and it will start from the last
|
313
|
-
successfull executed step.
|
314
|
-
|
315
|
-
When building there is the following error::
|
316
|
-
|
317
|
-
|
318
|
-
[kameleon]: Step 46 : setup/tau_install/tau_install
|
319
|
-
[kameleon]: ---> Running step
|
320
|
-
[in_ctx]: Unset ParaProf's cubeclasspath...
|
321
|
-
[in_ctx]: Unset Perfdmf cubeclasspath...
|
322
|
-
[in_ctx]: Error: Cannot access MPI include directory /usr/local/openmpi-install/include
|
323
|
-
[kameleon]: Error occured when executing the following command :
|
324
|
-
[kameleon]:
|
325
|
-
[kameleon]: > exec_in: ./configure -prefix=/usr/local/tau-install -pdt=/usr/local/pdt-install/ -mpiinc=/usr/local/openmpi-install/include -mpilib=/usr/local/openmpi-install/lib
|
326
|
-
[kameleon]: Press [r] to retry
|
327
|
-
[kameleon]: Press [c] to continue with execution
|
328
|
-
[kameleon]: Press [a] to abort execution
|
329
|
-
[kameleon]: Press [l] to switch to local_context shell
|
330
|
-
[kameleon]: Press [o] to switch to out_context shell
|
331
|
-
[kameleon]: Press [i] to switch to in_context shell
|
332
|
-
[kameleon]: answer ? [c/a/r/l/o/i]:
|
333
|
-
|
334
|
-
We can observe that the problem is related with the configure script that cannot access the MPI path.
|
335
|
-
It can be debugged by using the interactive shell provided by Kameleon.
|
336
|
-
The interactive shell allows us to log into a given context.
|
337
|
-
For this case we see that the error happened in the in context, so let's type i in order to enter to this context::
|
338
|
-
|
339
|
-
[kameleon]: User choice : [i] launch in_context
|
340
|
-
[in_ctx]: Starting interactive shell
|
341
|
-
[kameleon]: Starting process: "LC_ALL=POSIX ssh -F /tmp/kameleon/debian_customized/ssh_config debian_customized -t /bin/bash"
|
342
|
-
(in_context) root@cristiancomputer: / #
|
343
|
-
|
344
|
-
The commands executed by Kameleon remain in the bash history.
|
345
|
-
Therefore, It can be rexecuted manually.
|
346
|
-
For this case, we only need to change the path for the OpenMPI libraries.
|
347
|
-
As we have installed it using the packages they are avaiable under the directories:
|
348
|
-
*/usr/include/openmpi/*, */usr/lib/openmpi/* respectively.
|
349
|
-
If we try with the following parameters::
|
350
|
-
|
351
|
-
# ./configure -prefix=/usr/local/tau-install -pdt=/usr/local/pdt-install/ -mpiinc=/usr/include/openmpi/ -mpilib=/usr/lib/openmpi/
|
352
|
-
|
353
|
-
It will finish without any problem. We have found the bug, therefore we can just logout by typing *exit* and
|
354
|
-
then *abort* for stopping the execution and update the step file with the previous line.
|
355
|
-
If you carry out the building again you will see that now everything goes smoothly.
|
356
|
-
Again Kameleon will use the checkpoint system to avoid starting from scratch.
|
357
|
-
|
358
|
-
---------------------------------
|
359
|
-
Creating a Grid'5000 environment
|
360
|
-
---------------------------------
|
361
|
-
|
362
|
-
Now, let's use the extend and export functionalities for creating a Grid'5000 environment.
|
363
|
-
With this step we will see how code can be re-used with Kameleon.
|
364
|
-
Therefore, we can extend the recipe created before::
|
365
|
-
|
366
|
-
---
|
367
|
-
extend: debian_customized
|
368
|
-
|
369
|
-
global:
|
370
|
-
# You can see the base template `debian7.yaml` to know the
|
371
|
-
# variables that you can override
|
372
|
-
|
373
|
-
bootstrap:
|
374
|
-
- @base
|
375
|
-
|
376
|
-
setup:
|
377
|
-
- @base
|
378
|
-
|
379
|
-
export:
|
380
|
-
- save_appliance:
|
381
|
-
- input: $$image_disk
|
382
|
-
- output: $$kameleon_cwd/$$kameleon_recipe_name
|
383
|
-
- save_as_tgz
|
384
|
-
|
385
|
-
- g5k_custom:
|
386
|
-
- kadeploy_file:
|
387
|
-
- write_local:
|
388
|
-
- $$kameleon_cwd/$$kameleon_recipe_name.yaml
|
389
|
-
- |
|
390
|
-
#
|
391
|
-
# Kameleon generated based on kadeploy description file
|
392
|
-
#
|
393
|
-
---
|
394
|
-
name: $$kameleon_recipe_name
|
395
|
-
|
396
|
-
version: 1
|
397
|
-
|
398
|
-
os: linux
|
399
|
-
|
400
|
-
image:
|
401
|
-
file: $$kameleon_recipe_name.tar.gz
|
402
|
-
kind: tar
|
403
|
-
compression: gzip
|
404
|
-
|
405
|
-
postinstalls:
|
406
|
-
- archive: server:///grid5000/postinstalls/debian-x64-base-2.5-post.tgz
|
407
|
-
compression: gzip
|
408
|
-
script: traitement.ash /rambin
|
409
|
-
|
410
|
-
boot:
|
411
|
-
kernel: /vmlinuz
|
412
|
-
initrd: /initrd.img
|
413
|
-
|
414
|
-
filesystem: $$filesystem_type
|
415
|
-
|
416
|
-
This recipe will generate in the build directory a tar.gz image and a configuration file for Kadeploy.
|
417
|
-
For example::
|
418
|
-
|
419
|
-
$ ls builds
|
420
|
-
total 8831536
|
421
|
-
-rw-r--r-- 1 root root 18767806464 juin 15 23:04 base_debian_g5k.qcow2
|
422
|
-
-rw-r--r-- 1 root root 206403737 juin 15 23:04 debian_g5k.tar.gz
|
423
|
-
-rw-r--r-- 1 root root 379 juin 15 23:04 debian_g5k.yaml
|
424
|
-
-rw-r--r-- 1 root root 426 juin 15 23:03 fstab.orig
|
425
|
-
-rw------- 1 root root 672 juin 15 23:01 insecure_ssh_key
|
426
|
-
|
427
|
-
Therefore if we log in a Grid'5000 site for instance (Grenoble) we can submit a deploy job and
|
428
|
-
deploy the image using kadeploy::
|
429
|
-
|
430
|
-
|
431
|
-
user@fgrenoble:~$ oarsub -I t deploy
|
432
|
-
[ADMISSION RULE] Set default walltime to 3600.
|
433
|
-
[ADMISSION RULE] Modify resource description with type constraints
|
434
|
-
Generate a job key...
|
435
|
-
OAR_JOB_ID=1663465
|
436
|
-
Interactive mode : waiting...
|
437
|
-
Starting...
|
438
|
-
|
439
|
-
Connect to OAR job 1663465 via the node fgrenoble.grenoble.grid5000.fr
|
440
|
-
|
441
|
-
user@fgrenoble:~$ kadeploy -a debian_g5k.yaml -f $OAR_NODEFILE
|
442
|
-
|
443
|
-
|
444
|
-
With luck the image will be deployed on baremetal after some few minutes.
|
445
|
-
|
446
|
-
|
447
|
-
------------------------------
|
448
|
-
Playing with Kameleon contexts
|
449
|
-
------------------------------
|
450
|
-
|
451
|
-
The environment that has just been deployed is a basic debian.
|
452
|
-
It doesn't have the modules required for infiniband and
|
453
|
-
other configuration that site administrators do for a specific hardware
|
454
|
-
or politics of the site.
|
455
|
-
In this case would be good to be able to use the environments already
|
456
|
-
provided by Grid'5000. This can be done by using Kameleon contexts.
|
457
|
-
The idea is to re-utilize the same recipe we have written before.
|
458
|
-
|
459
|
-
Kameleon already provides a recipe for interacting with Grid'5000 where
|
460
|
-
the configuration of the contexts is as follows:
|
461
|
-
|
462
|
-
* Local context: it is the user's machine.
|
463
|
-
|
464
|
-
* Context out: it is the site frontend.
|
465
|
-
It is used for submitting a job and deploying
|
466
|
-
a given Grid'5000 environment.
|
467
|
-
|
468
|
-
* Context in: will be inside the deployed node.
|
469
|
-
|
470
|
-
|
471
|
-
First, we import the G5k recipe::
|
472
|
-
|
473
|
-
$ kameleon import debian7-g5k
|
474
|
-
|
475
|
-
And we can just make a copy of our previous recipe (debian customized) and
|
476
|
-
we call it for instance debian_customized_g5k.yaml.
|
477
|
-
This recipe will look like this:
|
478
|
-
|
479
|
-
.. literalinclude:: debian_customized_g5k.yaml
|
480
|
-
:language: yaml
|
481
|
-
|
482
|
-
But there will be a problem with the installation of TAU. Because
|
483
|
-
we download the tarball directly from its web site which is an
|
484
|
-
operation not allowed in Grid'5000. Just certain sites are accessible
|
485
|
-
using a web proxy.
|
486
|
-
To solve this we have to modify the step *tau_install* like this:
|
487
|
-
|
488
|
-
.. literalinclude:: tau_install_g5k.yaml
|
489
|
-
:language: yaml
|
490
|
-
|
491
|
-
Here, we change the context for performing the operation of download.
|
492
|
-
For now on, it will be the local context that is going to download the
|
493
|
-
tarballs. Then we have to put them into the *in contex* for
|
494
|
-
this operation we use a pipe. Pipes are a means for communicating
|
495
|
-
contexts. We use a pipe between our local context and the in contex.
|
496
|
-
|
497
|
-
With those changes we will be able to build a G5k environment with
|
498
|
-
our already tested configuration. The recipe saves
|
499
|
-
the environment on the Kameleon workdir on the frontend.
|
500
|
-
Thus the environment is accessible to be deployed the number of times needed.
|
501
|
-
|
502
|
-
-------------
|
503
|
-
Atlas example
|
504
|
-
-------------
|
505
|
-
|
506
|
-
Here, a more complicated example, where we install the benchmark HPL which
|
507
|
-
is used to benchmark and rank supercomputers for the TOP500 list:
|
508
|
-
|
509
|
-
.. literalinclude:: atlas_debian_g5k.yaml
|
510
|
-
:language: yaml
|
511
|
-
|
512
|
-
We have to add to the *steps/setup* directory the following files *install_atlas.yaml* and *install_hpl.yaml* for installing atlas and hpl respectively,
|
513
|
-
Atlas:
|
514
|
-
|
515
|
-
.. literalinclude:: install_atlas.yaml
|
516
|
-
:language: yaml
|
517
|
-
|
518
|
-
HPL:
|
519
|
-
|
520
|
-
.. literalinclude:: install_hpl.yaml
|
521
|
-
:language: yaml
|
522
|
-
|
523
|
-
|
524
|
-
.. note::
|
525
|
-
The building of this appliance could take around half an hour.
|