Skip to content

Instantly share code, notes, and snippets.

View trisberg's full-sized avatar

Thomas Risberg trisberg

View GitHub Profile
@trisberg
trisberg / spring-knative-cloudevents.adoc
Last active March 11, 2020 15:28
Processing CloudEvents with Spring and Knative
minikube start --memory=4096 --cpus=4 --vm-driver=kvm2 --kubernetes-version 1.17.2
kapp deploy -n apps -a cert-manager -f https://storage.googleapis.com/projectriff/release/0.5.0-snapshot/cert-manager.yaml -y
kapp deploy -n apps -a kpack -f https://storage.googleapis.com/projectriff/release/0.5.0-snapshot/kpack.yaml -y
kapp deploy -n apps -a riff-builders -f https://storage.googleapis.com/projectriff/release/0.5.0-snapshot/riff-builders.yaml -y
kapp deploy -n apps -a riff-build -f https://storage.googleapis.com/projectriff/release/0.5.0-snapshot/riff-build.yaml -y
ytt -f https://storage.googleapis.com/projectriff/release/0.5.0-snapshot/istio.yaml -f https://storage.googleapis.com/projectriff/charts/overlays/service-nodeport.yaml --file-mark istio.yaml:type=yaml-plain | kapp deploy -n apps -a istio -f - -y
kapp deploy -n apps -a knative -f https://storage.googleapis.com/projectriff/release/0.5.0-snapshot/knative.yaml -y
set -euo pipefail
set -x
# delete riff/knative resources
kubectl delete riff --all-namespaces --all
kubectl delete knative --all-namespaces --all
# riff streaming runtime
kapp delete -y -n apps -a riff-streaming-runtime
kapp delete -y -n apps -a keda
@trisberg
trisberg / DEMO.md
Last active October 5, 2019 15:54
Demo of a riff task runtime POC

Demo of a riff task runtime POC

Introduction

Spring Cloud Task allows a user to develop and run short lived microservices using Spring Cloud and run them locally or in the cloud. They can also be run as part of Spring Cloud Data Flow. We thought that it would be interesting if we could add a task runtime to riff to run tasks there. This document explains how to run a quick demo of this task runtime POC.

Installation

Download the riff-task-poc-demo.zip archive and unzip it in a riff-task-demo directory.

@trisberg
trisberg / riff-java-functions.md
Last active May 15, 2020 16:01
Creating Java functions for riff

Creating Java functions for riff

Java functions will be invoked using a Java Function Invoker that is provided by riff when you build the function.

The Java Function Invoker is a Spring Boot application which will locate your function based on configuration settings, and invoke the function for each request.

The riff function support for the Java language relies on function code being written using interfaces like Function<T,R>, Supplier<T>, or Consumer<T> from the java.util.function package in the Java SE platform.

The implementation can be provided as a plain Java class or as part of a Spring Boot app.

@trisberg
trisberg / riff-jfi-build.md
Created August 14, 2019 16:54
riff 0.3.x Java Function Invoker builds

Building and deploying functions to local cluster

To build and deploy your function locally you can use the riff CLI which can be installed following the instructions on the riff Release page.

You also need to have riff and Knative installed on a local Minikube or Docker for Mac cluster, just follow the instructions we linked to.

If you are using Minikube then you should configure Docker to use the Docker environment running in Minikube:

@trisberg
trisberg / four-bindings.adoc
Last active October 24, 2020 13:57
A tale of four backing service bindings
@trisberg
trisberg / three-bindings.adoc
Last active October 24, 2020 13:56
A tale of three database backing service bindings

A tale of three database backing service bindings

Important

This document is deprecated, you want to look at A tale of four backing service bindings instead.

Introduction

How does Cody connect his function or app to a backing service? First off, what do we mean by backing service?

Add the GCP Spanner starter dependency (the bold parts are the additions):

pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>