Goblet is an easy-to-use framework that enables developers to quickly spin up fully featured REST APIs with python on GCP

Overview

GOBLET

PyPI PyPI - Python Version Tests codecov

Goblet is a framework for writing serverless rest apis in python in google cloud. It allows you to quickly create and deploy python apis backed by cloudfunctions.

It provides:

  • A command line tool for creating, deploying, and managing your api
  • A decorator based API for integrating with GCP API Gateway, Storage, Cloudfunctions, PubSub, Scheduler, and other GCP services.
  • Local environment for your api endpoints
  • Dynamically generated openapispec
  • Support for multiple stages

You can create Rest APIs:

from goblet import Goblet, jsonify

app = Goblet(function_name="goblet_example")

@app.route('/home')
def home():
    return {"hello": "world"}

@app.route('/home/{id}', methods=["POST"])
def post_example(id: int) -> List[int]:
    return jsonify([id])

Once you've written your code, you just run goblet deploy and Goblet takes care of deploying your app.

$ goblet deploy -l us-central1
...
https://api.uc.gateway.dev

$ curl https://api.uc.gateway.dev/home
{"hello": "world"}

Installation

To install goblet, open an interactive shell and run:

pip install goblet-gcp

Make sure to have the correct services enabled in your gcp project depending on what you want to deploy

api-gateway, cloudfunctions, storage, pubsub, scheduler

You will also need to install gcloud cli for authentication

QuickStart

In this tutorial, you'll use the goblet command line utility to create and deploy a basic REST API. This quickstart uses Python 3.7. You can find the latest versions of python on the Python download page.

To install Goblet, we'll first create and activate a virtual environment in python3.7:

$ python3 --version
Python 3.7.3
$ python3 -m venv venv37
$ . venv37/bin/activate

Next we'll install Goblet using pip:

python3 -m pip install goblet-gcp

You can verify you have goblet installed by running:

$ goblet --help
Usage: goblet [OPTIONS] COMMAND [ARGS]...
...

Credentials

Before you can deploy an application, be sure you have credentials configured. You should run gcloud auth application-default login and sign in to the desired project.

When setting the defaut location note that api-gateway is only available in asia-east1, europe-west1, us-east-1 and us-central1.

Creating Your Project

create your project directory, which should include an main.py and a requirements.txt. Make sure requirements.txt includes goblet-gcp

$ ls -la
drwxr-xr-x   .goblet
-rw-r--r--   main.py
-rw-r--r--   requirements.txt

You can ignore the .goblet directory for now, the two main files we'll focus on is app.py and requirements.txt.

Let's take a look at the main.py file:

from goblet import Goblet

app = Goblet(function_name="goblet_example")

@app.route('/home')
def home():
    return {"hello": "world"}

This app will deploy an api with endpoint /home.

Running Locally

Running your functions locally for testing and debugging is easy to do with goblet. First set a local param in the goblet class

from goblet import Goblet

app = Goblet(function_name="goblet_example", local='test')

Then run goblet local test and replace test with whatever variable you decide to use. Now you can hit your functions endpoint at localhost:8080 with your routes.

Deploying

Let's deploy this app. Make sure you're in the app directory and run goblet deploy making sure to specify the desired location:

$ goblet deploy -l us-central1
INFO:goblet.deployer:zipping function......
INFO:goblet.deployer:uploading function zip to gs......
INFO:goblet.deployer:function code uploaded
INFO:goblet.deployer:creating cloudfunction......
INFO:goblet.deployer:deploying api......
INFO:goblet.deployer:api successfully deployed...
INFO:goblet.deployer:api endpoint is goblet-example-yol8sbt.uc.gateway.dev

You now have an API up and running using API Gateway and cloudfunctions:

$ curl https://goblet-example-yol8sbt.uc.gateway.dev/home
{"hello": "world"}

Try making a change to the returned dictionary from the home() function. You can then redeploy your changes by running golet deploy.

Next Steps

You've now created your first app using goblet. You can make modifications to your main.py file and rerun goblet deploy to redeploy your changes.

At this point, there are several next steps you can take.

Docs - Goblet Documentation

If you're done experimenting with Goblet and you'd like to cleanup, you can use the goblet destroy command making sure to specify the desired location, and Goblet will delete all the resources it created when running the goblet deploy command.

$ goblet destroy -l us-central1
INFO:goblet.deployer:destroying api gateway......
INFO:goblet.deployer:api configs destroying....
INFO:goblet.deployer:apis successfully destroyed......
INFO:goblet.deployer:deleting google cloudfunction......
INFO:goblet.deployer:deleting storage bucket......

Docs

Goblet Documentation

Blog Posts

Building Python Serverless Applications on GCP

Tutorial: Publishing GitHub Findings to Security Command Center

Examples

Goblet Examples

Issues

Please file any issues, bugs or feature requests as an issue on our GitHub page.

Github Action

Goblet Github Action

Roadmap

Integration Tests
Api Gateway Auth
Configuration Options (function names, ...)
Use checksum for updates
☐ Generate Openapi clients
User generated dataclasses for openapi spec
Scheduler trigger
Pub Sub trigger
Cloud Storage trigger
Firestore trigger
Firebase trigger
Cloud Tasks trigger
Cloud Endpoints trigger

Want to Contribute

If you would like to contribute to the library (e.g. by improving the documentation, solving a bug or adding a cool new feature) submit a pull request.

Want to Support

Buy Me A Coffee


Based on chalice

