Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate database to localhost #92

Merged
merged 6 commits into from
Apr 16, 2023
Merged

Migrate database to localhost #92

merged 6 commits into from
Apr 16, 2023

Conversation

atxr
Copy link
Contributor

@atxr atxr commented Apr 14, 2023

This PR removes the hardcoded values of the remote atlas database.
It introduces a new local database deployment in the docker-compose workflow.
The database is secured thanks to docker networking.

I tested the whole migration ✔️

⚠️ This PR doesn't migrate the current atlas db to the new local one. This action must be done "by hand" when the website will be bumped.

Add new mongodb app in docker-compose
This app has a volume in mongodb/ to store the data
Setup two docker networks to separate backend and proxy traffic
Update the backend to connect to localhost instead of remote database
@atxr atxr added enhancement New feature or request Priority: High The Issue must be addressed as soon as possible backend about the website backend (endpoints, API,...) labels Apr 14, 2023
@atxr atxr requested review from amtoine, vSt11 and ctmbl April 14, 2023 17:59
@atxr atxr self-assigned this Apr 14, 2023
amtoine
amtoine previously approved these changes Apr 14, 2023
Copy link
Member

@amtoine amtoine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks good to me even though i've no idea how it works 😮

i'll trust you when you say you have tested it => do you think we could test that part of the website during some deployment pipeline?

also, we'll have to wait for prettier to work, but that's a detail 😌

@amtoine
Copy link
Member

amtoine commented Apr 14, 2023

Note
once we land #91 and the prettier pipeline is fixed, you can

git fetch iscsc
git merge iscsc/main
git push atxr

to resolve the conflicts if any @atxr 👍

@atxr
Copy link
Contributor Author

atxr commented Apr 14, 2023

i'll trust you when you say you have tested it => do you think we could test that part of the website during some deployment pipeline?

What do you mean by testing it during some deployment pipeline?

@amtoine
Copy link
Member

amtoine commented Apr 15, 2023

What do you mean by testing it during some deployment pipeline?

well you're saying me you've updated the database, performed local manual tests and that it must 'be done "by hand"' to deploy the website on the server.

i'm wondering if there is some kind of GitHub pipeline we could write to test

  • the database is working properly
  • the website can be deployed safely

@atxr
Copy link
Contributor Author

atxr commented Apr 15, 2023

Ok yes I see!
Actually we don't have any test to verify that the backend/frontend/database is successfully deployed
But I guess it's a good next step for the CI
The migration of the database from atlas to localhost will be done only once and I'll probably write a little script to do so when we will deploy the website

@amtoine
Copy link
Member

amtoine commented Apr 15, 2023

Actually we don't have any test to verify that the backend/frontend/database is successfully deployed
But I guess it's a good next step for the CI

could you file an issue for this? 😋

The migration of the database from atlas to localhost will be done only once and I'll probably write a little script to do so when we will deploy the website

ok gotcha, no need to spend too much time on that particular migration then 😌
but a general CI that checks the deployment might be great.

Copy link
Member

@amtoine amtoine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm (CI for the win 😤)

@atxr
Copy link
Contributor Author

atxr commented Apr 15, 2023

could you file an issue for this? yum

Actually no, because we have a bigger plan for the CI with @ctmbl
We will create an issue soon

@amtoine amtoine merged commit 5764dba into iScsc:main Apr 16, 2023
@atxr atxr deleted the migrate_db branch April 16, 2023 18:06
ctmbl added a commit to ctmbl/iscsc.fr that referenced this pull request Apr 17, 2023
This merge is needed to bring the recent changes of iScsc#92 to the
'backend/python` branch
ctmbl added a commit to ctmbl/iscsc.fr that referenced this pull request Apr 20, 2023
This merge is needed to bring recent DB local containerization iScsc#92 to
this branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend about the website backend (endpoints, API,...) enhancement New feature or request Priority: High The Issue must be addressed as soon as possible
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants