From 73f420c339c9a32e5d842ea5a4cc4c2ea569926d Mon Sep 17 00:00:00 2001 From: Kevin Gartland Date: Fri, 5 Apr 2024 09:22:06 -0400 Subject: [PATCH 1/8] ensure RSC_LICENSE is passed to docker --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 9954625b..62eb7578 100644 --- a/Makefile +++ b/Makefile @@ -150,6 +150,7 @@ promote-docs-in-s3: RSC_API_KEYS=vetiver-testing/rsconnect_api_keys.json dev: + RSC_LICENSE=$RSC_LICENSE \ docker compose up -d docker compose exec -T rsconnect bash < vetiver-testing/setup-rsconnect/add-users.sh python vetiver-testing/setup-rsconnect/dump_api_keys.py $(RSC_API_KEYS) From 1bd84b9f92ea553ce618b2db7b5f1431414eb403 Mon Sep 17 00:00:00 2001 From: Kevin Gartland Date: Fri, 5 Apr 2024 09:51:41 -0400 Subject: [PATCH 2/8] export license --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 62eb7578..cdc4617c 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,7 @@ VERSION := $(shell python -m setuptools_scm) HOSTNAME := $(shell hostname) S3_PREFIX := s3://rstudio-connect-downloads/connect/rsconnect-python +export RSC_LICENSE := ${RSC_LICENSE} BDIST_WHEEL := dist/rsconnect_python-$(VERSION)-py2.py3-none-any.whl @@ -150,7 +151,6 @@ promote-docs-in-s3: RSC_API_KEYS=vetiver-testing/rsconnect_api_keys.json dev: - RSC_LICENSE=$RSC_LICENSE \ docker compose up -d docker compose exec -T rsconnect bash < vetiver-testing/setup-rsconnect/add-users.sh python vetiver-testing/setup-rsconnect/dump_api_keys.py $(RSC_API_KEYS) From 6e25c994790cc5f34fcf39184149964a0d0621ef Mon Sep 17 00:00:00 2001 From: Kevin Gartland Date: Fri, 5 Apr 2024 10:15:34 -0400 Subject: [PATCH 3/8] set rsc_license sooner --- .github/workflows/main.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 00c64d50..179cb309 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -175,6 +175,8 @@ jobs: test-rsconnect: name: "Integration tests against latest Connect" runs-on: ubuntu-latest + env: + RSC_LICENSE: ${{ secrets.RSC_LICENSE }} steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 @@ -190,9 +192,6 @@ jobs: docker compose up --build -d pip freeze > requirements.txt make dev - env: - RSC_LICENSE: ${{ secrets.RSC_LICENSE }} - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} - name: Get logs in case of failure run: | docker compose logs rsconnect From a8a483d4ae69186b34f6242958e3ffcfef87cb5a Mon Sep 17 00:00:00 2001 From: Kevin Gartland Date: Fri, 5 Apr 2024 10:23:47 -0400 Subject: [PATCH 4/8] rm RSC_LICENSE export --- Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/Makefile b/Makefile index cdc4617c..9954625b 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,6 @@ VERSION := $(shell python -m setuptools_scm) HOSTNAME := $(shell hostname) S3_PREFIX := s3://rstudio-connect-downloads/connect/rsconnect-python -export RSC_LICENSE := ${RSC_LICENSE} BDIST_WHEEL := dist/rsconnect_python-$(VERSION)-py2.py3-none-any.whl From 3cd8cecc14d85c1cc86d269117d053f798281750 Mon Sep 17 00:00:00 2001 From: Kevin Gartland Date: Fri, 5 Apr 2024 11:29:25 -0400 Subject: [PATCH 5/8] wait for connect --- Makefile | 1 + vetiver-testing/wait_for_connect.sh | 7 +++++++ 2 files changed, 8 insertions(+) create mode 100755 vetiver-testing/wait_for_connect.sh diff --git a/Makefile b/Makefile index 9954625b..40eab9c0 100644 --- a/Makefile +++ b/Makefile @@ -151,6 +151,7 @@ RSC_API_KEYS=vetiver-testing/rsconnect_api_keys.json dev: docker compose up -d + vetiver-testing/wait_for_connect.sh docker compose exec -T rsconnect bash < vetiver-testing/setup-rsconnect/add-users.sh python vetiver-testing/setup-rsconnect/dump_api_keys.py $(RSC_API_KEYS) diff --git a/vetiver-testing/wait_for_connect.sh b/vetiver-testing/wait_for_connect.sh new file mode 100755 index 00000000..cc3cd1a8 --- /dev/null +++ b/vetiver-testing/wait_for_connect.sh @@ -0,0 +1,7 @@ +timeout 5 bash -c \ + 'status=$(curl -s -o /dev/null -w ''%{http_code}'' http://localhdost:3939/__ping__); \ + while [[ "$status" != "200" ]]; \ + do sleep 1; \ + echo "retry"; \ + status=$(curl -s -o /dev/null -w ''%{http_code}'' http://locadlhost:3939/__ping__); \ + done' \ No newline at end of file From a61a4ad6155643e8293bfa48337af1a02b2602df Mon Sep 17 00:00:00 2001 From: Kevin Gartland Date: Fri, 5 Apr 2024 11:39:34 -0400 Subject: [PATCH 6/8] fix passwords --- vetiver-testing/setup-rsconnect/dump_api_keys.py | 6 +++--- vetiver-testing/setup-rsconnect/users.txt | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/vetiver-testing/setup-rsconnect/dump_api_keys.py b/vetiver-testing/setup-rsconnect/dump_api_keys.py index eebef59f..e44f0131 100644 --- a/vetiver-testing/setup-rsconnect/dump_api_keys.py +++ b/vetiver-testing/setup-rsconnect/dump_api_keys.py @@ -13,9 +13,9 @@ def get_api_key(user, password, email): api_keys = { - "admin": get_api_key("admin", "admin0", "admin@example.com"), - "susan": get_api_key("susan", "susan", "susan@example.com"), - "derek": get_api_key("derek", "derek", "derek@example.com"), + "admin": get_api_key("admin", "password", "admin@example.com"), + "susan": get_api_key("susan", "password", "susan@example.com"), + "derek": get_api_key("derek", "password", "derek@example.com"), } json.dump(api_keys, open(OUT_FILE, "w")) diff --git a/vetiver-testing/setup-rsconnect/users.txt b/vetiver-testing/setup-rsconnect/users.txt index dd4ec359..7b46db65 100644 --- a/vetiver-testing/setup-rsconnect/users.txt +++ b/vetiver-testing/setup-rsconnect/users.txt @@ -1,4 +1,4 @@ -admin admin0 -test test -susan susan -derek derek +admin password +test password +susan password +derek password From df04a664aac2cc8b64b4db10f0d6b590dece8900 Mon Sep 17 00:00:00 2001 From: Kevin Gartland Date: Fri, 5 Apr 2024 11:50:24 -0400 Subject: [PATCH 7/8] fix passwords --- vetiver-testing/setup-rsconnect/dump_api_keys.py | 6 +++--- vetiver-testing/setup-rsconnect/users.txt | 8 ++++---- vetiver-testing/wait_for_connect.sh | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/vetiver-testing/setup-rsconnect/dump_api_keys.py b/vetiver-testing/setup-rsconnect/dump_api_keys.py index e44f0131..cfee5ad6 100644 --- a/vetiver-testing/setup-rsconnect/dump_api_keys.py +++ b/vetiver-testing/setup-rsconnect/dump_api_keys.py @@ -13,9 +13,9 @@ def get_api_key(user, password, email): api_keys = { - "admin": get_api_key("admin", "password", "admin@example.com"), - "susan": get_api_key("susan", "password", "susan@example.com"), - "derek": get_api_key("derek", "password", "derek@example.com"), + "admin": get_api_key("admin", "Km(7N0L*J", "admin@example.com"), + "susan": get_api_key("susan", "Km(7N0L*J", "susan@example.com"), + "derek": get_api_key("derek", "Km(7N0L*J", "derek@example.com"), } json.dump(api_keys, open(OUT_FILE, "w")) diff --git a/vetiver-testing/setup-rsconnect/users.txt b/vetiver-testing/setup-rsconnect/users.txt index 7b46db65..d780a347 100644 --- a/vetiver-testing/setup-rsconnect/users.txt +++ b/vetiver-testing/setup-rsconnect/users.txt @@ -1,4 +1,4 @@ -admin password -test password -susan password -derek password +admin Km(7N0L*J +test Km(7N0L*J +susan Km(7N0L*J +derek Km(7N0L*J diff --git a/vetiver-testing/wait_for_connect.sh b/vetiver-testing/wait_for_connect.sh index cc3cd1a8..e9de65a5 100755 --- a/vetiver-testing/wait_for_connect.sh +++ b/vetiver-testing/wait_for_connect.sh @@ -1,7 +1,7 @@ timeout 5 bash -c \ - 'status=$(curl -s -o /dev/null -w ''%{http_code}'' http://localhdost:3939/__ping__); \ + 'status=$(curl -s -o /dev/null -w ''%{http_code}'' http://localhost:3939/__ping__); \ while [[ "$status" != "200" ]]; \ do sleep 1; \ echo "retry"; \ - status=$(curl -s -o /dev/null -w ''%{http_code}'' http://locadlhost:3939/__ping__); \ + status=$(curl -s -o /dev/null -w ''%{http_code}'' http://localhost:3939/__ping__); \ done' \ No newline at end of file From d52f4e876e6ec0c7f41c1345359bd1cb84501898 Mon Sep 17 00:00:00 2001 From: Kevin Gartland Date: Fri, 5 Apr 2024 12:41:39 -0400 Subject: [PATCH 8/8] increase wait --- vetiver-testing/wait_for_connect.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vetiver-testing/wait_for_connect.sh b/vetiver-testing/wait_for_connect.sh index e9de65a5..aa3ea6b9 100755 --- a/vetiver-testing/wait_for_connect.sh +++ b/vetiver-testing/wait_for_connect.sh @@ -1,4 +1,4 @@ -timeout 5 bash -c \ +timeout 30 bash -c \ 'status=$(curl -s -o /dev/null -w ''%{http_code}'' http://localhost:3939/__ping__); \ while [[ "$status" != "200" ]]; \ do sleep 1; \