Comments
  • Tutorial of `@app.route('/')` with authentication

    Tutorial of `@app.route('/')` with authentication

    I'm trying to setup a Cloud Function with multiple routes. The endpoint must be private but I don't really know much about authentication in Google Cloud. I've spend a lot of time reading Goblet docs Authentication Topic and all mentioned Google Docs + intensive research but I'm not sure how I should proceed : Do I have to setup something else in GCP ? (IAP, 0Auth) ?

    documentation question 
    opened by amirbtb 15
  • [FEATURE REQUEST] Build/Push docker image to external registry

    [FEATURE REQUEST] Build/Push docker image to external registry

    Description (what): I'd like to be able to build my docker image for cloud run using goblet and push it to an external artifact registry (outside of the one being deployed) and then have goblet deploy from that registry.

    Motivation (why): As a developer, I'd like to keep all of my artifacts in one central registry.

    How is this currently done?: Currently, if we deploy to a project, the artifact will be built in that projects artifact registry. In order to circumvent this, we need to do a docker build/push and then specify what image to use.

    Impact: Requires additional steps and glue during our CI/CD process

    Suggest a solution (optional): In .goblet/config.json add a field for the artifact registry to push to and deploy from

    {
        "cloudrun":{
            "max-instances": "1",
            "artifact_registry":"us-east1-docker.pkg.dev/gcp_project/artifact_name/image_name",
            "cpu": "1",
            "memory": "256Mi",
            "service-account": "[email protected]",
            "timeout": "3600",
            "vpc-connector": "projects/foo/locations/us-east1/connectors/connector"
        }
    }
    

    During the deploy process, have goblet build and push the image to that registry (potentially with a tag provided by the developer) and then once that image has been built, have goblet deploy to the cloud run specified in goblet deploy -p shazbot -l us-east1

    Potentially related issues:

    https://github.com/goblet/goblet/issues/163 - requests using the GCP client libraries which will require a separation of building and deploying.

    opened by eahrend 11
  • Bug: `0.9.0 ModuleNotFoundError: No module named 'goblet.infrastructures'`

    Bug: `0.9.0 ModuleNotFoundError: No module named 'goblet.infrastructures'`

    Hi. I just tried to update from version 0.8.4 to 0.9.0, and I get this error when I try to run goblet deploy:

    Run poetry run goblet deploy --location europe-north1
    Traceback (most recent call last):
      File "/home/runner/.cache/pypoetry/virtualenvs/bucket-to-bigquery-85QkY9Aq-py3.10/bin/goblet", line 5, in <module>
        from goblet.cli import main
      File "/home/runner/.cache/pypoetry/virtualenvs/bucket-to-bigquery-85QkY9Aq-py3.10/lib/python3.10/site-packages/goblet/__init__.py", line 1, in <module>
        from goblet.app import Goblet, jsonify, goblet_entrypoint  # noqa: F401
      File "/home/runner/.cache/pypoetry/virtualenvs/bucket-to-bigquery-85QkY9Aq-py3.10/lib/python3.10/site-packages/goblet/app.py", line 7, in <module>
        from goblet.decorators import Register_Handlers
      File "/home/runner/.cache/pypoetry/virtualenvs/bucket-to-bigquery-85QkY9Aq-py3.10/lib/python3.10/site-packages/goblet/decorators.py", line 8, in <module>
        from goblet.infrastructures.redis import Redis
    ModuleNotFoundError: No module named 'goblet.infrastructures'
    Error: Process completed with exit code 1.
    

    Anything I can do about this, or is this something that should be fixed on your end?

    bug 
    opened by rasnes 9
  • Add optional argument to keep last version of archive + delete archive in Cloud Storage when deleting the function

    Add optional argument to keep last version of archive + delete archive in Cloud Storage when deleting the function

    Hello,

    I noticed that the bucket used to store Cloud Function archives contains all the versions of all cloud functions deployed in the project. The number of objets is quite big after a couple of dev/try/test deployments.

    Feature request :

    • add an optional argument to goblet deploy to delete the previous version of the archive in Cloud Storage
    • add an optional argument to goblet destroy to delete the archive of the function in Cloud Storage

    Thanks !

    proposal 
    opened by amirbtb 8
  • Create multiple cloud scheduler to call the same function

    Create multiple cloud scheduler to call the same function

    Hello,

    I am working on a simple use case : I have a cloud function that accepts a 'URl' parameter, calls that URl (which is a public API endpoint) and saves the data in a JSON file stored in Cloud Storage. I want to be able to set multiple cloud scheduler to call different endpoints on different schedules, but I only need 1 function.

    Question : My guess is that @app.schedule('5 * * * *') creates both a Cloud Scheduler and a Cloud Function. Is there a possibility to only create a (or multiple) Cloud Scheduler and define parameters to use in the call to the Cloud Function ?

    enhancement question 
    opened by amirbtb 7
  • [Secret Manager] Secret Manager Integration

    [Secret Manager] Secret Manager Integration

    A built in integration with Secret Manager to inject secrets into cloudfunctions. Currently the options are to supply env variable, or to write the secret manager logic yourself.

    example config.json

    "secrets": {
      "GH_TOKEN": projects/{project_id}/secrets/GH_TOKEN/versions/2",
      "OTHER_TOKEN"
    }
    

    with default being projects/{project_id}/secrets/{secret_name}/versions/latest

    then in your code you would use config.secrets to access

    from goblet.config import Config
    
    config = Config()
    @app.route("/reveal")
    def reveal_secret():
        return config.secrets.GH_TOKEN
    
    proposal 
    opened by anovis 7
  • [Cloudrun backend] Missing None. Make sure you are in the correct directoty and this file exists

    [Cloudrun backend] Missing None. Make sure you are in the correct directoty and this file exists

    Hi, first of all, thanks for your work ! I use Goblet for cloud functions and it's very simple. But when I try to use cloud run as a backend, I have the error : "Missing None. Make sure you are in the correct directoty and this file exists" while I have a main.py and a dockerfile in the directory.

    Any idea of what can be the issue ? Thanks in advance, Regards

    bug documentation 
    opened by mikaelcoumet 6
  • Allow other files in zip along with *.py files

    Allow other files in zip along with *.py files

    Config parameters are usually stored in .ini or .txt files. Can we allow .ini and .txt files atleast?

    https://github.com/anovis/goblet/blob/61a8ce2e4e1ff8d3967d79437573843f5c88c389/goblet/deploy.py#L157

    enhancement 
    opened by ivmarkp 6
  • `TypeError: main_handler() takes 1 positional argument but 2 were given` with `@app.topic('mytopic')`

    `TypeError: main_handler() takes 1 positional argument but 2 were given` with `@app.topic('mytopic')`

    Hello,

    I created a topic in PubSub called mytopic and I tried to create a function triggered by a message in this topic. The deployment is successful but after I publish a message, I get a TypeError: dbt_handler() takes 1 positional argument but 2 were given. Here is the code of my function and the error traceback :

    Function code

    from goblet import Goblet
    
    app = Goblet(function_name="goblet-pubsub")
    
    
    @app.topic('mytopic')
    def main_handler(data):
        app.log.info(data)
        return 
    

    Error traceback

    2021-11-11T15:20:13.051Z goblet-pubsub-topic-mytopic6gbe9k87mz0j 
    Exception on / [POST] Traceback (most recent call last): 
    File "/layers/google.python.pip/pip/lib/python3.7/site-packages/flask/app.py", line 2073, in wsgi_app response
        = self.full_dispatch_request() 
    File "/layers/google.python.pip/pip/lib/python3.7/site-packages/flask/app.py", line 1518, in full_dispatch_request 
        rv = self.handle_user_exception(e) 
    File "/layers/google.python.pip/pip/lib/python3.7/site-packages/flask/app.py", line 1516, in full_dispatch_request 
        rv = self.dispatch_request() 
    File "/layers/google.python.pip/pip/lib/python3.7/site-packages/flask/app.py", line 1502, in dispatch_request 
        return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args) 
    File "/layers/google.python.pip/pip/lib/python3.7/site-packages/functions_framework/__init__.py", line 171, in view_func 
        function(data, context) TypeError: main_handler() takes 1 positional argument but 2 were given
    
    Exception on / [POST] Traceback (most recent call last): 
    File "/layers/google.python.pip/pip/lib/python3.7/site-packages/flask/app.py", line 2073, in wsgi_app response 
        = self.full_dispatch_request() 
    File "/layers/google.python.pip/pip/lib/python3.7/site-packages/flask/app.py", line 1518, in full_dispatch_request 
        rv = self.handle_user_exception(e) 
    File "/layers/google.python.pip/pip/lib/python3.7/site-packages/flask/app.py", line 1516, in full_dispatch_request 
        rv = self.dispatch_request() 
    File "/layers/google.python.pip/pip/lib/python3.7/site-packages/flask/app.py", line 1502, in dispatch_request 
        return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args) 
    File "/layers/google.python.pip/pip/lib/python3.7/site-packages/functions_framework/__init__.py", line 171, in view_func 
        function(data, context) 
    
    TypeError: main_handler() takes 1 positional argument but 2 were given
    

    What am I supposed to provided to main_handler ?

    Thank you !

    opened by amirbtb 5
  • Cloud run jobs not correctly interfacing with cloud logging

    Cloud run jobs not correctly interfacing with cloud logging

    When using logging like in the cloud run jobs tutorial, like: app.log.info(f"job...{id}")

    In cloud logging, this is being interpreted as print statements / stdout, not actually structured cloud logging. image

    Not a huge deal, but structured logging is nice to have

    enhancement 
    opened by AdeelK93 4
  • Cloud Run Jobs customization

    Cloud Run Jobs customization

    Hi I'm trying to customize a few things about the cloud run jobs deployment, but can't find any documentation or examples on how to change:

    • cpu/memory resources
    • timeout
    • number of retries
    • VPC connector
    • total number of tasks

    Would love some help! Thanks

    documentation 
    opened by AdeelK93 4
  • [Cloudrun] Unable to attach cloudsql connector

    [Cloudrun] Unable to attach cloudsql connector

    Looking at the docs it looks like the sql connector should be added as an annotation as below. But it seems to not be working. Works with the cloudrun jobs it seems.

            "run.googleapis.com/cloudsql-instances": "projects/PROJECT/locations/LOCATION/connectors/SQL_CONNECTION",
    
    bug documentation 
    opened by anovis 0
  • Resource: Alerts

    Resource: Alerts

    New Alert Resource (closes #278)

    You can deploy alerts related to your application by using the alert method. Each alert takes a name and a list of conditions. Notification channels can be added to the alerts.notification_channel key in config.json or explicity in the alert. The base AlertCondition class allows you to fully customize your alert based on the fields privided by the GCP Alert Resource

    If you do not need a fully customized alert you can use the built in classes for MetricCondition, LogMatchCondition, and CustomMetricCondition. These come with defaults in terms of duration and aggregations, but can be overriden as needed. The CustomMetricCondition creates a custom metric based on the filter provided and then creates an alert using that metric.

    from goblet.resources.alerts import MetricCondition,LogMatchCondition,CustomMetricCondition
    app = Goblet()
    
    # Example Metric Alert for the cloudfunctin metric execution_count with a threshold of 10
    app.alert("metric",conditions=[MetricCondition("test", metric="cloudfunctions.googleapis.com/function/execution_count", value=10)])
    
    # Example Log Match metric that will trigger an incendent off of any Error logs
    app.alert("error",conditions=[LogMatchCondition("error", "severity>=ERROR")])
    
    # Example Metric Alert that creates a custom metric for severe errors with http code in the 500's and creates an alert with a threshold of 10
    app.alert("custom",conditions=[CustomMetricCondition("custom", metric_filter='severity=(ERROR OR CRITICAL OR ALERT OR EMERGENCY) httpRequest.status=(500 OR 501 OR 502 OR 503 OR 504)', value=10)])
    
    opened by anovis 0
  • [Documentation] Feedback for Improvements

    [Documentation] Feedback for Improvements

    I am planning on revisiting some of the documentation and am starting to gather feedback for areas that can be improved.

    Areas I plan on focusing on initially will be

    • Contributor documentation
    • Config.json examples
    • Adding examples of all resources in the main readme.

    Feel free to comment with other areas you would like to see improved.

    documentation 
    opened by anovis 0
  • Cloudtrace plugin

    Cloudtrace plugin

    Addresses #110

    This PR is not propagating spans correctly.

    for tracing information see the following...

    https://opentelemetry.io/docs/instrumentation/python/manual/ https://cloud.google.com/trace/docs/setup#instrumenting_tracing_for_applications https://github.com/open-telemetry/opentelemetry-python-contrib/blob/main/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/init.py

    opened by anovis 2
  • Issue with config's and stages

    Issue with config's and stages

    Looks like the config in get_timeout is not correctly getting the staged values.

    for example

    "stages":{
    "dev":{
                "api_gateway":{
                    "deadline":3600
               } }},
               
    

    in a stage doesn't work

    but on the main route it works as expected.

    "api_gateway":{
                    "deadline":3600
               }
    
    bug 
    opened by anovis 1
  • Bigquery integration

    Bigquery integration

    I'd like to propose a new integration/decorator - bigquery. Remote functions are recently GA.

    Basically, this would be similar to the app.post decorator, but also:

    • create a cloud_resource connection (if it doesn't exist), sharing the name of the goblet app
    • register the cloud function or cloud run as a remote function in bigquery
    • require the user to provide the name of the BQ remote function to create, as well as the function type signature

    Interested in feedback on the idea!

    proposal 
    opened by AdeelK93 3
Releases(0.9.3)
  • 0.9.3(Dec 19, 2022)

    What's Changed

    • Add plugins section to docs by @anovis in https://github.com/goblet/goblet/pull/284
    • update cloudrun secrets documentation by @dennismutia in https://github.com/goblet/goblet/pull/286
    • pubsub message ordering added to immutable keys by @brianhlee in https://github.com/goblet/goblet/pull/289
    • Backend http endpoint by @anovis in https://github.com/goblet/goblet/pull/290
    • [Routes] Pass through custom deadline field by @anovis in https://github.com/goblet/goblet/pull/292
    • [Local] Add set-env flag to goblet local command by @anovis in https://github.com/goblet/goblet/pull/295
    • Bugfix for cloudfunction backend by @anovis in https://github.com/goblet/goblet/pull/296

    New Contributors

    • @dennismutia made their first contribution in https://github.com/goblet/goblet/pull/286

    Full Changelog: https://github.com/goblet/goblet/compare/0.9.2...0.9.3

    Source code(tar.gz)
    Source code(zip)
  • 0.9.2(Oct 31, 2022)

    What's Changed

    • Fix key error by @AdeelK93 in https://github.com/goblet/goblet/pull/265
    • Add gcloud logger by @anovis in https://github.com/goblet/goblet/pull/266
    • Add label for resources that support it by @anovis in https://github.com/goblet/goblet/pull/267
    • latest_build_source KeyError by @AdeelK93 in https://github.com/goblet/goblet/pull/268
    • Raise goblet error on cloud build failure by @anovis in https://github.com/goblet/goblet/pull/270
    • Readme + Ready Release by @anovis in https://github.com/goblet/goblet/pull/274
    • Pin protobuf version by @anovis in https://github.com/goblet/goblet/pull/275

    Full Changelog: https://github.com/goblet/goblet/compare/0.9.1...0.9.2

    Source code(tar.gz)
    Source code(zip)
  • 0.9.1(Oct 17, 2022)

    What's Changed

    • Cloudrun jobs metadata by @anovis in https://github.com/goblet/goblet/pull/262
    • add init file to infrastructures module by @jissac in https://github.com/goblet/goblet/pull/263 (fixes #261 bug in 0.9.0)

    New Contributors

    • @jissac made their first contribution in https://github.com/goblet/goblet/pull/263

    Full Changelog: https://github.com/goblet/goblet/compare/0.9.0...0.9.1

    Source code(tar.gz)
    Source code(zip)
  • 0.9.0(Oct 15, 2022)

    What's Changed

    • Bugfix252-parallel build artifacts by @anovis in https://github.com/goblet/goblet/pull/253
    • Support duplicate nested Pydantic models by @anovis in https://github.com/goblet/goblet/pull/256
    • Infrastructure Support by @qua-jones in https://github.com/goblet/goblet/pull/254
    • 0.9.0 prep by @anovis in https://github.com/goblet/goblet/pull/258

    New Features

    • Infrastructure support (currently redis and vpc connectors) #254

    Breaking Changes

    • update cli deploy flags from skip_function, only_function to skip_resources, skip_backend, skip_infra

    Full Changelog: https://github.com/goblet/goblet/compare/0.8.4...0.9.0

    Source code(tar.gz)
    Source code(zip)
  • 0.8.4(Sep 26, 2022)

    What's Changed

    • [CLI] goblet local custom port by @anovis in https://github.com/goblet/goblet/pull/244
    • Create CODE_OF_CONDUCT.md by @anovis in https://github.com/goblet/goblet/pull/246
    • Deployment vars by @anovis in https://github.com/goblet/goblet/pull/248
    • Pass in cloudrun flags, fix force by @anovis in https://github.com/goblet/goblet/pull/249
    • [OpenApi] Pydantic Support by @anovis in https://github.com/goblet/goblet/pull/240
    • fix logging by @anovis in https://github.com/goblet/goblet/pull/250
    • Add private python library example to docs by @anovis in https://github.com/goblet/goblet/pull/251

    Breaking Changes

    • request_body openapi generation takes a pydantic or marshmallow object instead of a nested dictionary

    Full Changelog: https://github.com/goblet/goblet/compare/0.8.3...0.8.4

    Source code(tar.gz)
    Source code(zip)
  • 0.8.3(Sep 14, 2022)

    What's Changed

    • Add support for content_types and tags fields for openapi spec creation by @kylejohnson514 in https://github.com/goblet/goblet/pull/234
    • requirements.txt override by @brianhlee in https://github.com/goblet/goblet/pull/236
    • Add exit 1 codes to cli by @anovis in https://github.com/goblet/goblet/pull/235
    • skip requirements.txt for cloudrun if not needed by @anovis in https://github.com/goblet/goblet/pull/237
    • [README] Add new blog post by @anovis in https://github.com/goblet/goblet/pull/238

    New Contributors

    • @kylejohnson514 made their first contribution in https://github.com/goblet/goblet/pull/234

    Full Changelog: https://github.com/goblet/goblet/compare/0.8.2...0.8.3

    Source code(tar.gz)
    Source code(zip)
  • 0.8.2(Aug 29, 2022)

    What's Changed

    • Gateway timeout by @anovis in https://github.com/goblet/goblet/pull/225
    • refresh auth credentials by @qua-jones in https://github.com/goblet/goblet/pull/227
    • Cloudrun jobs by @anovis in https://github.com/goblet/goblet/pull/231
    • MissingArtifact exception by @anovis in https://github.com/goblet/goblet/pull/233

    New Feature

    • Cloudrun Jobs Trigger

    Full Changelog: https://github.com/goblet/goblet/compare/0.8.1...0.8.2

    Source code(tar.gz)
    Source code(zip)
  • 0.8.1(Aug 20, 2022)

    What's Changed

    • Cloudbuild Timeout by @anovis in https://github.com/goblet/goblet/pull/219
    • Fix custom files by @anovis in https://github.com/goblet/goblet/pull/220
    • #119 by @brianhlee in https://github.com/goblet/goblet/pull/221
    • Default cloud run command by @AdeelK93 in https://github.com/goblet/goblet/pull/222

    Full Changelog: https://github.com/goblet/goblet/compare/0.8.0...0.8.1

    Source code(tar.gz)
    Source code(zip)
  • 0.8.0(Aug 15, 2022)

    What's Changed

    • Cloudfunction V2 support
    • Cloudrun deployment changed to allow for better configuration (see breaking change below)
    • [PubSub] pass through configuration for subscriptions

    Breaking Changes

    • Cloudrun now uses the GCP rest apis instead of the gcloud cli for deployments (#163 ). This will require changes in config.json. See exampe below for possible fields. Cloudbuild configs and traffics are now able to be specified
    {
        "cloudrun": {
            "traffic": 25
        },
        "cloudrun_revision": {
            "serviceAccount": "[email protected]"
        },
        "cloudbuild": {
            "artifact_registry": "us-central1-docker.pkg.dev/CROSS_PROJECT/cloud-run-source-deploy/SOURCE_NAME",
            "serviceAccount": "projects/PROJECT/serviceAccounts/[email protected]"
        },
        "cloudrun_container": {
            "env": [
                {
                    "name": "env-variable-name",
                    "value": "env-variable-value"
                },
                {
                    "name": "env-variable-name",
                    "valueSource": {
                        "secretKeyRef" : {
                            "secret": "secret-name",
                            "version": "secret-version"
                        }
                    }
                }
            ]
        }
    }
    
    • remove check for authentication flag by @qua-jones in https://github.com/goblet/goblet/pull/200
    • Removed unused CMD by @AdeelK93 in https://github.com/goblet/goblet/pull/202
    • Include timezone as a schedule argument by @AdeelK93 in https://github.com/goblet/goblet/pull/203
    • chore(Dockerfile): update python 3.7 -> 3.10 by @jward-premise in https://github.com/goblet/goblet/pull/206
    • [PubSub] pass through configuration for subscriptions by @qua-jones in https://github.com/goblet/goblet/pull/209
    • Split Cloud Build and Deploy and added Traffic by @luke-xue in https://github.com/goblet/goblet/pull/208
    • Bugfix: Subscription attribute filter by @anovis in https://github.com/goblet/goblet/pull/211
    • new backend classes and support for gen 2 cloudfunctions by @samdevo in https://github.com/goblet/goblet/pull/198
    • fix cloudrun delta check by @samdevo in https://github.com/goblet/goblet/pull/212
    • Fix aliasing with rueyaml dump by @anovis in https://github.com/goblet/goblet/pull/213
    • Container Config and Project ID Fix by @luke-xue in https://github.com/goblet/goblet/pull/216
    • Add waiters for api gateway destroy by @anovis in https://github.com/goblet/goblet/pull/217

    New Contributors

    • @qua-jones made their first contribution in https://github.com/goblet/goblet/pull/200
    • @AdeelK93 made their first contribution in https://github.com/goblet/goblet/pull/202
    • @jward-premise made their first contribution in https://github.com/goblet/goblet/pull/206
    • @luke-xue made their first contribution in https://github.com/goblet/goblet/pull/208
    • @samdevo made their first contribution in https://github.com/goblet/goblet/pull/198

    Full Changelog: https://github.com/goblet/goblet/compare/0.7.6...0.8.0

    Source code(tar.gz)
    Source code(zip)
  • 0.7.6(Jul 18, 2022)

    What's Changed

    • [Cloudfunction] uses python runtime by @anovis in https://github.com/goblet/goblet/pull/193
    • [Pubsub] Return Response by @anovis in https://github.com/goblet/goblet/pull/194
    • Bugfix cors args by @anovis in https://github.com/goblet/goblet/pull/195

    Full Changelog: https://github.com/goblet/goblet/compare/0.7.5...0.7.6

    Source code(tar.gz)
    Source code(zip)
  • 0.7.5(Jul 14, 2022)

    What's Changed

    • [Cloudrun] Allow port and command to be overiden by @anovis in https://github.com/goblet/goblet/pull/180
    • [Openapispec] Make operationId unique by @anovis in https://github.com/goblet/goblet/pull/184
    • [OpenAPI] openapi -v 3 option by @anovis in https://github.com/goblet/goblet/pull/186
    • Update readme to include Cloud Run by @ethanwlo in https://github.com/goblet/goblet/pull/189
    • Add preflight cors support by @anovis in https://github.com/goblet/goblet/pull/192

    New Contributors

    • @ethanwlo made their first contribution in https://github.com/goblet/goblet/pull/189

    Full Changelog: https://github.com/goblet/goblet/compare/0.7.4...0.7.5

    Source code(tar.gz)
    Source code(zip)
  • 0.7.4(Jun 9, 2022)

    What's Changed

    • Add gcloud config for cloudrun deployments by @anovis in https://github.com/goblet/goblet/pull/175

    Full Changelog: https://github.com/goblet/goblet/compare/0.7.3...0.7.4

    Source code(tar.gz)
    Source code(zip)
  • 0.7.3(May 31, 2022)

    What's Changed

    • [Openapi] Custom type support by @anovis in https://github.com/goblet/goblet/pull/168
    • Skipping tests folder when deploying function by @piusnig in https://github.com/goblet/goblet/pull/169
    • Bugfix - cloudrun + apigateway missing client by @anovis in https://github.com/goblet/goblet/pull/171
    • Pubsub subscription attributes by @anovis in https://github.com/goblet/goblet/pull/172

    New Contributors

    • @piusnig made their first contribution in https://github.com/goblet/goblet/pull/169

    Full Changelog: https://github.com/goblet/goblet/compare/0.7.2.2...0.7.3

    Source code(tar.gz)
    Source code(zip)
  • 0.7.2.2(May 18, 2022)

    What's Changed

    • Bugfix json error 2 by @anovis in https://github.com/anovis/goblet/pull/167

    Full Changelog: https://github.com/anovis/goblet/compare/0.7.2.1...0.7.2.2

    Source code(tar.gz)
    Source code(zip)
  • 0.7.2.1(May 11, 2022)

    What's Changed

    • Bugfix-json headers, gateway update by @anovis in https://github.com/anovis/goblet/pull/165

    Full Changelog: https://github.com/anovis/goblet/compare/0.7.2...0.7.2.1

    Source code(tar.gz)
    Source code(zip)
  • 0.7.2(May 2, 2022)

    What's Changed

    • Update Requirements, Tests for python 3.10 by @anovis in https://github.com/anovis/goblet/pull/161
    • Bugfix: Add is_json check by @anovis in https://github.com/anovis/goblet/pull/162

    Full Changelog: https://github.com/anovis/goblet/compare/0.7.1...0.7.2

    Source code(tar.gz)
    Source code(zip)
  • 0.7.1(Apr 18, 2022)

    What's Changed

    • [Routes] cloudrun and apigateway route_type option by @anovis in https://github.com/anovis/goblet/pull/153
    • [Sync] Fix resource permission issue by @anovis in https://github.com/anovis/goblet/pull/157
    • [Docs] Test scheduler locally by @anovis in https://github.com/anovis/goblet/pull/158

    Full Changelog: https://github.com/anovis/goblet/compare/0.7.0...0.7.1

    Source code(tar.gz)
    Source code(zip)
  • 0.7.0(Apr 1, 2022)

    What's Changed

    • Refactor Clients by @anovis in https://github.com/anovis/goblet/pull/139
    • [Documentation] Secrets Manager Integration by @anovis in https://github.com/anovis/goblet/pull/141
    • Cross project subscription by @anovis in https://github.com/anovis/goblet/pull/142
    • Fix docs related to #143 by @anovis in https://github.com/anovis/goblet/pull/144
    • [Pubsub] Fix subscription update and destroy by @anovis in https://github.com/anovis/goblet/pull/146
    • [Pubsub] Cross subscription correctly triggers by @anovis in https://github.com/anovis/goblet/pull/148
    • [EventArc] New resource by @anovis in https://github.com/anovis/goblet/pull/149

    Full Changelog: https://github.com/anovis/goblet/compare/0.6.3...0.7.0

    Source code(tar.gz)
    Source code(zip)
  • 0.6.3(Feb 22, 2022)

    What's Changed

    • [Goblet] Request Context by @anovis in https://github.com/anovis/goblet/pull/130
    • Add Before and After Middleware handlers by @anovis in https://github.com/anovis/goblet/pull/134

    Full Changelog: https://github.com/anovis/goblet/compare/0.6.1...0.6.3

    Source code(tar.gz)
    Source code(zip)
  • 0.6.1(Jan 23, 2022)

    What's Changed

    • add query support for goblet openspec generation by @davidyum in https://github.com/anovis/goblet/pull/126
    • [CLI] Goblet sync by @anovis in https://github.com/anovis/goblet/pull/127

    New Contributors

    • @davidyum made their first contribution in https://github.com/anovis/goblet/pull/126

    Full Changelog: https://github.com/anovis/goblet/compare/0.6.0...0.6.1

    Source code(tar.gz)
    Source code(zip)
  • 0.6.0(Jan 12, 2022)

    What's Changed

    • [.github] Add stale.yml config by @anovis in https://github.com/anovis/goblet/pull/106
    • Documentation for service account auth by @anovis in https://github.com/anovis/goblet/pull/114
    • Multi Cloudfunction Support by @anovis in https://github.com/anovis/goblet/pull/116
    • Cloudrun backend by @anovis in https://github.com/anovis/goblet/pull/122
    • Black formatter by @anovis in https://github.com/anovis/goblet/pull/123

    Full Changelog: https://github.com/anovis/goblet/compare/0.5.2...0.6.0

    Source code(tar.gz)
    Source code(zip)
  • 0.5.2(Nov 18, 2021)

    • Add flag --all to destroy cli command to delete all artifacts in cloud storage related to the cloudfunction. goblet destroy --all (closes #98 )
    • Custom storage cloudfunction name
    • Add test and venv directories to be excluded in zip_directory function (closes #104 )
    • Set local default to "local", so default command will be goblet local. (closes #80 )
    Source code(tar.gz)
    Source code(zip)
  • 0.5.1(Nov 12, 2021)

    • add scheduler support for retryConfig , attemptDeadline, name (closes #93 )
    • set entrypoint to goblet_entrypoint instead of app because of #88 (closes #95)
    Source code(tar.gz)
    Source code(zip)
  • 0.5.0(Nov 2, 2021)

    • multiple schedulers for one entry function (#91)
    @app.schedule('5 * * * *')
    @app.schedule('2 * * * *')
    def scheduled_function()
       app.current_request
       return
    
    • pass through custom scheduler params such as body, headers, httpMethod
    @app.schedule('5 * * * *', httpMethod='POST', headers={'X-Custom': 'header'}, body='BASE64 ENCODED STRING')
    @app.schedule('5 * * * *', httpMethod='GET', headers={'X-Custom': 'header2'}, body='BASE64 ENCODED STRING 2')
    def scheduled_function()
       app.current_request
       return
    
    • adds helper to set entrypoint. add_entrypoint (#88 )
    from goblet import Goblet, jsonify, Response, add_entrypoint
    
    app = Goblet(function_name="goblet-test-issue", local="test")
    add_entrypoint(app)
    
    @app.http()
    def main(request):
        app.log.info("triggered")
        return jsonify(request.json)
    
    Source code(tar.gz)
    Source code(zip)
  • 0.4.10.1(Sep 29, 2021)

  • 0.4.10(Sep 28, 2021)

    • Adding ability to add security definition at the method level
    @app.route('/method_security', security=[{"your_custom_auth_id": []}])
    def method_security():
        return
    
      • config-from-json-string
    goblet deploy --project PROJECT -l LOCATION --config-from-json-string '{"cloudfunction": {"serviceAccount": "[email protected]"}}'
    
    • Local logger fix
    • Bugfix for a GCP breaking change with generateUploadUr
    Source code(tar.gz)
    Source code(zip)
  • 0.4.9(Jul 19, 2021)

    • Ability to configure apiSpec using config.json, which included gatewayServiceAccount (closes #71)
        {
            "apiConfig": {
                "gatewayServiceAccount": "projects/-/serviceAccounts/[email protected]",
                "labels": {
                    "label1" : "value1"
                }
            }
        }  
    
    • Add security section to openApispec based on securityDefinitions or security field in config.json (closes #72 )

    • Cors can be set on the route level or on the Goblet application level. Setting cors=True uses the default cors setting. (closes #60 )

    app=goblet("example",cors=True)
    

    or

        @app.route('/custom_backend', cors=True)
        def home():
            return "cors headers"
    

    results in these headers

        headers : {
            "Access-Control-Allow-Headers" : ['Content-Type', 'Authorization'],
            "Access-Control-Allow-Origin": "*"
        }
    

    Use the CORSConfig class to set customized cors headers from the goblet.resources.routes class.

        from goblet.resources.routes import CORSConfig
        @app.route('/custom_cors', cors=CORSConfig(allow_origin='localhost'))
        def custom_cors():
            return jsonify('localhost is allowed')
    
    Source code(tar.gz)
    Source code(zip)
  • 0.4.8(Jun 4, 2021)

  • 0.4.7(May 20, 2021)

    • Improve get_event_type so don't need to add headers for local testing (closes #49 )
    • Skips deployment if no changes detected (closes #27 )
    • Docstrings
    Source code(tar.gz)
    Source code(zip)
  • 0.4.6(May 12, 2021)

    • iam bindings
    {
        "bindings": [
            {
                "role": "roles/cloudfunctions.invoker",
                "members": [
                "allUsers"
                ]
            }
        ]
    }
    
    • goblet init command
    • minor doc fixes
    Source code(tar.gz)
    Source code(zip)
Light, Flexible and Extensible ASGI API framework

Starlite Starlite is a light, opinionated and flexible ASGI API framework built on top of pydantic and Starlette. Check out the Starlite documentation

Na'aman Hirschfeld 1.6k Jan 09, 2023
Persistent remote applications for X11; screen sharing for X11, MacOS and MSWindows.

Table of Contents About Installation Usage Help About Xpra is known as "screen for X" : its seamless mode allows you to run X11 programs, usually on a

xpra.org 785 Dec 30, 2022
Try to create a python mircoservice framework.

Micro current_status: prototype. ... Python microservice framework. More in Document. You should clone this project and run inv docs. Install Not now.

修昊 1 Dec 07, 2021
Cses2humio - CrowdStrike Falcon Event Stream to Humio

CrowdStrike Falcon Event Stream to Humio This project intend to provide a simple

Trifork.Security 6 Aug 02, 2022
APIFlask is a lightweight Python web API framework based on Flask and marshmallow-code projects

APIFlask APIFlask is a lightweight Python web API framework based on Flask and marshmallow-code projects. It's easy to use, highly customizable, ORM/O

Grey Li 705 Jan 04, 2023
News search API developed for the purposes of the ColdCase Project.

Saxion - Cold Case - News Search API Setup Local – Linux/MacOS Make sure you have python 3.9 and pip 21 installed. This project uses a MySQL database,

Dimitar Rangelov 3 Jul 01, 2021
The comprehensive WSGI web application library.

Werkzeug werkzeug German noun: "tool". Etymology: werk ("work"), zeug ("stuff") Werkzeug is a comprehensive WSGI web application library. It began as

The Pallets Projects 6.2k Jan 01, 2023
Python AsyncIO data API to manage billions of resources

Introduction Please read the detailed docs This is the working project of the next generation Guillotina server based on asyncio. Dependencies Python

Plone Foundation 183 Nov 15, 2022
Mini Web Framework on MicroPython (Esp8266)

dupgee Dupgee is a mini web framework developed for micro-python(Tested on esp8266). Installation pip install dupgee Create Project dupgee create newp

ahmet kotan 38 Jul 25, 2022
Ape is a framework for Web3 Python applications and smart contracts, with advanced functionality for testing, deployment, and on-chain interactions.

Ape Framework Ape is a framework for Web3 Python applications and smart contracts, with advanced functionality for testing, deployment, and on-chain i

ApeWorX Ltd. 552 Dec 30, 2022
Fast⚡, simple and light💡weight ASGI micro🔬 web🌏-framework for Python🐍.

NanoASGI Asynchronous Python Web Framework NanoASGI is a fast ⚡ , simple and light 💡 weight ASGI micro 🔬 web 🌏 -framework for Python 🐍 . It is dis

Kavindu Santhusa 8 Jun 16, 2022
A Simple Kivy Greeting App

SimpleGreetingApp A Simple Kivy Greeting App This is a very simple GUI App that receives a name text input from the user and returns a "Hello" greetin

Mariya 40 Dec 02, 2022
A familiar HTTP Service Framework for Python.

Responder: a familiar HTTP Service Framework for Python Powered by Starlette. That async declaration is optional. View documentation. This gets you a

Taoufik 3.6k Dec 27, 2022
NO LONGER MAINTAINED - A Flask extension for creating simple ReSTful JSON APIs from SQLAlchemy models.

NO LONGER MAINTAINED This repository is no longer maintained due to lack of time. You might check out the fork https://github.com/mrevutskyi/flask-res

1k Jan 04, 2023
Daniel Vaz Gaspar 4k Jan 08, 2023
Official mirror of https://gitlab.com/pgjones/quart

Quart Quart is an async Python web microframework. Using Quart you can, render and serve HTML templates, write (RESTful) JSON APIs, serve WebSockets,

Phil Jones 2 Oct 05, 2022
The Python micro framework for building web applications.

Flask Flask is a lightweight WSGI web application framework. It is designed to make getting started quick and easy, with the ability to scale up to co

The Pallets Projects 61.5k Jan 06, 2023
A tool for quickly creating REST/HATEOAS/Hypermedia APIs in python

ripozo Ripozo is a tool for building RESTful/HATEOAS/Hypermedia apis. It provides strong, simple, and fully qualified linking between resources, the a

Vertical Knowledge 198 Jan 07, 2023
Serverless Python

Zappa - Serverless Python About Installation and Configuration Running the Initial Setup / Settings Basic Usage Initial Deployments Updates Rollback S

Rich Jones 11.9k Jan 01, 2023
Screaming-fast Python 3.5+ HTTP toolkit integrated with pipelining HTTP server based on uvloop and picohttpparser.

Japronto! There is no new project development happening at the moment, but it's not abandoned either. Pull requests and new maintainers are welcome. I

Paweł Piotr Przeradowski 8.6k Dec 29, 2022