Skip to content

Docker compose for dev#28

Open
Benjamintdk wants to merge 149 commits intoorcasound:masterfrom
Benjamintdk:docker-compose-for-dev
Open

Docker compose for dev#28
Benjamintdk wants to merge 149 commits intoorcasound:masterfrom
Benjamintdk:docker-compose-for-dev

Conversation

@Benjamintdk
Copy link
Copy Markdown
Collaborator

@Benjamintdk Benjamintdk commented Jun 19, 2022

Resolves #12. Builds on #23 #24 #26 #27. This PR aims to incorporate a docker compose file for development. Additionally, while not within the scope of the branch name, a Github Action was implemented for running tests as well, as there were some changes made to the test docker compose file along the way, especially with regard to the networking aspect.

Major changes:

  • Docker compose file for development

Miscellaneous changes:

  • Github Action to automatically run tests with docker compose test

Actions required:

  • Add secret AWS_ACCESS_KEY_ID to OrcaAL repository secrets
  • Add secret AWS_SECRET_ACCESS_KEY to OrcaAL repository secrets

Benjamintdk and others added 30 commits March 27, 2022 11:32
…environment, and changed webpack config for webapp docker deployment
Trying docker dev first to see if there are any issues with networking or starting containers
Removed verbose flag
Removing health check and dependency to hopefully get more logs
Trying to add in region to solve the issue
@Benjamintdk Benjamintdk mentioned this pull request Jun 19, 2022
@valentina-s
Copy link
Copy Markdown
Contributor

@Benjamintdk I have been trying to spin up the app through docker-compose (on Mac). The ML and API endpoints start well and I can access them through localhost:5000 and localhost:5001 (and getting the statistics from the browser works). However, I get an error and trying to get the statistics:
Screen Shot 2022-07-14 at 11 13 59 AM

Is there something I should configure regarding the networks?

@Benjamintdk
Copy link
Copy Markdown
Collaborator Author

@valentina-s I have provided a stack trace of the api service docker container below. If you wait for a while, you should see something along the lines of this, which indicates that the service is now up and running:
image
The error thrown is because the api service tries to send a get request to the statistics endpoint but the ml_endpoint has yet to finish training and predicting, and hence the statistics are not yet ready. To remedy this, I used a health check within the docker compose file to periodically check for when the ml_endpoint service is stable before starting up any other services. The ideal fix would be to add in the error handling for that part of the code to ensure the service does not fail while waiting, or to add in an await/async block to wait for the ml_endpoint to return the result. However, I felt that that was beyond the scope for this PR as I did not want to make too much refactoring to the code base itself, and hence left it as it is.

@valentina-s
Copy link
Copy Markdown
Contributor

@Benjamintdk After fiddling with the number of retries in the healthcheck, I can get through the api working and returning 200. However, after that I get an webpack-dev-server error:
Screen Shot 2022-07-18 at 12 33 30 AM

I tried npm install webpack-dev-server -g as some forums suggested but I was not sure at which step of the set up to do it.

@Benjamintdk Benjamintdk marked this pull request as ready for review August 17, 2022 09:29

3) To run testing for the services:

`docker-compose -f docker-compose.test.yml up --build --exit-code-from pytest --abort-on-container-exit`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

docker-compose.test.yml -> docker-compose.test.backend.yml docker-compose.test.frontend.yml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Adding docker compose file to root directory

2 participants