From 83625df364584b2731643b971ef5742443fafda4 Mon Sep 17 00:00:00 2001 From: John Stairs Date: Fri, 1 Nov 2024 14:33:36 +0000 Subject: [PATCH] Update template --- .devcontainer/Dockerfile | 18 +++++++----------- .devcontainer/devcontainer.json | 14 ++++++-------- environment.yml | 3 ++- 3 files changed, 15 insertions(+), 20 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 4e0fbee..45c3cb3 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -30,17 +30,15 @@ ARG USER_UID=1000 ARG USER_GID=$USER_UID ARG CONDA_GID=900 ARG CONDA_ENVIRONMENT_NAME=prd -ARG VSCODE_DEV_CONTAINERS_SCRIPT_LIBRARY_VERSION=v0.229.0 RUN apt-get update && apt-get install -y \ libc6-dbg \ && rm -rf /var/lib/apt/lists/* # Enable non-root Docker access in container -ARG ENABLE_NONROOT_DOCKER="true" -# Use the OSS Moby CLI instead of the licensed Docker CLI -ARG USE_MOBY="false" -RUN script=$(curl -fsSL "https://raw.githubusercontent.com/microsoft/vscode-dev-containers/${VSCODE_DEV_CONTAINERS_SCRIPT_LIBRARY_VERSION}/script-library/docker-debian.sh") && bash -c "$script" -- "${ENABLE_NONROOT_DOCKER}" "/var/run/docker-host.sock" "/var/run/docker.sock" "${USERNAME}" "${USE_MOBY}" +ARG DOCKER_VERSION="27.0.3" +RUN script=$(curl -fsSL "https://raw.githubusercontent.com/devcontainers/features/2951f0481a488ea43a6f2ea6f18a47f0a0bf744d/src/docker-outside-of-docker/install.sh") \ + && VERSION=${DOCKER_VERSION} DOCKERDASHCOMPOSEVERSION="none" bash -c "$script" # Setting the ENTRYPOINT to docker-init.sh will configure non-root access to # the Docker socket if "overrideCommand": false is set in devcontainer.json. @@ -48,10 +46,8 @@ RUN script=$(curl -fsSL "https://raw.githubusercontent.com/microsoft/vscode-dev- ENTRYPOINT [ "/usr/local/share/docker-init.sh" ] CMD [ "sleep", "infinity" ] -ARG MAMBAFORGE_VERSION=22.9.0-2 - # Based on https://github.com/conda-forge/miniforge-images/blob/master/ubuntu/Dockerfile -RUN wget --no-hsts --quiet https://github.com/conda-forge/miniforge/releases/download/${MAMBAFORGE_VERSION}/Mambaforge-${MAMBAFORGE_VERSION}-Linux-$(uname -m).sh -O /tmp/miniforge.sh \ +RUN wget --no-hsts --quiet https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh -O /tmp/miniforge.sh \ && /bin/bash /tmp/miniforge.sh -b -p /opt/conda \ && rm /tmp/miniforge.sh \ && /opt/conda/bin/conda clean --tarballs --index-cache --packages --yes \ @@ -67,8 +63,8 @@ RUN wget --no-hsts --quiet https://github.com/conda-forge/miniforge/releases/dow # Create a conda environment from the environment file in the repo root. COPY --from=file-normalizer --chown=$USER_UID:conda /data/environment.yml /tmp/build/ RUN umask 0002 \ - && /opt/conda/bin/mamba env create -f /tmp/build/environment.yml \ - && /opt/conda/bin/mamba clean -fy \ + && /opt/conda/bin/conda env create -f /tmp/build/environment.yml \ + && /opt/conda/bin/conda clean -fy \ && sudo chown -R :conda /opt/conda/envs # Add a file that is to be sourced from .bashrc and from the devops pipeline stages @@ -91,7 +87,7 @@ RUN mkdir -p /home/vscode/.local/share/CMakeTools \ && chown vscode:conda /home/vscode/.local/share/CMakeTools/cmake-tools-kits.json # Install the yardl tool -ARG YARDL_VERSION=0.3.2 +ARG YARDL_VERSION=0.6.2 RUN wget --quiet "https://github.com/microsoft/yardl/releases/download/v${YARDL_VERSION}/yardl_${YARDL_VERSION}_linux_x86_64.tar.gz" \ && tar -xzf "yardl_${YARDL_VERSION}_linux_x86_64.tar.gz" \ && mv yardl "/opt/conda/envs/${CONDA_ENVIRONMENT_NAME}/bin/" \ diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 6a0e73f..71c7118 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,5 +1,4 @@ -// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: -// https://github.com/microsoft/vscode-dev-containerdevcotns/tree/v0.238.0/containers/go +// For format details, see https://aka.ms/devcontainer.json. { "name": "prd", "build": { @@ -115,12 +114,11 @@ } }, - // Use 'forwardPorts' to make a list of ports inside the container available locally. - // "forwardPorts": [], - - // Use 'postCreateCommand' to run commands after the container is created. - // "postCreateCommand": "go version", + "overrideCommand": false, + "mounts": [ + // Bind mount docker socket under an alias to support docker-from-docker + "source=/var/run/docker.sock,target=/var/run/docker-host.sock,type=bind" + ], - // Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. "remoteUser": "vscode" } diff --git a/environment.yml b/environment.yml index a61c4e7..499b4df 100644 --- a/environment.yml +++ b/environment.yml @@ -10,11 +10,12 @@ dependencies: - h5py>=3.7.0 - hdf5>=1.12.1 - howardhinnant_date>=3.0.1 - - ipykernel>=6.19.2 + - ipykernel>=6.19.2 - ninja>=1.11.0 - nlohmann_json>=3.11.2 - numpy>=1.24.3 - python>=3.11.3 + - matplotlib - shellcheck>=0.8.0 - xtensor-fftw>=0.2.5 - xtensor>=0.24.2