Skip to content

Commit

Permalink
Add option to force using S3 for binary downloads (workbench)
Browse files Browse the repository at this point in the history
  • Loading branch information
ianpittwood committed Nov 8, 2023
1 parent cee0ad5 commit fab452b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
10 changes: 10 additions & 0 deletions .github/workflows/build-manual.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ on:
- preview
- daily
- release
use_s3_download_url:
description: "Force build to download binaries directly from S3 where applicable."
required: false
default: false
type: boolean
version:
description: "The version to build. Use 'auto' to target the latest build."
required: false
Expand Down Expand Up @@ -89,8 +94,12 @@ jobs:
run: |
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
ARGS_CMD=""
USE_S3_DOWNLOAD_URL=""
if [[ "${{ inputs.type }}" == "release" ]]; then
ARGS_CMD="get-product-args"
if [[ "${{ inputs.use_s3_download_url }}" == "true" ]]; then
USE_S3_DOWNLOAD_URL="${{ inputs.use_s3_download_url }}"
fi
else
ARGS_CMD="get-prerelease-args ${{inputs.type}}"
fi
Expand All @@ -100,6 +109,7 @@ jobs:
${{ inputs.product }} \
${{ inputs.os }} \
${{ steps.get-version.outputs.VERSION }} \
${USE_S3_DOWNLOAD_URL} \
)
echo "BUILD_ARGS<<$EOF" >> $GITHUB_OUTPUT
echo "$BUILD_ARGS" >> $GITHUB_OUTPUT
Expand Down
6 changes: 5 additions & 1 deletion ci.Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,14 @@ get-base-tags $OS $TYPE="base" $BRANCH=`git branch --show`:
ghcr.io/rstudio/${IMAGE_NAME}:${OS}

# just get-product-args connect ubuntu2204 2023.05.0
get-product-args $PRODUCT $OS $VERSION $BRANCH=`git branch --show` $SHA_SHORT=`git rev-parse --short HEAD`:
get-product-args $PRODUCT $OS $VERSION $USE_S3="false" $BRANCH=`git branch --show` $SHA_SHORT=`git rev-parse --short HEAD`:
#!/usr/bin/env bash
set -euxo pipefail

RSW_DOWNLOAD_URL=$(just -f ci.Justfile _get-rsw-download-url release $OS)
if [[ "${USE_S3}" == "true" ]]; then
RSW_DOWNLOAD_URL=$(just -f ci.Justfile _get-rsw-download-url preview $OS)
fi

if [[ $PRODUCT == "workbench" || $PRODUCT == "r-session-complete" || $PRODUCT == "workbench-for-microsoft-azure-ml" ]]; then
SHORT_NAME="RSW"
Expand Down

0 comments on commit fab452b

Please sign in to comment.