diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml new file mode 100644 index 0000000..6d8f8b8 --- /dev/null +++ b/.github/workflows/docker-build.yml @@ -0,0 +1,24 @@ +name: Publish docker image + +on: + workflow_dispatch: + +jobs: + push_to_registry: + name: Push Docker image to GitHub Packages + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Login to GitHub Container Registry + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push + uses: docker/build-push-action@v2 + with: + push: true + context: build + tags: ghcr.io/breakthrough-energy/postreise:latest diff --git a/.gitignore b/.gitignore index f91db91..7a70568 100644 --- a/.gitignore +++ b/.gitignore @@ -12,7 +12,6 @@ __pycache__/ # Distribution / packaging .Python -build/ develop-eggs/ dist/ downloads/ diff --git a/build/Dockerfile b/build/Dockerfile new file mode 100644 index 0000000..e5c2f2d --- /dev/null +++ b/build/Dockerfile @@ -0,0 +1,24 @@ +FROM python:3.8.3 + +RUN apt-get update +RUN ln -s /mnt/bes/pcm $HOME/ScenarioData + +RUN pip install -U pip pipenv ipython jupyterlab ipywidgets + +RUN git clone --depth 1 https://github.com/Breakthrough-Energy/PowerSimData +RUN git clone --depth 1 https://github.com/Breakthrough-Energy/PostREISE + +WORKDIR /PowerSimData +RUN mkdir -p /mnt/bes/pcm +RUN cp -r powersimdata/utility/templates /mnt/bes/pcm/ + +WORKDIR /PostREISE +RUN pipenv sync --dev --system; +RUN pip install . +RUN pip install ../PowerSimData + +WORKDIR /app +RUN rm -rf /PowerSimData +RUN rm -rf /PostREISE + +CMD ["jupyter", "lab", "--port=10000", "--no-browser", "--ip=0.0.0.0", "--allow-root"] diff --git a/standalone/docker-compose.dev.yml b/standalone/docker-compose.dev.yml index 80b7373..9157c32 100644 --- a/standalone/docker-compose.dev.yml +++ b/standalone/docker-compose.dev.yml @@ -1,13 +1,7 @@ services: - powersimdata: # included only for building postreise base image - build: - context: ../../PowerSimData - image: ghcr.io/breakthrough-energy/powersimdata:latest client: build: - context: ../../PostREISE - depends_on: - - powersimdata + context: ../build reisejl: build: context: ../../REISE.jl