Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
c705bac
new docker image
kgartland-rstudio Mar 26, 2024
f2d67fd
forgot the dockerfile
kgartland-rstudio Mar 26, 2024
c19adf0
pass quarto version
kgartland-rstudio Mar 26, 2024
ce581e3
use args
kgartland-rstudio Mar 26, 2024
2000230
dir already exists
kgartland-rstudio Mar 26, 2024
6106eb3
fix quarto path
kgartland-rstudio Mar 26, 2024
8c47045
update python
kgartland-rstudio Mar 26, 2024
ebdc1e3
cleanup
kgartland-rstudio Mar 26, 2024
886e164
install quarto on client
kgartland-rstudio Mar 26, 2024
cc0d451
set path to get quarto
kgartland-rstudio Mar 26, 2024
181629e
use client
kgartland-rstudio Mar 26, 2024
a9384e1
fix dockerfile
kgartland-rstudio Mar 26, 2024
c12a318
add conda
kgartland-rstudio Mar 26, 2024
ef30ee3
add deps
kgartland-rstudio Mar 26, 2024
34e11e7
fix network mode for client
kgartland-rstudio Mar 26, 2024
6f49ebb
use localhost
kgartland-rstudio Mar 26, 2024
0261890
use a new service
kgartland-rstudio Mar 26, 2024
8027579
new dockerfile
kgartland-rstudio Mar 26, 2024
6ef721c
add new dockerfile
kgartland-rstudio Mar 26, 2024
d3a0f88
use gh actions docker
kgartland-rstudio Mar 26, 2024
49df3bd
fix connect
kgartland-rstudio Mar 26, 2024
3ac0756
build separately
kgartland-rstudio Mar 26, 2024
1b2ba0e
add tmate
kgartland-rstudio Mar 26, 2024
0e09617
move tmate
kgartland-rstudio Mar 26, 2024
c9515b9
add api key
kgartland-rstudio Mar 27, 2024
53c2c3f
use api_key
kgartland-rstudio Mar 27, 2024
fde8174
use api_key
kgartland-rstudio Mar 27, 2024
cb29ab4
fix connect on main run
kgartland-rstudio Mar 27, 2024
28273b7
build in the right dir
kgartland-rstudio Mar 27, 2024
401a894
build and run connect
kgartland-rstudio Mar 27, 2024
f4639d6
use a separate connect instance to avoid build in CI
kgartland-rstudio Mar 27, 2024
a1e53b4
revert changes
kgartland-rstudio Mar 27, 2024
af6e19d
revert changes
kgartland-rstudio Mar 27, 2024
a19f99a
separte build commands
kgartland-rstudio Mar 27, 2024
62b8678
fix config
kgartland-rstudio Mar 27, 2024
b443e80
update conf
kgartland-rstudio Mar 27, 2024
a71a5d0
fix main now
kgartland-rstudio Mar 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions .github/workflows/deploy_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
with:
name: distributions
path: dist/

- name: Run rsconnect-python Tests
env:
CONNECT_LICENSE: "${{ secrets.RSC_LICENSE }}"
Expand All @@ -76,16 +76,17 @@ jobs:
RSC_AUTOMATION_PAT: "${{ secrets.CONNECT_PAT }}"
ADMIN_API_KEY: "${{ secrets.ADMIN_API_KEY }}"
QUARTO_VERSION: "1.4.546"

# This allows us to start Connect separately in our own docker container
CONNECT_SERVER: "http://localhost:3939"
remote: "yes"
run: |
cd integration-testing
docker compose pull connect
docker compose up -d connect
just ../test/connect-rsconnect-python/test/rsconnect-python/test-rsconnect-python-repo

docker compose build connect-cli
docker compose build client-cli
docker compose up -d connect-cli
docker compose up -d client-cli
docker-compose run --rm client-cli just ../test/connect-rsconnect-python/test/rsconnect-python/_start-dev

