From 17492e10bbd2af19d8eef147440343c0c135a821 Mon Sep 17 00:00:00 2001 From: Tamir Kamara <26870601+tamirkamara@users.noreply.github.com> Date: Sun, 23 Oct 2022 13:35:09 +0300 Subject: [PATCH] Pin porter components versions (#2762) --- .devcontainer/Dockerfile | 16 ++++++++++------ .devcontainer/devcontainer.json | 4 +--- .devcontainer/scripts/porter.sh | 12 ++++++------ CHANGELOG.md | 1 + e2e_tests/test_airlock.py | 5 ++++- resource_processor/_version.py | 2 +- resource_processor/scripts/porter.sh | 12 ++++++------ resource_processor/vmss_porter/Dockerfile | 16 ++++++++++------ 8 files changed, 39 insertions(+), 29 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index b6fa620701..8eab5df6aa 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -52,15 +52,19 @@ RUN if [ "${INTERACTIVE}" = "true" ]; then \ # Not using the script from https://cdn.porter.sh/latest/install-linux.sh # as it installs things we don't need and duplicates the binary. ARG PORTER_MIRROR=https://cdn.porter.sh -ARG PORTER_PERMALINK=v0.38.13 -ARG PORTER_PKG_PERMALINK=latest -ARG PORTER_TERRAFORM_MIXIN_PKG_PERMALINK="v1.0.0-rc.1" +ARG PORTER_VERSION=v0.38.13 +ARG PORTER_TERRAFORM_MIXIN_VERSION=v1.0.0-rc.1 +ARG PORTER_AZ_MIXIN_VERSION=v0.7.3 +ARG PORTER_DOCKER_MIXIN_VERSION=v0.3.0 +ARG PORTER_AZURE_PLUGIN_VERSION=v0.11.2 ARG PORTER_HOME=/home/$USERNAME/.porter/ COPY .devcontainer/scripts/porter.sh /tmp/ RUN export PORTER_MIRROR=${PORTER_MIRROR} \ - PORTER_PERMALINK=${PORTER_PERMALINK} \ - PORTER_PKG_PERMALINK=${PORTER_PKG_PERMALINK} \ - PORTER_TERRAFORM_MIXIN_PKG_PERMALINK=${PORTER_TERRAFORM_MIXIN_PKG_PERMALINK} \ + PORTER_VERSION=${PORTER_VERSION} \ + PORTER_TERRAFORM_MIXIN_VERSION=${PORTER_TERRAFORM_MIXIN_VERSION} \ + PORTER_AZ_MIXIN_VERSION=${PORTER_AZ_MIXIN_VERSION} \ + PORTER_DOCKER_MIXIN_VERSION=${PORTER_DOCKER_MIXIN_VERSION} \ + PORTER_AZURE_PLUGIN_VERSION=${PORTER_AZURE_PLUGIN_VERSION} \ PORTER_HOME=${PORTER_HOME} \ && /tmp/porter.sh diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 31709315dd..573a093045 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -255,14 +255,12 @@ "ms-python.python", "hashicorp.terraform", "github.vscode-pull-request-github", - "ms-kubernetes-tools.porter-vscode", + "getporter.porter-vscode", "davidanson.vscode-markdownlint", "editorconfig.editorconfig", - "github.vscode-pull-request-github", "mikestead.dotenv", "humao.rest-client", "timonwong.shellcheck", - "ms-azuretools.vscode-bicep", "ms-azuretools.vscode-azurefunctions" ], "forwardPorts": [ diff --git a/.devcontainer/scripts/porter.sh b/.devcontainer/scripts/porter.sh index a049fa6e28..a3ef83e46d 100755 --- a/.devcontainer/scripts/porter.sh +++ b/.devcontainer/scripts/porter.sh @@ -6,14 +6,14 @@ set -o nounset # set -o xtrace mkdir -p "${PORTER_HOME}/runtimes" -curl -fsSLo "${PORTER_HOME}/porter" "${PORTER_MIRROR}/${PORTER_PERMALINK}/porter-linux-amd64" +curl -fsSLo "${PORTER_HOME}/porter" "${PORTER_MIRROR}/${PORTER_VERSION}/porter-linux-amd64" chmod +x "${PORTER_HOME}/porter" ln -s "${PORTER_HOME}/porter" "${PORTER_HOME}/runtimes/porter-runtime" -"${PORTER_HOME}/porter" mixin install exec --version "${PORTER_PKG_PERMALINK}" -"${PORTER_HOME}/porter" mixin install terraform --version "${PORTER_TERRAFORM_MIXIN_PKG_PERMALINK}" -"${PORTER_HOME}/porter" mixin install az --version "${PORTER_PKG_PERMALINK}" -"${PORTER_HOME}/porter" plugin install azure --version "${PORTER_PKG_PERMALINK}" -"${PORTER_HOME}/porter" mixin install docker --version "${PORTER_PKG_PERMALINK}" +"${PORTER_HOME}/porter" mixin install exec --version "${PORTER_VERSION}" +"${PORTER_HOME}/porter" mixin install terraform --version "${PORTER_TERRAFORM_MIXIN_VERSION}" +"${PORTER_HOME}/porter" mixin install az --version "${PORTER_AZ_MIXIN_VERSION}" +"${PORTER_HOME}/porter" mixin install docker --version "${PORTER_DOCKER_MIXIN_VERSION}" +"${PORTER_HOME}/porter" plugin install azure --version "${PORTER_AZURE_PLUGIN_VERSION}" chown -R "${USERNAME}" "${PORTER_HOME}" diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b4f53628f..255f03b4b2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ ENHANCEMENTS: * `tre` CLI: added `raw` output option, improved `airlock-requests` handling, more consistent exit codes on error, added examples to CLI README.md BUG FIXES: +* Pin Porter's plugin/mixin versions used ([#2762](https://github.com/microsoft/AzureTRE/pull/2762)) * Fix issues with AML workspace service deployment ([#2768](https://github.com/microsoft/AzureTRE/pull/2768)) COMPONENTS: diff --git a/e2e_tests/test_airlock.py b/e2e_tests/test_airlock.py index d1b4eefd9e..5e2a2eb09f 100644 --- a/e2e_tests/test_airlock.py +++ b/e2e_tests/test_airlock.py @@ -157,4 +157,7 @@ async def test_airlock_flow(verify) -> None: # 11. delete workspace (cleanup) LOGGER.info("Deleting workspace") admin_token = await get_admin_token(verify) - await disable_and_delete_resource(f'/api{workspace_path}', admin_token, verify) + # we don't really care if the workspace is deleted successfully, so not waiting for it. + disable_and_delete_resource(f'/api{workspace_path}', admin_token, verify) + # but still need to wait a bit for the delete request to be issued to the API. + await asyncio.sleep(30) diff --git a/resource_processor/_version.py b/resource_processor/_version.py index 805e7c470e..58ce5cd174 100644 --- a/resource_processor/_version.py +++ b/resource_processor/_version.py @@ -1 +1 @@ -__version__ = "0.4.10" +__version__ = "0.4.11" diff --git a/resource_processor/scripts/porter.sh b/resource_processor/scripts/porter.sh index 4fc61dab15..10d5701cbd 100755 --- a/resource_processor/scripts/porter.sh +++ b/resource_processor/scripts/porter.sh @@ -6,12 +6,12 @@ set -o nounset # set -o xtrace mkdir -p "${PORTER_HOME}/runtimes" -curl -fsSLo "${PORTER_HOME}/porter" "${PORTER_MIRROR}/${PORTER_PERMALINK}/porter-linux-amd64" +curl -fsSLo "${PORTER_HOME}/porter" "${PORTER_MIRROR}/${PORTER_VERSION}/porter-linux-amd64" chmod +x "${PORTER_HOME}/porter" ln -s "${PORTER_HOME}/porter" "${PORTER_HOME}/runtimes/porter-runtime" -"${PORTER_HOME}/porter" mixin install exec --version "${PORTER_PKG_PERMALINK}" -"${PORTER_HOME}/porter" mixin install terraform --version "${PORTER_TERRAFORM_MIXIN_PKG_PERMALINK}" -"${PORTER_HOME}/porter" mixin install az --version "${PORTER_PKG_PERMALINK}" -"${PORTER_HOME}/porter" plugin install azure --version "${PORTER_PKG_PERMALINK}" -"${PORTER_HOME}/porter" mixin install docker --version "${PORTER_PKG_PERMALINK}" +"${PORTER_HOME}/porter" mixin install exec --version "${PORTER_VERSION}" +"${PORTER_HOME}/porter" mixin install terraform --version "${PORTER_TERRAFORM_MIXIN_VERSION}" +"${PORTER_HOME}/porter" mixin install az --version "${PORTER_AZ_MIXIN_VERSION}" +"${PORTER_HOME}/porter" mixin install docker --version "${PORTER_DOCKER_MIXIN_VERSION}" +"${PORTER_HOME}/porter" plugin install azure --version "${PORTER_AZURE_PLUGIN_VERSION}" diff --git a/resource_processor/vmss_porter/Dockerfile b/resource_processor/vmss_porter/Dockerfile index e0475ae523..e3837b373e 100644 --- a/resource_processor/vmss_porter/Dockerfile +++ b/resource_processor/vmss_porter/Dockerfile @@ -10,15 +10,19 @@ RUN export AZURE_CLI_VERSION=${AZURE_CLI_VERSION} \ # Install Porter ARG PORTER_MIRROR=https://cdn.porter.sh -ARG PORTER_PERMALINK=v0.38.13 -ARG PORTER_PKG_PERMALINK=latest -ARG PORTER_TERRAFORM_MIXIN_PKG_PERMALINK="v1.0.0-rc.1" +ARG PORTER_VERSION=v0.38.13 +ARG PORTER_TERRAFORM_MIXIN_VERSION=v1.0.0-rc.1 +ARG PORTER_AZ_MIXIN_VERSION=v0.7.3 +ARG PORTER_DOCKER_MIXIN_VERSION=v0.3.0 +ARG PORTER_AZURE_PLUGIN_VERSION=v0.11.2 ARG PORTER_HOME=/root/.porter/ COPY scripts/porter.sh /tmp/ RUN export PORTER_MIRROR=${PORTER_MIRROR} \ - PORTER_PERMALINK=${PORTER_PERMALINK} \ - PORTER_PKG_PERMALINK=${PORTER_PKG_PERMALINK} \ - PORTER_TERRAFORM_MIXIN_PKG_PERMALINK=${PORTER_TERRAFORM_MIXIN_PKG_PERMALINK} \ + PORTER_VERSION=${PORTER_VERSION} \ + PORTER_TERRAFORM_MIXIN_VERSION=${PORTER_TERRAFORM_MIXIN_VERSION} \ + PORTER_AZ_MIXIN_VERSION=${PORTER_AZ_MIXIN_VERSION} \ + PORTER_DOCKER_MIXIN_VERSION=${PORTER_DOCKER_MIXIN_VERSION} \ + PORTER_AZURE_PLUGIN_VERSION=${PORTER_AZURE_PLUGIN_VERSION} \ PORTER_HOME=${PORTER_HOME} \ && /tmp/porter.sh