Git Product home page Git Product logo

command-function-buildpack's Introduction

command-function-buildpack

The Command Function Buildpack is a Cloud Native Buildpack V3 that provides riff Command Function Invoker to functions.

This buildpack is designed to work in collaboration with other buildpacks, which are tailored to support (and know how to build / run) languages supported by riff.

In Plain English

In a nutshell, when combined with the other buildpacks present in the riff builder what this means (and especially when dealing with the riff CLI which takes care of the creation of the riff.toml file for you):

  • The fact that the --artifact flag points to a file with the execute permission will result in the execution as a command function, thanks to the command invoker
  • Ambiguity in the detection process will result in a build failure
  • The presence of the --invoker flag will entirely bypass the detection mechanism and force a given language/invoker

Detailed Buildpack Behavior

Detection Phase

Detection passes if

  • a $APPLICATION_ROOT/riff.toml exists and
  • the file pointed to by the artifact value in riff.toml exists and is executable

If detection passes, the buildpack will add a riff-invoker-command key and command metadata extracted from the riff metadata.

If several languages are detected simultaneously, the detect phase errors out. The override key in riff.toml can be used to bypass detection and force the use of a particular invoker.

Build Phase

If a command function has been selected

  • Contributes the riff Command Invoker to a launch layer, set as the main executable with FUNCTION_URI = <artifact> set as an environment variable.

The function behavior is exposed via standard buildpack process types:

  • Contributes web process
  • Contributes function process

How to Build

You can build the buildpack by running

make

This will package (with pre-downloaded cache layers) the buildpack in the artifactory/io/projectriff/command/io.projectriff.command/latest directory. That can be used as a uri in a builder.toml file of a builder (see https://github.com/projectriff/riff-buildpack-group)

License

This buildpack is released under version 2.0 of the Apache License.

command-function-buildpack's People

Contributors

scothis avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.