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

dockerHSSM #439

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
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
41 changes: 41 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: dockerHSSM CI

on:
workflow_dispatch:
release:
types: [published]

jobs:
buildx:
runs-on: ubuntu-latest
steps:

- name: Checkout
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install toml package
run: pip install toml
- name: Read version from pyproject.toml
id: get_version
run: |
VERSION=$(python -c "import toml; print(toml.load('pyproject.toml')['tool']['poetry']['version'])")
echo "HSSM_VERSION=hssm:$VERSION" >>$GITHUB_ENV

- name: Docker login
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}

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

- name: Build the Combined Manifest
run: docker buildx build --platform linux/amd64,linux/arm64 -t ${{ secrets.DOCKERHUB_USERNAME }}/${{env.HSSM_VERSION}} -f Dockerfile . --push

- name: Build the Newest Manifest
run: docker buildx build --platform linux/amd64,linux/arm64 -t ${{ secrets.DOCKERHUB_USERNAME }}/hssm:latest -f Dockerfile . --push
47 changes: 47 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.

# This Dockerfile is for HSSM
# The buid from the base of scipy-notebook, based on python 3.11

FROM jupyter/scipy-notebook:python-3.11

LABEL maintainer="Hu Chuan-Peng <[email protected]>"

USER root

RUN apt-get update -y && \
apt-get upgrade -y && \
apt-get install -y apt-utils && \
apt-get install -y build-essential &&\
apt-get install -y graphviz &&\
rm -rf /var/lib/apt/lists/*

USER $NB_UID

RUN pip install graphviz -i https://pypi.tuna.tsinghua.edu.cn/simple
RUN pip install -U "jax[cpu]" -i https://pypi.tuna.tsinghua.edu.cn/simple
RUN pip install pymc==5.14.0 -i https://pypi.tuna.tsinghua.edu.cn/simple
RUN pip install hssm -i https://pypi.tuna.tsinghua.edu.cn/simple

RUN fix-permissions "/home/${NB_USER}" &&\
rm -rf ~/.cache/

# Import matplotlib the first time to build the font cache.
ENV XDG_CACHE_HOME="/home/${NB_USER}/.cache/"

RUN MPLBACKEND=Agg python -c "import matplotlib.pyplot" &&\
fix-permissions "/home/${NB_USER}"

# Copy example data and scripts to the example folder
RUN rm -r /home/$NB_USER/work && \
fix-permissions /home/$NB_USER

COPY /docs/tutorials /home/$NB_USER/tutorials
COPY /tests/fixtures /home/$NB_USER/tutorials/src

USER root
RUN rm -rf /home/$NB_USER/tutorials/main_tutorial

USER $NB_UID
WORKDIR $HOME
514 changes: 262 additions & 252 deletions docs/tutorials/lapse_prob_and_dist.ipynb

Large diffs are not rendered by default.

Loading