| 1 | |
| 2 | == Rancher Desktop |
| 3 | Download Rancher Desktop from https://rancherdesktop.io and open it on your local desktop. |
| 4 | |
| 5 | == Dockerhub Account |
| 6 | Create a Dockerhub account on https://hub.docker.com. You will also want to create a repository to push the custom images you build. Call it 'deepxde' |
| 7 | |
| 8 | Remember to log in to your dockerhub account from your desktop. Enter `docker login` in your command line, and enter your password. You will only have to do this once. |
| 9 | |
| 10 | == Building Custom Image |
| 11 | Specifically for the DeepXDE package, you will need to create a folder on your local desktop, `deepxde`. Within this folder, create a dockerfile with `vim Dockerfile` and enter the following: |
| 12 | {{{ |
| 13 | FROM public.ecr.aws/j1r0q0g6/notebooks/notebook-servers/jupyter-tensorflow-cuda-full:v1.3.0-rc.1 |
| 14 | |
| 15 | USER root |
| 16 | |
| 17 | RUN rm /etc/apt/sources.list.d/cuda.list |
| 18 | RUN rm /etc/apt/sources.list.d/nvidia-ml.list |
| 19 | |
| 20 | RUN apt-get update && apt-get install -y --no-install-recommends imagemagick libopenmpi-dev \ |
| 21 | && apt-get clean \ |
| 22 | && rm -rf /var/lib/apt/lists/* |
| 23 | |
| 24 | USER $NB_UID |
| 25 | |
| 26 | # install - requirements.txt |
| 27 | COPY --chown=jovyan:users requirements.txt /tmp/requirements.txt |
| 28 | RUN python3 -m pip install -r /tmp/requirements.txt --quiet --no-cache-dir -f \ |
| 29 | https://www.paddlepaddle.org.cn/whl/linux/mkl/avx/stable.html \ |
| 30 | && rm -f /tmp/requirements.txt |
| 31 | }}} |
| 32 | |
| 33 | Within the same `deepxde` folder on your local desktop, create a new file called `requirements.txt` by entering the following in command line: `vim requirements.txt`. Here are some packages you may want to include: |
| 34 | {{{ |
| 35 | ipython |
| 36 | numpy |
| 37 | scipy |
| 38 | tensorflow |
| 39 | scikit-learn |
| 40 | matplotlib |
| 41 | scikit-optimize |
| 42 | seaborn |
| 43 | tensorflow-probability |
| 44 | torch |
| 45 | torchvision |
| 46 | torchaudio |
| 47 | jax |
| 48 | flax |
| 49 | optax |
| 50 | paddlepaddle-gpu==2.4.2.post112 |
| 51 | jupyter |
| 52 | jupyterlab |
| 53 | notebook |
| 54 | pandas |
| 55 | mpi4py |
| 56 | deepxde |
| 57 | }}} |
| 58 | You can add or remove the packages you need as required. |
| 59 | |
| 60 | Now, to build the custom image (for Mac), enter the following in your command line: `docker buildx build --platform linux/amd64 -t <username>/deepxde:<tagname> .` |
| 61 | You will need to use your dockerhub username and you can choose any tagname you want. For instance, your tagname could be `v1` for version 1 of the image you are building. |
| 62 | |
| 63 | == Pushing to Dockerhub |
| 64 | After building the image, push to Dockerhub: `docker push <username>/deepxde:<tagname>` |
| 65 | |
| 66 | == Kubeflow |
| 67 | Go to the Notebooks tab and create a new server. Select `custom image` and enter `<username>/deepxde:<tagname>`. Choose the number of CPUs and GPUs (NVIDIA), also use your existing volume. Once this is done, you will want to launch the server! |
| 68 | |