-
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 r session debug images #147
Open
colearendt
wants to merge
7
commits into
main
Choose a base branch
from
add-r-session-debug-images
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
878d849
add debug image for bionic
colearendt 6da4eb7
add debug action
colearendt 7cd927a
Merge remote-tracking branch 'origin/add-r-session-images' into add-r…
colearendt 91548a4
add startup.sh script
colearendt 0415592
add startup.sh script to image
colearendt f12a62f
switch to using docker hub for now
colearendt 59734e4
Merge branch 'main' into add-r-session-debug-images
colearendt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,157 @@ | ||
on: | ||
workflow_run: | ||
workflows: | ||
- "Build and Test (latest)" | ||
types: | ||
- completed | ||
|
||
name: Build and Test (debug) | ||
jobs: | ||
|
||
build: | ||
runs-on: ubuntu-latest | ||
name: build-${{ matrix.config.tag_prefix}}${{ matrix.config.product}} | ||
|
||
# beware - several copies of matrix below | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
config: | ||
- {product: 'r-session-debug', tag_prefix: 'bionic-', dir: 'r-session-debug/bionic', prefix: RSP, version: 1.4.1717-3} | ||
- {product: 'r-session-debug', tag_prefix: 'centos7-', dir: 'r-session-debug/centos7', prefix: RSP, version: 1.4.1717-3} | ||
|
||
steps: | ||
- name: Check Out Repo | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Cache Docker layers | ||
uses: actions/cache@v2 | ||
with: | ||
path: /tmp/.buildx-cache | ||
key: ${{ runner.os }}-buildx-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-buildx- | ||
|
||
- name: Build | ||
id: docker_build | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: ./${{ matrix.config.dir }} | ||
file: ./${{ matrix.config.dir }}/Dockerfile | ||
builder: ${{ steps.buildx.outputs.name }} | ||
tags: | | ||
rstudio/${{ matrix.config.product }}:${{ matrix.config.tag_prefix }}latest | ||
rstudio/${{ matrix.config.product }}:${{ matrix.config.tag_prefix }}${{ matrix.config.version }} | ||
ghcr.io/rstudio/${{ matrix.config.product }}:${{ matrix.config.tag_prefix }}latest | ||
ghcr.io/rstudio/${{ matrix.config.product }}:${{ matrix.config.tag_prefix }}${{ matrix.config.version }} | ||
cache-from: type=local,src=/tmp/.buildx-cache | ||
cache-to: type=local,dest=/tmp/.buildx-cache | ||
outputs: type=docker,dest=/tmp/${{ matrix.config.tag_prefix }}${{ matrix.config.product }}-image.tar | ||
push: false | ||
build-args: | | ||
RSP_VERSION=${{ matrix.config.version }} | ||
|
||
- name: Upload artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: ${{ matrix.config.tag_prefix }}${{ matrix.config.product }}-image | ||
path: /tmp/${{ matrix.config.tag_prefix }}${{ matrix.config.product }}-image.tar | ||
|
||
- name: Image digest | ||
run: echo ${{ steps.docker_build.outputs.digest }} | ||
|
||
test: | ||
runs-on: ubuntu-latest | ||
name: test-${{ matrix.config.tag_prefix }}${{ matrix.config.product}} | ||
needs: build | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
config: | ||
- {product: 'r-session-debug', tag_prefix: 'bionic-', dir: 'r-session-debug/bionic', prefix: RSP, version: 1.4.1717-3} | ||
- {product: 'r-session-debug', tag_prefix: 'centos7-', dir: 'r-session-debug/centos7', prefix: RSP, version: 1.4.1717-3} | ||
|
||
steps: | ||
- name: Check Out Repo | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Download artifact | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: ${{ matrix.config.tag_prefix }}${{ matrix.config.product}}-image | ||
path: /tmp | ||
|
||
- name: Load image | ||
run: | | ||
docker load --input /tmp/${{ matrix.config.tag_prefix }}${{ matrix.config.product }}-image.tar | ||
docker image ls -a | ||
|
||
- name: Test image | ||
env: | ||
IMAGE_NAME: rstudio/${{ matrix.config.product }}:${{ matrix.config.tag_prefix }}${{ matrix.config.version }} | ||
# because we cannot dynamically set env var names... set them all... | ||
RSP_VERSION: ${{ matrix.config.version }} | ||
RSC_VERSION: ${{ matrix.config.version }} | ||
RSPM_VERSION: ${{ matrix.config.version }} | ||
run: | | ||
docker-compose -f ./${{ matrix.config.dir }}/docker-compose.test.yml run sut | ||
|
||
push: | ||
runs-on: ubuntu-latest | ||
needs: test | ||
if: ${{ github.ref == 'refs/heads/main' }} | ||
name: push-${{ matrix.config.tag_prefix }}${{ matrix.config.product}} | ||
environment: build-and-push | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
config: | ||
- {product: 'r-session-debug', tag_prefix: 'bionic-', dir: 'r-session-debug/bionic', prefix: RSP, version: 1.4.1717-3} | ||
- {product: 'r-session-debug', tag_prefix: 'centos7-', dir: 'r-session-debug/centos7', prefix: RSP, version: 1.4.1717-3} | ||
|
||
steps: | ||
- name: Check Out Repo | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Download artifact | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: ${{ matrix.config.tag_prefix }}${{ matrix.config.product}}-image | ||
path: /tmp | ||
|
||
- name: Load image | ||
run: | | ||
docker load --input /tmp/${{ matrix.config.tag_prefix }}${{ matrix.config.product }}-image.tar | ||
docker image ls -a | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKER_HUB_USERNAME }} | ||
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | ||
|
||
- name: Login to ghcr.io | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.BUILD_PAT }} | ||
|
||
- name: Push image(s) to Docker Hub | ||
run: | | ||
docker push rstudio/${{ matrix.config.product }}:${{ matrix.config.tag_prefix }}${{ matrix.config.version }} | ||
docker push rstudio/${{ matrix.config.product }}:${{ matrix.config.tag_prefix }}latest | ||
docker push ghcr.io/rstudio/${{ matrix.config.product }}:${{ matrix.config.tag_prefix }}${{ matrix.config.version }} | ||
docker push ghcr.io/rstudio/${{ matrix.config.product }}:${{ matrix.config.tag_prefix }}latest |
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,15 @@ | ||
ARG RSP_VERSION | ||
FROM rstudio/r-session-complete:bionic-${RSP_VERSION} | ||
|
||
RUN apt-get update -qq \ | ||
&& apt-get install -y \ | ||
dnsutils \ | ||
tcpdump \ | ||
netcat \ | ||
net-tools \ | ||
psutils \ | ||
vim \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
COPY startup.sh /usr/local/bin/startup.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,18 @@ | ||
#!/bin/bash | ||
|
||
TCPDUMP_OUTPUT=${TCPDUMP_OUTPUT:-/tmp/tcpdump.pcap} | ||
TCPDUMP_MAX_PACKETS=${TCPDUMP_MAX_PACKETS:-10000} | ||
|
||
tcpdump -i any -w ${TCPDUMP_OUTPUT} -c ${TCPDUMP_MAX_PACKETS} & | ||
|
||
# Launch the session based on RSTUDIO_TYPE | ||
if [ -z "$RSTUDIO_TYPE" -o "$RSTUDIO_TYPE" == "session" ]; then | ||
echo "Starting RStudio session..." | ||
exec "/usr/lib/rstudio-server/bin/rserver-launcher" "$@" | ||
elif [ "$RSTUDIO_TYPE" == "adhoc" ]; then | ||
echo "Starting RStudio adhoc job..." | ||
exec "/bin/bash" "$@" | ||
else | ||
echo "ERROR: Unknown RSTUDIO_TYPE: ${RSTUDIO_TYPE}" | ||
exit 1 | ||
fi |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Should also have strace if it is not already installed