Skip to content

Commit

Permalink
Add workbench session target/matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
zachhannum committed Nov 19, 2024
1 parent f184da8 commit 5d9c081
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 1 deletion.
42 changes: 42 additions & 0 deletions .github/workflows/build-bake.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,48 @@ jobs:
snyk-org: ${{ secrets.SNYK_ORG }}
snyk-token: '${{ secrets.SNYK_TOKEN }}'

workbench-session:
needs: [setup]
name: Workbench Session
runs-on: ubuntu-latest-8x

concurrency:
group: bake-workbench-session-${{ github.ref }}
cancel-in-progress: true

env:
target: workbench-session
GIT_SHA: ${{ needs.setup.outputs.GIT_SHA }}

steps:
- name: Checkout
if: github.event_name == 'schedule'
uses: actions/checkout@v4
with:
ref: 'main'

- name: Checkout
if: github.event_name != 'schedule'
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
id: setup-buildx
with:
buildkitd-config: ./share/buildkitd.toml

- name: Build, Test, and Push
uses: ./.github/actions/bake-test-push
with:
target: ${{ env.target }}
push-image: ${{ github.ref == 'refs/heads/main' || github.event_name == 'schedule' }}
ghcr-token: ${{ secrets.GITHUB_TOKEN }}
dockerhub-username: ${{ secrets.DOCKER_HUB_USERNAME }}
dockerhub-token: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
gcp-json: '${{ secrets.GCP_ARTIFACT_REGISTRY_JSON }}'
snyk-org: ${{ secrets.SNYK_ORG }}
snyk-token: '${{ secrets.SNYK_TOKEN }}'

workbench-session-init:
needs: [setup, versions]
name: Workbench Session Init
Expand Down
30 changes: 30 additions & 0 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,10 @@ variable WORKBENCH_BUILD_MATRIX {
}
}

variable WORKBENCH_SESSION_MATRIX {
default = PRO_BUILD_MATRIX
}

variable WORKBENCH_SESSION_INIT_BUILD_MATRIX {
default = {
builds = [
Expand Down Expand Up @@ -221,6 +225,7 @@ group "default" {
"package-manager",
"r-session-complete",
"workbench",
"workbench-session",
"workbench-session-init",
]
}
Expand Down Expand Up @@ -441,6 +446,31 @@ target "r-session-complete" {
}
}

target "workbench-session" {
inherits = ["base"]
name = "workbench-session-${builds.os}-r${replace(builds.r_primary, ".", "-")}_${replace(builds.r_alternate, ".", "-")}-py${replace(builds.py_primary, ".", "-")}_${replace(builds.py_alternate, ".", "-")}"

tags = [
"ghcr.io/rstudio/workbench-session:${builds.os}-r${builds.r_primary}_${builds.r_alternate}-py${builds.py_primary}_${builds.py_alternate}",
"docker.io/rstudio/workbench-session:${builds.os}-r${builds.r_primary}_${builds.r_alternate}-py${builds.py_primary}_${builds.py_alternate}",
]

dockerfile = "Dockerfile.${builds.os}"
context = "workbench-session"
contexts = {
product-base-pro = "target:product-base-pro-${builds.os}-r${replace(builds.r_primary, ".", "-")}_${replace(builds.r_alternate, ".", "-")}-py${replace(builds.py_primary, ".", "-")}_${replace(builds.py_alternate, ".", "-")}"
}

matrix = BASE_BUILD_MATRIX
args = {
R_VERSION = builds.r_primary
R_VERSION_ALT = builds.r_alternate
PYTHON_VERSION = builds.py_primary
PYTHON_VERSION_ALT = builds.py_alternate
JUPYTERLAB_VERSION = DEFAULT_JUPYTERLAB_VERSION
}
}

target "workbench" {
inherits = ["base"]

Expand Down
2 changes: 1 addition & 1 deletion workbench-session/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ We provide simple ways to extend and build the Dockerfiles. After you have clone
## Overview

Built images are available from the
[rstudio/r-session-complete](https://hub.docker.com/r/rstudio/r-session-complete)
[rstudio/workbench-session](https://hub.docker.com/r/rstudio/workbench-session)
repository on Docker Hub.

These images include the following layers:
Expand Down

0 comments on commit 5d9c081

Please sign in to comment.