OCI FaaS MachaOn
Introduction to OCI FaaS MachaOn
The MachaOn project family offers tools, templates, configurations, and best practices for building, deploying, and managing cloud-native applications utilizing OCI's cutting-edge services such as OCI Functions, Container Registry, API Gateway, and Identity and Access Management (IAM).
Project structure
What is OCI FaaS?
Oracle's Function as a Service (FaaS) is a serverless platform that enables users to build and deploy lightweight, event-driven, and modular applications. It removes the complexity of managing infrastructure, allowing developers to focus solely on business logic. OCI FaaS uses the Fn Project as its backbone, making it compatible with a wide range of programming languages and frameworks.
Key Features of OCI FaaS
- Event-Driven: Build functions that can be triggered by events from OCI services or custom events.
- Pay for Usage: Pay only for the time your function runs.
- Scalability: Automatically scales based on demand.
- Language Flexibility: Supports Java, Python, Go, Node.js, and custom Docker containers.
- OCI Integration: Natively works with OCI services like API Gateway, Object Storage, Events, and more.
By combining OCI FaaS with the MachaOn ecosystem, we transform these serverless building blocks into high-level, modular enterprise solutions.
How MachaOn Extends OCI FaaS
The MachaOn project family introduces a framework designed to streamline the composition, deployment, and management of enterprise-grade serverless functions on OCI. By adhering to the principles of modularity, reusability, and clean architecture, MachaOn accelerates the journey from concept to deployable cloud application.
Capabilities of OCI FaaS MachaOn Projects
-
Module Integration:
- Use pre-defined Core modules (business entities, logic, adapters) and Application modules (customized workflows and services).
- Deploy them as OCI Functions to create lightweight, event-driven microservices.
-
Seed Projects for FaaS:
- Rapidly prototype serverless applications using pre-configured MachaOn “seed” templates for OCI.
- Examples include MachaOn-SL-AWS-1 and MachaOn-SL-OCI-1, which demonstrate scalable configurations.
-
Deployment-Oriented Framework:
- MachaOn projects provide templated deployment pipelines optimized for OCI Functions, enabling efficient packaging and delivery of serverless applications.
-
Cloud-Native Best Practices:
- Implements OCI-native infrastructure like Oracle Container Registry (OCIR), API Gateway integrations, and IAM for secure and scalable serverless solutions.
-
Multiple Deployment Options:
- Build functions for diverse deployment scenarios, including Production, Development, and Testing environments, all configurable via MachaOn templates.
Core Components of OCI FaaS MachaOn
-
OCI Functions:
- MachaOn projects leverage OCI Functions for their serverless compute capabilities, performing event-driven operations using pre-composed modular application layers.
-
Oracle Container Registry (OCIR):
- Each deployment orchestrates container images automatically packaged and stored in OCI’s secure container registry. MachaOn ensures seamless compatibility with OCI's native container services.
-
Application Gateway Integration:
- Expose your OCI Functions to external clients via the API Gateway, with pre-configured templates for routing, throttling, and authentication.
-
OCI Identity and Access Management (IAM):
- MachaOn provides predefined IAM configurations to securely handle execution permissions for serverless applications and control access across different OCI services.
-
Code Structure:
- Each MachaOn project features a modular directory structure where:
- Core Modules define reusable logic that follows clean architecture principles.
- Application Modules contain environment-specific workflows and deployment configurations.
- Macha Layer handles the composition and deployment of these components into FaaS-compatible artifacts.
- Each MachaOn project features a modular directory structure where:
-
CI/CD Pipelines:
- MachaOn supports continuous integration and deployment pipelines for automatic OCI Function deployment, testing, and monitoring.
How to Get Started with OCI FaaS MachaOn
Prerequisites
-
OCI Account Setup:
- Ensure you have access to Oracle Cloud Infrastructure with permissions for OCI Functions, OCIR, and IAM.
- Set up your tenancy and compartment for deployment.
-
Install Required Tools:
- OCI CLI for managing OCI services.
- Fn CLI for building and managing serverless functions.
- Docker for creating and packaging OCI-compatible function images.
-
Configure Fn Context for OCI Provider:
fn create context oci-macha-context --provider oracle fn update context oracle.compartment-id <your-compartment-ocid> fn update context api-url https://functions.<OCI-region>.oraclecloud.com fn use context oci-macha-context
Steps:
-
Clone a MachaOn required seed project.
-
Configure your OCI FaaS deployment:
- Edit
func.yamlto define OCI-specific runtime properties.
- Edit
-
Build and Deploy:
fn build fn deploy --app <application-name> --provider oracle -
Monitor:
- Monitor logs and metrics in the OCI Functions Monitoring Dashboard.
Advantages of OCI FaaS MachaOn
- Simplified Deployment:
- Abstracts the complexities of OCI Function deployment and container management.
- Modularity:
- Encourages reusable code development through modular architecture.
- Production-Ready Configurations:
- Includes predefined IAM policies, API Gateway routing, and CI/CD setup for enterprise deployment.
- Cost-Effectiveness:
- Fully serverless, pay-only-for-use model minimizes costs.
- Seamless OCI Integration:
- Natively supports OCI services, making it ideal for Oracle customers.
Macha
