Running Batch Jobs with IBM Code Engine
Key Points
- Gabby Moreno introduces batch jobs on IBM Cloud Code Engine as container‑based tasks that run at scheduled times to process data, such as daily record updates.
- In the Code Engine UI, she creates a new Job (not an Application) using the pre‑built “hmo‑task” container image, saving the definition so it can be executed repeatedly.
- Before submitting, she explains that the demo job will process customer records, with a dashboard showing total records versus those already processed.
- She configures the job’s “Array indices” to “1‑10” to launch ten parallel instances, noting that instance numbering can be customized to avoid overlapping work.
- After submitting, the ten instances move through pending, running, and completed states, quickly updating the processed‑record count until all jobs finish successfully.
Sections
- Running Batch Jobs with IBM Cloud Code Engine - A step-by-step walkthrough demonstrates how to create and configure a batch job in IBM Cloud Code Engine using a prebuilt container image, covering the selection of the Job type, default settings, and the purpose of processing customer records.
- Rapid Batch Job Deployment with Code Engine - The presenter demonstrates how, by specifying only a container image, a developer can launch a Code Engine job with ten parallel instances instantly—without any additional infrastructure setup—highlighting Code Engine’s ability to let developers focus solely on business logic.
Full Transcript
# Running Batch Jobs with IBM Code Engine **Source:** [https://www.youtube.com/watch?v=3oZW1FejYno](https://www.youtube.com/watch?v=3oZW1FejYno) **Duration:** 00:04:04 ## Summary - Gabby Moreno introduces batch jobs on IBM Cloud Code Engine as container‑based tasks that run at scheduled times to process data, such as daily record updates. - In the Code Engine UI, she creates a new Job (not an Application) using the pre‑built “hmo‑task” container image, saving the definition so it can be executed repeatedly. - Before submitting, she explains that the demo job will process customer records, with a dashboard showing total records versus those already processed. - She configures the job’s “Array indices” to “1‑10” to launch ten parallel instances, noting that instance numbering can be customized to avoid overlapping work. - After submitting, the ten instances move through pending, running, and completed states, quickly updating the processed‑record count until all jobs finish successfully. ## Sections - [00:00:00](https://www.youtube.com/watch?v=3oZW1FejYno&t=0s) **Running Batch Jobs with IBM Cloud Code Engine** - A step-by-step walkthrough demonstrates how to create and configure a batch job in IBM Cloud Code Engine using a prebuilt container image, covering the selection of the Job type, default settings, and the purpose of processing customer records. - [00:03:14](https://www.youtube.com/watch?v=3oZW1FejYno&t=194s) **Rapid Batch Job Deployment with Code Engine** - The presenter demonstrates how, by specifying only a container image, a developer can launch a Code Engine job with ten parallel instances instantly—without any additional infrastructure setup—highlighting Code Engine’s ability to let developers focus solely on business logic. ## Full Transcript
Hi everyone, my name is Gabby Moreno Cesar and I'm with the IBM Cloud team.
In this video we'll show you how to run batch jobs with IBM Cloud Code Engine. Batch jobs
are pieces of code meant to perform specific tasks at certain times of day and then stop -
for example, processing daily records in a back-end system.
So, starting at the Code Engine "overview" page, we are going to choose the "Run your
container image" option and give it the name of a "batch" container image: "hmo-task"
To save time, this image has already been built for us.
Let's go ahead and hit "Start creating" to move on to the next step.
On this screen we can enter many different configuration options but for now let's just
stick with the defaults for everything except for the first one... for that we're going
to choose "Job" instead of "Application". With that let's go ahead and hit "Create"
We have now created the definition of our Batch Job. Meaning, we didn't actually run it yet - we
just made the platform aware of our Job. This will allow us to run it over and over as needed.
Before we actually run the job, let's first talk about what the job will do.
For this demo we have an application that manages a set of customer records and our Job will process
all of the customer records in our backend system. You don't need to
understand what the records are for, or what this front-end application is that I'm showing.
The key things here are the two numbers that are from our backend system. The first shows
the number of records in there, and the second shows how many have been processed. As the batch
job runs, the second number will increase and eventually should equal the first number.
Let's just keep this off to the side so we can watch it.
Let's now run the batch job by hitting the "Submit job" button.
You'll notice there are a few options that we can modify.
First, and foremost, is the 'Array indices' field.
This tells Code Engine how many instances of the job to execute. It's showing a default value of
"1" - but this demo we're going to run 10 of them so we're going to enter "1-10"
Code Engine allows for you to not only specify how many instances to run,
but how those instances are numbered. Meaning, are they numbered 1, 2, 3... or should they be
numbered 1,3,5,7, ... if we only want odd numbered instances? Often the instance number is used a
part of the processing to ensure each instance's work doesn't overlap with any other's.
We're going to leave the rest of the configuration options alone and just press "Submit job".
Notice in the window that we have 10 pending instances.
Each instance will eventually move from "pending", to "running" and finally "completed" states
Notice in the application window you can see the number of records processed is going up... fast.
And in a matter of seconds all 10 jobs are completed
Let's quickly summarize what happen though. With just the name of a container image we defined
a Job and then executed it with 10 instances. We didn't have to do any other infrastructure
setup or management. As a developer of this code, all I had to worry about is the business logic of
workload - nothing else. And that's the goal of Code
Engine - allowing developers to focus on what's important... coding.
That's all the time we have today, but hopefully you found this quick walk-thru of how to manage
batch jobs in Code Engine exciting and I encourage you to look at our other videos to see more key
Code Engine features. And, of course, we hope that you'll go to www.ibm.com/cloud/code-engine to play
with it yourself. Thank you.