Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cloud Code for Cloud Run doesn't load builders to run code locally #3196

Open
fulviomanente opened this issue Apr 26, 2024 · 9 comments
Open

Comments

@fulviomanente
Copy link

PY-232.10300.41, JRE 17.0.10+7-b1000.48x64 JetBrains s.r.o., OS Mac OS X(aarch64) v14.1.2, screens 1920.0x1080.0

I'm trying to run a Google Cloud Run locally, as per the instructions. Everything goes fine if I use a Dockerfile however the new option to build it via build packs (which is how I build them in Cloud Build) is not showing up as an option on the IDE
Screenshot 2024-04-25 at 6 32 29 PM

@ivanporty
Copy link
Contributor

Thank you for the report. Are there any exceptions in your log file (idea.log, Help -> Show Log file..)

@codonist
Copy link

same thing there. Here are some information:

intellij
IntelliJ IDEA 2024.1 (Ultimate Edition)
Build #IU-241.14494.240, built on March 28, 2024
Licensed to Pengyu Zhao
Subscription is active until August 25, 2024.
Runtime version: 17.0.10+8-b1207.12 aarch64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 14.3.1
GC: G1 Young Generation, G1 Old Generation
Memory: 4096M
Cores: 12
Metal Rendering is ON
Registry:
ide.balloon.shadow.size=0
ide.new.editor.tabs.vertical.borders=true
ide.animate.toolwindows=true
ide.experimental.ui=true
ide.editor.tab.selection.animation=true
Non-Bundled Plugins:
com.jetbrains.plugins.ini4idea (241.14494.240)
com.intellij.apacheConfig (241.14494.240)
de.netnexus.camelcaseplugin (3.0.12)
IdeaVIM (2.10.2)
com.intellij.plugins.watcher (241.14494.150)
org.jetbrains.plugins.go-template (241.14494.150)
org.jetbrains.plugins.go (241.14494.240)
Pythonid (241.14494.240)
com.jetbrains.space (241.14494.150)
net.seesharpsoft.intellij.plugins.csv (3.3.0-241)
com.intellij.ml.llm (241.14494.240)
com.github.copilot (1.5.2.5345)
com.intellij.lang.jsgraphql (241.14494.150)
com.jetbrains.packagesearch.intellij-plugin (241.0.8)
mobi.hsz.idea.gitignore (4.5.3)
com.google.gct.core (24.4.2-api-version-223)
com.jetbrains.php (241.14494.240)
com.chrisrm.idea.MaterialThemeUI (9.2.0)
com.jetbrains.php.wordPress (241.14494.240)
ru.adelf.idea.dotenv (2024.1)
com.google.cloud.workstations.ide.jetbrains.connector (24.3.1-api-version-231)
Kotlin: 241.14494.240-IJ

Log
when i open the run local dialog:

2024-04-28 10:51:06,954 [3391265]   WARN - #com.google.cloud.tools.intellij.kubernetes.skaffold.run.ui.build.SkaffoldBuilderSettingsPanel - Unable to detect images and builders

when i open intellij setting dialog (not sure this is related):

2024-04-28 10:49:39,619 [3303930]   INFO - #com.google.cloud.tools.intellij.kubernetes.kpt.KptExecutorService - Error parsing kpt version
com.intellij.execution.process.ProcessNotCreatedException: Cannot run program "kpt": error=2, No such file or directory
	at com.intellij.execution.configurations.GeneralCommandLine.createProcess(GeneralCommandLine.java:366)
	at com.google.cloud.tools.intellij.util.CommandExecutor.run(CommandExecutor.kt:76)
	at com.google.cloud.tools.intellij.util.CommandExecutor.run$default(CommandExecutor.kt:60)
	at com.google.cloud.tools.intellij.kubernetes.kpt.KptExecutorService.createProcess(KptExecutorService.kt:133)
	at com.google.cloud.tools.intellij.kubernetes.kpt.KptExecutorService.executeKpt(KptExecutorService.kt:101)
	at com.google.cloud.tools.intellij.kubernetes.kpt.KptExecutorService.getKptVersion(KptExecutorService.kt:79)
	at com.google.cloud.tools.intellij.kubernetes.kpt.KptExecutorService.getManagedKptVersion(KptExecutorService.kt:67)
	at com.google.cloud.tools.intellij.configurables.DeploymentToolsDependenciesPanel$setManagedDependencyVersions$1$kptVersion$1.invokeSuspend(DeploymentToolsDependenciesPanel.kt:351)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
	at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:115)
	at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:103)
	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)
