-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Workbench session init container image #862
Changes from 6 commits
d340c7a
24c341f
9a68a9d
c8690ca
751a5bf
86425f9
aa7efaf
0fc9649
246e0b1
ea9e1be
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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-${RSW_VERSION_URL}-x86_64.tar.gz" && \ | ||
curl -fsSL -o /pwb-staging/rsp-session-multi.tar.gz "https://s3.amazonaws.com/rstudio-ide-build/session/multi/x86_64/rsp-session-multi-${RSW_VERSION_URL}-x86_64.tar.gz" && \ | ||
skyeturriff marked this conversation as resolved.
Show resolved
Hide resolved
|
||
mkdir -p /opt/session-components && \ | ||
tar -C /opt/session-components -xf /pwb-staging/rsp-session-multi.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"] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# 2024.11.0 | ||
|
||
- Add NEWS.md | ||
- Add daily builds |
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. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
skyeturriff marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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 |
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 | ||
Comment on lines
+6
to
+9
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If there are specific session component files, we should probably check for them here. If we want to check the indivdual contents of a tarfile that was added to the container, we could use a command block, running There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ooh, I think the issue here is the tarball gets cleaned up in the last line of the Dockerfile |
||
/usr/local/bin/run.sh: | ||
exists: true | ||
filetype: file | ||
mode: "0755" |
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to specify the version for products we aren't building in the workflow?
I don't yet fully understand if all bake targets require all these env vars.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ianpittwood This is really a question for you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah. It's a bake limitation. It doesn't handle null values on build variables even if they're not part of the specified targets.