Skip to content

Commit

Permalink
docs: update readme (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
bketelsen authored Sep 5, 2024
1 parent 50be19e commit 87bb8f9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 108 deletions.
75 changes: 2 additions & 73 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,91 +1,20 @@
# incus-compose

`incus-compose` is the missing equivalent for `docker-compose` in the Incus ecosystem.
`incus-compose` is an implementation of the `docker-compose` specification for the Incus ecosystem.


## Status

Partially functional, but many commands not complete.

Usage not recommended.
Only use this if you know enough `incus` to dig yourself out of the problems this tool might cause.

USE AT YOUR OWN RISK

`incus-compose up` - works

`incus-compose rm` - works

`incus-compose info` - works

`incus-compose snapshot` - works

`incus-compose export` - works



This project currently mixes API & CLI commands, so it only works against a "local" server for now.

## Usage

See the samples in the `samples` directory.

## Explanation


```
name: cloud # compose app name, used in custom storage & profile naming
project: default # incus project to use
export_path: /var/backup/cloud # where to export backups of instances and volumes (unimplemented)
services: # list of instances to create
mydb:
image: images:ubuntu/noble/cloud
gpu: true # share the gpu with the instance
cloud_init_user_data_file: mydb.yaml # if set, creates a custom profile and applies the cloud-init
additional_profiles: # additional profile to add to this instance
- nvmestorage
snapshot: # instance snapshot schedule
schedule: "@hourly"
expiry: 2w
volumes: # incus volumes to attach
config:
mountpoint: /config
pool: fast
binds: # host directories to bind
media:
type: disk
source: /var/home/bjk
target: /media
shift: true
myjellyfin:
image: images:ubuntu/noble/cloud
gpu: true
cloud_init_user_data_file: jellyfin.yaml
depends_on: # dependencies, used to determine start/stop order
- mydb
snapshot:
schedule: "@hourly"
expiry: 2w
volumes:
config:
mountpoint: /config
pool: default
snapshot: # volumes aren't included in container snapshots, but you can configure snapshots per volume
schedule: "@hourly"
expiry: 2w
binds:
media:
type: disk
source: /var/home/bjk
target: /media
shift: true
profiles: # existing profiles to apply to all instances
- default
- vlan5
```

# TODO

- [ ] environment variables, enumerate & bind
- [ ] networks key, what to do?
- [ ] validation, unsupported keys. warn, abort?
- [ ] ports, when to proxy, POLS
35 changes: 0 additions & 35 deletions example-incus-compose.yaml

This file was deleted.

6 changes: 6 additions & 0 deletions pkg/application/sanity.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,12 @@ func (app *Compose) SanityCheck() error {
}
}
netNames, err = d.GetNetworkNames()
if err != nil {
return &SanityCheckError{
Step: "get network names",
Err: fmt.Errorf("error getting network names: %s", err),
}
}
// check to see if the default profiles exists
for _, p := range app.Profiles {
if !slices.Contains(profileNames, p) {
Expand Down

0 comments on commit 87bb8f9

Please sign in to comment.