Skip to content

Commit

Permalink
Merge branch 'dev' into sj/python
Browse files Browse the repository at this point in the history
  • Loading branch information
shepherdjerred authored Nov 20, 2023
2 parents 12ffdc6 + 641b44c commit f9f3b76
Show file tree
Hide file tree
Showing 7 changed files with 122 additions and 104 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/build-manual.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,14 @@ jobs:
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
ARGS_CMD=""
USE_S3_DOWNLOAD_URL=""
VERSION_OVERRIDES=""
if [[ "${{inputs.os}}" == "centos7" ]]; then
# FIXME(ianpittwood): This is probably a silly way of doing this. We don't have CentOS builds for later
# Python versions so we need to override them. This is done via matrix in the release CI
# but we don't have that here. We're also limited by the 10 input cap so these can't be
# passed by the user alongside R versions as I would've liked to do.
VERSION_OVERRIDES="PYTHON_VERSION=3.9.14 PYTHON_VERSION_ALT=3.8.15"
fi
if [[ "${{ inputs.type }}" == "release" ]]; then
ARGS_CMD="get-product-args"
if [[ "${{ inputs.use_s3_download_url }}" == "true" ]]; then
Expand All @@ -105,6 +113,7 @@ jobs:
fi
BUILD_ARGS=$( \
just -f ci.Justfile \
${VERSION_OVERRIDES} \
${ARGS_CMD} \
${{ inputs.product }} \
${{ inputs.os }} \
Expand Down
94 changes: 0 additions & 94 deletions .github/workflows/build-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -357,97 +357,3 @@ jobs:
gcp-json: '${{ secrets.GCP_ARTIFACT_REGISTRY_JSON }}'

# End retry logic

build-workbench-for-google-cloud-workstations:
needs: [ build-base, build-base-pro ]
runs-on: ubuntu-latest
name: build-workbench-for-google-cloud-workstations

permissions:
contents: read
packages: write

concurrency:
group: build-products-${{ matrix.config.product }}-${{ matrix.config.os }}-${{ github.ref }}
cancel-in-progress: true

steps:
- name: Check Out Repo - cron main
if: github.event.schedule == '0 12 * * 1'
uses: actions/checkout@v3
with:
ref: main

- name: Check Out Repo
if: github.event.schedule != '0 12 * * 1'
uses: actions/checkout@v3

- name: Set up Just
uses: extractions/setup-just@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Get Version
id: get-version
run: |
VERSION=$(just workbench-for-google-cloud-workstations/get-version)
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
- name: Get build args
id: get-build-args
run: |
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
BUILD_ARGS=$(just workbench-for-google-cloud-workstations/get-build-args)
echo "BUILD_ARGS<<$EOF" >> $GITHUB_OUTPUT
echo "$BUILD_ARGS" >> $GITHUB_OUTPUT
echo "$EOF" >> $GITHUB_OUTPUT
- name: Get tags
id: get-tags
run: |
IMAGE_TAGS=$(just workbench-for-google-cloud-workstations/get-build-tags)
echo "IMAGE_TAGS=$IMAGE_TAGS" >> $GITHUB_OUTPUT
- name: Build/Test/Scan/Push base pro image
id: build1
uses: ./.github/actions/build-test-scan-push
continue-on-error: true
with:
context: ./workbench-for-google-cloud-workstations
os: ubuntu2004
product: workbench-for-google-cloud-workstations
image-tags: ${{ steps.get-tags.outputs.IMAGE_TAGS }}
build-args: ${{ steps.get-build-args.outputs.BUILD_ARGS }}
push-image: ${{ github.ref == 'refs/heads/main' || github.event.schedule == '0 12 * * 1' }}
snyk-token: ${{ secrets.SNYK_TOKEN }}
snyk-org-id: ${{ secrets.SNYK_ORG_ID }}
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 }}'

# Begin retry logic

- name: Wait 60s on failure before retrying
if: steps.build1.outcome == 'failure'
run: sleep 60

- name: Retry - Build/Test/Scan/Push base pro image
id: build2
if: steps.build1.outcome == 'failure'
uses: ./.github/actions/build-test-scan-push
with:
context: ./workbench-for-google-cloud-workstations
os: ubuntu2004
product: workbench-for-google-cloud-workstations
image-tags: ${{ steps.get-tags.outputs.IMAGE_TAGS }}
build-args: ${{ steps.get-build-args.outputs.BUILD_ARGS }}
push-image: ${{ github.ref == 'refs/heads/main' || github.event.schedule == '0 12 * * 1' }}
snyk-token: ${{ secrets.SNYK_TOKEN }}
snyk-org-id: ${{ secrets.SNYK_ORG_ID }}
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 }}'

# End retry logic
104 changes: 104 additions & 0 deletions .github/workflows/build-workbench-gcw.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
on:
schedule:
- cron: '0 14 * * 1' # If updating this value, be sure to update logic for all `push-image` arguments!
push:
branches:
- main
- dev
- workbench-gcw-push-errors # TODO: remove this branch once we've fixed the push errors
pull_request:

name: Workbench for GCW - Build, Test, Scan, and Push
jobs:
build-workbench-for-google-cloud-workstations:
runs-on: ubuntu-latest
name: build-workbench-for-google-cloud-workstations

permissions:
contents: read
packages: write

