diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index cf4b37aca9..8702d314cb 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -92,3 +92,10 @@ RUN umask 0002 \ && mkdir -p /opt/conda/pkgs/cache/ && chown -R vscode:conda /opt/conda/pkgs/cache/ RUN mkdir -p /home/vscode/.conda/envs \ && ln -s /opt/conda/envs/mlos /home/vscode/.conda/envs/mlos + +# Try and prime the devcontainer's ssh known_hosts keys with the github one for scripted calls. +RUN mkdir -p /home/vscode/.ssh \ + && ( \ + grep -q ^github.com /home/vscode/.ssh/known_hosts \ + || ssh-keyscan github.com | tee -a /home/vscode/.ssh/known_hosts \ + ) diff --git a/.github/workflows/devcontainer.yml b/.github/workflows/devcontainer.yml index c07a902fc6..b57257a907 100644 --- a/.github/workflows/devcontainer.yml +++ b/.github/workflows/devcontainer.yml @@ -128,6 +128,10 @@ jobs: run: | docker exec --user vscode --env USER=vscode mlos-devcontainer printenv + - name: Check that github.com is in the ssh known_hosts file + run: | + docker exec --user vscode --env USER=vscode mlos-devcontainer grep ^github.com /home/vscode/.ssh/known_hosts + - name: Update the conda env in the devcontainer timeout-minutes: 10 run: |