Enables a FaaS experience for Knative / Cloud Native Runtimes.

Function Buildpacks for Knative

Enables a FaaS experience for Knative / Cloud Native Runtimes.

Will soon extend func to create deployable functions via CLI.

Pre-Requisites

Currently Supported

  • Python
  • Java (Spring)

Future

  • NodeJS
  • .NET
  • Rust

Usage

The buildpacks in this repository have been built, published, and included in the builder.

The builder is also built and published as an image to gcr.io -- to build an image from source, simply use the builder as shown below.

For example:

pack build 
   
     --path /path/to/function --builder us.gcr.io/daisy-284300/kn-fn/builder:0.0.1

   

For more details you can refer to language-specific documentation:

Creating the Builder from Source

  1. Build the buildpacks
make buildpacks

TODO: Tag specific versions rather than depending on latest

  1. Build the builder
make builder

Note the builder name in the output. Use this local builder in the pack build command similarly to above.

Documentation

Each subdirectory has a relevant README.md describing how to use its respective files.

Contributing

The function-buildpacks-for-knative project team welcomes contributions from the community. Before you start working with function-buildpacks-for-knative, please read our Developer Certificate of Origin. All contributions to this repository must be signed as described on that page. Your signature certifies that you wrote the patch or have the right to pass it on as an open-source patch. For more detailed information, refer to CONTRIBUTING.md.

License

Reporting Bugs or Vulnerabilities

