Skip to content
This repository was archived by the owner on Mar 25, 2022. It is now read-only.

Commit 21d05d5

Browse files
committed
First initial version of provsn docs
1 parent b6240c1 commit 21d05d5

File tree

6 files changed

+110
-11
lines changed

6 files changed

+110
-11
lines changed

README.md

+1-11
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,6 @@
1313
- Known issues
1414
- Common tasks
1515

16-
TODO before @lgierth vacation:
17-
18-
- secrets submodule
19-
- make parallelism less awkward
20-
- fix unwanted `./provsn` parallelism
21-
- make sure `./provsn help` is up-to-date
22-
- migrate ansible/{common,ipfs,ipfs_gateway,nginx}
23-
- cjdns,metrics,node_exporter,pinbot remain todo
24-
- migrate peering script
25-
2616
### Introduction
2717

2818
This repository contains the technical infrastructure of the IPFS community.
@@ -42,7 +32,7 @@ Infrastructure that isn't contained here:
4232

4333
### Getting started
4434

45-
We use an experimental tool called Provsn to maintain the setup of hosts and services.
35+
We use a tool called Provsn to maintain the setup of hosts and services.
4636
The fundamental principle of Provsn is that hosts are in a certain state,
4737
and units of code are run to transition into a different state.
4838

ansible/README.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## DEPRECATED
2+
3+
We're trying to move away from ansible and this document is just here for history.
4+
5+
We should try to migrate this documentation to provsn
6+
17
# solarnet
28

39
- [Overview](#overview)

base/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## Unit - Base
2+
3+
This is the base unit. It installs required packages and also installs ssh-keys.

docker/README.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
## Unit - Docker
2+
3+
Installs docker on a machine.
4+
5+
TODO: Difference between getdocker.sh and install.sh? Should just be install.sh

ipfs/README.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
## Unit - IPFS
2+
3+
The IPFS unit, responsible for installing go-ipfs and setup the configuration.
4+
5+
Starts IPFS in a docker container.

provsn.md

+90
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
## provsn
2+
3+
provsn is our homemade provisioning tool.
4+
5+
## Requirements
6+
7+
* parallel
8+
* bash
9+
* ssh
10+
* jq
11+
* readlink
12+
* dirname
13+
* find
14+
* xargs
15+
* sed
16+
* awk
17+
* uniq
18+
* sort
19+
20+
## Concepts
21+
22+
provsn is a simple and nimble little tool, we just have a few concepts you need
23+
to understand to be able to use it and contribute.
24+
25+
### Host
26+
27+
A host is a computer that you have ssh access to and want to manage. They
28+
are all mapped in `env.sh` in the root directory.
29+
30+
Typically looks something like this:
31+
32+
```sh
33+
# digitalocean-sfo1
34+
pluto_ssh="[email protected]"
35+
pluto_units=(${baseunits[@]} ${gatewayunits[@]})
36+
```
37+
38+
### Unit
39+
40+
A unit is something that you can install and manage on a host. A unit needs to
41+
have at least a `env.sh` file in it's directory. Typical structure:
42+
43+
```
44+
nginx
45+
├── 451.html
46+
├── build.sh
47+
├── env.sh
48+
├── install.sh
49+
└── nginx.conf
50+
```
51+
52+
Both `451.html` and `nginx.conf` is unique for the nginx unit.
53+
54+
`env.sh` sets environment variables for this unit, in this case setting the nginx
55+
version we want to use.
56+
57+
`build.sh` contains setup instructions for our `install.sh` script. In nginx case,
58+
we copy `451.html` and `nginx.conf` to `out/` and then also create a `out/docker.opts`
59+
file with our arguments to docker.
60+
61+
`install.sh` is the script that actually installs nginx on our hosts. We now have
62+
access to our files in `out/` on our host, so we copy them to the right place and
63+
compare if anything changed. If it did, we make sure to restart the docker container.
64+
65+
## How to use provsn
66+
67+
provsn is a simple bash tool that should work on all platforms. To run, it simply
68+
execute the script.
69+
70+
```sh
71+
./provsn <command> <@args>
72+
```
73+
74+
## Common Tasks
75+
76+
### Gathering ipfs debug info
77+
78+
Grab the logs since `1 minute ago` on `pluto`
79+
80+
```sh
81+
./provsn exec pluto "docker logs --since 1m ipfs"
82+
```
83+
84+
### Updating IPFS on hosts
85+
86+
### Deploying a website
87+
88+
### Adding a root user
89+
90+
### Adding hashes to the blocklist

0 commit comments

Comments
 (0)