mirego / accent

The first developer-oriented translation tool. True asynchronous flow between translators and your team.
https://www.accent.reviews
BSD 3-Clause "New" or "Revised" License
1.3k stars 97 forks source link

Add Helm Chart Support for Accent #406

Open Braineanear opened 10 months ago

Braineanear commented 10 months ago

Overview

This PR introduces a new Helm chart for the Accent, facilitating its deployment on Kubernetes clusters.

Changes Made

Implementation Details

Testing

Future Improvements

Notes


This addition paves the way for easier and more efficient Kubernetes deployments of the Accent. Your review and feedback on this implementation are highly appreciated.

Mahmoud Yasser mle.mahmoud.yasser@gmail.com

Braineanear commented 10 months ago

@simonprev

simonprev commented 9 months ago

Hello @Braineanear , there is already a mention of an Helm chart in the README. Since we don’t use the chart (or Helm, or k8s) internally for this project at @mirego it would be hard to maintain/respond to issues. This is why we simply link to another repo.

Is your implementation different from the other repo? Could we use yours to have a more up-to-date version?

Braineanear commented 9 months ago

@simonprev Indeed, the approach we've adopted differs from that of the other repository. In our company, we utilize this particular version to gain enhanced management of Kubernetes resources and configurations. Furthermore, this implementation is aligned with the latest updates in the current accent version and its settings. I am willing to oversee the updates and improvements of the Kubernetes configurations for accent in this repository, ensuring they are optimized and updated in line with the best practices for a production environment.

nikkytub commented 6 months ago

Thank you @Braineanear for the PR. We want to deploy it in our dev env to explore it. Any updates here @simonprev? Can you please merge this PR?

nikkytub commented 6 months ago

Hi @Braineanear, It seems like your helm chart doesn't include postgres installation. You are specifying the configuration here. However, the actual deployment here has no postgres container. At the moment with helm install, the pod restarts with the Backoff reason and the logs state the following: * The database does not exist

Can you please add it?

Thanks & Kind Regards, Nikhil

Braineanear commented 6 months ago

Hey @nikkytub,

This configuration assumes that the user already has a PostgreSQL deployment in their cluster, and only needs to provide the database URL via the configMap. However, I can modify the deployment to include an option that allows the user to install PostgreSQL during the Accent installation on their cluster if they don't already have it. If that's what you need, please let me know, and I'll implement it.

nikkytub commented 6 months ago

Hi @Braineanear, the assumption of Postgres requires additional time and efforts and without proper documentation it becomes tedious. The Helm installation should be easy and straightforward that enables people to explore accent effortlessly. Hence, please include it and also add good documentation about it.

Braineanear commented 6 months ago

@nikkytub okay gonna add it and update the docs.

Braineanear commented 6 months ago

Hey @nikkytub Do you have any idea why the container restart on these logs

Running migrations for accent…
13:13:45.935 [info] Migrations already up
Running seed script for accent…

It started successfully at the beginning but then when it reached the seed script, the container restarted and showed the above logs and always restarting only showing the above logs

nikkytub commented 6 months ago

Hi @Braineanear, I am not involved with the development of accent nor I am maintaining it. I think it is better if @simonprev or other contributors can answer here.

nikkytub commented 6 months ago

Hi @Braineanear, I gave it a try. You are right, the pods are restarting and attached are the detailed logs. logs.txt

nikkytub commented 6 months ago

@Braineanear, Haha, I found the problem. It was crashing due to OOM killed. Increase the memory and it will be fine :-)

New logs: k logs accent-accent-674dd7b7c7-ftmpd -n accent E0513 18:18:15.862367 17695 memcache.go:287] couldn't get resource list for external.metrics.k8s.io/v1beta1: the server is currently unable to handle the request E0513 18:18:15.917614 17695 memcache.go:121] couldn't get resource list for external.metrics.k8s.io/v1beta1: the server is currently unable to handle the request E0513 18:18:15.948848 17695 memcache.go:121] couldn't get resource list for external.metrics.k8s.io/v1beta1: the server is currently unable to handle the request Running migrations for accent… 16:16:37.860 [info] Migrations already up Running seed script for accent… 16:16:45.363 [info] Loading 129 CA(s) from :otp store 16:16:45.368 [info] Running Accent.Endpoint with Bandit 1.3.0 at 0.0.0.0:4000 (http) 16:16:45.368 [info] Access Accent.Endpoint at http://localhost:4000 16:16:45.370 [info] LanguageTool was not configured. Use LANGUAGE_TOOL_LANGUAGES environment variable to set a list of comma-separated languages short code. 16:16:48.922 [info] tzdata release in place is from a file last modified Fri, 22 Oct 2021 02:20:47 GMT. Release file on server was last modified Thu, 01 Feb 2024 18:40:48 GMT. 16:16:50.416 [info] Tzdata has updated the release from 2021e to 2024a

kubectl get po -n accent NAME READY STATUS RESTARTS AGE accent-accent-674dd7b7c7-ftmpd 1/1 Running 0 2m17s accent-postgres-0 1/1 Running 0 45m

Braineanear commented 6 months ago

Hi @nikkytub,

I've updated the code to allow the installation of PostgreSQL. Users can choose to install it alongside Accent or provide the connection string in the config map if they already have it set up.

I've also updated the documentation accordingly.

Regarding the seed command that restarts the pod, I've increased the pod's memory and CPU limits. However, the pod still restarts without displaying any error messages.

I'm currently debugging the issue and will push the updates once it's resolved.

nikkytub commented 6 months ago

Hi @Braineanear, It is working fine in our setup. ` k get po -n accent

NAME READY STATUS RESTARTS AGE accent-accent-674dd7b7c7-ftmpd 1/1 Running 0 5h26m accent-postgres-0 1/1 Running 0 6h10m This is what I used for resources: resources: limits: cpu: 500m memory: 1Gi requests: cpu: 100m memory: 512Mi `

Thank you so much for pushing new changes :-)

Braineanear commented 6 months ago

@simonprev @nikkytub any updates

nikkytub commented 6 months ago

@simonprev @nikkytub any updates

Hi @Braineanear, Sorry, I got some other things to work on and couldn't continue as of now. Perhaps, will continue in a couple of weeks.

The app expects a test database without which it shows connection problems. Perhaps, you can try it if this was the case with you.

nikkytub commented 5 months ago

Hi @Braineanear, have you resolved the problem? I spent some time here recently. In our setup, it is working as intended.

Braineanear commented 5 months ago

Hi @nikkytub , sorry got involved in lot of work and forgot the issue, will resume working on it.