av / harbor

Effortlessly run LLM backends, APIs, frontends, and services with one command.
https://github.com/av/harbor
Apache License 2.0
553 stars 37 forks source link

Update to latest version causes git conflict #33

Closed FrantaNautilus closed 1 month ago

FrantaNautilus commented 1 month ago

Upon clean installation of harbor the version 1.9 is installed and when the command harbor update --latest is issued a merge conflict is reported by git:

Updating to the bleeding edge version...
remote: Enumerating objects: 302, done.
remote: Counting objects: 100% (302/302), done.
remote: Compressing objects: 100% (216/216), done.
remote: Total 247 (delta 44), reused 176 (delta 15), pack-reused 0 (from 0)
Receiving objects: 100% (247/247), 110.92 KiB | 1.71 MiB/s, done.
Resolving deltas: 100% (44/44), completed with 31 local objects.
From https://github.com/av/harbor
 * [new branch]      main       -> main
Previous HEAD position was 6ccc5c9 chore: v0.1.9 bump
Switched to branch 'main'
hint: You have divergent branches and need to specify how to reconcile them.
hint: You can do so by running one of the following commands sometime before
hint: your next pull:
hint:
hint:   git config pull.rebase false  # merge
hint:   git config pull.rebase true   # rebase
hint:   git config pull.ff only       # fast-forward only
hint:
hint: You can replace "git config" with "git config --global" to set a default
hint: preference for all repositories. You can also pass --rebase, --no-rebase,
hint: or --ff-only on the command line to override the configured default per
hint: invocation.
fatal: Need to specify how to reconcile divergent branches.
Merging .env files...
Merged content from default.env into .env, preserving order and structure
Harbor updated successfully.

Even though the harbor reports successful update, it is effectively broken because the profile in default.env is not updated to contain new environment variables. This leads to harbor commands being broken, e.g.

harbor version
/var/home/FrantaNautilus/.local/bin/harbor: line 1791: : No such file or directory
/var/home/FrantaNautilus/.local/bin/harbor: line 1794: : No such file or directory
/var/home/FrantaNautilus/.local/bin/harbor: line 1794: [: : integer expression expected
Harbor CLI version: 0.1.31

In order to get a fully working latest installation I had to perform it manually and it seams that manual update is currently the only working option.

av commented 1 month ago

Thank you so much for trying out Harbor and for reporting the issue!

The current install/update is indeed poorly implemented. We'll be switching away from using shell for this in the future. The current iteration of the issue was caused by multiple things adding up together:

I push fixes for these issues and couple of other things in v0.1.32. Tested a clean install on MacOS, seems to be working as expected now. (I'm not asking you to verify, since I'm already ashamed you had to spend your time investigate this thing, sorry!)

because the profile in default.env is not updated to contain new environment variables

Yes, unfortunately that's also a consequence of a failed update. There's a command for re-merging the defaults - harbor config update, but of course it wouldn't work if the update fails prior to that, leaving the setup in a permanently broken condition.

So, thank you so much for a detailed report, it's a great help when investigating things like this!

FrantaNautilus commented 1 month ago

Thank you for a quick fix. Only now I have realized I forgot to mention my OS, I am not on Mac OS but on Fedora Silverblue (derivative called Bluefin DX, this is the reason my home directory is under /var). I don't know if that changes anything about the causes of the problem, but I don't want to give you incomplete information.

av commented 1 month ago

Thank you for pointing that out, I was completely blinded by having this problem being related to MacOS setup specifically. But indeed, it was broken more generally after the previous fix attempts

FrantaNautilus commented 1 month ago

Tested updating to CLI version: 0.2.0 via harbor update -l and no problems appeared. Config merging works fine.

av commented 1 month ago

That's great to hear! Thank you so much for the additional tests and a follow-up! Sorry for not getting back to you on the other issues, I really wanted to release the app before this Monday, as I'll have drastically less time for Harbor now