-
Notifications
You must be signed in to change notification settings - Fork 80
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
Feat: Docker setup #208
base: develop
Are you sure you want to change the base?
Feat: Docker setup #208
Conversation
Hello there!👋 Welcome to the project!💖 Thank you and congrats🎉 for opening your first pull request.✨ AnitaB.org is an inclusive community, committed to creating a safe and positive environment.🌸Please adhere to our Code of Conduct and Contribution Guidelines.🙌.We will get back to you as soon as we can.😄 Feel free to join us on AnitaB.org Open Source Zulip Community.💖 We have different streams for each active repository for discussions.✨ Hope you have a great time there!😄 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@epicadk. I think having docker image is a good idea for newcomers who prefer to choose not to setup on local machine.
But we should give the alternative to run locally for those who prefer to go with this option. I myself prefer to run locally since it is:
- easier to debug
- easier to look into the local postgres db and directly manipulate it through running sql command which can be done through either terminal shell or pgadmin4
Like in MS backend, the docker is used only as alternative and the contributors still able to run the application locally if they want to.
So, please make sure the code for this docker setup won't interupt the existing local setup that is already there.
Also, please consider how this will affect the testing, both on local machine or on github action.
Below are my initial feedback. Please address them with the consideration that the application would be able to run both locally and on docker.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@epicadk , please check the comment below.
SQLALCHEMY_DATABASE_URI = BaseConfig.build_db_uri() | ||
|
||
# SQLALCHEMY_DATABASE_URI = "postgresql://postgres:postgres@postgres:5432/bit_schema" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this hard-coded string still?
@@ -0,0 +1,25 @@ | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the local setup, it is important to run the BIT backend first before running the MS backend. This is to make sure that the postgresql database schemas is built correctly using the db models from BIT backend code.
In this scenario (running the app on docker), how do you make sure that this constraint being followed? Should we add build BIT 1st, wait, then build MS next?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, how to make sure the docker runs the correct branch on MS and BIT on:
- normal situation: BIT == develop branch, MS == bit branch (assuming the PR is approved and merged)
- working on PR: BIT == pr branch, MS == bit branch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, how to inspect postgres db? can we still use the pgadmin4 to connect to this? or we must use command line to inspect potgres inside docker? whichever options are possible, can you please explain this in the setup instruction for docker.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, if we want to debug, can you please add instruction on docker on how to do this (command to be run for docker to run in debug mode)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to run docker by running docker-compose up
and tried to register, but failed. Possible cause is MS being built and run first before BIT which messed up the schemas inside postgres db.
Here's the terminal log.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is because you set the postgres host to localhost. It should be set to
postgers
while running the app and totest_postgres
while testing it ( If you are using docker).
So I need to add these extra variables inside my local .env? I thought that isn't necessary as docker has it's own env when it sets up postgres within docker? I'm confused 🤔. I looked up POSTGRES_HOST and only found it being setup inside Dockerfile.
It should be set to
postgers
while running the app and totest_postgres
while testing it ( If you are using docker)
Can you please be specific on how and where exactly we need to do this (set to postgres and test_postgres while running the app using docker). Sorry, I'm a noob here 😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The bit backend is working fine but the issue is with the MS backend (as can be seen in the error log). I have sent a pr to your initial-bit-integration
branch here you'll have to use this branch. Also remember to clean up the containers now that the code has changed remember to rebuild the containers. (You can use make docker-dev
and it will handle all of this for you : ) )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, how to inspect postgres db? can we still use the pgadmin4 to connect to this? or we must use command line to inspect potgres inside docker? whichever options are possible, can you please explain this in the setup instruction for docker.
You can connect to postgers using the docker command line. There are add-ons that let you use pgadmin4 for the database inside docker. Would you like me to set that up?
Yes please
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The bit backend is working fine but the issue is with the MS backend (as can be seen in the error log). I have sent a pr to your
initial-bit-integration
branch here you'll have to use this branch. Also remember to clean up the containers now that the code has changed remember to rebuild the containers. (You can usemake docker-dev
and it will handle all of this for you : ) )
you mean the command make docker_host_dev
as in the Dockerfile, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh oops yes I meant that.
Marking this as status on hold since docker needs to be setup on the mentorship system backend. |
Description
Added dockerfile and docker-compose.yml that will make it easier to setup the project.
Fixes #207
Type of Change:
Code/Quality Assurance Only
How Has This Been Tested?
Checklist:
Code/Quality Assurance Only