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

First version of Dockerfile & docker-compose #416

Merged
merged 32 commits into from
Apr 25, 2022

Conversation

nhoening
Copy link
Contributor

Closes #149.
This PR also includes a health check in the FM API (#213)

…k in the FM API

Signed-off-by: Nicolas Höning <nicolas@seita.nl>
@nhoening nhoening linked an issue Apr 10, 2022 that may be closed by this pull request
@nhoening nhoening added this to the 0.10.0 milestone Apr 10, 2022
@coveralls
Copy link
Collaborator

coveralls commented Apr 10, 2022

Pull Request Test Coverage Report for Build 2219819686

  • 16 of 34 (47.06%) changed or added relevant lines in 5 files are covered.
  • 6 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.04%) to 68.523%

Changes Missing Coverage Covered Lines Changed/Added Lines %
flexmeasures/utils/config_utils.py 2 3 66.67%
flexmeasures/cli/data_add.py 0 7 0.0%
flexmeasures/api/v3_0/health.py 11 21 52.38%
Files with Coverage Reduction New Missed Lines %
flexmeasures/data/models/parsing_utils.py 6 71.79%
Totals Coverage Status
Change from base Build 2173483890: -0.04%
Covered Lines: 7053
Relevant Lines: 9764

💛 - Coveralls

…lask), by not installing in editable mode

Signed-off-by: Nicolas Höning <nicolas@seita.nl>
…ration file; use flexmeasures run as default command for now

Signed-off-by: Nicolas Höning <nicolas@seita.nl>
…res container, clean up docs

Signed-off-by: Nicolas Höning <nicolas@seita.nl>
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
@nhoening nhoening marked this pull request as ready for review April 13, 2022 13:27
@nhoening
Copy link
Contributor Author

My last idea for now was to include the health check in the image. It's now in the docker compose file.
I left it there for now, as I think it's possible that we will only have one FlexMeasures Dockerfile, which is used both to run a container for the API (default), and one for running workers. Workers don't serve the API, so the health check we are using now would not work for them and the container would be marked unhealthy.
Actually, we should develop a CLI-based health check to be used when the image is used for such use case. This health check CLI command would the background make the same checks as the APi health check endpoint. Something to consider in #418.

Signed-off-by: Nicolas Höning <nicolas@seita.nl>
@nhoening nhoening requested a review from Flix6x April 13, 2022 16:06
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
…ntainer

Signed-off-by: Nicolas Höning <nicolas@seita.nl>
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
Copy link
Contributor

@Flix6x Flix6x left a comment

Choose a reason for hiding this comment

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

For a first version you already accomplished a lot of stuff! I mostly have small comments right now, but I think I also have some more testing to do.

documentation/dev/docker.rst Outdated Show resolved Hide resolved
documentation/dev/docker.rst Outdated Show resolved Hide resolved
documentation/dev/docker.rst Outdated Show resolved Hide resolved
documentation/dev/docker.rst Outdated Show resolved Hide resolved
documentation/tut/toy-example-from-scratch.rst Outdated Show resolved Hide resolved
documentation/changelog.rst Outdated Show resolved Hide resolved
documentation/dev/docker.rst Outdated Show resolved Hide resolved
documentation/dev/docker.rst Outdated Show resolved Hide resolved
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
… a way to tell FlexMeasures to use a different database URI than the standard one when testing

Signed-off-by: Nicolas Höning <nicolas@seita.nl>
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
…g/deploying), the latter more for development. Also fix small errors and give better info on WSGI scripts.

Signed-off-by: Nicolas Höning <nicolas@seita.nl>
…torial

Signed-off-by: Nicolas Höning <nicolas@seita.nl>
…on-Docker

Signed-off-by: Nicolas Höning <nicolas@seita.nl>
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
@nhoening
Copy link
Contributor Author

@Flix6x Not sure how far your review / testing went. I'm done with the documentation changes, and I have tested the toy tutorial done only in Docker.

The last thing I'm trying to accomplish is to move the Docker image to lfenergy/flexmeasures (right now we have our own repository, flexmeasures/fkexmeasures). This hinges on getting the repo set up in the existing lfenergy Docker organisation. I'm on it.

Signed-off-by: Nicolas Höning <nicolas@seita.nl>
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
@nhoening nhoening requested a review from Flix6x April 22, 2022 07:09
documentation/host/docker.rst Outdated Show resolved Hide resolved
documentation/host/docker.rst Outdated Show resolved Hide resolved
documentation/host/deployment.rst Show resolved Hide resolved
documentation/dev/docker-compose.rst Outdated Show resolved Hide resolved
Readme.md Outdated Show resolved Hide resolved
.gitignore Outdated Show resolved Hide resolved
documentation/tut/toy-example-from-scratch.rst Outdated Show resolved Hide resolved
documentation/tut/toy-example-from-scratch.rst Outdated Show resolved Hide resolved
flexmeasures/cli/data_add.py Outdated Show resolved Hide resolved
documentation/dev/docker.rst Outdated Show resolved Hide resolved
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
…tart_period for healthchecks)

Signed-off-by: Nicolas Höning <nicolas@seita.nl>
…docker container

Signed-off-by: Nicolas Höning <nicolas@seita.nl>
@nhoening nhoening requested a review from Flix6x April 23, 2022 10:52
documentation/changelog.rst Outdated Show resolved Hide resolved
documentation/changelog.rst Outdated Show resolved Hide resolved
Copy link
Contributor

@Flix6x Flix6x left a comment

Choose a reason for hiding this comment

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

Nice to have our tech running in docker again!

Signed-off-by: Nicolas Höning <nicolas@seita.nl>
…r doc fixes

Signed-off-by: Nicolas Höning <nicolas@seita.nl>
@nhoening nhoening merged commit 4cb6359 into main Apr 25, 2022
@nhoening nhoening deleted the 149-dockerfile-for-developmentdemo branch April 25, 2022 11:36
@nhoening nhoening mentioned this pull request Jul 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dockerfile for Development/demo
3 participants