OCI: Project Fn setup

Instructions posted in the fn project page:

#1 Setup a VM running OL7.2 with 50GB

Preferably pick OL72 over OL68 as fn require docker > 17.5

#2 Setup security policy (OL7)

# setenforce permission

#3 Install docker (root)

Follow the instructions posted in the documentation.

Update /etc/yum.repos.d/public-yum-ol7.repo to enable the ol7_addons then

# yum install docker-engine wget tree
# chkconfig docker on
# yum update
# service docker start

#4 Install fn (as root)

curl -LSs https://raw.githubusercontent.com/fnproject/cli/master/install | sh

#5 Create a runtime user and add it to the docker group

# useradd -g 500 -d /home/oracle oracle
# sudo usermod -a -G docker oracle

#6 Login as oracle and start the fn server

$ fn start

#5 Login again as oracle in a second window and configure a demo project

$ mkdir project
$ cd project
$ fn init --runtime go hello
$ cd hello
$ fn run
$ fn deploy --app myapp --local
$ fn invoke myapp hello

Update the file func.go, changing Hello with bonjour, deploy and test again

$ fn deploy --app myapp --local
$ fn invoke myapp hello
{"message":"Bonjour World"}