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

Add a Dockerised dev environment #66

Merged
merged 4 commits into from
Nov 23, 2021
Merged

Add a Dockerised dev environment #66

merged 4 commits into from
Nov 23, 2021

Conversation

JamieTaylor-TUOS
Copy link
Collaborator

Add a Docker Image that can serve as dev env - particularly useful for windows users.

The Docker image:

  • Uses python:3.9 as base (could perhaps use Python3.9-slim, or maybe even Alpine
  • Install system libs and packages that are likely to b needed in dev
  • Installs pip requirements
  • Launches Jupyter notebooks by default, but can also be used to run arbitrary scripts

Pull Request

Description

I have built locally as:

>> docker build -t sheffieldsolar/pvoutput:dev-20211118 -f Dockerfile_dev .

Usage

To launch Jupyter:

>> cd <path-to-pvoutput-repo-root>
>> docker run -it --rm -v ${PWD}:/pvoutput -e PVOUTPUT_CONFIG=/pvoutput/.pvoutput.yml -p 1234:1234 sheffieldsolar/pvoutput:dev-20211118

The above command will volume-mount the locally cloned repo inside the container at /pvoutput so that code can be developed inside the container. Note it is also necessary to mount the config file, unless it happens to be in your repo root directory, in which case just set the PVOUTPUT_CONFIG env var.

To run arbitrary scrips form the repo:

>> cd <path-to-pvoutput-repo-root>
>> docker run -it --rm -v ${PWD}:/pvoutput -e PVOUTPUT_CONFIG=/pvoutput/.pvoutput.yml sheffieldsolar/pvoutput:dev-20211118 <command>

Fixes #65
Fixes #47

If approved, the built image can be hosted somewhere on the web and the README should be updated with the above usage instructions.

How Has This Been Tested?

It is my current dev environment, seems to work ok in all regards.

Checklist:

  • My code follows OCF's coding style guidelines
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked my code and corrected any misspellings

JamieTaylor-TUOS and others added 2 commits November 18, 2021 15:25
Add a Docker Image that can serve as dev env - particularly useful for windows users.

The Docker image:
- Uses python:3.9 as base (could perhaps use Python3.9-slim, or maybe even Alpine
- Install system libs and packages that are likely to b needed in dev
- Installs pip requirements
- Launches Jupyter notebooks by default, but can also be used to run arbitrary scripts
Dockerfile_dev Outdated
@@ -0,0 +1,27 @@
FROM python:3.9
Copy link
Contributor

Choose a reason for hiding this comment

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

similar to what @flowirtz said about -slim

Copy link
Contributor

Choose a reason for hiding this comment

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

ive adde issue #77 for this

@@ -0,0 +1,10 @@
pytest
Copy link
Contributor

Choose a reason for hiding this comment

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

thanks for this

@peterdudfield peterdudfield merged commit 1ccf4af into main Nov 23, 2021
@peterdudfield peterdudfield deleted the Issue-#65 branch November 23, 2021 19:04
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.

Include a Dockerised dev environment create separate requirements file
2 participants