Announcing riff v0.2.0
We are happy to announce the release of riff v0.2.0. Thank you once again, all riff, Buildpacks, and Knative contributors.
The riff CLI can be downloaded from our releases page on GitHub. Please follow one of the getting started guides, to create a new cluster on GKE or minikube.
Notable changes in this release include:
- All builds now use Buildpacks
- No more special-case builds of images starting with
dev.local riff function create- no
<invoker>argument before the<name>argument - new optional
--invokerflag
- no
riff function buildhas been renamedriff function updateriff service revisehas been renamedriff service updateriff namespace inithas a new--no-secretflag
Buildpacks everywhere!
This release extends the use of buildpacks across all of our currently supported invokers: Java, JavaScript, and Command.
Here is a map of the buildpack-related repos on Github.
- riff builder creates the
projectriff/buildercontainer. - riff buildpack contributes invokers for running functions
- Node invoker runs JavaScript functions
- Java invoker runs Java functions
- Command invoker runs command functions
- OpenJDK buildpack contributes OpenJDK JREs and JDKs
- Build System buildpack performs Java based builds
- NodeJS buildpack contributes node.js runtime
- NPM buildpack performs npm based builds
Function Create
Since buildpacks do detection, we have simplified what used to be:
riff function create <invoker> <name>
The new syntax is:
riff function create <name>
A new --invoker <invokername> flag allows overrides.
Detection Logic
- The presence of a
pom.xmlorbuild.gradlefile will trigger compilation and building of an image for running a Java function. - A
package.jsonfile or an--artifactflag pointing to a.jsfile will build the image for running a JavaScript function. - An
--artifactflag pointing to a file with execute permissions will generate an image for running a Command function.
For example, say you have a directory containing just one file, wordcount.sh:
#!/bin/bash
tr ' ' '\n' | sort | uniq -c | sort -n
Make the file executable to use it as a command function.
chmod +x wordcount.sh
Call riff function create providing the name of the image. E.g. with your DockerHub repo ID.
riff function create wordcount \
--local-path . \
--artifact wordcount.sh \
--image $DOCKER_ID/wordcount:v1
When the function is running:
riff service invoke wordcount --text -- \
-d 'yo yo yo version 0.2.0' \
-w '\w'
1 0.2.0
1 version
3 yo
Extra!
Try running the following command to invoke your wordcount function on something a little more interesting.
curl -s https://www.constitution.org/usdeclar.txt \
| riff service invoke wordcount --text -- -d @-
Build from GitHub
For in-cluster builds using a GitHub repo, e.g. in a hosted riff environment, replace the --local-path . with --git-repo <url>.
riff function create wordcount \
--git-repo https://github.com/projectriff-samples/command-wordcount \
--artifact wordcount.sh \
--image $DOCKER_ID/wordcount \
--verbose
No more dev.local
Note that we have removed support for the special dev.local image name prefix for local builds. All image names need to be prefixed with a registry, and you'll need to configure your riff namespace with credentials to push images to that registry. A new --no-secret flag has been added to riff namespace init if your registry does not require authentication.
For more details please see the help for riff namespace init -h or refer to one of the Getting Started Guides.