Friday, April 17, 2026
The BLOCKCHAIN Page
No Result
View All Result
  • Home
  • Cryptocurrency
  • Blockchain
  • Bitcoin
  • Market & Analysis
  • Altcoins
  • DeFi
  • Ethereum
  • Dogecoin
  • XRP
  • Regulations
  • NFTs
The BLOCKCHAIN Page
No Result
View All Result
Home Blockchain

How to move from IBM Cloud Functions to IBM Code Engine

by admin
December 4, 2023
in Blockchain
0
How to move from IBM Cloud Functions to IBM Code Engine
0
SHARES
30
VIEWS
Share on FacebookShare on Twitter


When migrating off IBM Cloud Features, IBM Cloud Code Engine is without doubt one of the potential deployment targets. Code Engine presents apps, jobs and (lately operate) that you could (or want) to select from. On this publish, we offer some dialogue factors and share suggestions and methods on find out how to work with Code Engine features.

IBM Cloud Code Engine is a totally managed, serverless platform to (not solely) run your containerized workloads. It has evolved a lot since March 2021, once I printed the weblog publish “Migrating Cloud Functions Code to Code Engine.” In 2021, there have been solely Code Engine apps and jobs. Earlier this year, Code Engine added support for functions (Features-as-a-Service, or FaaS).

On this publish, I’m going to take a contemporary take a look at that matter and talk about the choices on find out how to transfer from IBM Cloud Functions to Code Engine.

Make the most of Code Engine surroundings variables.

Apps, jobs and features

IBM Cloud Code Engine options three different ways to run your business logic:

  • An app is a constantly run course of that solutions to HTTP requests.
  • A job runs to deal with a activity after which terminates.
  • A operate is a stateless code snippet that’s invoked by an HTTP request and, after producing a response, terminates. Furthermore, jobs often run considerably longer than features (“batch processing”).

There are various extra characteristics that help distinguish between apps, jobs and features. In brief, apps are a great match if you wish to craft a REST API or deploy an internet utility with backend/frontend performance. You may have full management over the HTTP server and its sources.

Jobs, alternatively, are long-running processes that don’t require any person interplay. They might be typical batch actions, analytics processing and even AI mannequin coaching.

Lastly, features can react to incoming HTTP requests in a short time. They serve low-latency use circumstances properly, like chatbot integrations or webhooks. In distinction to apps, you don’t and can’t outline and configure the HTTP server.

When coming from Cloud Features, you could have skilled that there are lots of use cases supported by Cloud Functions. Equally, a operate could have totally different attributes which are vital relying on the case:

  • The invocation or start-up time (chilly begin) is likely to be vital, resulting in an general brief response time.
  • In different circumstances, the price (billing) might need been the aggressive issue.
  • The simplicity and agility, brought on by a operate as unit for improvement and deployment in a DevSecOps course of leads some initiatives to go for features.

Typically, it’s a mixture of the above that results in folks preferring features (FaaS) over different runtime or compute choices.

From Cloud Features to Code Engine

When transferring from Cloud Features to Code Engine, the next operate traits should be taken into consideration when deciding to on an app, a job or a Code Engine operate:

  • Is an http endpoint wanted to invoke the code?
  • Is the processing triggered by an occasion?
  • What programming language is used for the present operate and the way huge are the required libraries?
  • How lengthy does the processing take, what compute sources are wanted, is parallel processing desired?

The information Migrating IBM Cloud Functions to Code Engine has an in depth overview with Code Engine app, job and performance traits. They enable you to to pick out the most effective entity to your current workload. Moreover, the present Code Engine function limitations and the final limits and quotas for Code Engine should be taken into consideration. The part Migrating IBM Cloud Functions Actions to Code Engine Functions FAQ would possibly enable you to resolve find out how to migrate.

Suggestions and methods for Code Engine features

The next suggestions and methods are based mostly on my experiences with transferring current code from Cloud Features to Code Engine features. They assist in reducing down deployment cycles by first using native checks to implement related performance in combining Code Engine features and jobs and designing built-in APIs by making use of Code Engine system variables.

Native testing of features

Apps are common net purposes, jobs are like scripts, and each might be examined regionally in a number of methods. As a result of features are code snippets, some wrapper is required to show them into applications. The next strategy has served me properly to this point.

With the operate code in a subdirectory “func,” I make the most of both the Python or Node.js wrapper code proven beneath and place it within the dad or mum listing. There, I additionally preserve recordsdata with check configurations as JSON objects, similar to what is passed by Code Engine to the function on invocation. For testing, I run the wrapper together with the configuration file as parameter. The wrappers for Python and Node.js are proven beneath:

# syntax: python wrapper.py params.json

# import the Code Engine operate: func/__main__.py
from func.__main__ import most important
import sys, json

if __name__ == "__main__":
    # open file, learn JSON config
    with open(str(sys.argv[1])) as confFile:
        params=json.load(confFile)
    # invoke the CE operate and print the end result
    print(most important(params))
