GoogleCloudPlatform / cloud-code-intellij

Plugin to support the Google Cloud Platform in IntelliJ IDEA - Docs and Issues Repository
Apache License 2.0
318 stars 59 forks source link

Sign in to Google to use Cloud Code every time I am starting my VM. Is this expected ? #3161

Closed tarrade closed 9 months ago

tarrade commented 10 months ago

Expected Behavior

Do this step only one time on my VM image

Actual Behavior

Every time I am starting my remote VM (Vertex AI Notebook) on GCP, I need to sign in in Google to use Cloud code.

What happen is that: image

After sign in, credentials.json contain the credential -rw-rw-r-- 1 jupyter jupyter 0 Sep 7 07:35 access_token_file -rw------- 1 jupyter jupyter 289 Sep 7 07:37 application_default_credentials.json -rw------- 1 jupyter jupyter 440 Sep 7 11:24 credentials.json

but when I restart the VM, credentials.json is empty: -rw-rw-r-- 1 jupyter jupyter 0 Sep 7 12:39 access_token_file -rw------- 1 jupyter jupyter 289 Sep 7 12:39 application_default_credentials.json -rw------- 1 jupyter jupyter 0 Sep 7 12:39 credentials.json

This is maybe a normal behavious with what is set in application_default_credentials.json but:

Q1: is it a bug or a feature Q2: if this is a feature why for the Cloud SDK we need to do the authentification once but for the Cloud Code plugin we need to do it at every start of the VM ? Q3: if this is a feature a there a way to change it ?

Additional Information

Non-Bundled Plugins: com.github.copilot (1.2.21.2995) org.toml.lang (232.8660.88) com.github.camork.fileExpander (2.2) krasa.CpuUsageIndicator (1.17.2023) com.jetbrains.sh (232.8660.88) izhangzhihao.rainbow.brackets (2023.3.4) com.intellij.ideolog (222.1.0.0)

etanshaul commented 10 months ago

@tarrade thanks for the issue.

This is a known bug. Were you trying out Duet AI features by any chance? We are debugging this overly-frequent login issue and have narrowed it down to one place and just wanted to confirm.

Also what is the version of the backend (not Gateway client) IDE you are connecting to? Thanks.

etanshaul commented 10 months ago

update: it might also be a bug causing the notification to pop up even when you don't need to sign in again. we are looking into it.

update 2: we are looking into it. thanks for all the details in the report, it gives us a lot to go by.

tarrade commented 10 months ago

@etanshaul , thanks for the follow up. Sorry I didn't find the existing bug report.

Yes I have am having access to Duet AI, my project got whitelisted but my company didn't grant me the IAM permission and they want to review the data residency first. Not sure if this is because of the IAM permission but when I clicked on the symbol nothing happen (sometime it happen but I got AI assistant stuff). Anyway happy to help if I can image

Here my IDE: image

Let me know if you need more or something else

etanshaul commented 10 months ago

thanks! that helps a lot. We have narrowed down this issue and will patch as soon as we can validate a fix. Thanks for the feedback on this.

etanshaul commented 10 months ago

@tarrade just a side note so you don't run into any surprises: Duet AI currently doesn't work in Cloud Workstations due to limitations in capabilities of gateway with the APIs we are using. We'll update the docs to clarify this. For now, you will need to use a desktop JB IDE for Duet.

tarrade commented 10 months ago

@etanshaul , thanks for the info and very good to know. Is there a public bug report on JetBrains so I can follow the progress ?

By the way, do you know if Google is providing a white paper that explain data residency with Duet AI ? (I know they published something for PaLM 2 fine tuning). Duet AI is triggering a lot of question and there is very few details in the official documentation i.e: • How das Duet AI works from the IDE • What data is sent • How is the data stored, used and deleted (code, answers, telemetry) • Are there any filters for PII • Can we have data deleted afterwards, … • How is copyright infringement managed

etanshaul commented 10 months ago

hi @tarrade sorry for the delay on responding.

Re questions about data residency etc. in Duet - I raised this internally as I'd like for us to answer this uniformly and I think this will be a common set of questions. No updates yet, but I think it will make sense for us to update this in docs (https://cloud.google.com/duet-ai, and downstream).

Re a bug on JB - not yet. JB recently released a new higher level completion API that is still being fully fleshed out to support our use cases (and currently only works in the very latest version of the IDE). We are going to evaluate migrating to this which will including validating it through Gateway.

etanshaul commented 10 months ago

some info on data governance is already outlined here: https://cloud.google.com/duet-ai/docs/discover/data-governance

etanshaul commented 9 months ago

hi @tarrade an update that we just released a new version that should fix the issue where you are asked to sign in too frequently.

tarrade commented 9 months ago

Hi @etanshaul ,

great, so far everything looks great and I didn't have to login for the moment.

Thanks raising the points for Duet AI internally. I will watch the official documentation. There already few things but not specific for our legal and gouvernance team. I may contact Duet AI if we have specific questions that are not anwsered.

For JB, I guess the same bug affect Copilot. I am also waiting for the coming new version 2023.2.3 for support for Markdown so hopefully everything will be in this release for the end of this year.

Last point, it seems that on Github, there is a missing entry for the latest version 23.9.1

Thanks again and closing

etanshaul commented 9 months ago

Last point, it seems that on Github, there is a missing entry for the latest version 23.9.1

Opps, our mistake. See: https://github.com/GoogleCloudPlatform/cloud-code-intellij/releases/tag/v23.9.1

Thanks for all of the feedback here. We'll keep you in the loop with any relevant updates.

tarrade commented 9 months ago

Hi @etanshaul ,

unfortunately, when restarting my VM this morning, I had to logging again. Same empty credentials.json before I redo the authentification. I check to see the list of my VMs with Cloud Code but authentification was necessary so it is not an unnecessary pop up windows in my case,

I am using latest cloud plugin 23.9.1-IB.1-api-version-222 latest pycharm version Build #JBC-232.9921.36, built on September 11, 2023 latest JetBrains Gateway as before

Thanks

etanshaul commented 9 months ago

this may be more specific to gateway then. we will investigate. (the original issue of non-gateway + Duet appears to be resolved, but we'll use this issue to track the gateway flavor of it). thanks.

tarrade commented 9 months ago

Hi @etanshaul,

yes it is working fine with Pycharm on my local PC (same version as for the Gateway).

Now, I realized that when using Gateway the issue was on my side. In fact, I am using a local proxy so I need to SSH the remote machine with port forwarding. If I SSH the machine first and then open remote Pycharm is work fine.

If I don't SSH first, I guess when I start remote Pycharm, it cannot access internet to do the authentification or do some check.

Sorry for the false alarm and thanks for the fix