support multi-hdd config #5
Closed
opened 2026-04-02 16:36:57 +00:00 by fauno
·
23 comments
No Branch/Tag Specified
main
request-limits
multi-hdd
ulimits
web-ui
maintainers
sixsmith-patch-1
subnet
monitoring
export-metrics
metrics
healthcheck
rpc_secret
rpc_secret_file
fixes
sqlite
auto_pass_gen
0.4.0+v2.5.0
0.3.2+v2.5.0
0.3.1+v2.4.1
0.3.0+v2.4.1
0.2.2+v2.4.0
0.2.1+v2.3.0
0.2.0+v2.3.0
0.1.0+v2.3.0
0.0.2+v2.3.0
0.0.1+2.1.0
Labels
Clear labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Breaking change that won't be backward compatible
Something is not working
Documentation changes
Improve existing functionality
New functionality
This is security issue
Issue or pull request related to testing
Priority
Critical
1
The priority is critical
Priority
High
2
The priority is high
Priority
Medium
3
The priority is medium
Priority
Low
4
The priority is low
Reviewed
Confirmed
1
Issue has been confirmed
Reviewed
Duplicate
2
This issue or pull request already exists
Reviewed
Help wanted
3
Reviewed
Invalid
3
Invalid issue
Reviewed
Won't Fix
3
This issue won't be fixed
Status
Blocked
1
Something is blocking this issue or pull request
Status
Need More Info
2
Feedback is required to reproduce issue or to continue work
Status
Abandoned
3
Somebody has started to work on this but abandoned work
Milestone
No items
No Milestone
Projects
Clear projects
No projects
Issue tracking
In Progress
Assignees
3wordchant
aadil (Aadil Ayub)
abra-bot (Abra Bot)
ammaratef45
amras (Sarma)
Apfelwurm
appletalk
arjan
basebuilder
BornDeleuze (Born Deleuze)
Brooke
carla
cas (Cassowary)
codegod100
coopcloud
cyrnel
dannygroenewegen (Danny Groenewegen)
decentral1se (d1)
dede
devydave
fauno (fauno)
flancian
Frando
hex (Josh Dukes)
iexos
jade (Jade Ambrose)
javielico (Javielico)
jjsfunhouse
jmakdah2 (Jackie Makdah)
joe-irving (Joe Irving)
kawaiipunk (KawaiiPunk)
knoflook
kolaente
lambdabundesverband
linnealovespie (April)
marlon (marlon)
mayel
mirsal
moosemower
moritz
nicksellen (Nick Sellen)
notplants
oxaliq (sorrel)
p4u1 (p4u1)
pau
pharaohgraphy (Andrew 🐦🔥❤️🔥✴️)
PhiNatalie
renovate-bot (Comrade Renovate Bot)
ripclap
rix
rscmbbng
sef (sef)
simon
sixsmith (Sixsmith)
stevensting (stevensting)
tobias
trav (Trav Fryer)
val (val (he/him))
vaznasty
virtualboys
wolcen (Chris Thompson)
wykwit
xynosis
yksflip
Clear assignees
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: coop-cloud/garage#5
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
how could something like this could be achieved via
.envandgarage.toml.templ? or include/concatenate an external file with custom configurations?https://garagehq.deuxfleurs.fr/documentation/operations/multi-hdd/
If you put
data_dir = [{{ env "UGLY_DATA_DIR_DUMP" }}]and then your.tmplfile and then just dump a super ugly'{ path = "/path/to/old_data", read_only = true }, { path = "/path/to/new_hdd1", capacity = "2T" }, { path = "/path/to/new_hdd2", capacity = "4T" },'then you're done? This might be guaranteed to cause further headaches 😬 I can't quite think of a recipe that deals with a complex config setup like this 🤔thanks! but yeah we'll be dealing with quote-escaping issues then, no?
Yes, you'd need to check the usage of
'and". You could potentially escape\"on the.envside. There might be some obscure functionality in Golang templating to help you out here but I wouldn't know. Good luck!@decentral1se what's the templating called? i seem to find a lot of these for golang and never the official reference
It's a disaster in terms of docs: https://pkg.go.dev/text/template#hdr-Actions I just search online and read what other people did. Looking at other recipes... there are even features which are only implemented in swarms version of the templating which aren't even supported in the compose spec. Dog bless us all.
besides templating issues, i'm thinking disks could be mounted on
$LOCAL_FOLDER_DATA/diskXso they example config would be like this:but i'm not sure if docker will show the nested mount points to the container.
reference:
https://git.coopcloud.tech/coop-cloud/garage/src/branch/main/compose.yml#L33
looks like it would work, so no changes needed to
compose.yml:I'm confused about the purpose of this script, what is the suggested change to the recipe to support multi-hdd?
I was thinking through this, what do people think about a syntax like:
Where disks are set with a defined format and assumed to be relative to the set root, this way there's not a ton of complex changes to compose.yml
I'm still working on it but I believe that I have a working tmpl file that can ingest this syntax.
looks great @Brooke! the script was an experiment to see if bind mounting partitions into a volume would make them available to the container, which seemed to be the case and you can render a template like this #5 (comment) without changes to the compose file
@Brooke could you push your changes? we have a garage node ready to test this!
Sorry I will have to check in on this later, currently traveling. The thing I was working on wasn't totally working but will certainly put it near the top of my todo for next week.
Ok so going through my notes the issue I was running into was the lack of split in the built-in golang interpreter for docker swarm. This makes it impossible(?) to parse a syntax like I was suggesting.
I had thought that it might be possible to setup an entrypoint that handles it instead but I forgot that garage uses a scratch container so there's no bash.
The truly cursed solution is a helper container that mounts the same volumes available to garage but readonly. This would eleviate the distroless issue #1
I'll see if I can get a working branch done today that just has a second alpine container for running backups and setting up multi-hdd but I'm unsure how I feel about it as a long term solution.
have you seen this? maybe it helps with attaching an alpine container to the same garage container? i really think we should be able to split and traverse arrays/lists on templates, ping @decentral1se ?
https://garagehq.deuxfleurs.fr/documentation/operations/debugging/
I agree re: split, it's extremely useful for this exact purpose when we're confining users to only editing .env.
I chose the alpine container cause I was following the debugging page from when you suggested it previously, I think the only issue is ensuring that depends_on properly stalls the garage container from starting. I've read conflicting posts abt depends_on with swarm, but it seems like it works?
Ok this may be blocked by missing split. the configuration is handled as a config within swarm/stack so obviously you can't actually touch it until the container has started and once it's started we risk causing a restart of the container or just launching garage in a degraded state by not having a consistent value for
data_dirs.Unless we change the config after the container starts and trigger the daemon to restart? But at this point it's very hacky. I'm still going to try and get backupbot working with an alpine helper container.
i'm assigning @decentral1se to get their input on the possibility of adding split support to abra or how would it work
ps: i think we need an abra-developers team so we don't ping individual people
i can't find any official documentation on what the template engine for docker swarm supports or not. another case for abra rendering templates rather than docker :)
There was no templating support implemented explicitly in the
.envto maintain compatibility with other tools that consume the.envformat. This has been debated over the years and even there is some movement around wanting areciipe.yamlper recipe instead of an.env.example. I don't know where this will finish but I think adding some special case parsing implementation into the.envfile would be controversial. I won't be working on this any time soon (unless funding miracle), so I would say the best option is to request support in the Abra Hackers channel or create an issue on the abra repo with a proposal so it is tracked. Good luck!#5 (comment)
i think we'll go with a customized template then! garage doesn't support including files