• Skip to primary navigation
  • Skip to main content
  • Skip to footer

Codemotion Magazine

We code the future. Together

  • Discover
    • Events
    • Community
    • Partners
    • Become a partner
    • Hackathons
  • Magazine
    • Backend
    • Frontend
    • AI/ML
    • DevOps
    • Dev Life
    • Soft Skills
    • Infographics
  • Talent
    • Discover Talent
    • Jobs
    • Manifesto
  • Companies
  • For Business
    • EN
    • IT
    • ES
  • Sign in
ads

CodemotionMarch 4, 2020

CI/CD Automation for Fn Project with Oracle FaaS and Developer Cloud Service

Cloud
CI/CD
facebooktwitterlinkedinreddit
Table Of Contents
  1. Docker Login
  2. OCIcli Configuration
  3. OCI Fn Configuration
  4. Fn Build
  5. Fn Deploy

This article written by Shay Shmeltzer, Director of Product Management at Oracle, was originally published on Oracle Developers Portal.

By this time you will probably have seen multiple blogs about the Fn Project – an open-source, multi-language, container-native serverless platform. You may already have heard that Oracle is going to offer a cloud-hosted Function as a Service (FaaS) for Fn-based functions called Oracle Functions – currently available with limited access (get your invite to try it out here).

Recommended article
kubernetes cost optimization
July 23, 2024

Kubernetes Cost Optimization: A Developer’s Guide

Gilad David Maayan

Cloud

So, how do you create an automated CI/CD chain for your Fn functions?

Oracle Developer Cloud Service now provides built-in functionality to support you.

DevCS supports Fn Project functions life cycle command definition in our CI/CD jobs. This means that you can automate Fn build and deploy steps in a declarative way. We also added support that enables levergaing the hosted FaaS offering in the cloud and CI/CD directly into that environment.

Here are the basic steps to get DevCS hooked up to your Fn-based FaaS service running in the Oracle Cloud Infrastructure.

Your build will have several steps, including:

Docker Login

This will let you connect to the hosted docker registry in the Oracle Cloud (OCIR)

Provide your OCIR url (phx.ocir.io, for example), your user ID(tenancy/username), and your auth token (N.B.this is not the password but rather the auth token you get from identity->user->auth tokens).

OCIcli Configuration

The next step is to configure access to your OCI environment by picking up the OCIcli build step. Then, provide information including your user’s OCID and Fingerprint, your tenancy OCID, your region, and paste in the private key that you generated.

OCI Fn Configuration

Now that your OCI connection is set, let’s add the specific configuration for your FaaS instance. From the Fn menu in DevCS pick up the Fn OCI option. Configure it with the details of the Fn environment you created, including the compartment ID, the provider (Oracle), and the passphrase you used when you created your private key.

Your environment is now ready to use the specific Fn lifecycle commands. We are going to assume that your Fn function code is in the root directory of the Git repository you hooked up to the build job.

Fn Build

The first step will build the function for us. If the code is at the root of your Git, then you need only specify the Registry Host (phx.ocir.io) and the username (tenant/user). You may also choose to check the box to get verbose output from the build operation.

Fn Deploy

If the Build was successful the next step is to deploy it to our FaaS service. First, make sure you created an app in your FaaS function console. Use the name of that app to fill in the “Deploy to App” field. Fill out the Registry Host and Username field as in the previous step, and don’t forget to add the API URL (https://functions.us-phoenix-1.oraclecloud.com). You can then choose additional options such as verbose output, bumping the version of the app, etc.

Now run the Build and watch the magic take place.

Check out the video below to see it in action.

Related Posts

Kubernetes Helm Guide

10 Tips and Tricks for Using Kubernetes Helm

Gilad David Maayan
June 18, 2024
10 years of kubernetes

Celebrating 10 Years of Kubernetes: A Journey Through Innovation

Codemotion
June 3, 2024
microservices digital transformation. From monolith to microservices concept.

Two feet in a shoe: more than one container in a single Pod

gregoriopalama
March 26, 2024
A-landscape-oriented-image-that-embodies-the-concept-of-a-lightweight-proxy-approach-in-a-cloud-native-scenario-with-a-special-focus

gRPC in a Cloud-native Environment: Challenge Accepted

Diego Petrecolla
February 22, 2024
Share on:facebooktwitterlinkedinreddit

Tagged as:Database Serverless

Codemotion
Articles wirtten by the Codemotion staff. Tech news, inspiration, latest treends in software development and more.
Codemotion Rome 2020: an overview of the companies involved
Previous Post
Design Tokens and Cross Platform Coherence – Part 2
Next Post

Footer

Discover

  • Events
  • Community
  • Partners
  • Become a partner
  • Hackathons

Magazine

  • Tech articles

Talent

  • Discover talent
  • Jobs

Companies

  • Discover companies

For Business

  • Codemotion for companies

About

  • About us
  • Become a contributor
  • Work with us
  • Contact us

Follow Us

© Copyright Codemotion srl Via Marsala, 29/H, 00185 Roma P.IVA 12392791005 | Privacy policy | Terms and conditions