Owner
VMware Tanzu
Cloud native open source from VMware
VMware Tanzu
Comments
  • Add Liveness/Readiness Endpoints to Python and Java Invokers

    Add Liveness/Readiness Endpoints to Python and Java Invokers

    Which issue(s) this PR fixes

    Fixes: #46

    What this PR solves

    Adds default endpoint Liveness and Readiness probes to the Python Invoker and Java Invoker. The final state of the PR will involve new Invoker, Buildpack, and Builder releases.

    Details for release notes

    Add Liveness and Readiness Probes via default endpoint to Python and Java Invokers
    

    Describe testing done for PR

    WIP

    Test by using the dev builder which includes these changes: us.gcr.io/daisy-284300/kn-fn/functions-builder:0.0.10

    Special notes for your reviewer

    Currently only available via the default endpoints.

  • Add Template Testing

    Add Template Testing

    Which issue(s) this PR fixes

    Fixes: #29

    What this PR solves

    Adds tests for our templates

  • Make templates usable for func create

    Make templates usable for func create

    Signed-off-by: Fabian Lopez [email protected]

    Which issue(s) this PR fixes

    Partially fixes: #30

    What this PR solves

    Makes templates usable by kn func create

    Details for release notes

    Create via kn-func can now make use the java and python templates from this repo:
    kn func create -r https://github.com/vmware-tanzu/function-buildpacks-for-knative.git -l java -t (cloudevents-maven|cloudevents-gradle|http-maven|http-gradle)
    kn func create -r https://github.com/vmware-tanzu/function-buildpacks-for-knative.git -l python -t (cloudevents|http)
    

    Describe testing done for PR

    Created a fork for this repo and by making the same changes in this PR to the manifest.yaml I was able to create functions by pointing to my fork with the -r flag

    Special notes for your reviewer

    As mentioned in the linked issue, there still is the problem of building the generated functions with our buildpacks

  • Add copyright notice to all files

    Add copyright notice to all files

    Which issue(s) this PR fixes

    Fixes: # PDY-809

    What this PR solves

    Add copyright notice to all files

    Details for release notes

    Added Makefile targets to easily add the copyright and license notice at the top of files.  
    Trigger a check upon PR creation. 
    

    Describe testing done for PR

    Manual test of the new github actions.

    Special notes for your reviewer

  • Extract common buildpack code

    Extract common buildpack code

    Introduces a common go module from which to share code that is common among buildpacks

    • Moves python/java.FuncYaml (and tests) to common config.FuncYaml
    • Moves python.CommandRunner to common command.Runner

    TODO:

    • [x] Change target branch back to main after #137 is merged
  • Java buildpacks do not pick up `func.yaml`

    Java buildpacks do not pick up `func.yaml`

    Bug Report

    The Java builder/buildpack does not pick up func.yaml, resulting in the logic for func.yaml never executing: https://github.com/vmware-tanzu/function-buildpacks-for-knative/blob/0962a3c438e2acefc05960df4db5c646d0d5b124/buildpacks/java/java/build.go#L50

    Expected Behavior

    func.yaml is copied over to the Java layers and can be accessed and read

    Steps to Reproduce the Bug

    1. Create a Java image that contains a func.yaml populated with envs and/or options at time of deployment.
    2. docker run -it --rm --entrypoint bash <image-name> into the image
    3. Check the directories and cd /workspace for the existence of func.yaml
  • Add configuration for Python buildpack to define package to scan and which function to load

    Add configuration for Python buildpack to define package to scan and which function to load

    Feature Request

    The Python buildpack expects two environment variables MODULE_NAME and FUNCTION_NAME.

    Proposed configuration values: BP_FUNCTION: The name of the function to look for. Default: func.main

    Alternatively we can instead do: BP_FUNCTION_MODULE BP_FUNCTION_NAME

  • Add smoke tests for CloudEvents

    Add smoke tests for CloudEvents

    Which issue(s) this PR fixes

    Fixes: #7 and PDY-527

    What this PR solves

    Add smoke tests for CloudEvents

    Details for release notes

    Added smoke testing for CloudEvents layers
    

    Describe testing done for PR

    Special notes for your reviewer

  • fix: Fix txt-to-pdf samples

    fix: Fix txt-to-pdf samples

    Which issue(s) this PR fixes

    Fixes: Both Python and Java txt-to-pdf samples, docs, and video demos.

  • Suan/smoke test v2

    Suan/smoke test v2

    Which issue(s) this PR fixes

    Fixes: #15

    What this PR solves

    Revises smoke-tests to work as expected for HTTP, Cloudevents on Java, Python

    Details for release notes

    Fixes issue with smoke tests for CloudEvents
    
  • As a developer, I want to use my function buildpack for my code when I specify my `func.yaml`.

    As a developer, I want to use my function buildpack for my code when I specify my `func.yaml`.

    Feature Request

    Right now, we rely on the environment variable PYTHON_HANDLER to be set with a default value of handler.handler. Source

    This can create some applications not meant for functions to be picked by the buildpack. We might want to align with the guide of a template described in Template Guide. the template guide describes that all templates will have a `func.yml file.

    This file is created by the func cli tool. It is not needed to be in the templates we use to create functions, but it should be in the mechanism of the buildpacks detection.

    Describe alternatives you've considered

    From the different ways to understand if the current folder/repo is a function type of the buildpacks we built, I think this is the easiest way so far and it will be aligned with the spec of a template folder for the CLI spec guide.

    Additional context

    This will probably require changes in our sample projects as well

  • fix (samples): Re-write txt-to-pdf sample to work with latest TriggerMesh

    fix (samples): Re-write txt-to-pdf sample to work with latest TriggerMesh

    Signed-off-by: Bryan Tong [email protected]


    Note: These samples require external applications (Cloud Native Runtimes, Tanzu Application Platform) Contingent on CNR updating their support for TriggerMesh. Was delayed to their 1.4 release.

  • When no default function is specified for Java but a function name exists in `func.yaml` use that.

    When no default function is specified for Java but a function name exists in `func.yaml` use that.

    Feature Request

    Since a Java class can have multiple function implementations, we won't be able to automatically determine the default function to use with /. I propose that if there is a func.yaml present and it has a name field, that we use it as the default if it wasn't specified.

  • Update Python invoker such that the function being written doesn't depend on flask's response object to return an http status

    Update Python invoker such that the function being written doesn't depend on flask's response object to return an http status

    Feature Request

    Update the Python invoker to handle http status codes. The way to do it currently is to return a Flask.Response object which makes us a leaky abstraction. We want to perhaps update the response we expect from the function to be (status_code, body) or the likes. We need to also consider the situation where we may want to have attributes returned in the case of CloudEvents or whether we want to respond with a specific header.

  • Provide a configuration option for the location of the function

    Provide a configuration option for the location of the function

    Feature Request

    A way to specify the location of a function within a directory. This is relevant to a monorepo consisting of multiple functions, possibly with multiple directories that could contain your function(s).

    This could be something like BP_FUNCTION_SEARCH_PATH or BP_FUNCTION_PATH. We can discuss on what name is appropriate in the comments.

    Describe alternatives you've considered

    New repo per function and everything is top-level. Applications may have multiple moving parts that are closely related.

    ⚠️ Still in an early discovery phase

  • Python invoker throws exception when the function returns just data without attributes

    Python invoker throws exception when the function returns just data without attributes

    Bug Report

    Running a function that expects cloudevents where after processing returns only the body will cause it to throw an exception.

    Expected Behavior

    No errors + proper attributes are returned.

    Steps to Reproduce the Bug

    1. Define a function:
      from typing import Any
      
      def main(data: Any, attributes: dict):
          # Your function implementation goes here
          return data
      
    2. Run this function with the Python invoker.
    3. Send a CE via curl to function.
Cloud Native Electronic Trading System built on Kubernetes and Knative Eventing

Ingenium -- Still heavily in prototyping stage -- Ingenium is a cloud native electronic trading system built on top of Kubernetes and Knative Eventing

Aug 29, 2022
FaaSNet: Scalable and Fast Provisioning of Custom Serverless Container Runtimes at Alibaba Cloud Function Compute (USENIX ATC'21)

FaaSNet FaaSNet is the first system that provides an end-to-end, integrated solution for FaaS-optimized container runtime provisioning. FaaSNet uses l

Jan 2, 2023
An open-source, distributed, cloud-native CD (Continuous Delivery) product designed for developersAn open-source, distributed, cloud-native CD (Continuous Delivery) product designed for developers
An open-source, distributed, cloud-native CD (Continuous Delivery) product designed for developersAn open-source, distributed, cloud-native CD (Continuous Delivery) product designed for developers

Developer-oriented Continuous Delivery Product ⁣ English | 简体中文 Table of Contents Zadig Table of Contents What is Zadig Quick start How to use? How to

Oct 19, 2021
provide api for cloud service like aliyun, aws, google cloud, tencent cloud, huawei cloud and so on

cloud-fitter 云适配 Communicate with public and private clouds conveniently by a set of apis. 用一套接口,便捷地访问各类公有云和私有云 对接计划 内部筹备中,后续开放,有需求欢迎联系。 开发者社区 开发者社区文档

Dec 20, 2022
TriggerMesh open source event-driven integration platform powered by Kubernetes and Knative.

TriggerMesh open source event-driven integration platform powered by Kubernetes and Knative. TriggerMesh allows you to declaratively define event flows between sources and targets as well as add even filter, splitting and processing using functions.

Dec 30, 2022
Knative function anonymousface for golang
Knative function anonymousface for golang

knative-function-anonymousface Usage $ curl -s -X POST -F [email protected] http://anonymousface.default.127.0.0.1.nip.io:8080 > out.jpg Installation

Nov 23, 2021
Knative Sample Controller

Knative Sample Controller Knative sample-controller defines a few simple resources that are validated by webhook and managed by a controller to demons

Jan 21, 2022
Cloud-Z gathers information and perform benchmarks on cloud instances in multiple cloud providers.

Cloud-Z Cloud-Z gathers information and perform benchmarks on cloud instances in multiple cloud providers. Cloud type, instance id, and type CPU infor

Jun 8, 2022
A kubernetes plugin which enables dynamically add or remove GPU resources for a running Pod
A kubernetes plugin which enables dynamically add or remove GPU resources for a running Pod

GPU Mounter GPU Mounter is a kubernetes plugin which enables add or remove GPU resources for running Pods. This Introduction(In Chinese) is recommende

Jan 5, 2023
Stackie enables developers to configure their local environment/toolchain with ease.

Stackie enables developers to configure their local environment/toolchain with ease. Made for Pulumi CLI, Google Cloud Platform (gcloud), and Amazon Web Services (aws-cli).

Sep 10, 2021
provider-kubernetes is a Crossplane Provider that enables deployment and management of arbitrary Kubernetes objects on clusters

provider-kubernetes provider-kubernetes is a Crossplane Provider that enables deployment and management of arbitrary Kubernetes objects on clusters ty

Dec 14, 2022
LazyXds enables Istio only push needed xDS to sidecars to reduce resource consumption and speed up xDS configuration propagation.
LazyXds enables Istio only push needed xDS to sidecars to reduce resource consumption and speed up xDS configuration propagation.

LazyXds LazyXds enables Istio only push needed xDS to sidecars to reduce resource consumption and speed up xDS configuration propagation. Problems to

Dec 28, 2022
The Cloud Native Application Proxy
The Cloud Native Application Proxy

Traefik (pronounced traffic) is a modern HTTP reverse proxy and load balancer that makes deploying microservices easy. Traefik integrates with your ex

Jan 9, 2023
Kubernetes Operator for a Cloud-Native OpenVPN Deployment.

Meerkat is a Kubernetes Operator that facilitates the deployment of OpenVPN in a Kubernetes cluster. By leveraging Hashicorp Vault, Meerkat securely manages the underlying PKI.

Jan 4, 2023
Open Service Mesh (OSM) is a lightweight, extensible, cloud native service mesh that allows users to uniformly manage, secure, and get out-of-the-box observability features for highly dynamic microservice environments.
Open Service Mesh (OSM) is a lightweight, extensible, cloud native service mesh that allows users to uniformly manage, secure, and get out-of-the-box observability features for highly dynamic microservice environments.

Open Service Mesh (OSM) Open Service Mesh (OSM) is a lightweight, extensible, Cloud Native service mesh that allows users to uniformly manage, secure,

Jan 2, 2023
Zadig is a cloud native, distributed, developer-oriented continuous delivery product.

Zadig Developer-oriented Continuous Delivery Product English | 简体中文 Table of Contents Zadig Table of Contents What is Zadig Quick start How to use? Ho

Jan 8, 2023
Zadig is a cloud native, distributed, developer-oriented continuous delivery product.

Zadig Developer-oriented Continuous Delivery Product ⁣ English | 简体中文 Table of Contents Zadig Table of Contents What is Zadig Quick start How to use?

May 12, 2021
Interactive Cloud-Native Environment Client
Interactive Cloud-Native Environment Client

Fenix-CLI:Interactive Cloud-Native Environment Client English | 简体中文 Fenix-CLI is an interactive cloud-native operating environment client. The goal i

Dec 15, 2022