1
votes

I am trying to deploy a simple "hello world" application in Appengine standard - Go environment. There is one source file hello.go with one import "google.golang.org/appengine"

I followed the documentation here to use the Admin API for deployment. But I got "can't find import: google.golang.org/appengine" error when I checked the status of the deployment.

So I uploaded the google.golang.org library folder to Cloud Storage, but documentation seems to only show how to include single files separately from GCS buckets, which is not feasible for big imported libraries.

I know all this will work with "gcloud app deploy", but I have to use the Admin API and standard environment.

  • Is there a way to tell Appengine to "go get" imported libraries?
  • Is there a way to include folders (not single files) from GCS bucket in deployment config files?
1
I understand you did "go get google.golang.org/appengine", could you check if cloud SDK's gopath directory is empty? If so, this link with a similar error might help you b.corp.google.com/issues/111017406#comment6. This question stackoverflow.com/questions/43744415/… could be related too.Temu
Thanks for responding. I am using Admin API to deploy in standard environment, not with gcloud. So I cannot do "go get google.golang.org/appengine". I have to upload my source files to storage bucket and then reference those files in a deployment config fileconundrum
I see, I'm trying to reproduce this. I understand you import it like import "google.golang.org/appengine"Temu
Thanks. The code is exactly as found in github.com/GoogleCloudPlatform/golang-samples/tree/master/…conundrum
For anyone else stumbling onto this post, looks like app.json should list each file in the deployment section - no way to deploy folders. The recommended way is to write a script to create the app.json file.conundrum

1 Answers

0
votes

The deployment works with gcloud because the appengine library is present in your GOPATH. gcloud fetches them from there.

In the case of the deployment using Admin API, in order to not include one per one all files from your libraries, the packages need to be present in Google Cloud Storage for ZIP deployment or you can use Cloud Source Repositories, build it with the CREATE call and then deploy it from a container with the Cloud Build image.