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

[Cloudfunction] Error type <class 'goblet.app.Goblet'> during deployment #88

Closed
anovis opened this issue Oct 5, 2021 · 3 comments
Closed
Labels
bug Something isn't working

Comments

@anovis
Copy link
Collaborator

anovis commented Oct 5, 2021

getting error while deploying to us-east1 . working in other regions. seems to be a recent change just to that region. following up with gcp whether it is a bug and/or will be deployed out to other regions

The function defined in file /workspace/main.py as app needs to be of type function. Got: invalid type <class 'goblet.app.Goblet'>

workaround would be to define a new entrypoint and call goblet app inside. this would require the user to set the entrypoint since now it is automatically set by goblet during deploy.

def entrypoint(request, context=None):
   app(request,context)
@anovis anovis added the bug Something isn't working label Oct 5, 2021
@anovis anovis changed the title [Cloudfunction] Error of type function during deployment [Cloudfunction] Error type <class 'goblet.app.Goblet'> during deployment Oct 5, 2021
@anovis
Copy link
Collaborator Author

anovis commented Oct 8, 2021

workaround for now is to call the goblet app in a new function and set the entrypoint to that function

app = Goblet(function_name="goblet-test-issue", local="test")

def entry(request):
    return app(request)

and in config.json

{
    "cloudfunction":{
        "entryPoint": "entry"
    }
}

@anovis anovis pinned this issue Oct 13, 2021
@anovis
Copy link
Collaborator Author

anovis commented Oct 19, 2021

looks like gcp has propagated the changes to all regions. have follow up with gcp folks and will update this issue based on that outcome

@anovis anovis mentioned this issue Oct 19, 2021
@anovis
Copy link
Collaborator Author

anovis commented Nov 9, 2021

from google
Product team informed me that there is no plan to revert the behavior on this case - it's expected behavior at this point so there is no effort to change it internally, ie no internal bug, no external bug. It was a product decision to have it function the way it is.

the workaround is to wrap app using goblet_entrypoint.

from goblet import Goblet, jsonify, Response, goblet_entrypoint

app = Goblet(function_name="goblet-test-issue", local="test")
goblet_entrypoint(app)

@anovis anovis closed this as completed Nov 9, 2021
anovis added a commit that referenced this issue Nov 12, 2021
set entrypoint to `goblet_entrypoint` instead of app because of #88 (closes #95)
@anovis anovis unpinned this issue Aug 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant