riff is for functions

riff is for functions

  • Docs
  • Blog
  • GitHub
  • Slack

›Build

Version (v0.5.x)

  • v0.6.x (snapshot)
  • v0.4.x
  • v0.3.x

Getting Started

  • Pick your environment
  • GKE
  • Minikube
  • Docker for Mac
  • Docker for Windows

Runtimes

  • Core
  • Knative
  • Streaming

Function Invokers

  • Java
  • Node.js
  • Command

CLI Reference

  • riff
  • riff doctor
  • riff completion
  • Credential

    • riff credential
    • riff credential apply
    • riff credential delete
    • riff credential list

    Build

    • riff function
    • riff function create
    • riff function delete
    • riff function list
    • riff function status
    • riff function tail
    • riff application
    • riff application create
    • riff application delete
    • riff application list
    • riff application status
    • riff application tail
    • riff container
    • riff container create
    • riff container delete
    • riff container list
    • riff container status

    Knative Runtime

    • riff knative
    • riff knative adapter
    • riff knative adapter create
    • riff knative adapter delete
    • riff knative adapter list
    • riff knative adapter status
    • riff knative deployer
    • riff knative deployer create
    • riff knative deployer delete
    • riff knative deployer list
    • riff knative deployer status
    • riff knative deployer tail

    Core Runtime

    • riff core
    • riff core deployer
    • riff core deployer create
    • riff core deployer delete
    • riff core deployer list
    • riff core deployer status
    • riff core deployer tail

    Streaming Runtime

    • riff streaming
    • riff streaming stream
    • riff streaming stream create
    • riff streaming stream delete
    • riff streaming stream list
    • riff streaming stream status
    • riff streaming processor
    • riff streaming processor create
    • riff streaming processor delete
    • riff streaming processor list
    • riff streaming processor status
    • riff streaming processor tail
    • riff streaming gateway
    • riff streaming gateway list
    • riff streaming gateway status

    In-memory Gateway

    • inmemory-gateway
    • inmemory-gateway create
    • inmemory-gateway delete
    • inmemory-gateway list
    • inmemory-gateway status

    Kafka Gateway

    • kafka-gateway
    • kafka-gateway create
    • kafka-gateway delete
    • kafka-gateway list
    • kafka-gateway status

    Pulsar Gateway

    • pulsar-gateway
    • pulsar-gateway create
    • pulsar-gateway delete
    • pulsar-gateway list
    • pulsar-gateway status
Edit

riff function create

create a function from source

Synopsis

Create a function from source using the function Cloud Native Buildpack builder.

Function source can be specified either as a Git repository or as a local directory. Builds from Git are run in the cluster while builds from a local directory are run inside a local Docker daemon and are orchestrated by this command (in the future, builds from local source may also be run in the cluster).

In addition to the source code, functions are defined by these properties:

  • invoker - language runtime that should host the function, the invoker is often auto-detected, but may need to be specified in cases of ambiguity.
  • artifact - file in the source that contains the function.
  • handler - invoker specific, typically the method or class within the artifact.

These values can be versioned with the source code in a riff.toml file, or specified here to override the source. Versioning with the source is preferred as changed can be deployed as a unit. Overriding is necessary when deploying multiple functions from a single code base.

The riff.toml file takes the form:

override = "<invoker name>"
artifact = "<path to artifact>"
handler = "<function handler>"
riff function create <name> [flags]

Examples

riff function create my-func --image registry.example.com/image --git-repo https://example.com/my-func.git
riff function create my-func --image registry.example.com/image --local-path ./my-func

Options

      --artifact file           file containing the function within the build workspace (detected by default)
      --cache-size size         size of persistent volume to cache resources between builds
      --dry-run                 print kubernetes resources to stdout rather than apply them to the cluster, messages normally on stdout will be sent to stderr
      --env variable            environment variable defined as a key value pair separated by an equals sign, example "--env MY_VAR=my-value" (may be set multiple times)
      --git-repo url            git url to remote source code
      --git-revision refspec    refspec within the git repo to checkout (default "master")
      --handler name            name of the method or class to invoke, depends on the invoker (detected by default)
  -h, --help                    help for create
      --image repository        repository where the built images are pushed (default "_")
      --invoker name            language runtime invoker name (detected by default)
      --limit-cpu cores         the maximum amount of cpu allowed, in CPU cores (500m = .5 cores)
      --limit-memory bytes      the maximum amount of memory allowed, in bytes (500Mi = 500MiB = 500 * 1024 * 1024)
      --local-path directory    path to directory containing source code on the local machine
  -n, --namespace name          kubernetes namespace (defaulted from kube config)
      --sub-path directory      path to directory within the git repo to checkout
      --tail                    watch build logs
      --wait-timeout duration   duration to wait for the function to become ready when watching logs (default "10m")

Options inherited from parent commands

      --config file       config file (default is $HOME/.riff.yaml)
      --kubeconfig file   kubectl config file (default is $HOME/.kube/config)
      --no-color          disable color output in terminals

SEE ALSO

  • riff function - functions built from source using function buildpacks
← riff functionriff function delete →
riff is for functions
Docs
Versions
Community
BlogGitHubSlackKnativeTwitter
More
Privacy PolicyTerms of UseCode of Conduct
Deployed by Netlify
Copyright © 2021 VMware, Inc