htappen / r-google-cloud-ai

A set of tutorials for how to use R with Google Cloud AI Platform
MIT License
1 stars 1 forks source link

Glitch due to Cookie generator `make_config.py` while saving anything on RStudio Notebooks #2

Closed herambgadgil closed 3 years ago

herambgadgil commented 3 years ago

Hi Henry,

I am encountering another issue while running RStudio notebook. If we stop and start the notebook, everything that has been stored, including installed packages are lost and the session starts like a fresh RStudio install with a clean slate. This, I believe, is because of the make_config.py file which is necessary to generate pseudo cookies for RStudio to function properly in the AI-instances.

Wanted to raise the issue here and understand if there is a simple fix for it. Appreciate any help on this!

Let me know if you need any additional information.

Thanks! Heramb

htappen commented 3 years ago

I've found the problem -- the issue is that it's installing the files into the docker container instead of onto the VM. Everything needs to be installed into /home/jupyter. I need to figure out how to change that in R (updating .Rprofile, I think). In the meantime, I think you can call setwd('/home/jupyter') and install.packages(, lib='/home/jupyter') to fix that

On Mon, Apr 19, 2021 at 10:05 AM Heramb Gadgil @.***> wrote:

Hi Henry,

I am encountering another issue while running RStudio notebook. If we stop and start the notebook, everything that has been stored, including installed packages are lost and the session starts like a fresh RStudio install with a clean slate. This, I believe, is because of the make_config.py file which is necessary to generate pseudo cookies for RStudio to function properly in the AI-instances.

Wanted to raise this here and understand if there is a simple fix for it. Appreciate any help on this!

Let me know if you need any additional information on this.

Thanks! Heramb

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/htappen/r-google-cloud-ai/issues/2, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABF7MVJ7UQSXQCAZ4AOPYH3TJRPGJANCNFSM43GHTRCQ .

herambgadgil commented 3 years ago

I think the user rstudio does not have privileges to any other path apart from /home/rstudio. I am getting following error if I try to save a test file to /home/jupyter

19 Apr 2021 18:35:35 [rsession-rstudio] ERROR system error 2 (No such file or directory) [path: /home/jupyter/heramb-test.R]; 
OCCURRED AT rstudio::core::Error rstudio::core::FilePath::openForWrite(std::shared_ptr<std::basic_ostream<char> >&, bool) const src/cpp/shared_core/FilePath.cpp:1482; 
LOGGED FROM: rstudio::core::Error rstudio::core::{anonymous}::openFileForWritingWithRetry(const rstudio::core::FilePath&, bool, int, std::shared_ptr<std::basic_ostream<char> >*) src/cpp/core/FileSerializer.cpp:73

I also tried to bring the python3 /root/make_config.py to the main Dockerfile from the startup.sh but got no success. This was a very amateur as I am just starting on Dockers. Apologies for any ignorance. :-)

Thanks! Heramb

htappen commented 3 years ago

I almost have the fix ready, will upload shortly.

On Mon, Apr 19, 2021 at 11:44 AM Heramb Gadgil @.***> wrote:

I think the user rstudio does not have privileges to any other path apart from /home/rstudio. I am getting following error if I try to save a test file to /home/jupyter

19 Apr 2021 18:35:35 [rsession-rstudio] ERROR system error 2 (No such file or directory) [path: /home/jupyter/heramb-test.R]; OCCURRED AT rstudio::core::Error rstudio::core::FilePath::openForWrite(std::shared_ptr<std::basic_ostream >&, bool) const src/cpp/shared_core/FilePath.cpp:1482; LOGGED FROM: rstudio::core::Error rstudio::core::{anonymous}::openFileForWritingWithRetry(const rstudio::core::FilePath&, bool, int, std::shared_ptr<std::basic_ostream >*) src/cpp/core/FileSerializer.cpp:73

I also tried to bring the python3 /root/make_config.py to the main Dockerfile from the startup.sh but got no success. This was a very amateur as I am just starting on Dockers. Apologies for any ignorance. :-)

Thanks! Heramb

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/htappen/r-google-cloud-ai/issues/2#issuecomment-822692878, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABF7MVKDXSP4QSN3PUVWJRTTJR22LANCNFSM43GHTRCQ .

htappen commented 3 years ago

Fixed

herambgadgil commented 3 years ago

Hello,

I have been trying for couple of days to get the new fix up and running on my instance. But it is not starting up. I get the following error. I have tried pushing the changes to my old container registry as well as creating a fresh container registry and the results have been the same.

image

These are the permissions that I have granted to the service-account that runs my ai-notebook.

image

The build is successful but the AI-Notebook fails. Below are the steps that I am implementing. Could you please let me know if I am missing out on anything

Step 1: Pull the latest changes from https://github.com/htappen/r-google-cloud-ai
Step 2: Initialize project to which the build needs to be pushed
Step 3: gcloud builds submit --config cloudbuild.yaml
Step 4: Create a fresh AI-Notebook with custom-image:latest

Thanks! Heramb

htappen commented 3 years ago

Hmm, it's working fresh for me. What happens if you do gcloud builds submit . -t gcr.io/<MY PROJECT>/<MY REPO>:latest?

I'm wondering if there's something bugged with cloudbuild.yaml

htappen commented 3 years ago

Looking at the screenshot, it looks like there's a problem with the proxy -- either a bug with nginx config or a problem with the VM itself that prevents the proxy from turning on.

Can you please share the machine type you're using?

Also, can you please try some of the procedures listed here

What happen if you run /opt/deeplearning/bin/load_container.sh?

herambgadgil commented 3 years ago

Hello,

One of the engineers in my organization found that my problem was due to misalignment of the code in the startup.sh file. He presumes that might be due to windows (local machine) to unix (gcp container registry) build push.

He cloned your repo on linux box and pushed it to GCR which ran just fine! The scripts are being retained even after I restart the instance. One small thing that I am seeing now is this error message. Its not a road blocker but mentioning it for reference anyway.

image

Could we keep this issue open for another couple of days? I will run few tests and then confirm back once they are successful.

Cannot thank you enough for helping with this and for quick & prompt responses. Appreciate it very much! :-)

Thanks! Heramb

herambgadgil commented 3 years ago

Hi Henry,

Everything is looking good! I ran few tests and everything went well. I think we can close the issue.

Thanks a lot for all your help! Appreciate it very much :-)

Thanks! Heramb