concurrency:
group: build-products-${{ matrix.config.product }}-${{ matrix.config.os }}-${{ github.ref }}
cancel-in-progress: true

steps:
- name: Check Out Repo - cron main
if: github.event.schedule == '0 14 * * 1'
uses: actions/checkout@v3
with:
ref: main

- name: Check Out Repo
if: github.event.schedule != '0 14 * * 1'
uses: actions/checkout@v3

- name: Set up Just
uses: extractions/setup-just@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Get Version
id: get-version
run: |
VERSION=$(just workbench-for-google-cloud-workstations/get-version)
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
- name: Get build args
id: get-build-args
run: |
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
BUILD_ARGS=$(just workbench-for-google-cloud-workstations/get-build-args)
echo "BUILD_ARGS<<$EOF" >> $GITHUB_OUTPUT
echo "$BUILD_ARGS" >> $GITHUB_OUTPUT
echo "$EOF" >> $GITHUB_OUTPUT
- name: Get tags
id: get-tags
run: |
IMAGE_TAGS=$(just workbench-for-google-cloud-workstations/get-build-tags)
echo "IMAGE_TAGS=$IMAGE_TAGS" >> $GITHUB_OUTPUT
- name: Build/Test/Scan/Push base pro image
id: build1
uses: ./.github/actions/build-test-scan-push
continue-on-error: true
with:
context: ./workbench-for-google-cloud-workstations
os: ubuntu2004
product: workbench-for-google-cloud-workstations
image-tags: ${{ steps.get-tags.outputs.IMAGE_TAGS }}
build-args: ${{ steps.get-build-args.outputs.BUILD_ARGS }}
push-image: ${{ github.ref == 'refs/heads/main' || github.event.schedule == '0 14 * * 1' || github.ref == 'refs/heads/workbench-gcw-push-errors' }}
snyk-token: ${{ secrets.SNYK_TOKEN }}
snyk-org-id: ${{ secrets.SNYK_ORG_ID }}
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 }}'

# Begin retry logic

- name: Wait 60s on failure before retrying
if: steps.build1.outcome == 'failure'
run: sleep 60

- name: Retry - Build/Test/Scan/Push base pro image
id: build2
if: steps.build1.outcome == 'failure'
uses: ./.github/actions/build-test-scan-push
with:
context: ./workbench-for-google-cloud-workstations
os: ubuntu2004
product: workbench-for-google-cloud-workstations
image-tags: ${{ steps.get-tags.outputs.IMAGE_TAGS }}
build-args: ${{ steps.get-build-args.outputs.BUILD_ARGS }}
push-image: ${{ github.ref == 'refs/heads/main' || github.event.schedule == '0 14 * * 1' || github.ref == 'refs/heads/workbench-gcw-push-errors' }}
snyk-token: ${{ secrets.SNYK_TOKEN }}
snyk-org-id: ${{ secrets.SNYK_ORG_ID }}
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 }}'

# End retry logic
5 changes: 4 additions & 1 deletion package-manager/NEWS.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
# 2023-11-13
# 2023-11-20
- Add Python
- Update R to 4.2.3
- Deprecate Ubuntu 18.04

# 2023-11-15
- Removed Launcher references. Package manager no longer uses the Job Launcher for building git packages.

# 2023-07-25
- Changed `rstudio-pm.gcfg` R version number behavior from statically defined to dynamically filled on build.

Expand Down
8 changes: 0 additions & 8 deletions package-manager/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,17 +80,9 @@ a persistent volume. The included configuration file expects a persistent volume
orchestration system to be available at `/var/lib/rstudio-pm`. Should you wish to move this to a different path, you can change the
`Server.DataDir` option.

When changing `Server.DataDir` to a custom location, we also recommend setting `Server.LauncherDir`
to a consistent location within `Server.DataDir`, such as `{Server.DataDir}/launcher_internal`.
The default location of `Server.LauncherDir` depends on the container's hostname, which may be
different each time the container restarts.

```ini
[Server]
DataDir = /mnt/rspm/data
; Use a consistent location for the Launcher directory. The default location
; is based on the hostname, and the hostname may be different in each container.
LauncherDir = /mnt/rspm/data/launcher_internal
```

### Licensing
Expand Down
4 changes: 4 additions & 0 deletions r-session-complete/Dockerfile.centos7
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ RUN yum install -y subversion \
&& yum clean all \
&& rm -rf /var/lib/rstudio-server/r-versions

COPY maybe_install_vs_code.sh /tmp/maybe_install_vs_code.sh
RUN /tmp/maybe_install_vs_code.sh \
&& rm /tmp/maybe_install_vs_code.sh

RUN /opt/python/"${PYTHON_VERSION}"/bin/pip3 install \
jupyter \
jupyterlab=="${JUPYTERLAB_VERSION}" \
Expand Down
2 changes: 1 addition & 1 deletion workbench-for-google-cloud-workstations/Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ get-build-args:
get-build-tags:
#!/usr/bin/env bash
set -eu
regions=("us" "asia" "europe" "us-central-1")
regions=("us-central1" "asia" "europe" "us")
tag_array=()
for region in "${regions[@]}"; do
tag_array+=("$region-docker.pkg.dev/posit-images/cloud-workstations/workbench:${RSW_TAG_VERSION}")
Expand Down

0 comments on commit f9f3b76

Please sign in to comment.