mirror of
https://github.com/moghtech/komodo.git
synced 2026-03-09 07:13:36 -05:00
Can't access stack folder #180
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @lordraiden on GitHub (Jan 12, 2025).
I loadad
I have my git repo here
and the files here
This is the toml configuration and this file exist /git/homeserver/docker-compose/dockge/docker-compose.yml
stack
name = "dockge"
tags = ["stack"]
[stack.config]
server = "unraid"
destroy_before_deploy = true
files_on_host = true
file_paths = ["docker-compose.yml"]
The thing is yesterday it was working, I added the stacks and I could deploy and stop them several times, and today for some reason (I have change anything) it looks like it doesn't have access to the files anymore, none of my stacks works I get this error If I try to deploy them
This is my full docker compose
Periphery logs
@lordraiden commented on GitHub (Jan 12, 2025):
I have been able to reproduce the issue, it happens after doing a clone repo using Komodo, apparently after restarting the komodo stack it works, for now
@mbecker20 commented on GitHub (Jan 12, 2025):
I see the issue happening. When you do "Clone Repo" for an already cloned repo, it will treat that command as "Re-clone", ie delete existing folder and clone it again. However that
.../git/homeserver/docker-composeis being mounted to Periphery container, and when you delete it, this breaks the mount even after the folder is recreated. This is why it works again after you recreate Periphery container, this fixes the mount.The fix for this would be to change those commands to "Pull Repo" instead, which won't delete folder and just pull the changes. This way the docker mount is never "broken".
Also you should check out #180, there's improvements to the docker mounts for Periphery in there. Basically with your current configuration, relative mounts will be broken. I have updated the example compose files in the next release branch: https://github.com/mbecker20/komodo/blob/1.17.0/compose/mongo.compose.yaml#L63. The change is to ensure the path inside and outside container is 1:1.
@lordraiden commented on GitHub (Jan 13, 2025):
@mbecker20 Thanks for the answer, honestly I don't fully understand how can I adapt the new compose to work with the next release.
My requirements are simple I have my repo in github and I have it in sync in local.
I need the files locally because I won't always manage the stacks using Komodo.
I tried to create a stack using github directly but it clones the entire repo for each stack so isn't a very elegant solution.
So I finally decided to keep the local git synced and configure the stack to pick the files from a local path.
Ideally I would want the stacks files to be picked directly from the git local repo to have a single source of truth and not having files everywhere. So considering this and the paths
my git repo
/mnt/services/docker/git
Stack files here
/mnt/services/docker/git/homeserver/docker-compose
So considering this how should I configure the new compose file? and what Run Directory path should I use in the stacks?
I there a better workflow/approach that I'm not considering?
@mbecker20 commented on GitHub (Jan 13, 2025):
I would move the stacks directory to be separate from the repo directory. But you may use neither of them. To be totally sure about the paths you are dealing with, you can specify the absolute "Path" (including leading
/) that the Repo is cloned to. And for each Stack, you can use also use absolute path (including leading/) pointing to the Run Directory. I also recommend reading #220 and #180 to understand how things work a bit more.maybe something like this:
I also recommend to use "Pull Repo" instead of using "Clone Repo". https://docs.rs/komodo_client/latest/komodo_client/api/execute/struct.PullRepo.html
"Clone Repo" deletes existing folder before cloning again and may cause data loss if using relative mounts. This is the direct cause of your original issue.
@lordraiden commented on GitHub (Jan 13, 2025):
Sorry but even a know a little bit about docker with linux I'm mostly lost,
Particulary for me this part is confusing having this in the compose file
${PERIPHERY_ROOT_DIRECTORY:-/etc/komodo}/repos
and then in the env file this:
PERIPHERY_ROOT_DIRECTORY=/etc/komodo
Anyway for now I would be happy making it work, I will try to understand why later xD
These are my absolutes paths, I'm using Unraid so the files are mounted in shares.
my git repo
/mnt/services/docker/git
Stack files here
/mnt/services/docker/git/homeserver/docker-compose
So basicaly the new compose would be
Docker compose
env file
Repo toml, is a github repo, that will clone the repo inside /mnt/services/docker/git/ adding homeserver/docker-compose/monitoring/...
Stack toml
Am I right?
@mbecker20 commented on GitHub (Jan 15, 2025):
Yeah I think it should work, you can try it out