# Videos are captured whether the suite fails or passes
- name: Save videos
uses: actions/upload-artifact@v3
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ jobs:
run: |
pytest tests/test_main_system_caches.py
pytest -m 'vetiver'

test-jupyter:
runs-on: ubuntu-latest
env:
Expand All @@ -218,14 +218,15 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build Containers
run: |
just integration-testing/build
cd integration-testing
docker compose build client
docker compose build cypress
- name: Start Connect + rsconnect-jupyter
run: |
just integration-testing/up

- name: Run Cypress Tests
run: |
export ADMIN_API_KEY="${{ secrets.ADMIN_API_KEY }}"
just integration-testing/up-cypress

# Videos are captured whether the suite fails or passes
Expand Down
45 changes: 44 additions & 1 deletion integration-testing/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,51 @@ services:
working_dir: /rsconnect-python/integration-testing
entrypoint: ''

client-cli:
build:
context: ./docker
dockerfile: cli.Dockerfile
args:
QUARTO_VERSION: ${QUARTO_VERSION}
PY_VERSION: ${PY_VERSION}
volumes:
- ../:/rsconnect-python
working_dir: /rsconnect-python/integration-testing
network_mode: host
entrypoint: ''
environment:
QUARTO_VERSION: ${QUARTO_VERSION}
PY_VERSION: ${PY_VERSION}
API_KEY: ${ADMIN_API_KEY}

# customized connect built with updated quarto version
# used for nightly deploy_tests.yml that include quarto projects
connect-cli:
hostname: connect-cli
image: rstudio/rstudio-connect:jammy
build:
context: ./docker
dockerfile: connect.Dockerfile
args:
QUARTO_VERSION: ${QUARTO_VERSION}
PY_VERSION: ${PY_VERSION}
restart: always
ports:
- 3939:3939
volumes:
- $PWD/docker/rstudio-connect-cli.gcfg:/etc/rstudio-connect/rstudio-connect.gcfg
privileged: true
environment:
RSTUDIO_CONNECT_HASTE: "enabled"
RSC_LICENSE: ${CONNECT_LICENSE}
QUARTO_VERSION: ${QUARTO_VERSION}
PY_VERSION: ${PY_VERSION}

# connect from public docker hub
# used jupyter-notebook and deploy tests in CI, main.yml
connect:
hostname: connect
image: rstudio/rstudio-connect:bionic
image: rstudio/rstudio-connect:jammy
restart: always
ports:
- 3939:3939
Expand All @@ -32,6 +74,7 @@ services:
RSTUDIO_CONNECT_HASTE: "enabled"
RSC_LICENSE: ${CONNECT_LICENSE}


cypress:
image: cypress/included:12.7.0
depends_on:
Expand Down
45 changes: 45 additions & 0 deletions integration-testing/docker/cli.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
ARG PY_VERSION=${PY_VERSION}
FROM python:${PY_VERSION}
COPY ./requirements.txt .
EXPOSE 9999
VOLUME ../../:/rsconnect-python/

WORKDIR /rsconnect-python/integration-testing
ARG QUARTO_VERSION

RUN apt-get update -y && apt-get install -y --no-install-recommends \
build-essential \
curl \
ca-certificates \
git \
sudo \
vim \
jq \
wget

RUN mkdir -p /libs-client && \
curl -fsSL https://github.com/casey/just/releases/download/1.1.2/just-1.1.2-x86_64-unknown-linux-musl.tar.gz \
| tar -C /libs-client -xz just

ENV PATH=$PATH:/libs-client

RUN git clone --depth=1 https://github.com/bats-core/bats-core.git /libs/bats-core \
&& cd /libs/bats-core \
&& ./install.sh /libs/bats-core/installation \
&& git clone --depth=1 https://github.com/bats-core/bats-support.git /libs/bats-support \
&& git clone --depth=1 https://github.com/bats-core/bats-file.git /libs/bats-file \
&& git clone --depth=1 https://github.com/bats-core/bats-assert.git /libs/bats-assert

