summaryrefslogtreecommitdiff
path: root/README
blob: 41a7a37dcbe3e1838b743aff22f1e78ae4407db9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
README for morph
================

> **NOTA BENE:** This document is very much work-in-progress, and anything
> and everything may and will change at little or no notice. If you see
> problems, mail baserock-dev@baserock.org.

`morph` builds binaries for [Baserock](http://www.baserock.org/),
an appliance Linux solution. Please see the website for overall information.


Usage
-----

The Baserock builds are controlled by Baserock definitions files.
See the documentation at <http://wiki.baserock.org/definitions/current>
for information on the format.

`morph --help` will provide some information, though a full guide is
really required. Meanwhile a short usage to build a disk image:

    git clone git://git.baserock.org/baserock/baserock/definitions
    cd definitions
    morph build systems/base-system-x86_64-generic.morph

For deploying you need to create a cluster morphology. Here is an
example to deploy to a raw disk image.

    name: base-system-x86_64-rawdisk
    kind: cluster
    systems:
    - morph: systems/base-system-x86_64-generic.morph
      deploy:
          my-raw-disk-image:
              type: extensions/rawdisk
              location: base-system-x86_64.img
              DISK_SIZE: 4G

To deploy it, you only need to run `morph deploy` with the cluster morphology
created:

    morph deploy foo.morph

You can write a configuration file to avoid having to write options on
the command line every time. Put it in `~/.morph.conf` and make it look
something like this:

    [config]
    cachedir = /home/username/baserock/cache
    log = /home/username/baserock/morph.log
    log-max = 200M
    trove-host = git.baserock.org

All of the above settings apart from `log` are the defaults, so may be omitted.


Build environment
-----------------

When `morph` runs build commands, it clears the environment of all
variables and creates new ones. This is so that the build will run
more consistently across machines and developers.

See the `morphlib/buildenvironment.py` file for details on what
environment variables are set.

Morph also constructs a staging area for every build, composed of its
build-dependencies, so everything that is used for a build is traceable
and reproducible.


Hacking morph
-------------

When running Morph from a Git checkout, remember to set PYTHONPATH to
point to your checkout. This will cause Morph to load the plugins and
write extensions from your checkout correctly.

Run the test suite with this command:

    ./check

If your /tmp is a tmpfs you may need to set TMPDIR to a different path,
as there are tests for large disk image deploys.

Install CoverageTestRunner (from <http://liw.fi/coverage-test-runner/>),
and check out the `cmdtest` utility (from <http://liw.fi/cmdtest/>).

Run the checks before submitting a patch, please.


Legalese
--------

Copyright (C) 2011-2015  Codethink Limited

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License along
with this program.  If not, see <http://www.gnu.org/licenses/>.