Functions Lab
In this lab you will also explore serverless computing using Oracle Functions. Oracle Functions uses the open-source Fn engine.
This document is meant to be an overview of the entire lab. Throughout, you may be directed to other labs, to run specific sections. It is important that when you finish each major section, you return to this document for the next section.
As you make your way through the tutorials, look out for this icon.
Whenever you see it, it's time for you to
perform an action.
Note:
-
Make sure you use
clear-guest
orclear-internet
. And NOTclear-corporate
. -
If you are using virtualbox with the "fnlab.ova" image make sure you run the entire lab inside the "fnlab VM".
Section 1 - Setting up a Docker Environment
Section 2 - Verifying your Docker Install
Before we get started with functions we're going to verify that Docker is installed and working. In a terminal, type the following command:
docker --version
If Docker is installed and running, you should see output something like:
Docker version 17.0x.x-ce, build 276fd32
NOTE: Depending on how you've installed Docker you may need to prefix docker
commands with sudo
in which case you would have to type:
sudo docker --version
Section 3 - Functions
Note: For this section you do NOT need the fn server on your machine. Your CLI will connect to the Functions cloud service.
With Docker successfully installed it's time to move on to functions. Functions as a Service (FaaS) platforms provide a way to deploy code to the cloud without having to worry about provisioning or managing any compute infrastructure.
Oracle Functions is a fully managed serverless FaaS platform running in Oracle Cloud. Functions uses open source Fn Project as it's underlying FaaS platform.
Fn Project can run anywhere - on your laptop or in the cloud. With Fn you can develop locally and deploy to the cloud knowing your functions are running on exactly the same underlying platform.
1) Setup Local Development Environment
2) Functions Commands Cheatsheet
-
Use the Functions Commands Cheatsheet
-
Also see the fn CLI docs
3) Your First Function
4) Your Second Function
Section 4 - Open Source Fn
Note: For this section you need the fn server running on your machine. Each lab below has a step to start the fn server.
1) Function to Oracle Database
Note: Your lab instructor will share your DB connection details
2) Function to OCI Object Store
Note: Your lab instructor will share the object store bucket details
3) Troubleshooting
TODO - Add DEBUG=1, Common Errors