diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 429231e1b713be1ec6aed34a4131d65677156a15..30384724ae8f48bd240ac0e6c820da1b26ec921c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -38,7 +38,6 @@ Python 3 POCL: tags: - python3 - pocl - - dealii - large-node except: - tags @@ -61,7 +60,6 @@ Python 3 Intel: - ". ./build-and-test-py-project.sh" tags: - python3 - - dealii - intel-cl-cpu - large-node except: @@ -120,7 +118,6 @@ Python 3 POCL Examples: tags: - python3 - pocl - - dealii - large-node except: - tags @@ -151,8 +148,6 @@ Documentation Sphinx: - git push tags: - python3 - - pocl - - dealii except: - tags allow_failure: true @@ -160,10 +155,15 @@ Documentation Sphinx: Docker Image w/t Firedrake: script: - docker info + - docker pull firedrakeproject/firedrake:latest - docker build --no-cache -t xywei/volumential-firedrake:latest -f docker/Dockerfile.firedrake . + - docker build --no-cache -t xywei/volumential-firedrake-jupyterlab:latest -f docker/Dockerfile.firedrake_jupyterlab . + - docker build --no-cache -t xywei/volumential-firedrake-jupyterlab-vim:latest -f docker/Dockerfile.firedrake_jupyterlab_vim . - bash -c 'if [ "$BRANCH_PROTECTED" = 1 ]; then exit 0; else exit 1; fi' - docker login --username "${DOCKERHUB_USERNAME}" --password "${DOCKERHUB_ACCESS_TOKEN}" - docker push xywei/volumential-firedrake:latest + - docker push xywei/volumential-firedrake-jupyterlab:latest + - docker push xywei/volumential-firedrake-jupyterlab-vim:latest tags: - docker except: diff --git a/docker/Dockerfile.firedrake b/docker/Dockerfile.firedrake index ccc06e8101b0be3b36d1be7041fd139499fcc5c8..cd5252eb989352c820e8abe822d28f6861d3d20a 100644 --- a/docker/Dockerfile.firedrake +++ b/docker/Dockerfile.firedrake @@ -19,12 +19,14 @@ RUN ln -s /usr/lib/x86_64-linux-gnu/libOpenCL.so.1 /usr/lib/libOpenCL.so ########################################## USER firedrake -WORKDIR /home/firedrake +WORKDIR /home/firedrake/firedrake/src RUN git clone --recurse-submodules "https://gitlab.tiker.net/xywei/volumential.git" # Code generation in pypvfm's setup.py needs mako -RUN bash -c "source firedrake/bin/activate; pip install mako" +RUN bash -c "source ~/firedrake/bin/activate; pip install mako" -RUN bash -c "source firedrake/bin/activate; cd volumential/contrib/meshgen11_dealii; ./build.sh" -RUN bash -c "source firedrake/bin/activate; cd volumential; pip install -r requirements.txt" +RUN bash -c "source ~/firedrake/bin/activate; cd volumential/contrib/meshgen11_dealii; ./build.sh" +RUN bash -c "source ~/firedrake/bin/activate; cd volumential; pip install -r requirements.txt" +COPY docker/to_loopyy.sh . +RUN bash -c "source ~/firedrake/bin/activate; sh to_loopyy.sh" diff --git a/docker/Dockerfile.firedrake_jupyterlab b/docker/Dockerfile.firedrake_jupyterlab new file mode 100644 index 0000000000000000000000000000000000000000..7d99b80d61b6a672e32d000e2c21a60077edca06 --- /dev/null +++ b/docker/Dockerfile.firedrake_jupyterlab @@ -0,0 +1,19 @@ +# Working environment that also starts a jupyterlab server on start +FROM xywei/volumential-firedrake:latest + +# This DockerFile is looked after by +MAINTAINER Xiaoyu Wei + +########################################## +# install nodejs for jupyter lab extensions +USER root +RUN curl -sL https://deb.nodesource.com/setup_14.x | bash - +RUN apt-get install -y nodejs && rm -rf /var/lib/apt/lists/* + +########################################## +USER firedrake +COPY docker/start_jupyterlab.sh . +RUN bash -c "source ~/firedrake/bin/activate; pip install tqdm jupyterlab" +RUN bash -c "source ~/firedrake/bin/activate; jupyter labextension install @jupyter-widgets/jupyterlab-manager" +RUN bash -c "source ~/firedrake/bin/activate; jupyter labextension install @jupyterlab/toc" +CMD ["sh", "start_jupyterlab.sh"] diff --git a/docker/Dockerfile.firedrake_jupyterlab_vim b/docker/Dockerfile.firedrake_jupyterlab_vim new file mode 100644 index 0000000000000000000000000000000000000000..25e2e2bc335dc6ff659da3e744ed956547774a75 --- /dev/null +++ b/docker/Dockerfile.firedrake_jupyterlab_vim @@ -0,0 +1,7 @@ +# Jupyter lab working envioronment with vim mode +FROM xywei/volumential-firedrake-jupyterlab:latest + +# This DockerFile is looked after by +MAINTAINER Xiaoyu Wei + +RUN bash -c "source ~/firedrake/bin/activate; jupyter labextension install @axlair/jupyterlab_vim" diff --git a/docker/start_jupyterlab.sh b/docker/start_jupyterlab.sh new file mode 100644 index 0000000000000000000000000000000000000000..127ba22d1c141d911496515743635f868d663fda --- /dev/null +++ b/docker/start_jupyterlab.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +. ~/firedrake/bin/activate +jupyter lab --ip=0.0.0.0 diff --git a/docker/to_loopyy.sh b/docker/to_loopyy.sh new file mode 100644 index 0000000000000000000000000000000000000000..7ed6ef0cea318bf4214ba51898510788aa603fc1 --- /dev/null +++ b/docker/to_loopyy.sh @@ -0,0 +1,38 @@ +#!/bin/sh + +cd /home/firedrake/firedrake/src/ +mv loo-py/ loopyy/ + +# under loopyy +cd loopyy/ +find . \( -type d -name .git -prune \) -o -type f -print0 | xargs -0 sed -i 's/loopy/loopyy/g' +find . \( -type d -name .git -prune \) -o -type f -print0 | xargs -0 sed -i 's/loo.py/loo.pyy/g' +mv loopy loopyy +mv bin/loopy bin/loopyy +cd .. + +# under meshmode +cd meshmode/ +find . \( -type d -name .git -prune \) -o -type f -print0 | xargs -0 sed -i 's/loopy/loopyy/g' +find . \( -type d -name .git -prune \) -o -type f -print0 | xargs -0 sed -i 's/loo.py/loo.pyy/g' +cd .. + +# under pytential +cd pytential/ +find . \( -type d -name .git -prune \) -o -type f -print0 | xargs -0 sed -i 's/loopy/loopyy/g' +find . \( -type d -name .git -prune \) -o -type f -print0 | xargs -0 sed -i 's/loo.py/loo.pyy/g' +find . \( -type d -name .git -prune \) -o -type f -print0 | xargs -0 sed -i 's/from __future__.*//g' # to use py3.6 +cd .. + +# under volumential +cd volumential/ +find . \( -type d -name .git -prune \) -o -type f -print0 | xargs -0 sed -i 's/loopy/loopyy/g' +find . \( -type d -name .git -prune \) -o -type f -print0 | xargs -0 sed -i 's/loo.py/loo.pyy/g' +find . \( -type d -name .git -prune \) -o -type f -print0 | xargs -0 sed -i 's/from __future__.*//g' # to use py3.6 +cd .. + +# fix egg links and make sure both loopy and loopyy are installed +rm /home/firedrake/firedrake/lib/python3.6/site-packages/loo.py.egg-link +pip install -e ./loopyy +pip install -e ./loopy +pip install -e ./loopyy