From 4d4901e7ad7e93641102b6e64a29000458452257 Mon Sep 17 00:00:00 2001 From: nerdvegas Date: Tue, 21 Dec 2021 15:21:34 +1100 Subject: [PATCH 01/34] experimental changes to windows workflows --- .github/workflows/windows-docker-image.yaml | 62 +++++++++++++-------- .github/workflows/windows.yaml | 17 ++---- 2 files changed, 44 insertions(+), 35 deletions(-) diff --git a/.github/workflows/windows-docker-image.yaml b/.github/workflows/windows-docker-image.yaml index 0a94887ae..a74f24861 100644 --- a/.github/workflows/windows-docker-image.yaml +++ b/.github/workflows/windows-docker-image.yaml @@ -20,7 +20,24 @@ name: windows-docker-image on: push: - # Will only trigger building a docker image if any of these changed + # We only generate new images on master, because the 'windows' workflow uses + # latest image, and we don't want it to use latest from a different branch. + # We could get around this by qualifying the image name with user and branch, + # however that would create a new image on each new branch, and windows image + # builds are _very slow_ on github runners. + # + # It would be ideal to avoid use of latest tag in 'windows' workflow, however + # that doesn't work. If we use the commit hash tag (see ${last_docker_py_rev} + # below), this causes the windows workflow to fail if the image also needs to + # be updated, since _this_ workflow hasn't had a chance to build it yet. We + # can't use workflow dependencies either (see 'workflow_run' github actions + # event) because that causes a workflow to run _only when_ another workflow + # has completed - however we only want to rebuild the image when required, + # not every time. Github needs to add a way to "run workflow B _after_ workflow + # A, _if_ A was triggered, otherwise run B regardless." + # + branches: + - issue_1181-win-docker # TEMP paths: - '.github/docker/rez-win-base/**' - '.github/docker/rez-win-py/**' @@ -47,22 +64,20 @@ jobs: - name: Checkout uses: actions/checkout@v2 - - name: Build docker image if needed + - name: Build base docker image if needed run: | - ${Env:LAST_DOCKER_BASE_REVISION} = $( git log -n 1 --author-date-order --pretty=format:%H -- .\.github\docker\rez-win-base\ .\.github\workflows\windows-docker-image.yaml ).SubString(0, 8) + ${last_docker_base_rev} = $( git log -n 1 --author-date-order --pretty=format:%H -- .\.github\docker\rez-win-base\ .\.github\workflows\windows-docker-image.yaml ).SubString(0, 8) ${gh_user} = ("${{ github.repository }}" -Split '/')[0] + $ErrorActionPreference = "Continue" - docker manifest inspect ${gh_user}/rez-win-base:${ENV:LAST_DOCKER_BASE_REVISION} | Out-Null + docker pull ${gh_user}/rez-win-base:${last_docker_base_rev} | Out-Null $ErrorActionPreference = "Stop" + if ($LastExitCode -ne 0) { cd .github\docker\rez-win-base - docker build --tag ${gh_user}/rez-win-base:${ENV:LAST_DOCKER_BASE_REVISION} . - docker push ${gh_user}/rez-win-base:${ENV:LAST_DOCKER_BASE_REVISION} + docker build --tag ${gh_user}/rez-win-base:${last_docker_base_rev} . + docker push ${gh_user}/rez-win-base:${last_docker_base_rev} } - env: - # By using dockers experimental CLI features we don't need to pull an - # image to check if it exists. - DOCKER_CLI_EXPERIMENTAL: enabled # ---------------------------------------------------------------------------- # Create python images off base image @@ -91,25 +106,26 @@ jobs: - name: Pull base docker image run: | - ${Env:LAST_DOCKER_BASE_REVISION} = $( git log -n 1 --author-date-order --pretty=format:%H -- .\.github\docker\rez-win-base\ .\.github\workflows\windows-docker-image.yaml ).SubString(0, 8) + ${last_docker_base_rev} = $( git log -n 1 --author-date-order --pretty=format:%H -- .\.github\docker\rez-win-base\ .\.github\workflows\windows-docker-image.yaml ).SubString(0, 8) ${gh_user} = ("${{ github.repository }}" -Split '/')[0] - docker pull ${gh_user}/rez-win-base:${ENV:LAST_DOCKER_BASE_REVISION} - docker tag ${gh_user}/rez-win-base:${ENV:LAST_DOCKER_BASE_REVISION} rez-win-base:${ENV:LAST_DOCKER_BASE_REVISION} + docker pull ${gh_user}/rez-win-base:${last_docker_base_rev} + + # so rez-win-py/Dockerfile can reference base image + docker tag ${gh_user}/rez-win-base:${last_docker_base_rev} rez-win-base:${last_docker_base_rev} - - name: Build Docker image if needed + - name: Build py Docker image if needed run: | - ${Env:LAST_DOCKER_BASE_REVISION} = $( git log -n 1 --author-date-order --pretty=format:%H -- .\.github\docker\rez-win-base\ .\.github\workflows\windows-docker-image.yaml ).SubString(0, 8) - ${Env:LAST_DOCKER_PY_REVISION} = $( git log -n 1 --author-date-order --pretty=format:%H -- .\.github\docker\rez-win-py\ .\.github\docker\rez-win-base\ .\.github\workflows\windows-docker-image.yaml ).SubString(0, 8) - ${Env:DOCKER_TAG} = "${{ matrix.python-version }}-${ENV:LAST_DOCKER_PY_REVISION}" + ${last_docker_base_rev} = $( git log -n 1 --author-date-order --pretty=format:%H -- .\.github\docker\rez-win-base\ .\.github\workflows\windows-docker-image.yaml ).SubString(0, 8) + ${last_docker_py_rev} = $( git log -n 1 --author-date-order --pretty=format:%H -- .\.github\docker\rez-win-py\ .\.github\docker\rez-win-base\ .\.github\workflows\windows-docker-image.yaml ).SubString(0, 8) ${gh_user} = ("${{ github.repository }}" -Split '/')[0] + ${docker_image} = "${gh_user}/rez-win-py-${{ matrix.python-version }}" + $ErrorActionPreference = "Continue" - docker manifest inspect ${gh_user}/rez-win-py:${ENV:DOCKER_TAG} | Out-Null + docker pull ${docker_image}:${last_docker_py_rev} | Out-Null $ErrorActionPreference = "Stop" + if ($LastExitCode -ne 0) { cd .github\docker\rez-win-py - docker build --tag ${gh_user}/rez-win-py:${ENV:DOCKER_TAG} --build-arg PYTHON_VERSION="${{ matrix.python-version }}" --build-arg BASE_TAG=${ENV:LAST_DOCKER_BASE_REVISION} . - docker push ${gh_user}/rez-win-py:${ENV:DOCKER_TAG} + docker build --tag ${docker_image} --tag ${docker_image}:${last_docker_py_rev} --build-arg PYTHON_VERSION="${{ matrix.python-version }}" --build-arg BASE_TAG=${last_docker_base_rev} . + docker push ${docker_image}:${last_docker_py_rev} } - $ErrorActionPreference = "Stop" - env: - DOCKER_CLI_EXPERIMENTAL: enabled diff --git a/.github/workflows/windows.yaml b/.github/workflows/windows.yaml index dfc86f6ab..00a7632e1 100644 --- a/.github/workflows/windows.yaml +++ b/.github/workflows/windows.yaml @@ -5,10 +5,6 @@ # Requires username/repository to match the github repository. # For example: nerdvegas/rez -> User/Repository: nerdvegas # -# Uses image tagged as **latest** commit revision of any file within: -# .github/docker/windows/** -# .github/workflows/windows-docker-image.yaml -# name: windows @@ -33,13 +29,8 @@ on: jobs: main: runs-on: windows-2019 - env: - # DockerHub base image name. May switch to GitHub Docker Packages - # in the future. See GitHub Issue #789 and PR #830 - BASE_IMAGE_NAME: "nerdvegas/rez-win-py:${{ matrix.python-version }}" strategy: - matrix: # Needs to match python version of images (see windows-docker-image.yaml) python-version: @@ -55,8 +46,10 @@ jobs: - name: Run Docker image (installs and tests rez) run: | - ${Env:LAST_DOCKER_REVISION} = $( git log -n 1 --author-date-order --pretty=format:%H -- .\.github\docker\rez-win-py\ .\.github\docker\rez-win-base\ .\.github\workflows\windows-docker-image.yaml ).SubString(0, 8) - ${docker_image} = "${{ Env.BASE_IMAGE_NAME }}-${Env:LAST_DOCKER_REVISION}" + ${docker_image} = "nerdvegas/rez-win-py-${{ matrix.python-version }}" + + Write-Output "Pulling latest DockerHub image ${docker_image}..." + docker pull ${docker_image} - Write-Output "Running DockerHub ${docker_image}..." + Write-Output "Running DockerHub image ${docker_image}..." docker run --mount type=bind,src=$pwd,dst=C:\checkout,readonly ${docker_image} From 5740959aa599d84e7f41e5f42890d070708e4867 Mon Sep 17 00:00:00 2001 From: nerdvegas Date: Wed, 22 Dec 2021 09:24:34 +1100 Subject: [PATCH 02/34] -use correct choco bin -generate json artifact on docker img build --- .github/docker/rez-win-base/Dockerfile | 2 +- .github/workflows/windows-docker-image.yaml | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/docker/rez-win-base/Dockerfile b/.github/docker/rez-win-base/Dockerfile index 9dbe021f1..4be4b04f5 100644 --- a/.github/docker/rez-win-base/Dockerfile +++ b/.github/docker/rez-win-base/Dockerfile @@ -29,7 +29,7 @@ RUN iex ((new-object net.webclient).DownloadString('https://chocolatey.org/insta choco install cmake --yes --version=${ENV:CMAKE_VERSION} --installargs 'ADD_CMAKE_TO_PATH=System'; ` choco install pwsh --yes --version=${PWSH_VERSION}; ` choco install --yes choco-cleaner; ` - C:\ProgramData\chocolatey\bin\choco-cleaner.ps1; ` + C:\ProgramData\chocolatey\bin\choco-cleaner.bat; ` choco uninstall --yes choco-cleaner ENTRYPOINT ["powershell.exe", "-NoLogo", "-ExecutionPolicy", "ByPass"] diff --git a/.github/workflows/windows-docker-image.yaml b/.github/workflows/windows-docker-image.yaml index a74f24861..9e611a17c 100644 --- a/.github/workflows/windows-docker-image.yaml +++ b/.github/workflows/windows-docker-image.yaml @@ -77,8 +77,22 @@ jobs: cd .github\docker\rez-win-base docker build --tag ${gh_user}/rez-win-base:${last_docker_base_rev} . docker push ${gh_user}/rez-win-base:${last_docker_base_rev} + + # store inspection as artifact for ease of debugging + docker inspect ${gh_user}/rez-win-base:${last_docker_base_rev} > inspect.json } + - id: inspect_json + uses: andstor/file-existence-action@v1 + with: + files: .github\docker\rez-win-base\inspect.json + + - uses: actions/upload-artifact@v2 + with: + name: "rez-win-base.json" + path: .github\docker\rez-win-base\inspect.json + if: steps.inspect_json.outputs.files_exists == 'true' + # ---------------------------------------------------------------------------- # Create python images off base image # Each image will have a single python version installed as defined in the From c859c92019f4f02349af8dd0112b1d2452bbff79 Mon Sep 17 00:00:00 2001 From: nerdvegas Date: Wed, 22 Dec 2021 10:06:07 +1100 Subject: [PATCH 03/34] -aded verbosity -added artifacts on build of py imgs --- .github/workflows/windows-docker-image.yaml | 49 ++++++++++++++++----- 1 file changed, 39 insertions(+), 10 deletions(-) diff --git a/.github/workflows/windows-docker-image.yaml b/.github/workflows/windows-docker-image.yaml index 9e611a17c..1ed6d778c 100644 --- a/.github/workflows/windows-docker-image.yaml +++ b/.github/workflows/windows-docker-image.yaml @@ -68,18 +68,24 @@ jobs: run: | ${last_docker_base_rev} = $( git log -n 1 --author-date-order --pretty=format:%H -- .\.github\docker\rez-win-base\ .\.github\workflows\windows-docker-image.yaml ).SubString(0, 8) ${gh_user} = ("${{ github.repository }}" -Split '/')[0] + ${docker_image} = ${gh_user}/rez-win-base:${last_docker_base_rev} + Write-Output "Pulling DockerHub image ${docker_image}..." $ErrorActionPreference = "Continue" - docker pull ${gh_user}/rez-win-base:${last_docker_base_rev} | Out-Null + docker pull ${docker_image} | Out-Null $ErrorActionPreference = "Stop" if ($LastExitCode -ne 0) { cd .github\docker\rez-win-base - docker build --tag ${gh_user}/rez-win-base:${last_docker_base_rev} . - docker push ${gh_user}/rez-win-base:${last_docker_base_rev} + + Write-Output "Building DockerHub image ${docker_image}..." + docker build --tag ${docker_image} . + + Write-Output "Pushing DockerHub image ${docker_image}..." + docker push ${docker_image} # store inspection as artifact for ease of debugging - docker inspect ${gh_user}/rez-win-base:${last_docker_base_rev} > inspect.json + docker inspect ${docker_image} > inspect.json } - id: inspect_json @@ -122,24 +128,47 @@ jobs: run: | ${last_docker_base_rev} = $( git log -n 1 --author-date-order --pretty=format:%H -- .\.github\docker\rez-win-base\ .\.github\workflows\windows-docker-image.yaml ).SubString(0, 8) ${gh_user} = ("${{ github.repository }}" -Split '/')[0] - docker pull ${gh_user}/rez-win-base:${last_docker_base_rev} + ${docker_image} = ${gh_user}/rez-win-base:${last_docker_base_rev} + + Write-Output "Pulling DockerHub image ${docker_image}..." + docker pull ${docker_image} # so rez-win-py/Dockerfile can reference base image - docker tag ${gh_user}/rez-win-base:${last_docker_base_rev} rez-win-base:${last_docker_base_rev} + docker tag ${docker_image} rez-win-base:${last_docker_base_rev} - name: Build py Docker image if needed run: | ${last_docker_base_rev} = $( git log -n 1 --author-date-order --pretty=format:%H -- .\.github\docker\rez-win-base\ .\.github\workflows\windows-docker-image.yaml ).SubString(0, 8) ${last_docker_py_rev} = $( git log -n 1 --author-date-order --pretty=format:%H -- .\.github\docker\rez-win-py\ .\.github\docker\rez-win-base\ .\.github\workflows\windows-docker-image.yaml ).SubString(0, 8) ${gh_user} = ("${{ github.repository }}" -Split '/')[0] - ${docker_image} = "${gh_user}/rez-win-py-${{ matrix.python-version }}" + ${docker_image_notag} = "${gh_user}/rez-win-py-${{ matrix.python-version }}" + ${docker_image} = ${docker_image_notag}:${last_docker_py_rev} + Write-Output "Pulling DockerHub image ${docker_image}..." $ErrorActionPreference = "Continue" - docker pull ${docker_image}:${last_docker_py_rev} | Out-Null + docker pull ${docker_image} | Out-Null $ErrorActionPreference = "Stop" if ($LastExitCode -ne 0) { cd .github\docker\rez-win-py - docker build --tag ${docker_image} --tag ${docker_image}:${last_docker_py_rev} --build-arg PYTHON_VERSION="${{ matrix.python-version }}" --build-arg BASE_TAG=${last_docker_base_rev} . - docker push ${docker_image}:${last_docker_py_rev} + + Write-Output "Building DockerHub image ${docker_image}..." + docker build --tag ${docker_image} --tag ${docker_image_notag} --build-arg PYTHON_VERSION="${{ matrix.python-version }}" --build-arg BASE_TAG=${last_docker_base_rev} . + + Write-Output "Pushing DockerHub image ${docker_image}..." + docker push ${docker_image} + + # store inspection as artifact for ease of debugging + docker inspect ${docker_image} > inspect.json } + + - id: inspect_json + uses: andstor/file-existence-action@v1 + with: + files: .github\docker\rez-win-py\inspect.json + + - uses: actions/upload-artifact@v2 + with: + name: "rez-win-py-${{ matrix.python-version }}.json" + path: .github\docker\rez-win-py\inspect.json + if: steps.inspect_json.outputs.files_exists == 'true' From 288a1f579f6cbd9ad49c8ead10bda89f8ad66a89 Mon Sep 17 00:00:00 2001 From: nerdvegas Date: Wed, 22 Dec 2021 10:11:19 +1100 Subject: [PATCH 04/34] added missing quotes --- .github/workflows/windows-docker-image.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/windows-docker-image.yaml b/.github/workflows/windows-docker-image.yaml index 1ed6d778c..3c4a8e9b0 100644 --- a/.github/workflows/windows-docker-image.yaml +++ b/.github/workflows/windows-docker-image.yaml @@ -68,7 +68,7 @@ jobs: run: | ${last_docker_base_rev} = $( git log -n 1 --author-date-order --pretty=format:%H -- .\.github\docker\rez-win-base\ .\.github\workflows\windows-docker-image.yaml ).SubString(0, 8) ${gh_user} = ("${{ github.repository }}" -Split '/')[0] - ${docker_image} = ${gh_user}/rez-win-base:${last_docker_base_rev} + ${docker_image} = "${gh_user}/rez-win-base:${last_docker_base_rev}" Write-Output "Pulling DockerHub image ${docker_image}..." $ErrorActionPreference = "Continue" @@ -128,7 +128,7 @@ jobs: run: | ${last_docker_base_rev} = $( git log -n 1 --author-date-order --pretty=format:%H -- .\.github\docker\rez-win-base\ .\.github\workflows\windows-docker-image.yaml ).SubString(0, 8) ${gh_user} = ("${{ github.repository }}" -Split '/')[0] - ${docker_image} = ${gh_user}/rez-win-base:${last_docker_base_rev} + ${docker_image} = "${gh_user}/rez-win-base:${last_docker_base_rev}" Write-Output "Pulling DockerHub image ${docker_image}..." docker pull ${docker_image} @@ -142,7 +142,7 @@ jobs: ${last_docker_py_rev} = $( git log -n 1 --author-date-order --pretty=format:%H -- .\.github\docker\rez-win-py\ .\.github\docker\rez-win-base\ .\.github\workflows\windows-docker-image.yaml ).SubString(0, 8) ${gh_user} = ("${{ github.repository }}" -Split '/')[0] ${docker_image_notag} = "${gh_user}/rez-win-py-${{ matrix.python-version }}" - ${docker_image} = ${docker_image_notag}:${last_docker_py_rev} + ${docker_image} = "${docker_image_notag}:${last_docker_py_rev}" Write-Output "Pulling DockerHub image ${docker_image}..." $ErrorActionPreference = "Continue" From d32a88497ad1c18efb1190ffcd5a600c538cd574 Mon Sep 17 00:00:00 2001 From: nerdvegas Date: Wed, 22 Dec 2021 10:39:47 +1100 Subject: [PATCH 05/34] -colored txt testing -ignore docker files in 'installation' workflow --- .github/workflows/installation.yaml | 2 ++ .github/workflows/windows-docker-image.yaml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/installation.yaml b/.github/workflows/installation.yaml index b97cc607b..e61ca61b1 100644 --- a/.github/workflows/installation.yaml +++ b/.github/workflows/installation.yaml @@ -2,6 +2,8 @@ name: installation on: push: paths-ignore: + - '.github/docker/**' + - '.github/workflows/windows-docker-image.yaml' - 'src/rez/utils/_version.py' - 'wiki/**' - 'metrics/**' diff --git a/.github/workflows/windows-docker-image.yaml b/.github/workflows/windows-docker-image.yaml index 3c4a8e9b0..22a3ffcba 100644 --- a/.github/workflows/windows-docker-image.yaml +++ b/.github/workflows/windows-docker-image.yaml @@ -70,7 +70,7 @@ jobs: ${gh_user} = ("${{ github.repository }}" -Split '/')[0] ${docker_image} = "${gh_user}/rez-win-base:${last_docker_base_rev}" - Write-Output "Pulling DockerHub image ${docker_image}..." + Write-Host -ForegroundColor Yellow "Pulling DockerHub image ${docker_image}..." $ErrorActionPreference = "Continue" docker pull ${docker_image} | Out-Null $ErrorActionPreference = "Stop" From ef5398104b8dd9e03da6c67e8db622133a7f678d Mon Sep 17 00:00:00 2001 From: nerdvegas Date: Wed, 22 Dec 2021 10:45:40 +1100 Subject: [PATCH 06/34] more testing for better output in windows workflow --- .github/workflows/windows-docker-image.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/windows-docker-image.yaml b/.github/workflows/windows-docker-image.yaml index 22a3ffcba..3916788c2 100644 --- a/.github/workflows/windows-docker-image.yaml +++ b/.github/workflows/windows-docker-image.yaml @@ -70,9 +70,9 @@ jobs: ${gh_user} = ("${{ github.repository }}" -Split '/')[0] ${docker_image} = "${gh_user}/rez-win-base:${last_docker_base_rev}" - Write-Host -ForegroundColor Yellow "Pulling DockerHub image ${docker_image}..." + Write-Output "Pulling DockerHub image ${docker_image}..." $ErrorActionPreference = "Continue" - docker pull ${docker_image} | Out-Null + docker pull ${docker_image} 2>$null $ErrorActionPreference = "Stop" if ($LastExitCode -ne 0) { @@ -146,7 +146,7 @@ jobs: Write-Output "Pulling DockerHub image ${docker_image}..." $ErrorActionPreference = "Continue" - docker pull ${docker_image} | Out-Null + docker pull ${docker_image} 2>$null $ErrorActionPreference = "Stop" if ($LastExitCode -ne 0) { From 9a2670e19e736ac3b572eed8be2ef5fef613fdf8 Mon Sep 17 00:00:00 2001 From: nerdvegas Date: Wed, 22 Dec 2021 10:50:47 +1100 Subject: [PATCH 07/34] -echo indication of missing image, but not as error -long live echo --- .github/workflows/windows-docker-image.yaml | 18 +++++++++--------- .github/workflows/windows.yaml | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/windows-docker-image.yaml b/.github/workflows/windows-docker-image.yaml index 3916788c2..c6fe7544b 100644 --- a/.github/workflows/windows-docker-image.yaml +++ b/.github/workflows/windows-docker-image.yaml @@ -70,18 +70,18 @@ jobs: ${gh_user} = ("${{ github.repository }}" -Split '/')[0] ${docker_image} = "${gh_user}/rez-win-base:${last_docker_base_rev}" - Write-Output "Pulling DockerHub image ${docker_image}..." + echo "Pulling DockerHub image ${docker_image}..." $ErrorActionPreference = "Continue" - docker pull ${docker_image} 2>$null + docker pull ${docker_image} 2>$null || echo "(no such image)" $ErrorActionPreference = "Stop" if ($LastExitCode -ne 0) { cd .github\docker\rez-win-base - Write-Output "Building DockerHub image ${docker_image}..." + echo "Building DockerHub image ${docker_image}..." docker build --tag ${docker_image} . - Write-Output "Pushing DockerHub image ${docker_image}..." + echo "Pushing DockerHub image ${docker_image}..." docker push ${docker_image} # store inspection as artifact for ease of debugging @@ -130,7 +130,7 @@ jobs: ${gh_user} = ("${{ github.repository }}" -Split '/')[0] ${docker_image} = "${gh_user}/rez-win-base:${last_docker_base_rev}" - Write-Output "Pulling DockerHub image ${docker_image}..." + echo "Pulling DockerHub image ${docker_image}..." docker pull ${docker_image} # so rez-win-py/Dockerfile can reference base image @@ -144,18 +144,18 @@ jobs: ${docker_image_notag} = "${gh_user}/rez-win-py-${{ matrix.python-version }}" ${docker_image} = "${docker_image_notag}:${last_docker_py_rev}" - Write-Output "Pulling DockerHub image ${docker_image}..." + echo "Pulling DockerHub image ${docker_image}..." $ErrorActionPreference = "Continue" - docker pull ${docker_image} 2>$null + docker pull ${docker_image} 2>$null || echo "(no such image)" $ErrorActionPreference = "Stop" if ($LastExitCode -ne 0) { cd .github\docker\rez-win-py - Write-Output "Building DockerHub image ${docker_image}..." + echo "Building DockerHub image ${docker_image}..." docker build --tag ${docker_image} --tag ${docker_image_notag} --build-arg PYTHON_VERSION="${{ matrix.python-version }}" --build-arg BASE_TAG=${last_docker_base_rev} . - Write-Output "Pushing DockerHub image ${docker_image}..." + echo "Pushing DockerHub image ${docker_image}..." docker push ${docker_image} # store inspection as artifact for ease of debugging diff --git a/.github/workflows/windows.yaml b/.github/workflows/windows.yaml index 00a7632e1..911a4b8b6 100644 --- a/.github/workflows/windows.yaml +++ b/.github/workflows/windows.yaml @@ -48,8 +48,8 @@ jobs: run: | ${docker_image} = "nerdvegas/rez-win-py-${{ matrix.python-version }}" - Write-Output "Pulling latest DockerHub image ${docker_image}..." + echo "Pulling latest DockerHub image ${docker_image}..." docker pull ${docker_image} - Write-Output "Running DockerHub image ${docker_image}..." + echo "Running DockerHub image ${docker_image}..." docker run --mount type=bind,src=$pwd,dst=C:\checkout,readonly ${docker_image} From 861f7781ab1d02aa5e7c22d845dddb42602bdcc0 Mon Sep 17 00:00:00 2001 From: nerdvegas Date: Wed, 22 Dec 2021 11:15:39 +1100 Subject: [PATCH 08/34] echo not working --- .github/workflows/windows-docker-image.yaml | 18 +++++++++--------- .github/workflows/windows.yaml | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/windows-docker-image.yaml b/.github/workflows/windows-docker-image.yaml index c6fe7544b..845bef732 100644 --- a/.github/workflows/windows-docker-image.yaml +++ b/.github/workflows/windows-docker-image.yaml @@ -70,18 +70,18 @@ jobs: ${gh_user} = ("${{ github.repository }}" -Split '/')[0] ${docker_image} = "${gh_user}/rez-win-base:${last_docker_base_rev}" - echo "Pulling DockerHub image ${docker_image}..." + Write-Output "Pulling DockerHub image ${docker_image}..." $ErrorActionPreference = "Continue" - docker pull ${docker_image} 2>$null || echo "(no such image)" + docker pull ${docker_image} 2>$null || Write-Output "(no such image)" $ErrorActionPreference = "Stop" if ($LastExitCode -ne 0) { cd .github\docker\rez-win-base - echo "Building DockerHub image ${docker_image}..." + Write-Output "Building DockerHub image ${docker_image}..." docker build --tag ${docker_image} . - echo "Pushing DockerHub image ${docker_image}..." + Write-Output "Pushing DockerHub image ${docker_image}..." docker push ${docker_image} # store inspection as artifact for ease of debugging @@ -130,7 +130,7 @@ jobs: ${gh_user} = ("${{ github.repository }}" -Split '/')[0] ${docker_image} = "${gh_user}/rez-win-base:${last_docker_base_rev}" - echo "Pulling DockerHub image ${docker_image}..." + Write-Output "Pulling DockerHub image ${docker_image}..." docker pull ${docker_image} # so rez-win-py/Dockerfile can reference base image @@ -144,18 +144,18 @@ jobs: ${docker_image_notag} = "${gh_user}/rez-win-py-${{ matrix.python-version }}" ${docker_image} = "${docker_image_notag}:${last_docker_py_rev}" - echo "Pulling DockerHub image ${docker_image}..." + Write-Output "Pulling DockerHub image ${docker_image}..." $ErrorActionPreference = "Continue" - docker pull ${docker_image} 2>$null || echo "(no such image)" + docker pull ${docker_image} 2>$null || Write-Output "(no such image)" $ErrorActionPreference = "Stop" if ($LastExitCode -ne 0) { cd .github\docker\rez-win-py - echo "Building DockerHub image ${docker_image}..." + Write-Output "Building DockerHub image ${docker_image}..." docker build --tag ${docker_image} --tag ${docker_image_notag} --build-arg PYTHON_VERSION="${{ matrix.python-version }}" --build-arg BASE_TAG=${last_docker_base_rev} . - echo "Pushing DockerHub image ${docker_image}..." + Write-Output "Pushing DockerHub image ${docker_image}..." docker push ${docker_image} # store inspection as artifact for ease of debugging diff --git a/.github/workflows/windows.yaml b/.github/workflows/windows.yaml index 911a4b8b6..00a7632e1 100644 --- a/.github/workflows/windows.yaml +++ b/.github/workflows/windows.yaml @@ -48,8 +48,8 @@ jobs: run: | ${docker_image} = "nerdvegas/rez-win-py-${{ matrix.python-version }}" - echo "Pulling latest DockerHub image ${docker_image}..." + Write-Output "Pulling latest DockerHub image ${docker_image}..." docker pull ${docker_image} - echo "Running DockerHub image ${docker_image}..." + Write-Output "Running DockerHub image ${docker_image}..." docker run --mount type=bind,src=$pwd,dst=C:\checkout,readonly ${docker_image} From 8589adf5fb6c244a6a565702782aaf75585451df Mon Sep 17 00:00:00 2001 From: nerdvegas Date: Wed, 22 Dec 2021 11:22:15 +1100 Subject: [PATCH 09/34] -ignore workflow changes for triggering most workflows -not so useful as very often the workflows you don't want to trigger get triggered anyway --- .github/workflows/core.yaml | 3 +-- .github/workflows/flake8.yaml | 3 +-- .github/workflows/installation.yaml | 3 +-- .github/workflows/mac.yaml | 3 +-- .github/workflows/ubuntu.yaml | 3 +-- .github/workflows/windows.yaml | 3 +-- 6 files changed, 6 insertions(+), 12 deletions(-) diff --git a/.github/workflows/core.yaml b/.github/workflows/core.yaml index b9bdcee3e..f873ebd1a 100644 --- a/.github/workflows/core.yaml +++ b/.github/workflows/core.yaml @@ -7,8 +7,7 @@ name: core on: pull_request: paths-ignore: - - '.github/docker/**' - - '.github/workflows/windows-docker-image.yaml' + - '.github/**' - 'src/rez/utils/_version.py' - 'wiki/**' - 'metrics/**' diff --git a/.github/workflows/flake8.yaml b/.github/workflows/flake8.yaml index 795f88cad..873b8d074 100644 --- a/.github/workflows/flake8.yaml +++ b/.github/workflows/flake8.yaml @@ -2,8 +2,7 @@ name: flake8 on: pull_request: paths-ignore: - - '.github/docker/**' - - '.github/workflows/windows-docker-image.yaml' + - '.github/**' - 'src/rez/utils/_version.py' - 'wiki/**' - 'metrics/**' diff --git a/.github/workflows/installation.yaml b/.github/workflows/installation.yaml index e61ca61b1..3c7f43331 100644 --- a/.github/workflows/installation.yaml +++ b/.github/workflows/installation.yaml @@ -2,8 +2,7 @@ name: installation on: push: paths-ignore: - - '.github/docker/**' - - '.github/workflows/windows-docker-image.yaml' + - '.github/**' - 'src/rez/utils/_version.py' - 'wiki/**' - 'metrics/**' diff --git a/.github/workflows/mac.yaml b/.github/workflows/mac.yaml index 82fbb6c55..fa38ae070 100644 --- a/.github/workflows/mac.yaml +++ b/.github/workflows/mac.yaml @@ -2,8 +2,7 @@ name: mac on: pull_request: paths-ignore: - - '.github/docker/**' - - '.github/workflows/windows-docker-image.yaml' + - '.github/**' - 'src/rez/utils/_version.py' - 'wiki/**' - 'metrics/**' diff --git a/.github/workflows/ubuntu.yaml b/.github/workflows/ubuntu.yaml index e14f9c106..e1da4ddf2 100644 --- a/.github/workflows/ubuntu.yaml +++ b/.github/workflows/ubuntu.yaml @@ -2,8 +2,7 @@ name: ubuntu on: pull_request: paths-ignore: - - '.github/docker/**' - - '.github/workflows/windows-docker-image.yaml' + - '.github/**' - 'src/rez/utils/_version.py' - 'wiki/**' - 'metrics/**' diff --git a/.github/workflows/windows.yaml b/.github/workflows/windows.yaml index 00a7632e1..71e131d01 100644 --- a/.github/workflows/windows.yaml +++ b/.github/workflows/windows.yaml @@ -11,8 +11,7 @@ name: windows on: pull_request: paths-ignore: - - '.github/docker/**' - - '.github/workflows/windows-docker-image.yaml' + - '.github/**' - 'src/rez/utils/_version.py' - 'wiki/**' - 'metrics/**' From 0052d106d006011236d1572a11dc153e62cbcbe0 Mon Sep 17 00:00:00 2001 From: nerdvegas Date: Wed, 22 Dec 2021 11:31:41 +1100 Subject: [PATCH 10/34] trying out SilentlyContinue --- .github/workflows/windows-docker-image.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/windows-docker-image.yaml b/.github/workflows/windows-docker-image.yaml index 845bef732..d13f8661f 100644 --- a/.github/workflows/windows-docker-image.yaml +++ b/.github/workflows/windows-docker-image.yaml @@ -71,8 +71,8 @@ jobs: ${docker_image} = "${gh_user}/rez-win-base:${last_docker_base_rev}" Write-Output "Pulling DockerHub image ${docker_image}..." - $ErrorActionPreference = "Continue" - docker pull ${docker_image} 2>$null || Write-Output "(no such image)" + $ErrorActionPreference = "SilentlyContinue" + docker pull ${docker_image} || Write-Output "(no such image)" $ErrorActionPreference = "Stop" if ($LastExitCode -ne 0) { @@ -145,8 +145,8 @@ jobs: ${docker_image} = "${docker_image_notag}:${last_docker_py_rev}" Write-Output "Pulling DockerHub image ${docker_image}..." - $ErrorActionPreference = "Continue" - docker pull ${docker_image} 2>$null || Write-Output "(no such image)" + $ErrorActionPreference = "SilentlyContinue" + docker pull ${docker_image} || Write-Output "(no such image)" $ErrorActionPreference = "Stop" if ($LastExitCode -ne 0) { From c026979506604b46daa73c8f67d540c1f0493e41 Mon Sep 17 00:00:00 2001 From: nerdvegas Date: Wed, 22 Dec 2021 11:33:33 +1100 Subject: [PATCH 11/34] SilentlyContinue is bulshit, reverting --- .github/workflows/windows-docker-image.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/windows-docker-image.yaml b/.github/workflows/windows-docker-image.yaml index d13f8661f..845bef732 100644 --- a/.github/workflows/windows-docker-image.yaml +++ b/.github/workflows/windows-docker-image.yaml @@ -71,8 +71,8 @@ jobs: ${docker_image} = "${gh_user}/rez-win-base:${last_docker_base_rev}" Write-Output "Pulling DockerHub image ${docker_image}..." - $ErrorActionPreference = "SilentlyContinue" - docker pull ${docker_image} || Write-Output "(no such image)" + $ErrorActionPreference = "Continue" + docker pull ${docker_image} 2>$null || Write-Output "(no such image)" $ErrorActionPreference = "Stop" if ($LastExitCode -ne 0) { @@ -145,8 +145,8 @@ jobs: ${docker_image} = "${docker_image_notag}:${last_docker_py_rev}" Write-Output "Pulling DockerHub image ${docker_image}..." - $ErrorActionPreference = "SilentlyContinue" - docker pull ${docker_image} || Write-Output "(no such image)" + $ErrorActionPreference = "Continue" + docker pull ${docker_image} 2>$null || Write-Output "(no such image)" $ErrorActionPreference = "Stop" if ($LastExitCode -ne 0) { From d8e5eea7c8893c3fc9aa601ea395434c9c001d04 Mon Sep 17 00:00:00 2001 From: nerdvegas Date: Wed, 22 Dec 2021 11:54:41 +1100 Subject: [PATCH 12/34] better path incl/excl in workflows --- .github/workflows/core.yaml | 23 ++++++++++------------- .github/workflows/flake8.yaml | 23 ++++++++--------------- .github/workflows/installation.yaml | 11 +++++------ .github/workflows/mac.yaml | 23 ++++++++++------------- .github/workflows/ubuntu.yaml | 23 ++++++++++------------- .github/workflows/windows.yaml | 23 ++++++++++------------- 6 files changed, 53 insertions(+), 73 deletions(-) diff --git a/.github/workflows/core.yaml b/.github/workflows/core.yaml index f873ebd1a..0dbf3007c 100644 --- a/.github/workflows/core.yaml +++ b/.github/workflows/core.yaml @@ -6,20 +6,17 @@ name: core on: pull_request: - paths-ignore: - - '.github/**' - - 'src/rez/utils/_version.py' - - 'wiki/**' - - 'metrics/**' - - '**.md' + paths: + - 'src/**' + - '.github/workflows/core.yaml' + - '!src/rez/utils/_version.py' + - '!**.md' push: - paths-ignore: - - '.github/docker/**' - - '.github/workflows/windows-docker-image.yaml' - - 'src/rez/utils/_version.py' - - 'wiki/**' - - 'metrics/**' - - '**.md' + paths: + - 'src/**' + - '.github/workflows/core.yaml' + - '!src/rez/utils/_version.py' + - '!**.md' jobs: main: diff --git a/.github/workflows/flake8.yaml b/.github/workflows/flake8.yaml index 873b8d074..61c80223c 100644 --- a/.github/workflows/flake8.yaml +++ b/.github/workflows/flake8.yaml @@ -1,22 +1,15 @@ name: flake8 on: pull_request: - paths-ignore: - - '.github/**' - - 'src/rez/utils/_version.py' - - 'wiki/**' - - 'metrics/**' - - 'data/**' - - '**.md' + paths: + - 'src/**.py' + - '.github/workflows/flake8.yaml' + - '!src/rez/utils/_version.py' push: - paths-ignore: - - '.github/docker/**' - - '.github/workflows/windows-docker-image.yaml' - - 'src/rez/utils/_version.py' - - 'wiki/**' - - 'metrics/**' - - 'data/**' - - '**.md' + paths: + - 'src/**.py' + - '.github/workflows/flake8.yaml' + - '!src/rez/utils/_version.py' jobs: lint: diff --git a/.github/workflows/installation.yaml b/.github/workflows/installation.yaml index 3c7f43331..f58d17b61 100644 --- a/.github/workflows/installation.yaml +++ b/.github/workflows/installation.yaml @@ -1,12 +1,11 @@ name: installation on: push: - paths-ignore: - - '.github/**' - - 'src/rez/utils/_version.py' - - 'wiki/**' - - 'metrics/**' - - '**.md' + paths: + - 'src/**' + - '.github/workflows/installation.yaml' + - '!src/rez/utils/_version.py' + - '!**.md' jobs: main: diff --git a/.github/workflows/mac.yaml b/.github/workflows/mac.yaml index fa38ae070..b1e0e2fcb 100644 --- a/.github/workflows/mac.yaml +++ b/.github/workflows/mac.yaml @@ -1,20 +1,17 @@ name: mac on: pull_request: - paths-ignore: - - '.github/**' - - 'src/rez/utils/_version.py' - - 'wiki/**' - - 'metrics/**' - - '**.md' + paths: + - 'src/**' + - '.github/workflows/mac.yaml' + - '!src/rez/utils/_version.py' + - '!**.md' push: - paths-ignore: - - '.github/docker/**' - - '.github/workflows/windows-docker-image.yaml' - - 'src/rez/utils/_version.py' - - 'wiki/**' - - 'metrics/**' - - '**.md' + paths: + - 'src/**' + - '.github/workflows/mac.yaml' + - '!src/rez/utils/_version.py' + - '!**.md' jobs: main: diff --git a/.github/workflows/ubuntu.yaml b/.github/workflows/ubuntu.yaml index e1da4ddf2..3ffd1a40f 100644 --- a/.github/workflows/ubuntu.yaml +++ b/.github/workflows/ubuntu.yaml @@ -1,20 +1,17 @@ name: ubuntu on: pull_request: - paths-ignore: - - '.github/**' - - 'src/rez/utils/_version.py' - - 'wiki/**' - - 'metrics/**' - - '**.md' + paths: + - 'src/**' + - '.github/workflows/ubuntu.yaml' + - '!src/rez/utils/_version.py' + - '!**.md' push: - paths-ignore: - - '.github/docker/**' - - '.github/workflows/windows-docker-image.yaml' - - 'src/rez/utils/_version.py' - - 'wiki/**' - - 'metrics/**' - - '**.md' + paths: + - 'src/**' + - '.github/workflows/ubuntu.yaml' + - '!src/rez/utils/_version.py' + - '!**.md' jobs: main: diff --git a/.github/workflows/windows.yaml b/.github/workflows/windows.yaml index 71e131d01..4f95d2676 100644 --- a/.github/workflows/windows.yaml +++ b/.github/workflows/windows.yaml @@ -10,20 +10,17 @@ name: windows on: pull_request: - paths-ignore: - - '.github/**' - - 'src/rez/utils/_version.py' - - 'wiki/**' - - 'metrics/**' - - '**.md' + paths: + - 'src/**' + - '.github/workflows/windows.yaml' + - '!src/rez/utils/_version.py' + - '!**.md' push: - paths-ignore: - - '.github/docker/**' - - '.github/workflows/windows-docker-image.yaml' - - 'src/rez/utils/_version.py' - - 'wiki/**' - - 'metrics/**' - - '**.md' + paths: + - 'src/**' + - '.github/workflows/windows.yaml' + - '!src/rez/utils/_version.py' + - '!**.md' jobs: main: From cdec18b7f69a0343ad3fb058362992db0ef637ca Mon Sep 17 00:00:00 2001 From: nerdvegas Date: Wed, 22 Dec 2021 11:56:14 +1100 Subject: [PATCH 13/34] force win-dock-img workflow run --- .github/workflows/windows-docker-image.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows-docker-image.yaml b/.github/workflows/windows-docker-image.yaml index 845bef732..c362a3f67 100644 --- a/.github/workflows/windows-docker-image.yaml +++ b/.github/workflows/windows-docker-image.yaml @@ -37,7 +37,7 @@ on: # A, _if_ A was triggered, otherwise run B regardless." # branches: - - issue_1181-win-docker # TEMP + - issue_1181-win-docker # TEMP1 paths: - '.github/docker/rez-win-base/**' - '.github/docker/rez-win-py/**' From bc4f93896400be5ede00283fcfbba9d447192582 Mon Sep 17 00:00:00 2001 From: nerdvegas Date: Wed, 22 Dec 2021 13:20:28 +1100 Subject: [PATCH 14/34] force windows workflow run --- .github/workflows/windows.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/windows.yaml b/.github/workflows/windows.yaml index 4f95d2676..60c71e4dd 100644 --- a/.github/workflows/windows.yaml +++ b/.github/workflows/windows.yaml @@ -49,3 +49,4 @@ jobs: Write-Output "Running DockerHub image ${docker_image}..." docker run --mount type=bind,src=$pwd,dst=C:\checkout,readonly ${docker_image} + From 26752369bdcae30510a2613748294429e5722fab Mon Sep 17 00:00:00 2001 From: nerdvegas Date: Wed, 22 Dec 2021 13:22:50 +1100 Subject: [PATCH 15/34] win img not tagged as latest, fix --- .github/workflows/windows-docker-image.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows-docker-image.yaml b/.github/workflows/windows-docker-image.yaml index c362a3f67..294ed4e9b 100644 --- a/.github/workflows/windows-docker-image.yaml +++ b/.github/workflows/windows-docker-image.yaml @@ -153,7 +153,7 @@ jobs: cd .github\docker\rez-win-py Write-Output "Building DockerHub image ${docker_image}..." - docker build --tag ${docker_image} --tag ${docker_image_notag} --build-arg PYTHON_VERSION="${{ matrix.python-version }}" --build-arg BASE_TAG=${last_docker_base_rev} . + docker build --tag ${docker_image} --tag ${docker_image_notag}:latest --build-arg PYTHON_VERSION="${{ matrix.python-version }}" --build-arg BASE_TAG=${last_docker_base_rev} . Write-Output "Pushing DockerHub image ${docker_image}..." docker push ${docker_image} From 68d7553bf56eab14d6d46b0e37e4a4007e46ee3b Mon Sep 17 00:00:00 2001 From: nerdvegas Date: Wed, 22 Dec 2021 13:50:22 +1100 Subject: [PATCH 16/34] using ::set-output to embed img tag into artifact name --- .github/workflows/windows-docker-image.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/windows-docker-image.yaml b/.github/workflows/windows-docker-image.yaml index 294ed4e9b..ef3dba829 100644 --- a/.github/workflows/windows-docker-image.yaml +++ b/.github/workflows/windows-docker-image.yaml @@ -65,6 +65,7 @@ jobs: uses: actions/checkout@v2 - name: Build base docker image if needed + id: build_image run: | ${last_docker_base_rev} = $( git log -n 1 --author-date-order --pretty=format:%H -- .\.github\docker\rez-win-base\ .\.github\workflows\windows-docker-image.yaml ).SubString(0, 8) ${gh_user} = ("${{ github.repository }}" -Split '/')[0] @@ -86,6 +87,7 @@ jobs: # store inspection as artifact for ease of debugging docker inspect ${docker_image} > inspect.json + Write-Output "::set-output base_rev=${last_docker_base_rev}" } - id: inspect_json @@ -95,7 +97,7 @@ jobs: - uses: actions/upload-artifact@v2 with: - name: "rez-win-base.json" + name: "rez-win-base-${{ steps.build_image.outputs.base_rev }}.json" path: .github\docker\rez-win-base\inspect.json if: steps.inspect_json.outputs.files_exists == 'true' From afc88492795ca908e7800517d11c53c4bec8aafb Mon Sep 17 00:00:00 2001 From: nerdvegas Date: Wed, 22 Dec 2021 14:27:42 +1100 Subject: [PATCH 17/34] -formatting cleanup -fix chocolatey in py Dockerfile -tag and push latest for windows.yaml to pull --- .github/docker/rez-win-base/Dockerfile | 12 +++---- .github/docker/rez-win-py/Dockerfile | 14 ++++---- .github/workflows/windows-docker-image.yaml | 40 +++++++++++++++++---- 3 files changed, 47 insertions(+), 19 deletions(-) diff --git a/.github/docker/rez-win-base/Dockerfile b/.github/docker/rez-win-base/Dockerfile index 4be4b04f5..101beb22e 100644 --- a/.github/docker/rez-win-base/Dockerfile +++ b/.github/docker/rez-win-base/Dockerfile @@ -23,13 +23,13 @@ ARG PWSH_VERSION=6.2.2 # - PowerShellCore # ENV chocolateyUseWindowsCompression false -RUN iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1')); ` - choco feature disable --name showDownloadProgress; ` - choco install git.install --yes --version=${ENV:GIT_VERSION}; ` +RUN iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1')); ` + choco feature disable --name showDownloadProgress; ` + choco install git.install --yes --version=${ENV:GIT_VERSION}; ` choco install cmake --yes --version=${ENV:CMAKE_VERSION} --installargs 'ADD_CMAKE_TO_PATH=System'; ` - choco install pwsh --yes --version=${PWSH_VERSION}; ` - choco install --yes choco-cleaner; ` - C:\ProgramData\chocolatey\bin\choco-cleaner.bat; ` + choco install pwsh --yes --version=${PWSH_VERSION}; ` + choco install --yes choco-cleaner; ` + C:\ProgramData\chocolatey\bin\choco-cleaner.bat; ` choco uninstall --yes choco-cleaner ENTRYPOINT ["powershell.exe", "-NoLogo", "-ExecutionPolicy", "ByPass"] diff --git a/.github/docker/rez-win-py/Dockerfile b/.github/docker/rez-win-py/Dockerfile index db63cc99c..3b3c622f2 100644 --- a/.github/docker/rez-win-py/Dockerfile +++ b/.github/docker/rez-win-py/Dockerfile @@ -36,14 +36,14 @@ RUN ${PYTHON_INSTALL_PATH} = 'C:\Python'; # ------------------------------------------------------------------------------------------------------------ # Verify Python # -RUN $python_relative_ver = (& python --version 2>&1).ToString().Trim().Split(" ")[1]; ` - $python_explicit_ver = (& C:\python\python.exe --version 2>&1).ToString().Trim().Split(" ")[1]; ` - if (-not $?) {exit 1}; ` - $python_relative_ver = (& python --version 2>&1).ToString().Trim().Split(" ")[1]; ` - $python_explicit_ver = (& C:\python\python.exe --version 2>&1).ToString().Trim().Split(" ")[1]; ` +RUN $python_relative_ver = (& python --version 2>&1).ToString().Trim().Split(" ")[1]; ` + $python_explicit_ver = (& C:\python\python.exe --version 2>&1).ToString().Trim().Split(" ")[1]; ` + if (-not $?) {exit 1}; ` + $python_relative_ver = (& python --version 2>&1).ToString().Trim().Split(" ")[1]; ` + $python_explicit_ver = (& C:\python\python.exe --version 2>&1).ToString().Trim().Split(" ")[1]; ` if (-not ($python_explicit_ver -eq $python_relative_ver -and $python_explicit_ver -eq ${ENV:PYTHON_VERSION})) {exit 1}; ` - choco install --yes choco-cleaner; ` - C:\ProgramData\chocolatey\bin\choco-cleaner.ps1; ` + choco install --yes choco-cleaner; ` + C:\ProgramData\chocolatey\bin\choco-cleaner.bat; ` choco uninstall --yes choco-cleaner COPY entrypoint.ps1 /entrypoint.ps1 diff --git a/.github/workflows/windows-docker-image.yaml b/.github/workflows/windows-docker-image.yaml index ef3dba829..f4b633750 100644 --- a/.github/workflows/windows-docker-image.yaml +++ b/.github/workflows/windows-docker-image.yaml @@ -67,7 +67,12 @@ jobs: - name: Build base docker image if needed id: build_image run: | - ${last_docker_base_rev} = $( git log -n 1 --author-date-order --pretty=format:%H -- .\.github\docker\rez-win-base\ .\.github\workflows\windows-docker-image.yaml ).SubString(0, 8) + ${last_docker_base_rev} = $( ` + git log -n 1 --author-date-order --pretty=format:%H -- ` + .\.github\docker\rez-win-base\ ` + .\.github\workflows\windows-docker-image.yaml ` + ).SubString(0, 8) + ${gh_user} = ("${{ github.repository }}" -Split '/')[0] ${docker_image} = "${gh_user}/rez-win-base:${last_docker_base_rev}" @@ -87,7 +92,7 @@ jobs: # store inspection as artifact for ease of debugging docker inspect ${docker_image} > inspect.json - Write-Output "::set-output base_rev=${last_docker_base_rev}" + Write-Output "::set-output name=base_rev::${last_docker_base_rev}" } - id: inspect_json @@ -128,7 +133,12 @@ jobs: - name: Pull base docker image run: | - ${last_docker_base_rev} = $( git log -n 1 --author-date-order --pretty=format:%H -- .\.github\docker\rez-win-base\ .\.github\workflows\windows-docker-image.yaml ).SubString(0, 8) + ${last_docker_base_rev} = $( ` + git log -n 1 --author-date-order --pretty=format:%H -- ` + .\.github\docker\rez-win-base\ ` + .\.github\workflows\windows-docker-image.yaml ` + ).SubString(0, 8) + ${gh_user} = ("${{ github.repository }}" -Split '/')[0] ${docker_image} = "${gh_user}/rez-win-base:${last_docker_base_rev}" @@ -140,8 +150,19 @@ jobs: - name: Build py Docker image if needed run: | - ${last_docker_base_rev} = $( git log -n 1 --author-date-order --pretty=format:%H -- .\.github\docker\rez-win-base\ .\.github\workflows\windows-docker-image.yaml ).SubString(0, 8) - ${last_docker_py_rev} = $( git log -n 1 --author-date-order --pretty=format:%H -- .\.github\docker\rez-win-py\ .\.github\docker\rez-win-base\ .\.github\workflows\windows-docker-image.yaml ).SubString(0, 8) + ${last_docker_base_rev} = $( ` + git log -n 1 --author-date-order --pretty=format:%H -- ` + .\.github\docker\rez-win-base\ ` + .\.github\workflows\windows-docker-image.yaml ` + ).SubString(0, 8) + + ${last_docker_py_rev} = $( ` + git log -n 1 --author-date-order --pretty=format:%H -- ` + .\.github\docker\rez-win-py\ ` + .\.github\docker\rez-win-base\ ` + .\.github\workflows\windows-docker-image.yaml ` + ).SubString(0, 8) + ${gh_user} = ("${{ github.repository }}" -Split '/')[0] ${docker_image_notag} = "${gh_user}/rez-win-py-${{ matrix.python-version }}" ${docker_image} = "${docker_image_notag}:${last_docker_py_rev}" @@ -155,11 +176,18 @@ jobs: cd .github\docker\rez-win-py Write-Output "Building DockerHub image ${docker_image}..." - docker build --tag ${docker_image} --tag ${docker_image_notag}:latest --build-arg PYTHON_VERSION="${{ matrix.python-version }}" --build-arg BASE_TAG=${last_docker_base_rev} . + docker build ` + --tag ${docker_image} ` + --build-arg PYTHON_VERSION="${{ matrix.python-version }}" ` + --build-arg BASE_TAG=${last_docker_base_rev} . Write-Output "Pushing DockerHub image ${docker_image}..." docker push ${docker_image} + Write-Output "Tagging and pushing ${docker_image_notag}:latest..." + docker tag ${docker_image} ${docker_image_notag}:latest + docker push ${docker_image_notag}:latest + # store inspection as artifact for ease of debugging docker inspect ${docker_image} > inspect.json } From e60ce5ff03197b3581f17015ea112013446cc7c0 Mon Sep 17 00:00:00 2001 From: nerdvegas Date: Wed, 22 Dec 2021 15:03:43 +1100 Subject: [PATCH 18/34] add commit hash rev to py image artifact name --- .github/workflows/windows-docker-image.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/windows-docker-image.yaml b/.github/workflows/windows-docker-image.yaml index f4b633750..29e54af44 100644 --- a/.github/workflows/windows-docker-image.yaml +++ b/.github/workflows/windows-docker-image.yaml @@ -149,6 +149,7 @@ jobs: docker tag ${docker_image} rez-win-base:${last_docker_base_rev} - name: Build py Docker image if needed + id: build_image run: | ${last_docker_base_rev} = $( ` git log -n 1 --author-date-order --pretty=format:%H -- ` @@ -190,6 +191,7 @@ jobs: # store inspection as artifact for ease of debugging docker inspect ${docker_image} > inspect.json + Write-Output "::set-output name=py_rev::${last_docker_py_rev}" } - id: inspect_json @@ -199,6 +201,6 @@ jobs: - uses: actions/upload-artifact@v2 with: - name: "rez-win-py-${{ matrix.python-version }}.json" + name: "rez-win-py-${{ matrix.python-version }}-${{ steps.build_image.outputs.py_rev }}.json" path: .github\docker\rez-win-py\inspect.json if: steps.inspect_json.outputs.files_exists == 'true' From 50af0d24a00427f7e6c25b19a2c2c76e147d2c92 Mon Sep 17 00:00:00 2001 From: nerdvegas Date: Wed, 22 Dec 2021 17:12:30 +1100 Subject: [PATCH 19/34] force windows workflow run --- .github/workflows/windows.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/windows.yaml b/.github/workflows/windows.yaml index 60c71e4dd..4f95d2676 100644 --- a/.github/workflows/windows.yaml +++ b/.github/workflows/windows.yaml @@ -49,4 +49,3 @@ jobs: Write-Output "Running DockerHub image ${docker_image}..." docker run --mount type=bind,src=$pwd,dst=C:\checkout,readonly ${docker_image} - From 3e6927931240ea4271e2cee2e6e3b31eaee97b1d Mon Sep 17 00:00:00 2001 From: nerdvegas Date: Thu, 23 Dec 2021 10:25:16 +1100 Subject: [PATCH 20/34] -split windows workflow into pull/run steps -print non-latest image tag for debugging --- .github/workflows/windows.yaml | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/windows.yaml b/.github/workflows/windows.yaml index 4f95d2676..83c16eac6 100644 --- a/.github/workflows/windows.yaml +++ b/.github/workflows/windows.yaml @@ -40,12 +40,21 @@ jobs: - name: Checkout uses: actions/checkout@v2 + - name: "Pull Docker image nerdvegas/rez-win-py-${{ matrix.python-version }}:latest" + run: | + ${docker_image} = "nerdvegas/rez-win-py-${{ matrix.python-version }}" + docker pull ${docker_image}:latest + - name: Run Docker image (installs and tests rez) run: | ${docker_image} = "nerdvegas/rez-win-py-${{ matrix.python-version }}" - Write-Output "Pulling latest DockerHub image ${docker_image}..." - docker pull ${docker_image} + # show tagged image name to help debugging + ${docker_image_tagged} = $( ` + docker inspect ${docker_image} --format "{{range .RepoTags}}{{println .}}{{end}}" ` + | grep -vw latest ` + | grep nerdvegas ` + ) + Write-Output "Running DockerHub image ${docker_image_tagged}..." - Write-Output "Running DockerHub image ${docker_image}..." - docker run --mount type=bind,src=$pwd,dst=C:\checkout,readonly ${docker_image} + docker run --mount type=bind,src=$pwd,dst=C:\checkout,readonly ${docker_image}:latest From f99200f1f9b230908310c2a90ec7443e02e00c71 Mon Sep 17 00:00:00 2001 From: nerdvegas Date: Thu, 23 Dec 2021 10:55:46 +1100 Subject: [PATCH 21/34] attempt #2 at showing tagged img name --- .github/workflows/windows.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/windows.yaml b/.github/workflows/windows.yaml index 83c16eac6..715a40822 100644 --- a/.github/workflows/windows.yaml +++ b/.github/workflows/windows.yaml @@ -51,9 +51,7 @@ jobs: # show tagged image name to help debugging ${docker_image_tagged} = $( ` - docker inspect ${docker_image} --format "{{range .RepoTags}}{{println .}}{{end}}" ` - | grep -vw latest ` - | grep nerdvegas ` + docker inspect ${docker_image} --format "{{.RepoTags}}" ` ) Write-Output "Running DockerHub image ${docker_image_tagged}..." From 2f4dfd27cda9fbf85d571c91de6a286d488a4718 Mon Sep 17 00:00:00 2001 From: nerdvegas Date: Thu, 23 Dec 2021 11:24:21 +1100 Subject: [PATCH 22/34] yet another attempt at showing img tag info in workflow output --- .github/docker/rez-win-py/Dockerfile | 3 +++ .github/docker/rez-win-py/entrypoint.ps1 | 6 ++++++ .github/workflows/windows-docker-image.yaml | 3 ++- .github/workflows/windows.yaml | 7 ------- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/.github/docker/rez-win-py/Dockerfile b/.github/docker/rez-win-py/Dockerfile index 3b3c622f2..cc2b8caf9 100644 --- a/.github/docker/rez-win-py/Dockerfile +++ b/.github/docker/rez-win-py/Dockerfile @@ -3,6 +3,9 @@ # Tag of base image to use ARG BASE_TAG +# Tag applied to this image +ENV PY_TAG + # Base image windows version FROM rez-win-base:$BASE_TAG diff --git a/.github/docker/rez-win-py/entrypoint.ps1 b/.github/docker/rez-win-py/entrypoint.ps1 index 0d2cb100e..7a9cb5b54 100644 --- a/.github/docker/rez-win-py/entrypoint.ps1 +++ b/.github/docker/rez-win-py/entrypoint.ps1 @@ -10,6 +10,12 @@ $ErrorActionPreference = "Stop" # ${ENV:PYTHONIOENCODING} = "UTF-8" +# Print name of image being run, for debugging purposes. We can't show the +# literal image name here, because it just uses 'latest' tagged image (see +# explanation in windows-docker-image.yaml - on.push) +# +Write-Output "Running rez tests from docker image rez-win-py:${ENV:PY_TAG}" + # Verify Python # python --version diff --git a/.github/workflows/windows-docker-image.yaml b/.github/workflows/windows-docker-image.yaml index 29e54af44..013abf814 100644 --- a/.github/workflows/windows-docker-image.yaml +++ b/.github/workflows/windows-docker-image.yaml @@ -180,7 +180,8 @@ jobs: docker build ` --tag ${docker_image} ` --build-arg PYTHON_VERSION="${{ matrix.python-version }}" ` - --build-arg BASE_TAG=${last_docker_base_rev} . + --build-arg BASE_TAG=${last_docker_base_rev} . ` + --build-arg PY_TAG=${last_docker_py_rev} . Write-Output "Pushing DockerHub image ${docker_image}..." docker push ${docker_image} diff --git a/.github/workflows/windows.yaml b/.github/workflows/windows.yaml index 715a40822..9e1e383d0 100644 --- a/.github/workflows/windows.yaml +++ b/.github/workflows/windows.yaml @@ -48,11 +48,4 @@ jobs: - name: Run Docker image (installs and tests rez) run: | ${docker_image} = "nerdvegas/rez-win-py-${{ matrix.python-version }}" - - # show tagged image name to help debugging - ${docker_image_tagged} = $( ` - docker inspect ${docker_image} --format "{{.RepoTags}}" ` - ) - Write-Output "Running DockerHub image ${docker_image_tagged}..." - docker run --mount type=bind,src=$pwd,dst=C:\checkout,readonly ${docker_image}:latest From fc380e388d135bf54feaaa217833303836f2d3e0 Mon Sep 17 00:00:00 2001 From: nerdvegas Date: Thu, 23 Dec 2021 11:53:23 +1100 Subject: [PATCH 23/34] fixed typo in workflow --- .github/workflows/windows-docker-image.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/windows-docker-image.yaml b/.github/workflows/windows-docker-image.yaml index 013abf814..eeefcae0b 100644 --- a/.github/workflows/windows-docker-image.yaml +++ b/.github/workflows/windows-docker-image.yaml @@ -180,8 +180,9 @@ jobs: docker build ` --tag ${docker_image} ` --build-arg PYTHON_VERSION="${{ matrix.python-version }}" ` - --build-arg BASE_TAG=${last_docker_base_rev} . ` - --build-arg PY_TAG=${last_docker_py_rev} . + --build-arg BASE_TAG=${last_docker_base_rev} ` + --build-arg PY_TAG=${last_docker_py_rev} ` + . Write-Output "Pushing DockerHub image ${docker_image}..." docker push ${docker_image} From 6b34822ae39e2dd2f36b40eeac395887c620f759 Mon Sep 17 00:00:00 2001 From: nerdvegas Date: Thu, 23 Dec 2021 12:07:59 +1100 Subject: [PATCH 24/34] ENV usage fix in dockerfile --- .github/docker/rez-win-py/Dockerfile | 3 ++- .github/docker/rez-win-py/entrypoint.ps1 | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/docker/rez-win-py/Dockerfile b/.github/docker/rez-win-py/Dockerfile index cc2b8caf9..c9aa4f769 100644 --- a/.github/docker/rez-win-py/Dockerfile +++ b/.github/docker/rez-win-py/Dockerfile @@ -4,7 +4,8 @@ ARG BASE_TAG # Tag applied to this image -ENV PY_TAG +ARG PY_TAG +ENV _PY_TAG=$PY_TAG # Base image windows version FROM rez-win-base:$BASE_TAG diff --git a/.github/docker/rez-win-py/entrypoint.ps1 b/.github/docker/rez-win-py/entrypoint.ps1 index 7a9cb5b54..9f42087fa 100644 --- a/.github/docker/rez-win-py/entrypoint.ps1 +++ b/.github/docker/rez-win-py/entrypoint.ps1 @@ -14,7 +14,7 @@ ${ENV:PYTHONIOENCODING} = "UTF-8" # literal image name here, because it just uses 'latest' tagged image (see # explanation in windows-docker-image.yaml - on.push) # -Write-Output "Running rez tests from docker image rez-win-py:${ENV:PY_TAG}" +Write-Output "Using docker image rez-win-py:${ENV:_PY_TAG}" # Verify Python # From b9fff9cb9894bedbd958dbcb91f320eeb1fabdde Mon Sep 17 00:00:00 2001 From: nerdvegas Date: Thu, 23 Dec 2021 12:52:15 +1100 Subject: [PATCH 25/34] https://stackoverflow.com/questions/50452860/error-response-from-daemon-no-build-stage-in-current-context --- .github/docker/rez-win-py/Dockerfile | 6 +++--- .github/workflows/windows-docker-image.yaml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/docker/rez-win-py/Dockerfile b/.github/docker/rez-win-py/Dockerfile index c9aa4f769..c1a704b4a 100644 --- a/.github/docker/rez-win-py/Dockerfile +++ b/.github/docker/rez-win-py/Dockerfile @@ -3,13 +3,13 @@ # Tag of base image to use ARG BASE_TAG +# Base image windows version +FROM rez-win-base:$BASE_TAG + # Tag applied to this image ARG PY_TAG ENV _PY_TAG=$PY_TAG -# Base image windows version -FROM rez-win-base:$BASE_TAG - # NOTE: Any " requires \" in the Dockerfile for windows. # NOTE: The order matters. ARG after the shell command will allow access via # the PowerShell environment like ${ENV:PYTHON_VERSION}. diff --git a/.github/workflows/windows-docker-image.yaml b/.github/workflows/windows-docker-image.yaml index eeefcae0b..de08ac5f5 100644 --- a/.github/workflows/windows-docker-image.yaml +++ b/.github/workflows/windows-docker-image.yaml @@ -180,8 +180,8 @@ jobs: docker build ` --tag ${docker_image} ` --build-arg PYTHON_VERSION="${{ matrix.python-version }}" ` - --build-arg BASE_TAG=${last_docker_base_rev} ` - --build-arg PY_TAG=${last_docker_py_rev} ` + --build-arg BASE_TAG="${last_docker_base_rev}" ` + --build-arg PY_TAG="${last_docker_py_rev}" ` . Write-Output "Pushing DockerHub image ${docker_image}..." From 7d68ba8360b362823f597dc7503cedc0c42d83f1 Mon Sep 17 00:00:00 2001 From: nerdvegas Date: Fri, 24 Dec 2021 07:57:51 +1100 Subject: [PATCH 26/34] force windows workflow run --- .github/workflows/windows.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/windows.yaml b/.github/workflows/windows.yaml index 9e1e383d0..4c400c865 100644 --- a/.github/workflows/windows.yaml +++ b/.github/workflows/windows.yaml @@ -49,3 +49,4 @@ jobs: run: | ${docker_image} = "nerdvegas/rez-win-py-${{ matrix.python-version }}" docker run --mount type=bind,src=$pwd,dst=C:\checkout,readonly ${docker_image}:latest + From 5aff96b41ff151c8a1a4a8e096e0e367305ec1d7 Mon Sep 17 00:00:00 2001 From: nerdvegas Date: Fri, 24 Dec 2021 08:44:15 +1100 Subject: [PATCH 27/34] -test trigger of win-img and win workflow at same time -some formatting improvements -added some more verbosity --- .github/docker/rez-win-py/Dockerfile | 16 ++++++++-------- .github/workflows/windows-docker-image.yaml | 2 +- .github/workflows/windows.yaml | 1 - 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/.github/docker/rez-win-py/Dockerfile b/.github/docker/rez-win-py/Dockerfile index c1a704b4a..8f491926b 100644 --- a/.github/docker/rez-win-py/Dockerfile +++ b/.github/docker/rez-win-py/Dockerfile @@ -27,14 +27,14 @@ ARG PYTHON_VERSION # Python 2.x uses msi while 3.x has an exe with separate arguments # Verifies the installation by running python explicitly and via `python` # -RUN ${PYTHON_INSTALL_PATH} = 'C:\Python'; ` - ${PYTHON_MAJOR_VERSION} = ${ENV:PYTHON_VERSION}.Split('.')[0]; ` - if (${PYTHON_MAJOR_VERSION} -eq "2") { ` - ${INSTALLARGS} = \"'/qn /norestart ADDLOCAL=ALL ALLUSERS=1 TARGETDIR=`\"\" + ${PYTHON_INSTALL_PATH} + \"`\"'\"; ` - } else { ` - ${INSTALLARGS} = \"'/quiet InstallAllUsers=1 PrependPath=1 TargetDir=`\"\" + ${PYTHON_INSTALL_PATH} + \"`\"'\"; ` - } ` - choco install python${PYTHON_MAJOR_VERSION} --yes --version=\"${ENV:PYTHON_VERSION}\" --override --installargs=${INSTALLARGS}; ` +RUN ${PYTHON_INSTALL_PATH} = 'C:\Python'; ` + ${PYTHON_MAJOR_VERSION} = ${ENV:PYTHON_VERSION}.Split('.')[0]; ` + if (${PYTHON_MAJOR_VERSION} -eq "2") { ` + ${INSTALLARGS} = \"'/qn /norestart ADDLOCAL=ALL ALLUSERS=1 TARGETDIR=`\"\" + ${PYTHON_INSTALL_PATH} + \"`\"'\"; ` + } else { ` + ${INSTALLARGS} = \"'/quiet InstallAllUsers=1 PrependPath=1 TargetDir=`\"\" + ${PYTHON_INSTALL_PATH} + \"`\"'\"; ` + } ` + choco install python${PYTHON_MAJOR_VERSION} --yes --version=\"${ENV:PYTHON_VERSION}\" --override --installargs=${INSTALLARGS}; ` if (-not $?) {exit 1}; # ------------------------------------------------------------------------------------------------------------ diff --git a/.github/workflows/windows-docker-image.yaml b/.github/workflows/windows-docker-image.yaml index de08ac5f5..1ea26c03e 100644 --- a/.github/workflows/windows-docker-image.yaml +++ b/.github/workflows/windows-docker-image.yaml @@ -176,7 +176,7 @@ jobs: if ($LastExitCode -ne 0) { cd .github\docker\rez-win-py - Write-Output "Building DockerHub image ${docker_image}..." + Write-Output "Building DockerHub image ${docker_image} from rez-win-base:${last_docker_base_rev}..." docker build ` --tag ${docker_image} ` --build-arg PYTHON_VERSION="${{ matrix.python-version }}" ` diff --git a/.github/workflows/windows.yaml b/.github/workflows/windows.yaml index 4c400c865..9e1e383d0 100644 --- a/.github/workflows/windows.yaml +++ b/.github/workflows/windows.yaml @@ -49,4 +49,3 @@ jobs: run: | ${docker_image} = "nerdvegas/rez-win-py-${{ matrix.python-version }}" docker run --mount type=bind,src=$pwd,dst=C:\checkout,readonly ${docker_image}:latest - From e65c37e4a931ad43f4e6c2588573484cf3a1eb12 Mon Sep 17 00:00:00 2001 From: nerdvegas Date: Fri, 24 Dec 2021 09:15:20 +1100 Subject: [PATCH 28/34] force windows run, just validating that correct image is used --- .github/workflows/windows.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/windows.yaml b/.github/workflows/windows.yaml index 9e1e383d0..4c400c865 100644 --- a/.github/workflows/windows.yaml +++ b/.github/workflows/windows.yaml @@ -49,3 +49,4 @@ jobs: run: | ${docker_image} = "nerdvegas/rez-win-py-${{ matrix.python-version }}" docker run --mount type=bind,src=$pwd,dst=C:\checkout,readonly ${docker_image}:latest + From 7c7344e11b130b52852b140143d59b9fff2e978e Mon Sep 17 00:00:00 2001 From: nerdvegas Date: Fri, 24 Dec 2021 09:29:13 +1100 Subject: [PATCH 29/34] use pytest in windows rez-selftest run --- .github/docker/rez-win-py/entrypoint.ps1 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/docker/rez-win-py/entrypoint.ps1 b/.github/docker/rez-win-py/entrypoint.ps1 index 9f42087fa..59bd2a4e4 100644 --- a/.github/docker/rez-win-py/entrypoint.ps1 +++ b/.github/docker/rez-win-py/entrypoint.ps1 @@ -40,6 +40,9 @@ mkdir build python .\checkout\install.py build if (-not $?) {exit 1} +# Install pytest for better rez-selftest output +.\build\Scripts\rez\rez-python -m pip install pytest-cov + # Run Rez Tests # .\build\Scripts\rez\rez-selftest.exe From e4644ece47045e2b8125d7755408136d95b7fd93 Mon Sep 17 00:00:00 2001 From: nerdvegas Date: Fri, 24 Dec 2021 09:50:34 +1100 Subject: [PATCH 30/34] force windows run --- .github/workflows/windows.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/windows.yaml b/.github/workflows/windows.yaml index 4c400c865..9e1e383d0 100644 --- a/.github/workflows/windows.yaml +++ b/.github/workflows/windows.yaml @@ -49,4 +49,3 @@ jobs: run: | ${docker_image} = "nerdvegas/rez-win-py-${{ matrix.python-version }}" docker run --mount type=bind,src=$pwd,dst=C:\checkout,readonly ${docker_image}:latest - From cb571aad1810d42c8a0327746f857f1f816f4bba Mon Sep 17 00:00:00 2001 From: nerdvegas Date: Fri, 24 Dec 2021 11:04:54 +1100 Subject: [PATCH 31/34] set correct master branch restriction in win-docker-img workflow --- .github/workflows/windows-docker-image.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/windows-docker-image.yaml b/.github/workflows/windows-docker-image.yaml index 1ea26c03e..5e66b9cf8 100644 --- a/.github/workflows/windows-docker-image.yaml +++ b/.github/workflows/windows-docker-image.yaml @@ -33,11 +33,12 @@ on: # can't use workflow dependencies either (see 'workflow_run' github actions # event) because that causes a workflow to run _only when_ another workflow # has completed - however we only want to rebuild the image when required, - # not every time. Github needs to add a way to "run workflow B _after_ workflow - # A, _if_ A was triggered, otherwise run B regardless." + # not every time the windows workflow runs. Github needs to add a way to + # "run workflow B _after_ workflow A, _if_ A was triggered, otherwise run B + # regardless." # branches: - - issue_1181-win-docker # TEMP1 + - master paths: - '.github/docker/rez-win-base/**' - '.github/docker/rez-win-py/**' From f87374b69140eff876700d07663731fddafc70d0 Mon Sep 17 00:00:00 2001 From: nerdvegas Date: Fri, 24 Dec 2021 11:25:47 +1100 Subject: [PATCH 32/34] exclude data files from flake8 workflow trigger --- .github/workflows/flake8.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/flake8.yaml b/.github/workflows/flake8.yaml index 61c80223c..29535f246 100644 --- a/.github/workflows/flake8.yaml +++ b/.github/workflows/flake8.yaml @@ -5,11 +5,13 @@ on: - 'src/**.py' - '.github/workflows/flake8.yaml' - '!src/rez/utils/_version.py' + - '!src/rez/data/**' push: paths: - 'src/**.py' - '.github/workflows/flake8.yaml' - '!src/rez/utils/_version.py' + - '!src/rez/data/**' jobs: lint: From 63ddafdf8fd21fdaac06f1be191cc039ff4e2df0 Mon Sep 17 00:00:00 2001 From: nerdvegas Date: Sat, 15 Jan 2022 14:28:09 +1100 Subject: [PATCH 33/34] better path exclusion for flake8 workflow --- .github/workflows/flake8.yaml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/flake8.yaml b/.github/workflows/flake8.yaml index 29535f246..496cf27a7 100644 --- a/.github/workflows/flake8.yaml +++ b/.github/workflows/flake8.yaml @@ -8,10 +8,13 @@ on: - '!src/rez/data/**' push: paths: - - 'src/**.py' + - 'src/rez/**.py' + - 'src/rezplugins/**.py' - '.github/workflows/flake8.yaml' - '!src/rez/utils/_version.py' - '!src/rez/data/**' + - '!src/rez/vendor/**' + - '!src/rez/backport/**' jobs: lint: @@ -34,11 +37,11 @@ jobs: - name: Run flake8 run: >- find -name '*.py' - -not -path './build_utils/*' -not -path './rez/vendor/*' -not -path './rez/data/*' - -not -path './support/*' -not -path './rez/backport/*' + -not -path './build_utils/*' + -not -path './support/*' -not -path './rezgui/*' | xargs flake8 working-directory: src From 8ec37988c9a5e1aea89caa2c0ad66c954d8a60d2 Mon Sep 17 00:00:00 2001 From: nerdvegas Date: Sat, 15 Jan 2022 14:29:58 +1100 Subject: [PATCH 34/34] paste fix --- .github/workflows/flake8.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/flake8.yaml b/.github/workflows/flake8.yaml index 496cf27a7..99bab985a 100644 --- a/.github/workflows/flake8.yaml +++ b/.github/workflows/flake8.yaml @@ -2,10 +2,13 @@ name: flake8 on: pull_request: paths: - - 'src/**.py' + - 'src/rez/**.py' + - 'src/rezplugins/**.py' - '.github/workflows/flake8.yaml' - '!src/rez/utils/_version.py' - '!src/rez/data/**' + - '!src/rez/vendor/**' + - '!src/rez/backport/**' push: paths: - 'src/rez/**.py'