From 4ab4e477a610331927d67ccfc18bfd6cad9b07cc Mon Sep 17 00:00:00 2001 From: Aron Atkins Date: Thu, 13 Jun 2024 16:54:50 -0400 Subject: [PATCH 1/5] recent connect, updated config, passes tests --- __tests__/main.spec.ts | 2 +- __tests__/rstudio-connect.test.gcfg | 42 ++++++++++++++++------------- docker-compose.yml | 6 +---- 3 files changed, 25 insertions(+), 25 deletions(-) diff --git a/__tests__/main.spec.ts b/__tests__/main.spec.ts index 03b4aeb8..7bde0f46 100644 --- a/__tests__/main.spec.ts +++ b/__tests__/main.spec.ts @@ -8,7 +8,7 @@ import * as rsconnect from '../src/main' jest.setTimeout(1000 * 60 * 2) const SEED_ADMIN_CONFIG: rsconnect.APIClientConfiguration = { - apiKey: 'f1wc3w4090uv67yhud7j08zjzgvt7yfg', + apiKey: '21232f297a57a5a743894a0e4a801fc3', baseURL: 'http://127.0.0.1:23939/__api__' } diff --git a/__tests__/rstudio-connect.test.gcfg b/__tests__/rstudio-connect.test.gcfg index ac39e99b..d4987b60 100644 --- a/__tests__/rstudio-connect.test.gcfg +++ b/__tests__/rstudio-connect.test.gcfg @@ -1,42 +1,46 @@ ; RStudio Connect test environment configuration -[Applications] -RunAs = rstudio-connect +[Server] +DataDir = /data +EmailProvider = print +DatabaseEmailSettings = true +Address = http://localhost:23939 [Authentication] Provider = password +BasicAuth = true +InsecureDefaultUserAPIKey = true +APIKeyBcryptCost = 4 [Database] Provider = Postgres SeedUsers = true -[Debug] -Log = router -Log = services -Log = url-normalization - [HTTP] Listen = :3939 NoWarning = true -[Mount] -BaseDir = /connect-test-mount - [Postgres] URL = postgres://postgres:notasecret@db/postgres?sslmode=disable [Python] Enabled = true -Executable = /opt/python/3.6.5/bin/python +Executable = /opt/python/3.12.1/bin/python +Executable = /opt/python/3.11.7/bin/python + +[Quarto] +Enabled = true +Executable = /opt/quarto/1.4.552/bin/quarto [RPackageRepository "CRAN"] -URL = https://packagemanager.rstudio.com/cran/__linux__/bionic/latest +URL = https://packagemanager.rstudio.com/cran/__linux__/jammy/latest [RPackageRepository "RSPM"] -URL = https://packagemanager.rstudio.com/cran/__linux__/bionic/latest - -[Server] -DataDir = /data -EmailProvider = print -DatabaseEmailSettings = true -Address = http://127.0.0.1:23939 +URL = https://packagemanager.rstudio.com/cran/__linux__/jammy/latest + +[Logging] +ServiceLog = STDOUT +ServiceLogFormat = TEXT ; TEXT or JSON +ServiceLogLevel = INFO ; INFO, WARNING or ERROR +AccessLog = STDOUT +AccessLogFormat = COMMON ; COMMON, COMBINED, or JSON diff --git a/docker-compose.yml b/docker-compose.yml index bc499cf9..6e924dd2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,5 +1,3 @@ -version: '3.7' - services: db: image: postgres:12 @@ -11,9 +9,7 @@ services: privileged: true depends_on: - db - # TODO: when available - # image: rstudio/rstudio-connect:1.8.6 - image: rstudio/rstudio-connect:1.8.4.2-2 + image: rstudio/rstudio-connect:ubuntu2204-2024.05.0 volumes: - ./.cache/data:/data - ./__tests__/rstudio-connect.test.gcfg:/etc/rstudio-connect/rstudio-connect.gcfg From d9901d5843042bd781537c9dc722edf5973ad2af Mon Sep 17 00:00:00 2001 From: Aron Atkins Date: Fri, 14 Jun 2024 08:10:16 -0400 Subject: [PATCH 2/5] update actions deps --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 796f249e..e284aa2a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,8 +18,8 @@ jobs: - 16.x runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v2-beta + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: ${{ matrix.node }} - run: npm install From d7a0b82dc2b8b047825e1c51d50dd41138f313ed Mon Sep 17 00:00:00 2001 From: Aron Atkins Date: Fri, 14 Jun 2024 08:10:46 -0400 Subject: [PATCH 3/5] revert server.address --- __tests__/rstudio-connect.test.gcfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/__tests__/rstudio-connect.test.gcfg b/__tests__/rstudio-connect.test.gcfg index d4987b60..a6d82cb3 100644 --- a/__tests__/rstudio-connect.test.gcfg +++ b/__tests__/rstudio-connect.test.gcfg @@ -4,7 +4,7 @@ DataDir = /data EmailProvider = print DatabaseEmailSettings = true -Address = http://localhost:23939 +Address = http://127.0.0.1:23939 [Authentication] Provider = password From 09dee6c9b3c84aa9918ecb92d0f0a0cbca516fc1 Mon Sep 17 00:00:00 2001 From: Aron Atkins Date: Thu, 20 Jun 2024 16:26:42 -0400 Subject: [PATCH 4/5] racy: remove postgres (faster startup) and add/wait on health-check (no test race) --- Makefile | 2 +- __tests__/rstudio-connect.test.gcfg | 4 ---- docker-compose.yml | 12 ++++-------- 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index a16ac884..499ca72f 100644 --- a/Makefile +++ b/Makefile @@ -30,7 +30,7 @@ distclean: clean .PHONY: up up: .require-license docker-compose port connect 3939 2>/dev/null | if ! grep -q ':23939$$'; then \ - docker-compose up -d; \ + docker-compose up -d --wait; \ fi .PHONY: down diff --git a/__tests__/rstudio-connect.test.gcfg b/__tests__/rstudio-connect.test.gcfg index a6d82cb3..64defc01 100644 --- a/__tests__/rstudio-connect.test.gcfg +++ b/__tests__/rstudio-connect.test.gcfg @@ -13,16 +13,12 @@ InsecureDefaultUserAPIKey = true APIKeyBcryptCost = 4 [Database] -Provider = Postgres SeedUsers = true [HTTP] Listen = :3939 NoWarning = true -[Postgres] -URL = postgres://postgres:notasecret@db/postgres?sslmode=disable - [Python] Enabled = true Executable = /opt/python/3.12.1/bin/python diff --git a/docker-compose.yml b/docker-compose.yml index 6e924dd2..403028b7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,15 +1,11 @@ services: - db: - image: postgres:12 - volumes: - - ./.cache/pgdata:/var/lib/postgresql/data - environment: - POSTGRES_PASSWORD: notasecret connect: privileged: true - depends_on: - - db image: rstudio/rstudio-connect:ubuntu2204-2024.05.0 + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:3939/"] + start_period: 30s + start_interval: 1s volumes: - ./.cache/data:/data - ./__tests__/rstudio-connect.test.gcfg:/etc/rstudio-connect/rstudio-connect.gcfg From 55fea0d299a010f55d11625f2b6f7ba79c7aefc8 Mon Sep 17 00:00:00 2001 From: Aron Atkins Date: Thu, 20 Jun 2024 17:12:35 -0400 Subject: [PATCH 5/5] docker compose not docker-compose --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 499ca72f..9768a0fa 100644 --- a/Makefile +++ b/Makefile @@ -29,13 +29,13 @@ distclean: clean .PHONY: up up: .require-license - docker-compose port connect 3939 2>/dev/null | if ! grep -q ':23939$$'; then \ - docker-compose up -d --wait; \ + docker compose port connect 3939 2>/dev/null | if ! grep -q ':23939$$'; then \ + docker compose up -d --wait; \ fi .PHONY: down down: - docker-compose down --remove-orphans + docker compose down --remove-orphans .PHONY: .require-license .require-license: