isle/docs/operator/managing-garage.md
Brian Picciano b35a3d6574 First public commit
There has been over 1 year of commit history leading up to this point,
but almost all of that has had some kind network configuration or
secrets built into the code. As of today all of that has been removed,
and the codebase can finally be published!

I am keeping a private copy of the previous commit history, though it's
unclear if it will ever be able to be published.
2022-07-04 15:18:55 -06:00

66 lines
2.1 KiB
Markdown

# Managing Garage
The garage project provides the network storage component for
cryptic-net. If you're reading this document then you would likely benefit
greatly from reading the [garage documentation][garage] on their website. It's
extremely well written and concise.
Note that the `cryptic-net daemon` process will handle all setup steps described
in that documentation, but it's still good to have an understanding of how
garage works and what it can do.
[garage]: https://garagehq.deuxfleurs.fr/documentation/quick-start/
## Garage Runtime Note
There is an important thing to note regarding how cryptic-net runs garage. As
described in the [Contributing Storage](contributing-storage.md) document, a
single `cryptic-net daemon` process can be configured to provide any number of
storage allocations.
For each allocation which is configured, `cryptic-net daemon` will configure and
run a separate `garage server` instance as a sub-process. Each garage will use
the host's name as its zone in the garage cluster layout, which means that the
cluster will prefer to not replicate the same data within the same host, but may
do so if necessary.
## Garage CLI
Every `cryptic-net` binary contains a full `garage` binary embedded into it.
This binary can be accessed directly like so:
```
sudo cryptic-net garage cli <subcmd> <args>
```
Before handing off execution to the `garage` binary, the `cryptic-net` process
will automatically set up the RPC host and secret environment variables.
If the host which is running the command has more than one allocation
configured, then the `garage server` process for the first allocation will be
connected to by this invocation of `garage`. If no allocations are configured,
then the `garage server` process of some other host in the network will be
connected to.
## Examples
To display the current layout of the garage cluster:
```
sudo cryptic-net garage cli layout show
```
**(DO NOT CHANGE THE CLUSTER LAYOUT UNLESS YOU KNOW WHAT YOU'RE DOING!)**
To create a new bucket:
```
sudo cryptic-net garage cli bucket create new-bucket
```
To list existing buckets:
```
sudo cryptic-net garage cli bucket list
```