RUN curl -fsSL -o miniconda.sh https://repo.anaconda.com/miniconda/Miniconda3-py38_4.10.3-Linux-x86_64.sh \
&& chmod 755 miniconda.sh \
&& ./miniconda.sh -b -p /opt/miniconda \
&& rm -rf miniconda.sh

RUN pip install rsconnect-jupyter --pre && \
pip install pipenv && \
jupyter-nbextension install --sys-prefix --py rsconnect_jupyter

RUN curl -fsSLO https://github.com/quarto-dev/quarto-cli/releases/download/v${QUARTO_VERSION}/quarto-${QUARTO_VERSION}-linux-amd64.tar.gz && \
mkdir /opt/quarto && tar xf quarto-${QUARTO_VERSION}-linux-amd64.tar.gz -C /opt/quarto --strip-components 1 && \
( echo ""; echo 'export PATH=$PATH:/opt/quarto/bin' ; echo "" ) >> ~/.profile && \
. ~/.profile
7 changes: 7 additions & 0 deletions integration-testing/docker/connect.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM rstudio/rstudio-connect:jammy
ARG QUARTO_VERSION

RUN curl -fsSLO https://github.com/quarto-dev/quarto-cli/releases/download/v${QUARTO_VERSION}/quarto-${QUARTO_VERSION}-linux-amd64.tar.gz && \
tar xf quarto-${QUARTO_VERSION}-linux-amd64.tar.gz -C /opt/quarto --strip-components 1 && \
( echo ""; echo 'export PATH=$PATH:/opt/quarto/bin' ; echo "" ) >> ~/.profile && \
source ~/.profile
37 changes: 37 additions & 0 deletions integration-testing/docker/rstudio-connect-cli.gcfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
; Posit Connect test environment configuration

[Server]
SenderEmail = testuser@testrsc.com
EmailProvider = print
DataDir = /connect-rsconnect-data
EnableSitemap = true
AllowConfirmedUsers = true
Address = http://localhost:3939
JumpStartEnabled = false

[HTTP]
Listen = :3939
NoWarning = true

[Python]
Enabled = true
Executable = /opt/python/3.8.17/bin/python
Executable = /opt/python/3.9.17/bin/python

[Quarto]
Enabled = true
Executable = /opt/quarto/bin/quarto

[Authentication]
BasicAuth = true
InsecureDefaultUserAPIKey = true
APIKeyBcryptCost = 4

[Authorization]
DefaultUserRole = "publisher"

[Database]
SeedUsers = true

[Mount]
BaseDir = /connect-rsconnect-mount
6 changes: 3 additions & 3 deletions integration-testing/docker/rstudio-connect.gcfg
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ NoWarning = true

[Python]
Enabled = true
Executable = /opt/python/3.8.10/bin/python
Executable = /opt/python/3.9.5/bin/python
Executable = /opt/python/3.8.17/bin/python
Executable = /opt/python/3.9.17/bin/python

[Quarto]
Enabled = true
Expand All @@ -34,4 +34,4 @@ DefaultUserRole = "publisher"
SeedUsers = true

[Mount]
BaseDir = /connect-rsconnect-mount
BaseDir = /connect-rsconnect-mount
3 changes: 2 additions & 1 deletion integration-testing/justfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export RSC_LICENSE := env_var_or_default("RSC_LICENSE", "$CONNECT_LICENSE")
export ADMIN_API_KEY := env_var_or_default('ADMIN_API_KEY', "${ADMIN_API_KEY}")
export QUARTO_VERSION := env_var_or_default('QUARTO_VERSION', '1.4.546')


all:
Expand All @@ -14,7 +15,7 @@ up:
docker compose up -d client && docker compose up -d connect

up-cypress:
docker compose up --exit-code-from cypress
docker compose up cypress --exit-code-from cypress

# use this target if you want to run Cypress
# without shutting down all containers after each run
Expand Down