From 3db9ce6ddaa07c7cd72b73dd82ab5e9f98f5ee4f Mon Sep 17 00:00:00 2001 From: Ian Pittwood Date: Wed, 10 Apr 2024 08:17:31 -0700 Subject: [PATCH] Update preview builds for new test script --- .github/workflows/build-bake-preview.yaml | 8 +++- build.justfile | 25 +++++++++- docker-bake.preview.hcl | 56 +---------------------- 3 files changed, 31 insertions(+), 58 deletions(-) diff --git a/.github/workflows/build-bake-preview.yaml b/.github/workflows/build-bake-preview.yaml index 75ce7c6de..0d76a3ddf 100644 --- a/.github/workflows/build-bake-preview.yaml +++ b/.github/workflows/build-bake-preview.yaml @@ -76,7 +76,13 @@ jobs: push: false files: docker-bake.preview.hcl - - name: Test Connect (privileged container) + - name: Test + env: + WORKBENCH_DAILY_VERSION: ${{ steps.get-version.outputs.WORKBENCH_DAILY_VERSION }} + WORKBENCH_PREVIEW_VERSION: ${{ steps.get-version.outputs.WORKBENCH_PREVIEW_VERSION }} + PACKAGE_MANAGER_DAILY_VERSION: ${{ steps.get-version.outputs.PACKAGE_MANAGER_DAILY_VERSION }} + CONNECT_DAILY_VERSION: ${{ steps.get-version.outputs.CONNECT_DAILY_VERSION }} + BRANCH: ${{ github.head_ref || github.ref_name }} run: | just -f build.justfile preview-test diff --git a/build.justfile b/build.justfile index 79808b3d3..885930a61 100755 --- a/build.justfile +++ b/build.justfile @@ -51,12 +51,33 @@ preview-build branch="$(git branch --show-current)": PACKAGE_MANAGER_DAILY_VERSION=$(just -f ci.Justfile get-version package-manager --type=daily --local) \ CONNECT_DAILY_VERSION=$(just -f ci.Justfile get-version connect --type=daily --local) \ BRANCH="{{branch}}" \ - just -f {{justfile()}} bake preview-build + just -f {{justfile()}} preview-bake build # Run tests test: python3 {{justfile_directory()}}/tools/test_bake_artifacts.py -preview-test: +preview-test branch="$(git branch --show-current)": + #!/bin/bash + if [ -z "$WORKBENCH_DAILY_VERSION" ]; then + WORKBENCH_DAILY_VERSION=$(just -f ci.Justfile get-version workbench --type=daily --local) + fi + if [ -z "$WORKBENCH_PREVIEW_VERSION" ]; then + WORKBENCH_PREVIEW_VERSION=$(just -f ci.Justfile get-version workbench --type=preview --local) + fi + if [ -z "$PACKAGE_MANAGER_DAILY_VERSION" ]; then + PACKAGE_MANAGER_DAILY_VERSION=$(just -f ci.Justfile get-version package-manager --type=daily --local) + fi + if [ -z "$CONNECT_DAILY_VERSION" ]; then + CONNECT_DAILY_VERSION=$(just -f ci.Justfile get-version connect --type=daily --local) + fi + if [ -z "$BRANCH" ]; then + BRANCH="{{branch}}" + fi + WORKBENCH_DAILY_VERSION="${WORKBENCH_DAILY_VERSION}" \ + WORKBENCH_PREVIEW_VERSION="${WORKBENCH_PREVIEW_VERSION}" \ + PACKAGE_MANAGER_DAILY_VERSION="${PACKAGE_MANAGER_DAILY_VERSION}" \ + CONNECT_DAILY_VERSION="${CONNECT_DAILY_VERSION}" \ + BRANCH="${BRANCH}" \ python3 {{justfile_directory()}}/tools/test_bake_artifacts.py --file docker-bake.preview.hcl diff --git a/docker-bake.preview.hcl b/docker-bake.preview.hcl index 55ee13a24..3f143abd6 100644 --- a/docker-bake.preview.hcl +++ b/docker-bake.preview.hcl @@ -225,7 +225,7 @@ target "base" { labels = { "maintainer" = "Posit Docker " } - output = ["type=image"] + output = ["type=image", "type=docker"] } target "product-base-dev" { @@ -238,12 +238,6 @@ target "product-base-dev" { "docker.io/rstudio/product-base-dev:${builds.os}-r${builds.r_primary}_${builds.r_alternate}-py${builds.py_primary}_${builds.py_alternate}", ] - # We output to an OCI so it can be pulled in for testing later on. - output = [ - "type=image", - "type=oci,tar=false,dest=./.out/preview/product-base-dev-${builds.os}-r${replace(builds.r_primary, ".", "-")}_${replace(builds.r_alternate, ".", "-")}-py${replace(builds.py_primary, ".", "-")}_${replace(builds.py_alternate, ".", "-")}" - ] - dockerfile = "Dockerfile.${builds.os}" context = "product/base" @@ -268,12 +262,6 @@ target "product-base-pro-dev" { "docker.io/rstudio/product-base-pro-dev:${builds.os}-r${builds.r_primary}_${builds.r_alternate}-py${builds.py_primary}_${builds.py_alternate}", ] - # We output to an OCI so it can be pulled in for testing later on. - output = [ - "type=image", - "type=oci,tar=false,dest=./.out/preview/product-base-pro-dev-${builds.os}-r${replace(builds.r_primary, ".", "-")}_${replace(builds.r_alternate, ".", "-")}-py${replace(builds.py_primary, ".", "-")}_${replace(builds.py_alternate, ".", "-")}" - ] - dockerfile = "Dockerfile.${builds.os}" context = "product/pro" contexts = { @@ -300,12 +288,6 @@ target "package-manager-daily" { name = "package-manager-daily-${builds.os}-${replace(PACKAGE_MANAGER_DAILY_VERSION, ".", "-")}" tags = get_tags(builds.os, "rstudio-package-manager-preview", PACKAGE_MANAGER_DAILY_VERSION, "daily") - # We output to an OCI so it can be pulled in for testing later on. - output = [ - "type=image", - "type=oci,tar=false,dest=./.out/preview/package-manager-daily-${builds.os}-${replace(PACKAGE_MANAGER_DAILY_VERSION, ".", "-")}" - ] - dockerfile = "Dockerfile.${builds.os}" context = "package-manager" contexts = { @@ -330,12 +312,6 @@ target "connect-daily" { name = "connect-daily-${builds.os}-${replace(tag_safe_version(CONNECT_DAILY_VERSION), ".", "-")}" tags = get_tags(builds.os, "rstudio-connect-preview", CONNECT_DAILY_VERSION, "daily") - # We output to an OCI so it can be pulled in for testing later on. - output = [ - "type=image", - "type=oci,tar=false,dest=./.out/preview/connect-daily-${builds.os}-${replace(tag_safe_version(CONNECT_DAILY_VERSION), ".", "-")}" - ] - dockerfile = "Dockerfile.${builds.os}" context = "connect" contexts = { @@ -359,12 +335,6 @@ target "connect-content-init-daily" { name = "connect-content-init-daily-${builds.os}-${replace(tag_safe_version(CONNECT_DAILY_VERSION), ".", "-")}" tags = get_tags(builds.os, "rstudio-connect-content-init-preview", CONNECT_DAILY_VERSION, "daily") - # We output to an OCI so it can be pulled in for testing later on. - output = [ - "type=image", - "type=oci,tar=false,dest=./.out/preview/connect-content-init-daily-${builds.os}-${replace(tag_safe_version(CONNECT_DAILY_VERSION), ".", "-")}" - ] - dockerfile = "Dockerfile.${builds.os}" context = "connect-content-init" @@ -383,12 +353,6 @@ target "r-session-complete-daily" { name = "r-session-complete-daily-${builds.os}-${replace(tag_safe_version(WORKBENCH_DAILY_VERSION), ".", "-")}" tags = get_tags(builds.os, "r-session-complete-preview", WORKBENCH_DAILY_VERSION, "daily") - # We output to an OCI so it can be pulled in for testing later on. - output = [ - "type=image", - "type=oci,tar=false,dest=./.out/preview/r-session-complete-daily-${builds.os}-${replace(tag_safe_version(WORKBENCH_DAILY_VERSION), ".", "-")}" - ] - dockerfile = "Dockerfile.${builds.os}" context = "r-session-complete" contexts = { @@ -415,12 +379,6 @@ target "r-session-complete-preview" { name = "r-session-complete-preview-${builds.os}-${replace(tag_safe_version(WORKBENCH_PREVIEW_VERSION), ".", "-")}" tags = get_tags(builds.os, "r-session-complete-preview", WORKBENCH_PREVIEW_VERSION, "preview") - # We output to an OCI so it can be pulled in for testing later on. - output = [ - "type=image", - "type=oci,tar=false,dest=./.out/preview/r-session-complete-preview-${builds.os}-${replace(tag_safe_version(WORKBENCH_PREVIEW_VERSION), ".", "-")}" - ] - dockerfile = "Dockerfile.${builds.os}" context = "r-session-complete" contexts = { @@ -446,12 +404,6 @@ target "workbench-daily" { name = "workbench-daily-${builds.os}-${replace(tag_safe_version(WORKBENCH_DAILY_VERSION), ".", "-")}" tags = get_tags(builds.os, "rstudio-workbench-preview", WORKBENCH_DAILY_VERSION, "daily") - # We output to an OCI so it can be pulled in for testing later on. - output = [ - "type=image", - "type=oci,tar=false,dest=./.out/preview/workbench-daily-${builds.os}-${replace(tag_safe_version(WORKBENCH_DAILY_VERSION), ".", "-")}" - ] - dockerfile = "Dockerfile.${builds.os}" context = "workbench" contexts = { @@ -477,12 +429,6 @@ target "workbench-preview" { name = "workbench-preview-${builds.os}-${replace(tag_safe_version(WORKBENCH_PREVIEW_VERSION), ".", "-")}" tags = get_tags(builds.os, "rstudio-workbench-preview", WORKBENCH_PREVIEW_VERSION, "preview") - # We output to an OCI so it can be pulled in for testing later on. - output = [ - "type=image", - "type=oci,tar=false,dest=./.out/preview/workbench-preview-${builds.os}-${replace(tag_safe_version(WORKBENCH_PREVIEW_VERSION), ".", "-")}" - ] - dockerfile = "Dockerfile.${builds.os}" context = "workbench" contexts = {