Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 23 additions & 19 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ on:
pull_request:

env:
TEST_TAG: user/myapp:test
TEST_TAG: pyansys-base-image:test
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build:
Expand All @@ -16,51 +18,51 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Read IMAGE_NAME
id: image_name
uses: falti/dotenv-action@v0.2.7
with:
path: IMAGE_NAME
- name: Login to ${{ steps.image_name.outputs.registry }}

- name: Login to ${{ env.REGISTRY }}
uses: docker/login-action@v1
with:
registry: ${{ steps.image_name.outputs.registry }}
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_PASSWORD }}
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
images: ${{ steps.image_name.outputs.registry }}/${{ steps.image_name.outputs.repository }}
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
github-token: ${{ github.token }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern=v{{major}}.{{minor}}.{{patch}}
type=semver,pattern=v{{major}}.{{minor}}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Build and export to Docker
uses: docker/build-push-action@v2
with:
context: .
load: true
tags: ${{ env.TEST_TAG }}
cache-from: type=registry,ref=${{ steps.image_name.outputs.registry }}/${{ steps.image_name.outputs.repository }}:latest

- name: Test
run: >-
docker run --rm
-v `pwd`/test_notebooks:/test_notebooks
--user $(id -u):$(id -g) -e HOME=/tmp
${{ env.TEST_TAG }}
jupyter nbconvert --to html --execute $NOTEBOOKS --output-dir=/test_notebooks/out
env:
# Need fix: cadquery.ipynb
NOTEBOOKS: >-
/test_notebooks/import-all.ipynb
/test_notebooks/ipygany.ipynb
/test_notebooks/ipyvtk-simple.ipynb
/test_notebooks/panel.ipynb
jupyter nbconvert --to html --execute /test_notebooks/* --output-dir=/test_notebooks/out

- name: Save notebook HTML out
uses: actions/upload-artifact@v2
with:
name: test-notebooks-html-out
path: test_notebooks/out/*.html

- name: Push the image
uses: docker/build-push-action@v2
with:
Expand All @@ -70,3 +72,5 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=registry,ref=${{ steps.image_name.outputs.registry }}/${{ steps.image_name.outputs.repository }}:latest
cache-to: type=inline
secrets: |
"github_token=${{ steps.get_workflow_token.outputs.token }}"
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM jupyter/base-notebook:python-3.8.8
FROM jupyter/base-notebook:hub-1.4.2
Copy link
Contributor

Choose a reason for hiding this comment

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

Guess 3.8 isn't the latest anyway. Between the python-3.9 and hub images, I'm not seeing any difference in the docker layers, so either one works.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@akaszynski ah yep I did this change because I had warnings of version difference between the jupyter hub base image and the version of the helm chart, so I thought tagging by hub version was more significant here


MAINTAINER Alex Kaszynski "alexander.kaszynski@ansys.com"
MAINTAINER PyAnsys Maintainers "pyansys.maintainers@ansys.com"

USER root

Expand Down
6 changes: 0 additions & 6 deletions IMAGE_NAME

This file was deleted.

16 changes: 2 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,9 @@ This repository contains a `Dockerfile` to generate the base image
required for upstream images for pyansys.com. Images are generated by
pushing a git tag starting with `v`.

Image is named and is built to be deployed at the MBU container
repository, but this will be changed to be deployed via dockerhub or
github docker
The image is pushed to the github repository ghcr.io.

```
mapdlhelm.azurecr.io/jupyterlab_base:$VERSION
```

Obtain docker login credentials by following the steps at:
https://portal.azure.com/#@ansys.com/resource/subscriptions/2870ae10-53f8-46b1-8971-93761377c38b/resourceGroups/PyANSYS/providers/Microsoft.ContainerRegistry/registries/mapdlhelm

It can be run locally by running the scripts in the following order:

- build_image.sh
- run_image.sh
It can be run locally with `build_and_run_image.sh`

#### Notes
- GPU image on dev.pyansys.com contains additional GPU remote
Expand Down
10 changes: 6 additions & 4 deletions run_image.sh → build_and_run_image.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
source IMAGE_NAME
#!/bin/bash

# with GPU
# docker run -it --rm -v /home/$USER/python:/mnt/python -v /tmp:/mnt/tmp -p 8888:8888 --gpus all $IMAGE
IMAGE="pyansys-base-image:dev"

# build the jupyter single user image
docker build -t "$IMAGE" .

# w/o GPU
docker run -it --rm \
-v /home/$USER/python:/mnt/python \
-v /tmp:/mnt/tmp \
-v `pwd`/test_notebooks:/home/jovyan/test_notebooks \
-p 8888:8888 $IMAGE
-p 8888:8888 "$IMAGE"
7 changes: 0 additions & 7 deletions build_image.sh

This file was deleted.

30 changes: 15 additions & 15 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,25 @@ channels:
- cadquery
- plotly
dependencies:
- jupyterlab=3.0.10
- ipywidgets=7.6.3
- pandas=1.2.3
- jupyterlab=3.2.0
- ipywidgets=7.6.5
- pandas=1.2.4
- ipygany=0.5.0
- pyvista=0.32.1
- panel=0.11.0
- plotly=4.14.3
- cadquery=master
- jupyter-dash=0.3.0
- networkx=2.5
- panel=0.12.4
- plotly=5.3.1
- cadquery=master # version 2.1 does not support python 3.9
- jupyter-dash=0.4.0
- networkx=2.6.3
- colour=0.1.5
- cairo=1.16.0
- ipympl=0.6.3
- ipyevents=0.8.2
- ipycanvas=0.8.2
- dash-bootstrap-components=0.11.3
- ipympl=0.8.1
- ipyevents=2.0.1
- ipycanvas=0.9.0
- dash-bootstrap-components=1.0.0
- ipyvtklink==0.2.1
- pip=21.2.4
- pip=21.3
- pip:
- jupyter-cadquery==2.0.0
- dash-vtk==0.0.6
- jupyter-cadquery==2.2.1
- dash-vtk==0.0.9
- dash-treeview-antd==0.0.1
2 changes: 1 addition & 1 deletion labextensions.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
jupyterlab-plotly@4.14.3
jupyterlab-plotly@5.3.1
plotlywidget@4.14.3
ipygany@0.5.0