-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #862 from rstudio/workbench-session-init
Add Workbench session init container image
- Loading branch information
Showing
15 changed files
with
206 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
FROM ubuntu:22.04 AS build | ||
|
||
# Install required tools: | ||
# - ca-certificates installs necessary certificates to use cURL with HTTPS websites | ||
# - curl is used to download the runtime tar.gz | ||
ARG DEBIAN_FRONTEND=noninteractive | ||
RUN apt-get update && \ | ||
apt-get install -y --no-install-recommends ca-certificates curl && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
ARG RSW_VERSION=2024.09.0+375.pro3 | ||
|
||
SHELL ["/bin/bash", "-o", "pipefail", "-c"] | ||
RUN mkdir -p /pwb-staging && \ | ||
RSW_VERSION_URL=$(echo -n "${RSW_VERSION}" | sed 's/+/-/g') && \ | ||
echo "Downloading https://s3.amazonaws.com/rstudio-ide-build/session/multi/x86_64/rsp-session-multi-linux-${RSW_VERSION_URL}-x86_64.tar.gz" && \ | ||
curl -fsSL -o /pwb-staging/rsp-session-multi-linux.tar.gz "https://s3.amazonaws.com/rstudio-ide-build/session/multi/x86_64/rsp-session-multi-linux-${RSW_VERSION_URL}-x86_64.tar.gz" && \ | ||
mkdir -p /opt/session-components && \ | ||
tar -C /opt/session-components -xf /pwb-staging/rsp-session-multi-linux.tar.gz && \ | ||
chmod -R 755 /opt/session-components && \ | ||
rm -rf /pwb-staging | ||
|
||
COPY --chmod=755 run.sh /usr/local/bin/run.sh | ||
|
||
ENTRYPOINT ["/usr/local/bin/run.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# 2024.11.0 | ||
|
||
- Add NEWS.md | ||
- Add daily builds |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# Posit Workbench Session Init Container | ||
|
||
This directory contains a Dockerfile and script that will create an init container to copy session runtime components from a release package into a target mount directory. This init container can be used to pull the session runtime components into another base sesssion image, which can then be used to run Workbench sessions. | ||
|
||
## Quick reference | ||
|
||
* Maintained by: [the Posit Docker team](https://github.com/rstudio/rstudio-docker-products) | ||
* Where to get help: [our Github Issues page](https://github.com/rstudio/rstudio-docker-products/issues) | ||
* Posit Workbench image: [Docker Hub](https://hub.docker.com/r/rstudio/rstudio-workbench) | ||
* RStudio r-session-complete image: [Docker Hub](https://hub.docker.com/r/rstudio/r-session-complete) | ||
* Workbench Session Init image (Daily/Preview): [Docker Hub](https://hub.docker.com/r/rstudio/rstudio-workbench-session-init-preview) | ||
|
||
## Supported tags and respective Dockerfile links | ||
|
||
* [`jammy-daily`, `ubuntu2204-daily`, `jammy-2024.11.0`, `ubuntu2204-2024.11.0`](https://github.com/rstudio/rstudio-docker-products/blob/main/workbench-session-init/Dockerfile.2204) | ||
|
||
## Building | ||
|
||
Currently daily builds are supported. To build the image, run: | ||
|
||
```console | ||
just preview-bake workbench-session-init-daily | ||
``` | ||
|
||
## Testing | ||
|
||
You can observe what gets copied by the container: | ||
|
||
```console | ||
mkdir init | ||
docker run --rm -v $(pwd)/init:/mnt/init rstudio/workbench-session-init-preview:workbench-session-init-jammy-2024.11.0-daily-328.pro3 | ||
# The init directory has been populated with the Workbench session runtime components. | ||
``` | ||
|
||
You can also test using GOSS: | ||
|
||
```console | ||
just preview-test workbench-session-init-daily | ||
``` | ||
|
||
## Licensing | ||
|
||
The license associated with the RStudio Docker Products repository is located [in LICENSE.md](https://github.com/rstudio/rstudio-docker-products/blob/main/LICENSE.md). | ||
|
||
As is the case with all container images, the images themselves also contain other software which may be under other | ||
licenses (i.e. bash, linux, system libraries, etc., along with any other direct or indirect dependencies of the primary | ||
software being contained). | ||
|
||
It is an image user's responsibility to ensure that use of this image (and any of its dependent layers) complies with | ||
all relevant licenses for the software contained in the image. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
set -x | ||
|
||
S=/opt/session-components | ||
|
||
# The target should exist and be an empty directory. | ||
T=/mnt/init | ||
|
||
if [ ! -d "${T}" ] ; then | ||
echo "Cannot find the copy target ${T}" | ||
exit 1 | ||
fi | ||
|
||
echo "Copying files from /session-components to /mnt/init" | ||
time cp -r $S/* $T |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package: | ||
curl: | ||
installed: true | ||
|
||
file: | ||
/opt/session-components/: | ||
exists: true | ||
mode: "0755" | ||
filetype: directory | ||
/usr/local/bin/run.sh: | ||
exists: true | ||
filetype: file | ||
mode: "0755" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash | ||
|
||
# install goss | ||
GOSS_FILE=${GOSS_FILE:-/test/goss.yaml} | ||
GOSS_VERSION=${GOSS_VERSION:-0.4.6} | ||
GOSS_MAX_CONCURRENT=${GOSS_MAX_CONCURRENT:-50} | ||
|
||
if [ -f /etc/debian_version ]; then | ||
OS="ubuntu" | ||
else | ||
echo "OS not supported. Exiting" | ||
exit 1 | ||
fi | ||
|
||
# install goss to tmp location and make executable | ||
curl -fsSL https://github.com/aelsabbahy/goss/releases/download/v$GOSS_VERSION/goss-linux-amd64 -o /tmp/goss \ | ||
&& chmod +x /tmp/goss \ | ||
&& GOSS=/tmp/goss | ||
|
||
OS=$OS GOSS_FILE=$GOSS_FILE $GOSS v --format documentation --max-concurrent $GOSS_MAX_CONCURRENT |