From 211b36a082ffd4a7a139aa991f572c6ea440d75b Mon Sep 17 00:00:00 2001 From: Matt Craddock <5796417+craddm@users.noreply.github.com> Date: Mon, 22 Apr 2024 15:48:50 +0000 Subject: [PATCH 1/3] update dockerfile and devcontainer configuration --- .devcontainer/Dockerfile | 53 ++++++++++++++++++++++----------- .devcontainer/devcontainer.json | 7 ++--- 2 files changed, 39 insertions(+), 21 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index a28ef01333..b2ac959fe6 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,26 +1,42 @@ -ARG VARIANT=3.10 -FROM python:${VARIANT}-buster - -# Set package versions -ARG AZURE_CLI_VERSION="2.42.0" -ARG PULUMI_VERSION="3.80.0" +ARG VARIANT=3.12 +ARG DISTRIBUTION="bookworm" +FROM python:${VARIANT}-${DISTRIBUTION} RUN apt-get update \ && export DEBIAN_FRONTEND=noninteractive \ && apt-get -y install --no-install-recommends \ - git \ - libssl-dev \ - python3-sphinx - -# Set up TARGETARCH variable to use to pull the right binaries -# for the current architecture. -ARG TARGETARCH + git \ + libssl-dev \ + python3-sphinx # Install Azure-CLI -# Standard install method currently does not support ARM64 -# Use pip instead - https://github.com/Azure/azure-cli/issues/22875 -RUN pip3 install azure-cli==${AZURE_CLI_VERSION} -RUN pip3 install hatch +RUN apt-get update \ + && apt-get -y install --no-install-recommends \ + apt-transport-https \ + ca-certificates \ + curl \ + gnupg \ + lsb-release +RUN mkdir -p /etc/apt/keyrings \ + && curl -sLS https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor -o /etc/apt/keyrings/microsoft.gpg \ + && chmod go+r /etc/apt/keyrings/microsoft.gpg + +# Set package versions +ARG AZURE_CLI_VERSION="2.59.0" +ARG DISTRIBUTION + +# Add the Azure CLI repository +RUN cat < /etc/apt/sources.list.d/azure-cli.sources +Types: deb +URIs: https://packages.microsoft.com/repos/azure-cli/ +Suites: $(lsb_release -cs) +Components: main +Architectures: $(dpkg --print-architecture) +Signed-by: /etc/apt/keyrings/microsoft.gpg +EOF + +RUN apt-get update \ + && apt-get -y install azure-cli=${AZURE_CLI_VERSION}-1~${DISTRIBUTION} # Create non-root user and give them sudo access ARG USERNAME=deploydsh @@ -42,3 +58,6 @@ RUN pip3 install -r /build/requirements.txt # Set PATH for pulumi - pulumi installed as feature to work round installing as root ENV PATH=$PATH:/home/${USERNAME}/.pulumi/bin + +# Install hatch to build the dsh cli tool +RUN pip3 install hatch \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index c3e34d44b2..c57e96b8d0 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -2,7 +2,7 @@ { "name": "Turing Data Safe Haven - Pulumi", "build": { - "context": "../..", + "context": "..", "dockerfile": "Dockerfile" }, "settings": { @@ -10,7 +10,6 @@ }, "extensions": [ "github.vscode-pull-request-github", - "ms-vscode.powershell", "ms-vscode.azure-account", "ms-python.python", "christian-kohler.path-intellisense" @@ -18,8 +17,8 @@ "remoteUser": "deploydsh", "features": { "ghcr.io/devcontainers-contrib/features/pulumi:1": { - "version": "3.80.0", - "bashCompletion": false + "version": "latest", + "bashCompletion": true } } } From c396a62b96b979c1f4e2dccb7f3eb7d95e7e1b69 Mon Sep 17 00:00:00 2001 From: Matt Craddock Date: Wed, 24 Apr 2024 10:07:00 +0100 Subject: [PATCH 2/3] Update .devcontainer/devcontainer.json Co-authored-by: James Robinson --- .devcontainer/devcontainer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index c57e96b8d0..f8e49feed9 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,6 +1,6 @@ // Development container for the Data Safe Haven project pulumi { - "name": "Turing Data Safe Haven - Pulumi", + "name": "Turing Data Safe Haven", "build": { "context": "..", "dockerfile": "Dockerfile" From 2d5774b1c13946828933c0ec764449c1004e703f Mon Sep 17 00:00:00 2001 From: James Robinson Date: Thu, 25 Apr 2024 15:55:08 +0100 Subject: [PATCH 3/3] :bug: Run documentation build from root directory --- .github/workflows/build_documentation.yaml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/build_documentation.yaml b/.github/workflows/build_documentation.yaml index 1914edf57f..caa67fa5b0 100644 --- a/.github/workflows/build_documentation.yaml +++ b/.github/workflows/build_documentation.yaml @@ -12,9 +12,6 @@ jobs: build: name: Build runs-on: ubuntu-latest - defaults: - run: - working-directory: ./docs/ steps: - name: Checkout code uses: actions/checkout@v4 @@ -34,9 +31,6 @@ jobs: name: Check links runs-on: ubuntu-latest needs: build - defaults: - run: - working-directory: ./docs/ steps: - name: Checkout code uses: actions/checkout@v4