// syntax: node wrapper.js params.json

// require the Code Engine operate: func/most important.js
var func=require('./func/most important.js')

// learn the file with operate parameters
const fs = require("fs");
const knowledge = fs.readFileSync(course of.argv[2]);

// invoke the CE operate and log the end result
console.log(func.most important(JSON.parse(knowledge)));

Job-like features

Generally, you would possibly want the HTTP endpoint of a operate and the presumably longer execution time of a job. In that case, create each a operate and a job. Then, make the most of the Code Engine API to create a job run from inside the operate. On this hybrid strategy, the operate can get known as by way of its HTTP endpoint and it terminates after kicking off the job run. A job might then run as much as 24 hours and profit from the parallel job processing capabilities in Code Engine. You’ll find a pattern implementation of this sample within the Code Engine code examples.

Surroundings variables and API design

For designing your API and features namespace, you possibly can make the most of Code Engine-injected environment variables like __ce_path and __ce_method. The previous holds the trail part of the requested URL like “/object”, and the latter has the HTTP technique like GET or POST. By switching on the provided values for these variables, you possibly can serve a number of API features from the identical Code Engine operate. The profit is a single base URL.

Relying in your undertaking and code administration, you would possibly even need to mix this strategy with separating every API operate implementation into its personal file—much like the wrapper strategy proven above.

Conclusions

IBM Cloud Functions have many use circumstances and properties, so there isn’t any easy mapping to a particular Code Engine entity (i.e., app, job or operate). By evaluating an current (Cloud Features) operate’s attribute to these of the Code Engine entities, you possibly can choose the most effective match. In lots of circumstances, a Code Engine operate is likely to be a sensible choice. For these circumstances, we shared suggestions and methods that you need to use to your Features-as-a-Service undertaking with Code Engine.

Use the next IBM Cloud Code Engine documentation to get began:

When you’ve got suggestions, options, or questions on this publish, please attain out to me on Twitter (@data_henrik), Mastodon (@data_henrik@mastodon.social) or LinkedIn.

Technical Providing Supervisor / Developer Advocate





Source link

Tags: CloudCodeEnginefunctionsIBMmove
admin

admin

Recommended

California’s Crypto Revolution: New Regulations and Their National Impact

California’s Crypto Revolution: New Regulations and Their National Impact

3 years ago
Analysts Believe Bitcoin Begins Early Bull Run and May Hit $50,000 This Month

Analysts Believe Bitcoin Begins Early Bull Run and May Hit $50,000 This Month

2 years ago

Popular News

  • Protocol-Owned Liquidity: A Sustainable Path for DeFi

    Protocol-Owned Liquidity: A Sustainable Path for DeFi

    0 shares
    Share 0 Tweet 0
  • Cryptocurrency for College: Exploring DeFi Scholarship Models

    0 shares
    Share 0 Tweet 0
  • What are rebase tokens, and how do they work?

    0 shares
    Share 0 Tweet 0
  • What is Velodrome Finance (VELO): why it’s a next-gen AMM

    0 shares
    Share 0 Tweet 0
  • $10 XRP Price Envisioned By Fund Manager As Ripple Mounts Trillion-Dollar Payment Markets ⋆ ZyCrypto

    0 shares
    Share 0 Tweet 0

Latest

I traded my Sonos Era 300 for Denon’s new home speaker – and see no reason to go back

I traded my Sonos Era 300 for Denon’s new home speaker – and see no reason to go back

April 17, 2026
OpenSim builders get new one-prim NPC manager — no scripts, no orphans – Hypergrid Business

OpenSim builders get new one-prim NPC manager — no scripts, no orphans – Hypergrid Business

April 16, 2026

Categories

  • Altcoins
  • Bitcoin
  • Blockchain
  • Cryptocurrency
  • DeFi
  • Dogecoin
  • Ethereum
  • Market & Analysis
  • NFTs & Metaverse
  • Regulations
  • XRP

Follow us

Recommended

  • I traded my Sonos Era 300 for Denon’s new home speaker – and see no reason to go back
  • OpenSim builders get new one-prim NPC manager — no scripts, no orphans – Hypergrid Business
  • I found a way to roll back buggy Google Services updates on Android – in just a few clicks
  • OpenSim April stats down on grid outage – Hypergrid Business
  • Why your TV wowed you in the store but looks unnatural at home – and how to fix it ASAP
  • About us
  • Privacy Policy
  • Terms & Conditions

© 2023 TheBlockchainPage | All Rights Reserved

No Result
View All Result
  • Home
  • Cryptocurrency
  • Blockchain
  • Bitcoin
  • Market & Analysis
  • Altcoins
  • DeFi
  • Ethereum
  • Dogecoin
  • XRP
  • Regulations
  • NFTs

© 2023 TheBlockchainPage | All Rights Reserved