PalisadoesFoundation / talawa-api

API Backend for the Talawa Mobile App. Click on the link below to see our documentation
https://docs.talawa.io/
GNU General Public License v3.0
218 stars 778 forks source link

Cloud Based API Instance for Developers #1428

Open palisadoes opened 11 months ago

palisadoes commented 11 months ago

We need to have a cloud based API instance for developers to test against. It must:

  1. Be integrated into our CI/CD pipeline so that the app is rebuilt with every newly merged PR.
  2. Initialize the database to a known working state with appropriate services will be restarted when this happens: (there are existing API calls for this):
    1. with each CI/CD update
    2. every 24 hours
  3. Use a talawa.io sub-domain as the endpoint
  4. The API instance will have a rate limiting mechanism to reduce the risk of abuse
  5. Preferably use a free service
  6. Use a palisadoes role based account for management
  7. The demo cloud API must be easily switched between branches as the code source. We will be migrating to master as the default branch soon.

Please coordinate these efforts with @noman2002 and @kb-0311. Ask to be assigned this task by them.

Cioppolo14 commented 4 months ago

@palisadoes The ci/cd is ready but it is failing often when there are several commits in small time intervals. How about if we update the cloud instance every 6 or 12 hours? It will improve the stability and uptime of the instance significantly.

@noman2002 @palisadoes What do you think?

palisadoes commented 4 months ago

@palisadoes The ci/cd is ready but it is failing often when there are several commits in small time intervals. How about if we update the cloud instance every 6 or 12 hours? It will improve the stability and uptime of the instance significantly.

Once a day, and try to make it happen with a reloading of the sample database. It'll be easier to troubleshoot with the lower frequency

palisadoes commented 4 months ago

Thanks for continuing with this

vasujain275 commented 4 months ago

@palisadoes

  1. I will change the github action to run once every 24 hours.
  2. Caddy is a much better alternative to Nginx + Certbot. I will raise an issue to migrate to caddy.
vasujain275 commented 4 months ago

@palisadoes As I am revamping the build and deploy process of talawa-api docker images, I think it will be easy to start with fresh vps. So, can you please reset our current VPS that we are working on?

palisadoes commented 4 months ago

Why will a fresh VPS be easier?

vasujain275 commented 4 months ago

@palisadoes

I have added a lot of manual configurations and cron jobs to get Nginx Certbot working, but that won't be needed now because the Caddy reverse proxy only needs a Caddyfile and additions in Docker Compose and does not require additional manual configuration on the server. So, a fresh VPS will make it a lot easier to document the process. If resetting the VPS is not possible easily, then I can manage with this current vps state as well.

vasujain275 commented 4 months ago

@palisadoes No need to reset now, I am reverting all the nginx cerbot configs by cli. Will move them to Caddy

palisadoes commented 4 months ago

Thanks.

github-actions[bot] commented 3 months ago

This issue did not get any activity in the past 10 days and will be closed in 180 days if no update occurs. Please check if the develop branch has fixed it and report again or close the issue.

vasujain275 commented 3 months ago

As Caddy Pr was closed due to branch name issue, I will make another pr by tomorrow as @palisadoes suggested

github-actions[bot] commented 1 month ago

This issue did not get any activity in the past 10 days and will be closed in 180 days if no update occurs. Please check if the develop branch has fixed it and report again or close the issue.

Cioppolo14 commented 1 month ago

@vasujain275 Should we see if someone else wants to pick this up or do you have time for this?

vasujain275 commented 1 month ago

@vasujain275 Should we see if someone else wants to pick this up or do you have time for this?

I can work on it but we are shifting from mongodb to Postgresql soon, so the only left feature in this issue is that the db sample data populate script will be obsolete in few weeks.

The demo api deployment is working fine and has been hosted on the demo api website for ~10 weeks.

palisadoes commented 1 month ago

Vasu, why is it that when we merge PRs, we get deployment errors?

vasujain275 commented 1 month ago

@palisadoes The Deploying to VPS workflow is failing because we decided not to deploy on each commit but instead deploy evert 24hrs. I haven't modify the github action to deploy on 24hr instead of every commit

github-actions[bot] commented 1 month ago

This issue did not get any activity in the past 10 days and will be closed in 180 days if no update occurs. Please check if the develop branch has fixed it and report again or close the issue.

vasujain275 commented 2 weeks ago

@palisadoes Any update on database migration from mongodb to postgresql? Because I haven't made the sample data push script due db being migrated from mongo to postgresql

palisadoes commented 1 week ago
  1. @xoldd has submitted a PR on a new branch
  2. @vasujain275 we should assume the continued use of mongo until we migrate all the other repos to use the postgres option.
  3. Take a look at the most recent post in the #general slack channel