From d1fac5b8f55ee113b57c9d082a119f2b587f0122 Mon Sep 17 00:00:00 2001 From: John Muschelli Date: Mon, 7 Feb 2022 20:37:02 +0000 Subject: [PATCH 1/6] trying to get auth to work for pkg.dev --- DESCRIPTION | 2 +- inst/cloudconfig/rstudio-noauth.yaml | 2 +- inst/cloudconfig/rstudio.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 208524a..c6794ac 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -36,4 +36,4 @@ Suggests: License: MIT + file LICENSE LazyData: true VignetteBuilder: knitr -RoxygenNote: 7.1.1 +RoxygenNote: 7.1.2.9000 diff --git a/inst/cloudconfig/rstudio-noauth.yaml b/inst/cloudconfig/rstudio-noauth.yaml index 2958a58..15c4644 100644 --- a/inst/cloudconfig/rstudio-noauth.yaml +++ b/inst/cloudconfig/rstudio-noauth.yaml @@ -22,7 +22,7 @@ write_files: [Service] Restart=always Environment="HOME=/home/gcer" - ExecStartPre=/usr/bin/docker-credential-gcr configure-docker + ExecStartPre=/usr/bin/docker-credential-gcr configure-docker --registries=asia.gcr.io,eu.gcr.io,gcr.io,marketplace.gcr.io,us.gcr.io,docker.pkg.dev,us-docker.pkg.dev,eu-docker.pkg.dev,asia-docker.pkg.dev ExecStart=/etc/gcer/startup.sh ExecStop=/usr/bin/docker stop rstudio ExecStopPost=/usr/bin/docker rm rstudio diff --git a/inst/cloudconfig/rstudio.yaml b/inst/cloudconfig/rstudio.yaml index 2958a58..15c4644 100644 --- a/inst/cloudconfig/rstudio.yaml +++ b/inst/cloudconfig/rstudio.yaml @@ -22,7 +22,7 @@ write_files: [Service] Restart=always Environment="HOME=/home/gcer" - ExecStartPre=/usr/bin/docker-credential-gcr configure-docker + ExecStartPre=/usr/bin/docker-credential-gcr configure-docker --registries=asia.gcr.io,eu.gcr.io,gcr.io,marketplace.gcr.io,us.gcr.io,docker.pkg.dev,us-docker.pkg.dev,eu-docker.pkg.dev,asia-docker.pkg.dev ExecStart=/etc/gcer/startup.sh ExecStop=/usr/bin/docker stop rstudio ExecStopPost=/usr/bin/docker rm rstudio From c415514f6970e4fbcfd03e859c38fca9c8b6ad0c Mon Sep 17 00:00:00 2001 From: John Muschelli Date: Tue, 15 Mar 2022 21:34:26 +0000 Subject: [PATCH 2/6] added new features to mounting for docker --- inst/startupscripts/rstudio-noauth.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/inst/startupscripts/rstudio-noauth.sh b/inst/startupscripts/rstudio-noauth.sh index a04c781..8839aa3 100644 --- a/inst/startupscripts/rstudio-noauth.sh +++ b/inst/startupscripts/rstudio-noauth.sh @@ -11,10 +11,17 @@ GCER_DOCKER_IMAGE=$(curl http://metadata.google.internal/computeMetadata/v1/inst echo "Docker image: $GCER_DOCKER_IMAGE" +if [ -f /home/gcer ]; +then + chmod 775 /home/gcer + vol_code="-v /home/gcer:/home/gcer" +fi # as per https://www.rocker-project.org/use/managing_users/ docker run -p 8787:8787 \ -e ROOT=TRUE \ - -e USER=rstudio -e DISABLE_AUTH=true \ + -e USER=gcer \ + ${vol_code} \ + -e DISABLE_AUTH=true \ --name=rstudio \ --privileged=true \ $GCER_DOCKER_IMAGE \ No newline at end of file From 9d39aa7c5e826528bb074df9c07e95377d9c28d0 Mon Sep 17 00:00:00 2001 From: John Muschelli Date: Tue, 15 Mar 2022 21:42:09 +0000 Subject: [PATCH 3/6] correct test for directory --- inst/startupscripts/rstudio-noauth.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inst/startupscripts/rstudio-noauth.sh b/inst/startupscripts/rstudio-noauth.sh index 8839aa3..e491dac 100644 --- a/inst/startupscripts/rstudio-noauth.sh +++ b/inst/startupscripts/rstudio-noauth.sh @@ -11,7 +11,7 @@ GCER_DOCKER_IMAGE=$(curl http://metadata.google.internal/computeMetadata/v1/inst echo "Docker image: $GCER_DOCKER_IMAGE" -if [ -f /home/gcer ]; +if [ -d /home/gcer ]; then chmod 775 /home/gcer vol_code="-v /home/gcer:/home/gcer" From 8669385d72587632a5882b45f60774641a0a514b Mon Sep 17 00:00:00 2001 From: John Muschelli Date: Tue, 15 Mar 2022 22:05:44 +0000 Subject: [PATCH 4/6] fixing back roxygen version --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index c6794ac..208524a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -36,4 +36,4 @@ Suggests: License: MIT + file LICENSE LazyData: true VignetteBuilder: knitr -RoxygenNote: 7.1.2.9000 +RoxygenNote: 7.1.1 From 6bd2e3e122f0134310aa67e92228464d2729f493 Mon Sep 17 00:00:00 2001 From: John Muschelli Date: Wed, 1 Jun 2022 15:58:53 +0000 Subject: [PATCH 5/6] added mounting /R --- inst/startupscripts/rstudio-noauth.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/inst/startupscripts/rstudio-noauth.sh b/inst/startupscripts/rstudio-noauth.sh index e491dac..915df00 100644 --- a/inst/startupscripts/rstudio-noauth.sh +++ b/inst/startupscripts/rstudio-noauth.sh @@ -16,6 +16,11 @@ then chmod 775 /home/gcer vol_code="-v /home/gcer:/home/gcer" fi +# Need to mount in / because of filesystem noexec +# https://cloud.google.com/container-optimized-os/docs/concepts/security +mkdir -p /R +vol_code="${vol_code} -v /R:/R" + # as per https://www.rocker-project.org/use/managing_users/ docker run -p 8787:8787 \ -e ROOT=TRUE \ From 82e4c4e08cb6b416b7f150ac929b4854a5af53d4 Mon Sep 17 00:00:00 2001 From: John Muschelli Date: Wed, 1 Jun 2022 20:56:44 +0000 Subject: [PATCH 6/6] added /R --- inst/startupscripts/rstudio-noauth.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/inst/startupscripts/rstudio-noauth.sh b/inst/startupscripts/rstudio-noauth.sh index 915df00..4659714 100644 --- a/inst/startupscripts/rstudio-noauth.sh +++ b/inst/startupscripts/rstudio-noauth.sh @@ -18,7 +18,8 @@ then fi # Need to mount in / because of filesystem noexec # https://cloud.google.com/container-optimized-os/docs/concepts/security -mkdir -p /R +mkdir -p /R/library +chown gcer:gcer -R /R vol_code="${vol_code} -v /R:/R" # as per https://www.rocker-project.org/use/managing_users/