Caused by: java.io.IOException: Cannot run program "kpt": error=2, No such file or directory
	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1143)
	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1073)
	at com.intellij.execution.configurations.GeneralCommandLine.createProcess(GeneralCommandLine.java:490)
	at com.intellij.execution.configurations.GeneralCommandLine.startProcess(GeneralCommandLine.java:463)
	at com.intellij.execution.configurations.GeneralCommandLine.createProcess(GeneralCommandLine.java:356)
	... 15 more

Let me know if you need more information, thanks.

@fulviomanente
Copy link
Author

fulviomanente commented Apr 28, 2024 via email

@codonist
Copy link

i am wondering if we could get around the UI by putting the config inside the Run_locally.xml configuration file (by checking "store as project file" in run locally dialog). In my case is something like this

<component name="ProjectRunConfigurationManager">
  <configuration default="false" name="my-service: Run Locally" type="CloudCodeCloudRunConfigurationType" factoryName="CloudCodeCloudRunDevelopConfigurationFactory" show_console_on_std_err="false" show_console_on_std_out="false">
    <option name="allowRunningInParallel" value="false" />
    <option name="buildpacksEnv">
      <map />
    </option>
    <option name="cloudSqlConnections">
      <list />
    </option>
    <option name="cpuAllocated" value="NO_LIMIT" />
    <option name="dockerBuildArgs">
      <map />
    </option>
    <option name="dockerTarget" value="" />
    <option name="environmentVariables">
      <map />
    </option>
    <option name="loadingAvailableBuilders" value="false" />
    <option name="mappings">
      <list />
    </option>
    <option name="memoryAllocated" value="MIB_256" />
    <option name="projectPathOnTarget" />
    <option name="selectedOptions">
      <list />
    </option>
    <option name="serviceAccount" value="" />
    <option name="serviceName" value="my-service" />
    <option name="skaffoldWatchMode" value="ON_DEMAND" />
    <method v="2" />
  </configuration>
</component>

Is there something we could add here to make it work?

@apeltop
Copy link

apeltop commented May 21, 2024

I also had the same problem. I resolved it by uninstalling and reinstalling the Cloud Code plugin in IntelliJ.

@codonist
Copy link

@apeltop thanks for the suggestion, unfortunately it seems uninstalling and reinstalling doesn't work on my end.

@codonist
Copy link

@apeltop would you mind share your Run_locally.xml configuration file when checking the checkbox of "store as project file" in run locally dialog. The file would end up in .idea folder of your project. You can hide or replace any private content in that file if there is any. I am just wondering if it's possible for me to add the related builder configs in the xml directly to work around it. Thanks in advance.

@apeltop
Copy link

apeltop commented May 21, 2024

@codonist hope this helps.

<component name="ProjectRunConfigurationManager">
  <configuration default="false" name="Unnamed" type="CloudCodeCloudRunConfigurationType" factoryName="CloudCodeCloudRunDevelopConfigurationFactory" show_console_on_std_err="false" show_console_on_std_out="false" imageBuilder="{&quot;name&quot;:&quot;Docker&quot;,&quot;payload&quot;:{&quot;path&quot;:&quot;Dockerfile&quot;}}">
    <option name="allowRunningInParallel" value="false" />
    <option name="buildpacksEnv">
      <map />
    </option>
    <option name="cloudSqlConnections">
      <list />
    </option>
    <option name="cpuAllocated" value="NO_LIMIT" />
    <option name="dockerBuildArgs">
      <map />
    </option>
    <option name="dockerTarget" value="" />
    <option name="environmentVariables">
      <map />
    </option>
    <option name="loadingAvailableBuilders" value="false" />
    <option name="mappings">
      <list />
    </option>
    <option name="memoryAllocated" value="MIB_256" />
    <option name="projectPathOnTarget" />
    <option name="selectedOptions">
      <list />
    </option>
    <option name="serviceAccount" value="" />
    <option name="serviceName" value="my-service" />
    <option name="skaffoldWatchMode" value="ON_DEMAND" />
    <method v="2" />
  </configuration>
</component>

@codonist
Copy link

@apeltop thanks a lot, but unfortunately i still can't get it working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants