Skip to content

Latest commit

 

History

History
116 lines (68 loc) · 4.96 KB

Lab300a.md

File metadata and controls

116 lines (68 loc) · 4.96 KB

Lab 300: Serverless Functions

comic

Source

Recommended Resources to start with before this lab

Getting started with functions lab - MANDATORY There is also this secondary lab

You may consider the above lab as the best place to start using functions while the rest of this page is a repo for supplemental knowledge. In lab 301 and lab 302, we will build on the work from that lab. The bottom of this page in this repo has consolidated the terminal commands you will use in the above lab.

Useful resources

fn project tuturials

fn project documentation

Functions API

Functions CLI

CI/CD for Functions

3 letter OCI region codes (useful for terminal commands in first lab)

Chapter 10 of this manual is useful for the registry

Preparing your container registry

Dockerizing your Python Application

Deploying docker image to project fn

Pre-requisite work

Note: this lab will assume you have properly configured the project fn CLI on your machine

Begin by creating a new user.

Then create a group.

Add your created user to the functions group.

Create a policy for your group to enable function access. Note, you should probably be more secure than enabling tenancy wide access, but for speed - there is this option.

These are the policies you will need, click here to read more about IAM policies for functions. Navigate to developer services > functions, and create a new app.

Useful command line commands for reference

These are performed in order and will setup your terminal to have fn and be connect to your cloud's container repository.

docker login iad.ocir.io
<TENANCY>/<USERNAME>
<TOKEN>

brew install fn
fn version
fn create context ocicontext1 --provider oracle
fn use context ocicontext1
fn update context oracle.profile functionsUser
fn update context oracle.compartment-id ocid1.tenancy.oc1..aaabkakkackakdnum3fd24qioebxwe3xuqdealrsa2g42gs4ja
fn update context api-url https://functions.us-ashburn-1.oci.oraclecloud.com
fn update context registry iad.ocir.io/<TENANCYNAME>/myrepo

fn init --runtime java helloworld-func
cd helloworld-func
fn -v deploy --app hellothere

fn invoke hellothere helloworld-func

Extending functions

Deploying your hello-world function to API Gateway

Querying an ATP database with Functions

More information

Add functions user to the oci config file

Going forward

Functions with API Gateway

Managing APIs with terraform!

Deploying a flask api on API Gateway

Troubleshooting your functions

Useful tips for fdk development