From 9b353e7ad9695ba7360fc2fc88ada88c4a9231b9 Mon Sep 17 00:00:00 2001 From: Alexander Penev Date: Sun, 29 Oct 2023 21:13:34 +0000 Subject: [PATCH] Move docker container to port 9999 and some other minor fixes --- Dockerfile | 13 ++++++++----- run-docker.sh | 2 +- share/jupyter/kernels/xcpp/kernel.json.in | 1 + src/xmagics/pythonexec.cpp | 1 - 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index fddb6ffe..1020b0cb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,6 +6,7 @@ ARG BASE_CONTAINER=jupyter/base-notebook ARG BASE_TAG=latest ARG BUILD_TYPE=Debug + FROM $BASE_CONTAINER:$BASE_TAG LABEL maintainer="Xeus-cpp Project" @@ -61,7 +62,8 @@ USER ${NB_UID} # Copy git repository to home directory of container COPY --chown=${NB_UID}:${NB_GID} . "${HOME}"/ -EXPOSE 8888 +EXPOSE 9999 +ENV JUPYTER_PORT=9999 # Configure container startup CMD ["start-notebook.sh", "--debug", "&>/home/jovyan/log.txt"] @@ -108,8 +110,9 @@ ENV NB_PYTHON_PREFIX=${CONDA_DIR} \ /opt/conda/envs/.venv/x86_64-conda-linux-gnu/include/c++/12.3.0:\ /opt/conda/envs/.venv/x86_64-conda-linux-gnu/include/c++/12.3.0/x86_64-conda-linux-gnu:\ /opt/conda/envs/.venv/x86_64-conda-linux-gnu/include/c++/12.3.0/backward:\ -/opt/conda/envs/.venv/x86_64-conda-linux-gnu/sysroot/usr/include - +/opt/conda/envs/.venv/x86_64-conda-linux-gnu/sysroot/usr/include:\ +# +/usr/include # VENV @@ -185,8 +188,8 @@ RUN \ conda activate .venv && \ # export PATH_TO_LLVM_BUILD=${VENV} && \ - #export PATH=${VENV}/bin:${CONDA_DIR}/bin:$PATH_TO_LLVM_BUILD/bin:$PATH && \ - export PATH=${VENV}/bin:${CONDA_DIR}/bin:$PATH && \ + ###export PATH=${VENV}/bin:${CONDA_DIR}/bin:$PATH_TO_LLVM_BUILD/bin:$PATH && \ + ##export PATH=${VENV}/bin:${CONDA_DIR}/bin:$PATH && \ echo "export EDITOR=emacs" >> ~/.profile && \ # # Build CppInterOp diff --git a/run-docker.sh b/run-docker.sh index e64d7116..2d7f7506 100755 --- a/run-docker.sh +++ b/run-docker.sh @@ -8,7 +8,7 @@ jupyter-repo2docker \ . #docker run --gpus all --publish 8888:8888 --name xeus-cpp-c -i -t xeus-cpp "start-notebook.sh" -docker run --rm --runtime=nvidia --gpus all --publish 8888:8888 --name xeus-cpp-c -i -t xeus-cpp "start-notebook.sh" +docker run --rm --runtime=nvidia --gpus all --publish 9999:9999 --name xeus-cpp-c -i -t xeus-cpp "start-notebook.sh" # --editable \ # --ref InterOpIntegration \ diff --git a/share/jupyter/kernels/xcpp/kernel.json.in b/share/jupyter/kernels/xcpp/kernel.json.in index 556bd429..70c99e20 100644 --- a/share/jupyter/kernels/xcpp/kernel.json.in +++ b/share/jupyter/kernels/xcpp/kernel.json.in @@ -10,6 +10,7 @@ "@CMAKE_VENV_PATH@/bin/xcpp", "-f", "{connection_file}", + "-cuda", "-std=c++17"@CMAKE_OMP@ ], "language": "cpp", diff --git a/src/xmagics/pythonexec.cpp b/src/xmagics/pythonexec.cpp index ccd308c0..152b36cb 100644 --- a/src/xmagics/pythonexec.cpp +++ b/src/xmagics/pythonexec.cpp @@ -53,7 +53,6 @@ void pythonexec::startup() { // if (!gMainDict) // printf("Could not add module __main__"); - // // Retrieve the dictionary of cppyy module // PyObject* cppyyDict = PyModule_GetDict(cppyyModule); // Py_DECREF(cppyyModule);