roflcoopter / viseron

Self-hosted, local only NVR and AI Computer Vision software. With features such as object detection, motion detection, face recognition and more, it gives you the power to keep an eye on your home, office or any other place you want to monitor.
MIT License
1.68k stars 172 forks source link

Helm chart #241

Closed kevinrademan closed 2 months ago

kevinrademan commented 3 years ago

Is there any plans to create a helm chart for this project?

roflcoopter commented 3 years ago

I have never used Kubernetes so i dont really know how to create one. I would gladly accept a PR for it tho if you wanna give it a try

mkelley88 commented 2 years ago

@roflcoopter In addition to a helm chart, getting this onto Truecharts for use on TrueNAS SCALE might get the project some recognition. https://truecharts.org/apps/app-requests/

People love options and alternatives. If I knew how to make up a chart, I would happily submit a PR. But I don't at this time.

roflcoopter commented 2 years ago

@roflcoopter In addition to a helm chart, getting this onto Truecharts for use on TrueNAS SCALE might get the project some recognition. https://truecharts.org/apps/app-requests/

People love options and alternatives. If I knew how to make up a chart, I would happily submit a PR. But I don't at this time.

Great idea! I dont have much time to research this atm tho, currently focusing on a major rewrite of Viseron

carlosrodfern commented 2 months ago

(... three years later)

I have it running on kubernetes. I just migrated it to a helm chart and began to work on it here: https://github.com/carlosrodfern/viseron-helm-chart

I'll be working on cleaning it up to make it more generic, and setting up CI/CD.

Once I have it ready, @roflcoopter you could then fork it and tweak it for your github repo (it'll be using githup actions) to make it "official". At that point, I can switch to use yours and contribute to it.

I'll post back when I have the first version fully ready.

roflcoopter commented 2 months ago

Awesome, thank you! 🚀

carlosrodfern commented 2 months ago

Awesome, thank you! 🚀

Thank you for building this awesome app.

I have the helm chart ready, and I have been using it for my installation. It has CI on PRs doing linting and testing, and automatic releasing on merges to main, using the github pages. Let me know what you think.

The only thing I have not documented is how to use it with Nvidia. Setting up the nvidia runtime on containerd is a little bit of work, which I can't test because I don't have that hardware. Since it is not something trivial, and I can't test it, I passed on documenting how to do it with kubernetes (e.g., k3s.io) and this chart. Hoping someone will, and contribute back to the docs and the chart.

I looked into the code and the webserver component, and I can't find any health check endpoint. Is there one? It would be for kubernetes which uses it to decide when it is ready to receive traffic, and if it needs to be restarted/rescheduled.

roflcoopter commented 2 months ago

I have the helm chart ready, and I have been using it for my installation. It has CI on PRs doing linting and testing, and automatic releasing on merges to main, using the github pages. Let me know what you think.

Had a quick look but i dont fully understand the process, how does Github pages come into play and what is published there?

I looked into the code and the webserver component, and I can't find any health check endpoint. Is there one? It would be for kubernetes which uses it to decide when it is ready to receive traffic, and if it needs to be restarted/rescheduled.

No healthcheck endpoint is available atm sadly, will make sure to add it!

roflcoopter commented 2 months ago

Okay i think i get it now. Does it make any sense to keep it in the main repo or should i create a separate repo for it you think?

carlosrodfern commented 2 months ago

Okay i think i get it now. Does it make any sense to keep it in the main repo or should i create a separate repo for it you think?

I recommend you keep it in a separate repository. It is in reality a separate project that can have a very different change pace than your main application. The CI/CD will also be different and may get in your way of your main project.

So, apparently, I have two options. I can transfer the ownership to you (simpler?), or you can fork it and then I nuke mine and yours become the upstream repo according to github docs. Not sure what the difference is in practice.

roflcoopter commented 2 months ago

I see, yes you can try to transfer the ownership, seems simpler indeed!

carlosrodfern commented 2 months ago

I see, yes you can try to transfer the ownership, seems simpler indeed!

You should have gotten a request to accept the transfer. After the transfer is done, we will need to test the github workflows. I can create a PR against the repo to test the ci, and then once merged, we will see if the gh pages is updated with the new version of the chart.

roflcoopter commented 2 months ago

Great! Transfer is complete now: https://github.com/roflcoopter/viseron-helm-chart

carlosrodfern commented 2 months ago

I created a PR bumping the app version to 2.3.1: https://github.com/roflcoopter/viseron-helm-chart/pull/3 After some fixes, the CI passed. That PR also shows an example of how to bump the image in the chart. The chart is using the "app" version as the default image tag in the template. I'll write at some point some developer/contributors docs, because of the bus factor.

I merged it, and the CD kicked in and deployed it successfully.

I migrated my setting to the new chart repo, and tested it.

$ helm repo add viseron https://roflcoopter.github.io/viseron-helm-chart
"viseron" has been added to your repositories

$ helm repo update
Hang tight while we grab the latest from your chart repositories...
...Successfully got an update from the "viseron" chart repository

$ helm search repo -l viseron/viseron
NAME            CHART VERSION   APP VERSION DESCRIPTION             
viseron/viseron 0.1.2           2.3.1       A Helm chart for viseron
viseron/viseron 0.1.1           2.3.0       A Helm chart for viseron
viseron/viseron 0.1.0           2.3.0       A Helm chart for viseron

$ helm -n nvr upgrade --values values.yaml --version "0.1.2" viseron viseron/viseron
Release "viseron" has been upgraded. Happy Helming!
NAME: viseron
LAST DEPLOYED: Thu Jul 18 07:53:56 2024
NAMESPACE: nvr
STATUS: deployed
REVISION: 3
TEST SUITE: None
NOTES:
1. Get the application URL by running these commands:
  export NODE_PORT=$(kubectl get --namespace nvr -o jsonpath="{.spec.ports[0].nodePort}" services viseron)
  export NODE_IP=$(kubectl get nodes --namespace nvr -o jsonpath="{.items[0].status.addresses[0].address}")
  echo http://$NODE_IP:$NODE_PORT

$ kubectl -n nvr get pod
NAME                       READY   STATUS    RESTARTS   AGE
viseron-5745654d57-chfbf   1/1     Running   0          13s

So, I think we may consider this issue resolved.

@roflcoopter, thank you again for this great app, and for taking this helm chart! BTW, I'll be publishing a post in the Fedora Magazine about how to set up viseron on a fedora server with k3s.io, and openebs. You may get new users :).

roflcoopter commented 2 months ago

Sorry for the delay in response!

Awesome, great job on this! Thanks for wanting to make that post, more recognition for Viseron is always welcome.

Will have to update the docs as well to highlight the helm chart

roflcoopter commented 2 months ago

I am closing this issue now since the helm chart now exists