summaryrefslogtreecommitdiff
path: root/README.md
blob: 1eb16d75daa4aba0ef32fd859970387911bf634f (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
# ambient-run -- build safely and securely in a local virtual machyine

`ambient-run` builds a software project in a local virtual machine,
safely and securely


## Example

A software developer would use this program to build their project in
a tightly controlled environment like this:

```sh
$ ambient-run build myproject.yaml
```

## Discussion

`ambient-run` is the first component of Ambient CI, which will be a
continuous integration system. The build is run in a virtual machine
that does not have any networking, mainly for security. All source and
dependencies are provided to the build, when it start, as the lack of
networking means it can't, for example, download them at build time.
The lack of networking also means the build can't leak secrets or
attack other computers over the network.

## Stakeholders

* Lars Wirzenius is the instigator and primary developer.
* Daniel Silverstone is an advisor.

## Requirements

See [`ambient-run.md`] for detailed requirements and acceptance
criteria.

## Architecture

`ambient-run` runs a VM using QEMU. The VM is given the source code
and dependencies using read-only virtual drives. It will also be
provided read-write drives for caching and for output artifacts. All
drives contain tar archives, not file systems, to make them easier,
safer, and more secure to deal with.

## Building

To build the documentation, run:

~~~sh
$ make
~~~

To build the software, run the usual Rust command:

~~~sh
$ cargo build
~~~

## Testing


To run the automated test suite, you need to first have a virtual
machine image for Ambient. The base image for
[ambient-build-vm](https://codeberg.org/ambient/ambient-build-vm) will
do fine. Set the `IMAGE` environment variable to the path to that
image when running the test suite:

~~~sh
$ IMAGE=/path/to/base.qcow2 cargo test
~~~

The reason the image is needed is that the test suite runs tests using
the virtual machine, to make sure `ambient-run` works.

## Deployment

To create a binary to install, run:

~~~sh
$ cargo install --path=.
~~~

There is a `debian/` directory with rudimentary Debian packaging,
which can be build in the usual Debian way.

## Contributing

See <https://codeberg.org/ambient/ambient-run> for the public git
repository. Please open issues, or send patches, via that.

## Legalese

Copyright 2023 Lars Wirzenius.

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
 .
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 Affero General Public License for more details.
 .
You should have received a copy of the GNU Affero General Public License
along with this program.  If not, see <https://www.gnu.org/licenses/>.