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

Support JetBrain Client (JetBrain Gateway for remote development) #3121

Open zarinfam opened 1 year ago

zarinfam commented 1 year ago

Expected Behavior

Cloud Code plugin works on JetBrains Client (JetBrain Gateway for remote development) as it works on IntelliJ!

Actual Behavior

You can install the plugin and configure run configuration, but you can not run or debug the project!

Additional Information

ruomengz commented 1 year ago

Hi, thanks for reporting this! Can you please also provide your remote host IDE version and your local/remote OS? Thanks!

Cloud Code supports JetBrains Gateway using Cloud Workstations (https://cloud.google.com/workstations/docs/develop-remotely-with-jetbrains-ides) Please feel free to try it out too.

zarinfam commented 1 year ago

@ruomengz If I understood correctly, My remote host IDE is an Ubuntu Server 22.04, which I connect to using ssh (JetBrain Gateway), and my local machine is a Mac.

etanshaul commented 1 year ago

but you can not run or debug the project

Hi @zarinfam could you elaborate one what exactly you are seeing? Not being able to debug is actually a known current limitation due to the way the UI is streamed from the backend IDE (we will be working on it). But "run" using the Cloud Code run configurations should be working when connected via Gateway.

etanshaul commented 1 year ago

My remote host IDE is an Ubuntu Server 22.04

Sorry I missed this part. Though this should still work per my previous comment, the team has validated mainly using Cloud Workstations as a backend host.

Info on Cloud Workstations: https://cloud.google.com/workstations Info on connecting to CW from Gateway: https://cloud.google.com/workstations/docs/develop-remotely-with-jetbrains-ides

zarinfam commented 1 year ago

@etanshaul I have created a Cloud Code: Kubernetes run configuration. When I press the run button, nothing happens. (I am sure my skaffold configuration is correct because this project works perfectly locally)

etanshaul commented 1 year ago

yeah - we discussed this internally and realized that there is a gap here - we have specialized logic to support the gateway use case, but it is only being enabled on Cloud Workstations backends; since you are not using Cloud Workstations this logic isn't being triggered. Will keep this open for tracking. Thanks.

In the meantime, as a hack, you can try setting an environment variable on your Ubuntu server:

GOOGLE_CLOUD_WORKSTATIONS=true

This will trick the plugin into thinking its running on Cloud Workstations and apply the shims. You'll probably need to restart the IDE backend after setting this env var.

zarinfam commented 1 year ago

@etanshaul Unfortunately, it did not help. I set this environment variable in the system and the run config setting, but it did not work.

etanshaul commented 1 year ago

@zarinfam too bad. But just to confirm - you did set this env var on the Ubuntu server machine (where you are running the backend IDE)? (it needs to be on the backend machine, not where the client IDE is running).

Otherwise, we'll discuss to see when we can get to this, and update.

zarinfam commented 1 year ago

@zarinfam too bad. But just to confirm - you did set this env var on the Ubuntu server machine (where you are running the backend IDE)? (it needs to be on the backend machine, not where the client IDE is running).

Otherwise, we'll discuss to see when we can get to this, and update.

Yes, I did set this env var on the Ubuntu server machine (where IDE backend run)

ivanporty commented 1 year ago

@zarinfam when you say you cannot run or debug the project - could you explain a bit more on this? You run configuration and nothing happens or something else? Maybe a small screencast would be amazing