<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Luke Roy on Medium]]></title>
        <description><![CDATA[Stories by Luke Roy on Medium]]></description>
        <link>https://medium.com/@luke.roy?source=rss-e26a536ae4a4------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*0N4QjdmvR06q7fb0kSBZUw.jpeg</url>
            <title>Stories by Luke Roy on Medium</title>
            <link>https://medium.com/@luke.roy?source=rss-e26a536ae4a4------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 11:18:37 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@luke.roy/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Remote Bob: Run Bob Shell in IBM Cloud Code Engine]]></title>
            <link>https://medium.com/@luke.roy/remote-bob-run-bob-shell-in-ibm-cloud-code-engine-0141761c006c?source=rss-e26a536ae4a4------2</link>
            <guid isPermaLink="false">https://medium.com/p/0141761c006c</guid>
            <category><![CDATA[code-engine]]></category>
            <category><![CDATA[ibm-cloud]]></category>
            <category><![CDATA[ibm-bob]]></category>
            <dc:creator><![CDATA[Luke Roy]]></dc:creator>
            <pubDate>Wed, 02 Sep 2026 14:46:57 GMT</pubDate>
            <atom:updated>2026-09-02T14:47:26.169Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Written by Luke Roy (Cloud Software Engineer — IBM Cloud Code Engine) and Joachim Jordan (Tech Lead Code Engine Platform— IBM Cloud Code Engine)</em></p><h3>Introduction</h3><p><a href="https://www.ibm.com/products/code-engine">IBM Cloud Code Engine</a> is IBM’s fully managed, strategic serverless platform. It lets you run containerised workloads — applications, batch jobs, and functions — without ever touching infrastructure. Code Engine scales to zero when idle, scales out automatically under load, and charges only for the compute you actually consume. It is the platform of choice for teams that want the power of Kubernetes without the operational overhead.</p><p><a href="https://bob.ibm.com/">Bob</a> is IBM’s AI software engineering assistant. Bob understands your codebase, executes multi-step agentic tasks, runs CLI commands, manages secrets, and integrates with the full IBM Cloud ecosystem through its skill and MCP-server plugin architecture. Bob Shell — the terminal-first interface to Bob — takes this further: it is a full interactive environment where Bob operates as an autonomous agent, capable of writing, running, and iterating on code with no human in the loop for each individual step.</p><p>Together, Code Engine and Bob open up a compelling new pattern: <strong>running Bob Shell as a serverless cloud workload</strong>. This is what Remote Bob is about.</p><p>Remote Bob gives you a <strong>full Bob Shell terminal running in IBM Cloud Code Engine</strong>, accessible from your local browser. One command provisions the infrastructure. A second command starts a session and opens the terminal. Close the browser tab — the session keeps running in the cloud. Reopen it with a single command. When you are done, tear everything down cleanly or simply let it sit at zero cost until you need it again.</p><h3>Why Run Bob in the Cloud?</h3><p>Running an AI coding agent locally is fine for interactive work, but several scenarios benefit from — or require — a cloud-hosted agent:</p><h4>Sandboxed Execution</h4><p>Bob can write and execute arbitrary code. When working on exploratory or risky tasks — generating and running build scripts, testing untrusted dependencies, bulk-modifying a large codebase — you may want that execution to happen in an isolated environment, not on your laptop. A Code Engine job run is a disposable container: every session starts from a clean image, and when the job ends the container is gone. Nothing persists to your local machine.</p><h4>Autonomous Long-Running Tasks</h4><p>Some tasks take hours: large-scale refactors, multi-stage data pipelines, training-data preprocessing, automated code reviews across hundreds of files. Running these on your laptop ties up your machine, drains the battery, and breaks if you close the lid. Code Engine job runs are designed for exactly this pattern — they run to completion in the cloud while you do other things. Remote Bob makes it trivial to attach a terminal to that running job whenever you want to check progress.</p><h4>Remote and Multi-Device Access</h4><p>With Remote Bob, your Bob Shell session is not tied to a single machine. Start a session from your workstation in the morning, reconnect from a laptop on the go, and check in from a coffee shop in the afternoon — all connecting to the same live session. The terminal state, tmux layout, and open buffers are all preserved in the cloud-hosted container.</p><h4>High-Performance Compute on Demand</h4><p>Bob doesn’t just read code — it builds it, tests it, and runs it. Agentic tasks can be surprisingly compute-intensive: compiling a large monorepo, running a full test suite, processing large datasets as part of an automated pipeline, or parallelising tool calls across many files simultaneously. On a laptop, these tasks compete with everything else running on your machine. In a Code Engine job run, Bob gets dedicated resources.</p><p>The job-agent container supports up to <strong>12 vCPUs and 48 GB of memory</strong> per session. Two lines in .env are all it takes:</p><pre>DEFAULT_CPU=12<br>DEFAULT_MEMORY=48G</pre><p>The next --new-session picks up the new sizing automatically — no rebuilding, no re-provisioning. Bob gets exactly the headroom it needs for the duration of the session, and the job costs nothing when it is not running.</p><h4>Cost Efficiency</h4><p>Because the apiserver scales to zero between sessions and job runs are stopped when not needed, the idle cost is effectively zero. You pay only for active compute time — typically a few cents per hour of actual use.</p><h3>Prerequisites</h3><p>Before you begin, make sure you have the following in place. You will need a Bob subscription (or free trial), an IBM Cloud account with the right permissions, two API keys (one for IBM Cloud, one for Bob Shell), a gateway password you choose yourself, and a handful of CLI tools that the launcher script relies on. Everything else — the Code Engine project, container images, secrets — is created automatically by ./remote-bob --setup.</p><ul><li><strong>Bob subscription</strong> — An active Bob subscription or <a href="https://bob.ibm.com/">free trial</a> is required to obtain a Bob Shell API key</li><li><strong>IBM Cloud account</strong> — With permission to create Code Engine projects and Container Registry namespaces</li><li><strong>IBM Cloud API key</strong> — Needs Code Engine Writer + Container Registry Writer roles</li><li><strong>Bob Shell API key</strong> — From <a href="https://bob.ibm.com/">bob.ibm.com</a> → Settings → API Keys</li><li><strong>ibmcloud CLI</strong> — <a href="https://cloud.ibm.com/docs/cli">Install</a>; the code-engine plugin is installed automatically by the launcher</li><li><strong>jq</strong>, <strong>curl</strong>, <strong>openssl</strong> — brew install jq / apt install jq; curl and openssl are pre-installed on macOS and most Linux distros</li><li><strong>Google Chrome</strong> — Auto-detected on macOS and Linux. Chrome is the most widely used browser and is what the launcher opens automatically; the browser client is a standard HTML/WebSocket page and can be opened in any modern browser manually if you prefer a different one</li></ul><h3>Quickstart</h3><h4>Step 1: Clone the repository and configure</h4><pre>git clone https://github.com/IBM/CodeEngine<br>cd CodeEngine/remote-bob<br># Copy the config template and fill in the two API keys and gateway password<br>cp .env.template .env</pre><p>Open .env and set the three required values:</p><pre>BOBSHELL_API_KEY=your-bob-shell-api-key   # from bob.ibm.com → Settings → API Keys<br>GATEWAY_PASSWORD=choose-any-password       # protects the browser terminal endpoint<br>IBMCLOUD_API_KEY=your-ibm-cloud-api-key    # needs Code Engine Writer + ICR Writer</pre><p>That is it. Everything else — region, resource group name, container image tags, CPU and memory — has sensible defaults and the system works out of the box without touching any of them. That said, all of these values are fully configurable: adjust the region, resource sizing, or any other parameter to match your preferences, and the launcher will pick up the changes on the next run.</p><h4>Step 2: Run status to log in and see current state</h4><pre>./remote-bob</pre><p>Running ./remote-bob with no arguments logs in to IBM Cloud and prints a status summary. On first run it creates the resource group and Code Engine project, then tells you what to do next.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*P-3Tv8fhTsGTTHNM.jpg" /></figure><h4>Step 3: Provision infrastructure and build images</h4><pre>./remote-bob --setup</pre><p>--setup is idempotent: it creates the Code Engine project, provisions secrets, builds the apiserver container image and the job-agent container image, and deploys the apiserver as a Code Engine application. The first run takes a few minutes because both images are built from source on Code Engine. Subsequent runs skip steps that are already complete and only rebuild if source code has changed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3xUiPahnBw4JuxBb.jpg" /></figure><p>At the end of setup you will see the apiserver URL and a prompt to run --new-session.</p><h4>Step 4: Start a session</h4><pre>./remote-bob --new-session</pre><p>This submits a new Code Engine job run, waits for the agent to connect to the apiserver (typically under 30 seconds), and then opens a Chrome window pointed at the browser client.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*YXCQDN8XRNBy5CEk.jpg" /></figure><h4>Step 5: Log in and start working</h4><p>The browser client is a self-contained HTML page served from file:// — no web server required. It prompts for your gateway password, then opens a full xterm.js terminal connected over WebSocket to your Bob Shell session running in Code Engine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*8NzgL4C07zKpjEP0.jpg" /></figure><p>Once authenticated, you are in Bob Shell — the same experience you would have locally, but running as an isolated job in the cloud.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*0niMF_IpQard7ie7.jpg" /></figure><p>Bob Shell in the cloud has the full set of capabilities: writing and running code in any language, executing CLI commands, managing files, calling external APIs, and working through multi-step agentic tasks autonomously.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Zh-wM807X92Sg67P.jpg" /></figure><h4>Step 6: Disconnect and reconnect</h4><p>Close the browser tab at any time. The Code Engine job run keeps running — the tmux session inside is untouched.</p><p>To reconnect from any machine:</p><pre>./remote-bob --connect</pre><p>--connect queries IBM Cloud for the live session, constructs the browser client URL, and opens Chrome again. No re-provisioning, no waiting.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*HILHatCUfRb9rM8y.jpg" /></figure><h4>Step 7: View the running job in IBM Cloud</h4><p>You can also monitor the session directly from the IBM Cloud console. Navigate to your Code Engine project and open the Jobs section. You will see the job run listed as <strong>Running</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*j05ChideZiC0bXNJ.jpg" /></figure><p>Only one session can be active at a time — --new-session will refuse to start if one is already running. Once you end a session with --end-session, you can start a fresh one. The IBM Cloud console keeps a history of all job runs, showing completed sessions alongside the current one.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*73uX0bj7K0zjp1sJ.jpg" /></figure><h4>Step 8: End the session and clean up</h4><pre># End the current session (stops job runs; infrastructure stays for fast restart)<br>./remote-bob --end-session<br><br># Start another session without rebuilding (seconds, not minutes)<br>./remote-bob --new-session<br><br># Remove all IBM Cloud resources when finished<br>./remote-bob --clean</pre><p>--end-session gracefully disconnects the agent and deletes all job runs. The apiserver application and Code Engine project remain, so the next --new-session starts in seconds rather than minutes.</p><p>--clean removes everything: job runs, job definition, application, secrets, Code Engine project, and resource group. It is only needed if you want a complete teardown and to remove all IBM Cloud resources entirely. If you simply end the session without cleaning up, the apiserver scales to zero and no job runs are executing — so no costs are generated. You can start a new session at any time with --new-session without going through setup again.</p><h3>How It Works</h3><pre>Browser  (Chrome, file:// page, xterm.js)<br>  │  WebSocket  /ws/browser?token=&lt;wsToken&gt;&amp;agent=&lt;id&gt;&amp;service=ttyd<br>  ▼<br>Apiserver  (Go, IBM Code Engine app, scales to zero)<br>  │  auth: POST /auth/login → 60s WS token<br>  │        POST /auth/runs  → per-run agent token (HMAC-signed)<br>  │  relay: opaque frame proxy — text + binary frames preserved verbatim<br>  │  WebSocket  /ws/agent  (Bearer &lt;runToken&gt;)<br>  ▼<br>Job-agent  (Go, IBM Code Engine job run)<br>  │  dials apiserver on startup, registers services<br>  │  opens upstream ttyd connection per relay request<br>  ▼<br>ttyd → tmux → Bob Shell</pre><p><strong>Apiserver</strong> is a thin authenticated relay deployed as a Code Engine application. It maintains an in-memory agent registry, issues short-lived single-use tokens, and proxies WebSocket frames between the browser and the job-agent without inspecting the payload. It scales to zero when no agent is connected — zero idle cost.</p><p><strong>Job-agent</strong> is a Go binary deployed as a Code Engine job run. On startup it dials the apiserver control WebSocket, registers the ttyd service, and handles relay connections by piping raw frames between the apiserver and a local ttyd process. It runs tmux → Bob Shell inside ttyd and provides a health endpoint for the job run lifecycle. Code Engine job runs have a maximum execution time of 24 hours, which is also the maximum lifetime of a Remote Bob session. For workloads that must run beyond that limit, Code Engine&#39;s <a href="https://cloud.ibm.com/docs/codeengine?topic=codeengine-job-daemon">daemon run mode</a> is the path forward.</p><p><strong>Browser client</strong> is a single self-contained HTML file loaded from file://. It authenticates with the gateway password, opens a WebSocket relay connection, and renders the terminal using xterm.js — no server-side rendering, no CDN dependencies.</p><p><strong>Secrets</strong> are stored in two IBM Code Engine secrets injected as environment variables:</p><ul><li>remote-bob-gateway — GATEWAY_PASSWORD, ENCRYPTION_KEY</li><li>remote-bob-bobshell — BOBSHELL_API_KEY</li></ul><h3>Use Cases in Depth</h3><h4>Sandboxed Agentic Coding</h4><p>Give Bob a task that involves writing and running unknown code — for example, “generate a data cleaning pipeline for this CSV schema and run it.” In a cloud job, that code executes in an isolated container with no access to your local filesystem, no persistent state beyond the job lifetime, and no way to interfere with your development environment. When the job ends, the container is gone.</p><h4>Autonomous Long-Running Agents</h4><p>Kick off a task that takes hours — a large-scale codebase migration, an exhaustive test suite run, a multi-repository dependency audit — and let it run overnight. You do not need to keep your laptop awake. Check in from any device with ./remote-bob --connect to see where Bob got to. For compute-heavy workloads, scale the job up to 12 vCPUs and 48 GB of memory by setting DEFAULT_CPU and DEFAULT_MEMORY in .env before starting the session.</p><h4>CI/CD Integration</h4><p>The --new-session flow is scriptable. You can trigger a Remote Bob session from a GitHub Actions workflow, inject environment variables via --env-from-secret, let Bob run a task, and collect results — all without provisioning or managing long-lived infrastructure.</p><h4>Team Shared Agents</h4><p>Remote Bob is personal by design — the IBM Cloud account and Bob subscription belong to whoever ran --setup, and one session runs at a time. That said, multiple people can --connect to the same running session using the gateway password. This makes it straightforward to hand off a long-running task mid-flight, review what Bob is working on in real time, or demonstrate a live agentic workflow to a colleague — without any re-provisioning.</p><h3>Command Reference</h3><ul><li><strong>./remote-bob</strong> — Log in, print infrastructure + session status, suggest next step</li><li><strong>./remote-bob --setup</strong> — Provision IBM Cloud resources and build container images. Idempotent — safe to re-run after code changes.</li><li><strong>./remote-bob --new-session</strong> — Submit a job run, wait for the agent to connect, open Chrome</li><li><strong>./remote-bob --connect</strong> — Find the live session and reopen Chrome. No re-provisioning.</li><li><strong>./remote-bob --end-session</strong> — Stop all job runs gracefully. Infrastructure remains for a fast restart.</li><li><strong>./remote-bob --clean</strong> — Delete all provisioned IBM Cloud resources</li></ul><p>All commands accept --config=FILE to use a config file other than .env.</p><h3>Conclusion</h3><p>Remote Bob demonstrates a pattern that becomes increasingly useful as AI agents take on longer and more complex tasks: <strong>decouple the agent runtime from the developer’s local machine</strong> and let serverless infrastructure handle the lifecycle.</p><p>IBM Cloud Code Engine is a natural fit for this. Job runs give you isolated, ephemeral containers that start in seconds and cost nothing when idle. The apiserver application scales to zero between sessions. The total infrastructure footprint is minimal, and the total idle cost is zero.</p><p>Two API keys, one gateway password, one command to provision, one command to start — and Bob is running in the cloud. No infrastructure to manage, no servers to maintain, and nothing running idle when you are not using it. That is the promise of Remote Bob, and Code Engine is what makes it possible.</p><h3>Try It — and Make It Your Own</h3><p>Get the code from the <a href="https://github.com/IBM/CodeEngine">CodeEngine sample repository</a>, fill in the two API keys and gateway password, and run --setup. From there, the system is yours to extend.</p><p><strong>Add the tools you need.</strong> The job-agent is a standard container. If Bob needs a tool — a specific CLI, a language runtime, a build toolchain — add it to the Dockerfile. The next --setup rebuilds the image and every subsequent session has it available.</p><p><strong>Persist your work across sessions.</strong> By default each session starts from a clean container. If you want Bob to pick up where it left off — keeping a workspace, a git clone, or accumulated context — connect a <a href="https://cloud.ibm.com/docs/codeengine?topic=codeengine-persistent-data-store">Code Engine persistent data store</a> to the job and mount it into the workspace directory. Files written there survive across sessions. For larger datasets or shared outputs between sessions, Code Engine also integrates natively with IBM Cloud Object Storage — mount a bucket directly into the job container and Bob can read and write files at scale without any additional infrastructure.</p><p><strong>Run your own MCP server.</strong> Deploy any MCP server as a Code Engine application alongside the apiserver, wire up the URL as an environment variable in the job-agent secret, and Bob will have access to it in every session. Your tools, your APIs, your data sources — all reachable from the cloud agent without exposing anything to the public internet.</p><p>Remote Bob is a starting point. The session lifecycle, the relay architecture, and the launcher script are all open and composable. Take it, adapt it, and build the cloud agent environment that fits your workflow.</p><h3>Resources</h3><ul><li><a href="https://www.ibm.com/products/code-engine">IBM Cloud Code Engine</a></li><li><a href="https://cloud.ibm.com/docs/codeengine">Code Engine Documentation</a></li><li><a href="https://github.com/IBM/CodeEngine">Code Engine Sample Repository</a> — Remote Bob source code lives here</li><li><a href="https://bob.ibm.com/">Bob</a></li><li><a href="https://cloud.ibm.com/docs/cli">IBM Cloud CLI</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0141761c006c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From Markdown to Live Presentations: Serverless Slidev Deployments with Code Engine Functions and…]]></title>
            <link>https://medium.com/@luke.roy/from-markdown-to-live-presentations-serverless-slidev-deployments-with-code-engine-functions-and-ae43757d5127?source=rss-e26a536ae4a4------2</link>
            <guid isPermaLink="false">https://medium.com/p/ae43757d5127</guid>
            <category><![CDATA[code-engine]]></category>
            <category><![CDATA[single-page-applications]]></category>
            <category><![CDATA[github-actions]]></category>
            <category><![CDATA[ibm-cloud]]></category>
            <category><![CDATA[slidev]]></category>
            <dc:creator><![CDATA[Luke Roy]]></dc:creator>
            <pubDate>Tue, 23 Jun 2026 13:09:21 GMT</pubDate>
            <atom:updated>2026-06-23T13:09:21.509Z</atom:updated>
            <content:encoded><![CDATA[<h3>From Markdown to Live Presentations: Serverless Slidev Deployments with Code Engine Functions and GitHub Actions</h3><p>This post walks through a simple end-to-end workflow for turning a Markdown-based <a href="https://sli.dev/">Slidev</a> deck into a live presentation: create and preview the slides locally, push the project to GitHub, and automatically deploy the generated output to <a href="https://www.ibm.com/products/code-engine">IBM Cloud Code Engine</a> as a Function using the official <a href="https://github.com/marketplace/actions/code-engine-github-action">Code Engine GitHub Action</a>.</p><p>It builds on our earlier posts <a href="https://ibm.github.io/CodeEngine/posts/serverless-spa-deployment-with-code-engine-functions/">The Serverless Way to Auto-Build and Deploy React, Angular, and Any SPA with IBM Cloud Code Engine Functions</a> and <a href="https://ibm.github.io/CodeEngine/posts/deploying-apps-jobs-and-functions-using-github-actions/">IBM Cloud Code Engine: Deploying Apps, Jobs and Functions using GitHub Actions</a>, but applies the same approach specifically to Slidev presentations. The result is a clean workflow where you focus on writing slides in Markdown while Code Engine handles the hosting and GitHub Actions handles the deployment.</p><p><a href="https://www.ibm.com/products/code-engine">IBM Cloud Code Engine</a> makes this possible by providing a fully managed serverless platform for running applications, jobs, and functions without infrastructure management. In this post, we use a Code Engine Function to serve the static Slidev build as a web presentation, giving you a lightweight way to publish and update slides from your repository.</p><p>By the end, you’ll have a repeatable setup that takes your presentation from local authoring to an automatically updated live URL with minimal operational overhead. The same pattern also works for any other SPA or static web content.</p><h3>What is Slidev?</h3><p><a href="https://sli.dev/">Slidev</a> is a developer-focused presentation framework that lets you write slides entirely in Markdown. Rather than dragging elements around a GUI, you write plain text with a simple syntax — code blocks, headings, lists — and Slidev renders them as polished, interactive slides in the browser. It supports syntax-highlighted code snippets, LaTeX math, custom themes, animations, and even embedded Vue components, making it particularly well-suited for technical talks and developer workshops.</p><p>Under the hood, Slidev compiles your Markdown into a static Single Page Application (SPA) that can be served from any web host. That SPA output is exactly what we’ll package and deploy as a Code Engine Function, so every time you push a change to your slides.md, a fresh build is triggered and your live presentation URL is updated automatically.</p><h3>Prerequisites and Setup</h3><p>We combine three simple but powerful building blocks to create a seamless, fully automated workflow: Slidev for writing presentations in Markdown, a Code Engine SPA function to serve the presentation as a serverless web application, and GitHub Actions to automate deployment directly from your repository. Together, these enable a setup where you focus purely on content while the platform handles everything else. Slidev allows you to author presentations as Markdown and build them into static web apps, Code Engine Functions take care of building and serving that content without requiring infrastructure management, and GitHub Actions ties it all together with automated CI/CD.</p><ol><li>Make sure you have a <a href="https://cloud.ibm.com/">IBM Cloud account</a> to access Code Engine and related services. For proof-of-concept or initial experimentation, you can simply create an IBM Cloud API key to authenticate your workflows. However, for production-grade setups, it’s recommended to use a service ID API key for better security and separation of concerns. To do this, navigate to <a href="https://cloud.ibm.com/iam/serviceids">Manage → Access (IAM) → Service IDs</a>, create a new service ID, assign it access to your resource group along with Code Engine and Container Registry permissions, and then generate and securely store the associated API key for use in your workflows. See the <a href="https://cloud.ibm.com/docs/iam?topic=iam-serviceidapikeys">documentation</a> for additional information.</li><li>Next, set up your GitHub repository by storing your IBM Cloud API key as a secret so it can be securely used by your deployment workflow. Regardless of whether you are using a personal API key or a service ID API key, navigate on GitHub to your repository settings under Settings → Secrets and variables → Actions, create a new secret (for example, IBM_IAM_API_KEY), and paste the API key you generated earlier. This allows your GitHub Actions workflow to authenticate with IBM Cloud and deploy your Code Engine function automatically.</li><li>Now you can create the project structure.Start by adding the three SPA function wrapper files <a href="https://github.com/IBM/CodeEngine/blob/main/function-spa/main.js">main.js</a>, <a href="https://github.com/IBM/CodeEngine/blob/main/function-spa/package.json">package.json</a>, and <a href="https://github.com/IBM/CodeEngine/blob/main/function-spa/build-spa.sh">build-spa.sh</a> into the repository directory. These files are the reusable SPA function asset from our <a href="https://ibm.github.io/CodeEngine/posts/serverless-spa-deployment-with-code-engine-functions/">previous post</a> build-spa.sh builds the Slidev project into a static SPA, and main.js serves it as a Code Engine Function over HTTP. No changes to these files are needed.</li><li>Next, initialize your Slidev project. The following command npm init slidev@latest my-presentation generates a my-presentation directory containing your slides.md file along with the supporting Slidev project files.</li><li>Finally, add the GitHub Actions workflow file at .github/workflows/deploy-func-slides.yml to enable automated deployment.</li></ol><p>Your directory structure should now look like this:</p><pre>├── my-presentation/              # Slidev project<br>├── main.js                       # Code Engine function entry point<br>├── package.json                  # Runtime dependencies for the function<br>├── build-spa.sh                  # Build script executed by Code Engine<br>└── .github/<br>    └── workflows/<br>        └── deploy-func-slides.yml</pre><p>Your GitHub Actions workflow should define an automated deployment that builds your Slidev presentation from the repository and deploys it as a Code Engine function whenever changes are pushed to main. You simply configure the required parameters such as your API key (IBM_IAM_API_KEY), target project, runtime, and source directory so that updates to your repository are automatically reflected in a live deployment. For more details and advanced configuration options, refer to the official Code Engine GitHub Action <a href="https://github.com/marketplace/actions/code-engine-github-action">documentation</a>.</p><pre>name: Deploy Slidev Presentation to Code Engine<br>on:<br>  push:<br>    branches:<br>      - main<br>jobs:<br>  slidev-func:<br>    runs-on: ubuntu-latest<br>    steps:<br>    - name: Check out code<br>      uses: actions/checkout@v3<br>    - name: Deploy Presentation Function<br>      uses: IBM/code-engine-github-action@v1<br>      with:<br>        api-key: ${{ secrets.IBM_IAM_API_KEY }}<br>        region: &#39;eu-de&#39;           # Change to your target region<br>        project: &#39;my-ce-project&#39;<br>        component: &#39;fn&#39;<br>        runtime: nodejs-24<br>        name: &#39;my-presentation&#39;<br>        build-source: &#39;.&#39;</pre><h3>Creating your Presentations</h3><p>With everything set up, you can now focus entirely on creating your presentation. Navigate into the ./my-presentation directory and open slides.md this is the file that contains all of your slides. Each slide is separated by --- and written in standard Markdown. You can preview your changes locally by running the development server:</p><pre>cd my-presentation<br>npm run dev</pre><p>This provides instant feedback in the browser as you edit. Once you’re happy with the result, just commit and push your changes to the main branch—your presentation will be automatically rebuilt and deployed, ensuring that what you see locally is exactly what goes live. For more advanced features and customisation options, be sure to explore the <a href="https://sli.dev/guide/">Slidev documentation</a> to create engaging and interactive presentations.</p><h3>Conclusion</h3><p>In summary, this approach creates a fully automated and serverless pipeline where everything — from building to deployment — happens in the background. Every time you update slides.md and push your changes, GitHub Actions triggers the workflow, Code Engine builds your Slidev project, and your function is deployed or updated automatically. The result is a streamlined, developer-friendly experience with no manual builds, no infrastructure to manage, and no deployment scripts—just Markdown pushed to GitHub and a live presentation URL moments later. This makes it a great fit for demos, workshops, technical talks, and internal knowledge sharing, and it extends the idea of easy SPA deployment into something even more powerful: turning content itself into the deployment unit.</p><p>Ready to try it yourself? Grab the <a href="https://github.com/IBM/CodeEngine/tree/main/function-spa">SPA function wrapper files</a> from the Code Engine sample repository, follow the steps above, and have your first Slidev presentation live on Code Engine in under ten minutes. Or check out our other samples or previous blogs.</p><ul><li><a href="https://www.ibm.com/products/code-engine">Code Engine</a></li><li><a href="https://cloud.ibm.com/docs/codeengine">Code Engine Docs</a></li><li><a href="https://github.com/IBM/CodeEngine">Code Engine Sample Repository</a></li><li><a href="https://sli.dev/">Slidev</a></li><li><a href="https://ibm.github.io/CodeEngine/posts/serverless-spa-deployment-with-code-engine-functions/">The Serverless Way to Auto-Build and Deploy React, Angular, and Any SPA with IBM Cloud Code Engine Functions</a></li><li><a href="https://github.com/marketplace/actions/code-engine-github-action">Code Engine Github Action</a></li><li><a href="https://ibm.github.io/CodeEngine/posts/deploying-apps-jobs-and-functions-using-github-actions/">IBM Cloud Code Engine: Deploying Apps, Jobs and Functions using GitHub Actions</a></li><li><a href="https://ibm.github.io/CodeEngine/posts/getting-into-the-cloud-just-got-a-lot-easier/">IBM Cloud Code Engine GitHub Action: Getting into the Cloud just got a lot easier!</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ae43757d5127" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Serverless Way to Auto-Build and Deploy React, Angular, and Any SPA with IBM Cloud Code Engine…]]></title>
            <link>https://medium.com/@luke.roy/the-serverless-way-to-auto-build-and-deploy-react-angular-and-any-spa-with-ibm-cloud-code-engine-fef54594a37d?source=rss-e26a536ae4a4------2</link>
            <guid isPermaLink="false">https://medium.com/p/fef54594a37d</guid>
            <category><![CDATA[code-engine]]></category>
            <category><![CDATA[ibm-cloud]]></category>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[single-page-applications]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Luke Roy]]></dc:creator>
            <pubDate>Mon, 08 Jun 2026 08:24:27 GMT</pubDate>
            <atom:updated>2026-06-08T08:24:27.479Z</atom:updated>
            <content:encoded><![CDATA[<h3>The Serverless Way to Auto-Build and Deploy React, Angular, and Any SPA with IBM Cloud Code Engine Functions</h3><p>Written by Josip Ledic (Software Engineer — IBM Cloud Code Engine) and Luke Roy (Cloud Software Engineer — IBM Cloud Code Engine)</p><p><a href="https://www.ibm.com/products/code-engine">IBM Cloud Code Engine</a> is IBM’s serverless platform that allows developers to run applications, batch jobs, and functions at scale, without the hassle of managing infrastructure. It automatically handles provisioning, scaling, networking, and security, letting you focus on writing code instead of managing servers.</p><p>Among its workload types are <a href="https://cloud.ibm.com/docs/codeengine?topic=codeengine-cefunctions">functions</a>, which provide a lightweight, event-driven execution model. Code Engine functions currently support Node.js and Python <a href="https://cloud.ibm.com/docs/codeengine?topic=codeengine-fun-runtime">runtimes</a>, making them ideal for serving APIs, processing events or, as we’ll explore in this post serving static web content.</p><p>When deploying Single Page Applications (SPAs) to the cloud, you typically face a choice: use a full application server with all its overhead, or manually build your frontend and figure out how to serve static files. What if you could skip both the complexity and the manual steps?</p><p>Code Engine Functions offer a compelling middle ground. Serverless, pay-per-use, and surprisingly simple for static content. But the real magic happens when you eliminate the build step from your deployment workflow entirely.</p><p>In this post, we’ll explore how to deploy any Single Page Application — whether it’s Angular, React, Svelte, Vue, or any other framework — as a Code Engine function. This approach lets you enjoy the benefits of serverless deployment — automatic scaling, pay-per-use pricing, and zero infrastructure management — while keeping your deployment workflow dead simple: just point Code Engine at your source code, and it handles the build automatically.</p><h3>The Problem with Traditional SPA Deployment</h3><p>Most SPA deployment workflows look like this:</p><ol><li>Build your frontend locally (npm run build)</li><li>Upload the build artifacts to object storage or a CDN</li><li>Configure routing rules for client-side navigation</li><li>Set up cache headers manually</li><li>Hope you didn’t forget to rebuild before deploying</li></ol><p>This works, but it’s error-prone. You might deploy stale builds, forget to update dependencies, or misconfigure cache headers. And if you’re working with multiple frameworks or projects, each one has its own quirks.</p><h3>A Better Approach: Build During Deployment</h3><p>What if the build happened automatically during deployment, using the exact source code you’re deploying? That’s the approach this solution takes.</p><p>Here’s the complete deployment flow:</p><pre># Create a new function<br>ibmcloud ce function create \<br>  --name my-static-app \<br>  --runtime nodejs-24 \<br>  --build-source .<br><br># Or update an existing one<br>ibmcloud ce function update \<br>  --name my-static-app \<br>  --build-source .</pre><p>That’s it. No separate build step. No manual file copying. Just point Code Engine at your repository, and it handles the rest.</p><h3>How It Works</h3><h3>Prerequisites</h3><p>Before you begin, make sure you have:</p><ul><li><strong>IBM Cloud account</strong> with Code Engine access (<a href="https://cloud.ibm.com/registration">IBM Cloud account</a>)</li><li><strong>Code Engine project</strong> created in your IBM Cloud account (<a href="https://cloud.ibm.com/docs/codeengine?topic=codeengine-getting-started">Code Engine getting started</a>)</li><li><strong>IBM Cloud CLI &amp; Code Engine CLI plugin</strong> installed and configured (<a href="https://cloud.ibm.com/docs/cli">installation guide</a>)</li><li><strong>Basic familiarity</strong> with npm and your chosen frontend framework</li></ul><h3>The Function Wrapper</h3><p>The magic happens thanks to a simple function wrapper that we provide, consisting of just three files. These files are included in the <a href="https://github.com/IBM/CodeEngine/tree/main/function-spa">Code Engine Sample repository</a>:</p><ol><li><strong>main.js</strong> — The function entrypoint that serves your static files</li><li><strong>package.json</strong> — The function definition with a postinstall hook</li><li><strong>build-spa.sh</strong> — The build script that runs during deployment</li></ol><p>When you deploy to Code Engine, you’re actually deploying this function wrapper alongside your SPA source code. The wrapper handles everything: building your frontend, serving the files, routing requests, and setting cache headers.</p><p>From a development perspective, your repository structure looks like this:</p><pre>your-repo/<br>├── main.js              # As provided from the Repo (serves static files)<br>├── package.json         # As provided from the Repo (with postinstall hook)<br>├── build-spa.sh         # As provided from the Repo (runs during deployment)<br>└── my-frontend/         # Your SPA source code folder<br>    ├── package.json     # Frontend dependencies<br>    ├── src/             # Frontend source files<br>    └── ...              # Other frontend files</pre><p>The root contains the function wrapper files (<a href="https://github.com/IBM/CodeEngine/blob/main/function-spa/main.js">main.js</a>, <a href="https://github.com/IBM/CodeEngine/blob/main/function-spa/package.json">package.json</a> and <a href="https://github.com/IBM/CodeEngine/blob/main/function-spa/build-spa.sh">build-spa.sh</a>), and your SPA lives in a subdirectory. During deployment, the build script automatically detects your frontend folder, builds it, and places the output in the root dist/ directory.</p><p><strong>These three function wrapper files (</strong><strong>main.js, </strong><strong>package.json, and </strong><strong>build-spa.sh) can be directly copied and used for your own SPA projects without modification.</strong> They&#39;re designed to be framework-agnostic and work out of the box with any frontend that builds to static files. If you have specific requirements—such as custom routing logic, additional MIME types, or different build output locations—you can adapt these files to suit your needs while maintaining the core deployment workflow.</p><p>The secret is in the package.json postinstall hook:</p><pre>{<br>  &quot;name&quot;: &quot;static-content-function&quot;,<br>  &quot;version&quot;: &quot;1.0.0&quot;,<br>  &quot;main&quot;: &quot;main.js&quot;,<br>  &quot;scripts&quot;: {<br>    &quot;postinstall&quot;: &quot;./build-spa.sh&quot;<br>  }<br>}</pre><p>When Code Engine builds your function, it runs npm install. After installation completes, the postinstall hook triggers build-spa.sh, which:</p><ol><li><strong>Detects your frontend</strong> — Finds the first non-hidden directory (excluding node_modules and dist)</li><li><strong>Installs dependencies</strong> — Runs npm ci or npm install in that directory</li><li><strong>Builds the frontend</strong> — Executes npm run build</li><li><strong>Locates output</strong> — Finds `index.html` in either dist/ or build/</li><li><strong>Copies to root</strong> — Places build artifacts in the root dist/ directory</li><li><strong>Cleans up</strong> — Removes the source frontend directory to keep the function package small</li></ol><p>The final function package contains only three things:</p><pre>function-package/<br>├── main.js         # Function entrypoint<br>├── package.json    # Function definition<br>└── dist/           # Your built frontend<br>    ├── index.html<br>    ├── assets/<br>    └── ...</pre><p>At runtime, the function serves files directly from dist/ when they exist, falls back to index.html for paths without extensions (enabling client-side routing), and returns 404 for missing assets. Binary files like images and fonts are automatically base64-encoded, while path traversal attempts are sanitized and only GET requests are allowed for security.</p><h3>Using Any Frontend Framework</h3><p>This approach works with any frontend framework or build tool that produces static files.</p><h3>Quick Start</h3><p>To get started quickly:</p><p><strong>1. Clone the repository</strong></p><pre>git clone https://github.com/IBM/CodeEngine.git<br>cd CodeEngine/function-spa</pre><p><strong>2. Add your SPA to a subdirectory</strong></p><ul><li>Place your frontend project in a subdirectory (e.g., my-app/)</li><li>Ensure it has npm run build configured in its package.json</li></ul><p><strong>3. Deploy to Code Engine</strong></p><pre>ibmcloud ce function create --name my-app --runtime nodejs-24 --build-source .</pre><p><strong>Or use the included quick-start scripts:</strong></p><p>The repository includes three quick-start scripts demonstrating the workflow:</p><pre>./run-angular  # Creates Angular project (SSR disabled, routing enabled, standalone components)<br>./run-react    # Creates React project with Vite (TypeScript, fast builds, modern tooling)<br>./run-svelte   # Creates Svelte project with Vite (minimal bundle, reactive components)</pre><p>Each script creates a new project in a subdirectory, checks if the function already exists, runs either function create or function update, and waits for deployment to complete. These examples show that whether you&#39;re using Angular, React, Svelte, Vue, Solid, Qwik, or any other framework, the deployment process is identical.</p><p>To use your own frontend, it must meet these requirements:</p><ol><li><strong>Produces static files</strong> — The output must be plain HTML, CSS, and JavaScript</li><li><strong>Has a build script</strong> — Must have npm run build in package.json</li><li><strong>Outputs to </strong><strong>dist/ or </strong><strong>build/</strong> - The build script should create one of these directories</li><li><strong>Includes </strong><strong>index.html</strong> - The build output must contain an index.html file</li></ol><p>The deployment workflow is straightforward:</p><ol><li>Create your SPA project in a subdirectory alongside the function wrapper files (main.js, package.json, build-spa.sh)</li><li>Develop locally using your framework’s dev server</li><li>Test that npm run build works and produces the expected output</li><li>Deploy with ibmcloud ce function create or update</li></ol><p>The build process automatically detects your frontend, builds it during deployment, and packages everything correctly.<br>This approach doesn’t interfere with your local development workflow — you can continue using your framework’s hot reload, dev server, and all existing best practices and tooling.<br>Simply develop locally as usual, test that npm run build produces static files, then deploy with the Code Engine command. You never need to manually copy files or worry about build artifacts; the deployment process handles everything.</p><h3>Conclusion</h3><p>Deploying SPAs to Code Engine Functions eliminates the manual build step while keeping your deployment simple and cost-effective. The build happens automatically during deployment, using the exact source code you’re deploying. The function runtime is minimal, secure, and handles all the routing and caching logic you need.</p><p>Whether you’re deploying an Angular dashboard, a React demo, or a Svelte tool, the workflow is the same: develop locally, then deploy with a single command. No build artifacts to manage, no manual file copying, no configuration drift.</p><p>Code Engine Functions offer a sweet spot between different deployment options. Compared to Code Engine Applications, functions are more cost-effective for low-traffic SPAs since you only pay per invocation rather than for always-running containers, and functions have fast cold starts. Compared to Object Storage with CDN, functions automate the build process and handle routing in code, eliminating manual builds and complex routing configuration. And compared to traditional hosting with fixed monthly costs and server management overhead, functions provide pay-per-use pricing with automatic deployment and zero server management.</p><p>This approach is ideal for internal tools, demos and previews, customer-specific frontends, small static bundles, and cost-sensitive projects. However, it’s not suited for applications requiring server-side rendering (SSR), backends with complex API logic (use Code Engine applications instead), sites with extremely high traffic (consider a CDN), or applications needing WebSocket connections or long-running processes.</p><p>The complete source code is available at the <a href="https://github.com/IBM/CodeEngine/blob/main/function-spa">Code Engine Sample Repository</a>, including the quick-start scripts for Angular, React, and Svelte. <br>Now its your turn try it out and see how simple SPA deployment can be.</p><p><em>This approach works with any frontend framework that builds to static files. The examples use Angular, React, and Svelte, but Vue, Solid, Qwik, and others work just as well.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fef54594a37d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[IBM Cloud Code Engine GitHub Action: Getting into the Cloud just got a lot easier!]]></title>
            <link>https://medium.com/@luke.roy/ibm-cloud-code-engine-github-action-getting-into-the-cloud-just-got-a-lot-easier-4b75bd0fac9c?source=rss-e26a536ae4a4------2</link>
            <guid isPermaLink="false">https://medium.com/p/4b75bd0fac9c</guid>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[ibm]]></category>
            <category><![CDATA[code-engine]]></category>
            <category><![CDATA[github-actions]]></category>
            <dc:creator><![CDATA[Luke Roy]]></dc:creator>
            <pubDate>Wed, 26 Nov 2025 10:09:17 GMT</pubDate>
            <atom:updated>2025-11-26T10:09:17.539Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p><a href="https://www.ibm.com/products/code-engine">IBM Cloud Code Engine</a> is IBM’s fully managed, strategic serverless platform that lets you run container images, batch jobs, source code, and functions in the cloud — without worrying about infrastructure management or scalability. It’s designed to simplify cloud-native development so you can focus on building, your business logic, not managing infrastructure. To make the developer experience even smoother, we introduced the <a href="https://github.com/IBM/code-engine-github-action">IBM Cloud Code Engine GitHub Action</a>. This action allows you to automate the build and deployment of your apps, jobs, and functions directly to Code Engine from your GitHub workflows.</p><p>And now, it just got even better!</p><p>We’re excited to announce new capabilities that take automation and flexibility to the next level:</p><p><strong>Build from Source with Ease:</strong><br>The action now supports building a container image directly from your source code and storing it in <a href="https://www.ibm.com/products/container-registry">IBM Cloud Container Registry</a> — ready for deployment.</p><p><strong>Multiple Build Strategies:</strong></p><ul><li>Buildpacks (default): No Dockerfile required! Perfect for quick builds without extra configuration.</li><li>Dockerfile: For developers who want full control over their build process.</li></ul><p><strong>Image Support for Apps and Jobs:</strong><br>Instead of building and deploying every time, you can now reference existing container images, including private ones. This opens the door to advanced workflows, such as multi-stage builds or integrating with external CI/CD pipelines.</p><p>With these enhancements, getting your workloads into the cloud has never been easier — or more powerful.</p><h3>Getting Started</h3><p>Before diving into the examples, it’s important to prepare your repository for seamless integration with IBM Cloud Code Engine. Here’s what you need to do:</p><h3>Prerequisites</h3><p>First, enable GitHub Actions for your repository. This can be done an a per repository basis. If your repository isn’t already enabled for GitHub Actions, check your access permissions, and reach out to the administrator of the GitHub organization.</p><h3>IBM Cloud account preparations</h3><p>If you’re building a proof of concept or trying out the Code Engine for the first time, create an <a href="https://cloud.ibm.com/iam/apikeys">IBM Cloud API Key</a> to authenticate your workflows with IBM Cloud services. For production-grade workloads create an IBM Cloud service ID API Key to authenticate your workflows with IBM Cloud services, as described below:</p><ul><li>Navigate to <a href="https://cloud.ibm.com/iam/serviceids">Manage → Access (IAM) → Service IDs</a> .</li><li>Click Create service ID, give it a name, assign Access policies to Resource group only, Code Engine and Container Registry. Then create a API key and copy the generated key for later use. See the <a href="https://cloud.ibm.com/docs/account?topic=account-serviceidapikeys&amp;interface=ui">documentation</a> for additional information.</li></ul><p>Regardless whether you are using a personal API Key, or a service ID API Key, store it’s value as a GitHub secret:</p><ul><li>On GitHub.com, navigate to your repository and go to Settings → Secrets and variables → Actions.</li><li>Create a new secret named IBM_IAM_API_KEY (or any name you prefer) and paste the API key you&#39;ve generated.</li></ul><p>Congratulations, your repository is now ready to leverage the IBM Cloud Code Engine GitHub Action. Let’s move on to the exciting part — exploring the new functionalities with hands-on examples! This blog post, uses pretty simple hello world examples. If you’re looking for more advanced code examples and sample workflows, be sure to check out the <a href="https://github.com/IBM/CodeEngine">Code Engine Sample Repository</a>, or revisit my initial blogpost <a href="https://medium.com/@luke.roy/ibm-cloud-code-engine-deploying-apps-jobs-and-functions-using-github-actions-76de1f8352a3">IBM Cloud Code Engine: Deploying Apps, Jobs and Functions using GitHub Actions</a><br>that showcased the Code Engine GitHub Action.</p><h3>Building and Pushing a Container Image to IBM Container Registry (ICR) Using Code Engine:</h3><p>Start by creating a directory my-ce-app containing the source code you want to build and push to ICR using Code Engine build run. Inside the my-ce-app directory create the following files which make up a simple Node.JS Web Server.</p><p>app.js</p><pre>const express = require(&quot;express&quot;);<br>const app = express();<br>const port = 8080;<br>app.use(express.urlencoded({ extended: true }));<br>app.use(express.json());<br>app.get(&quot;/&quot;, (req, res) =&gt; {<br>  res.setHeader(&quot;Content-Type&quot;, &quot;application/json&quot;);<br>  res.status(200).send(JSON.stringify({ body: &quot;Hello from Node&quot; }));<br>});<br>const server = app.listen(port, () =&gt; {<br>  console.log(`Example app listening at http://localhost:${port}`);<br>});<br>process.on(&quot;SIGTERM&quot;, () =&gt; {<br>  console.info(&quot;SIGTERM signal received.&quot;);<br>  server.close(() =&gt; {<br>    console.log(&quot;Http server closed.&quot;);<br>  });<br>});</pre><p>package.json</p><pre>{<br>    &quot;dependencies&quot;: {<br>      &quot;express&quot;: &quot;^4.17.1&quot;<br>    }<br>}</pre><p>build-push.yml</p><pre>name: Build and Push to ICR<br><br>on:<br>  push:<br>    branches:<br>      - main<br>jobs:<br>  app:<br>    runs-on: ubuntu-latest<br>    steps:<br>    - name: Check out code<br>      uses: actions/checkout@v3<br>    - name: Build and Push to ICR<br>      id: build-step<br>      uses: ibm/code-engine-github-action@v1<br>      with:<br>        api-key: ${{ secrets.IBM_IAM_API_KEY }}<br>        region: &#39;eu-de&#39;<br>        project: &#39;MY-PROJECT&#39;<br>        component: &#39;build&#39;<br>        name: &#39;my-ce-app&#39;<br>        image: private.de.icr.io/my-namespace/my-image:latest<br>        registry-secret: ce-auto-icr-private-eu-de<br>        build-source: &#39;./my-ce-app&#39;<br>    - name: Get image with digest<br>      run: | <br>        echo &quot;Image with digest: ${{ steps.build-step.outputs.image-with-digest }}&quot;</pre><p>Next, inside of the .github/workflows create the following GitHub Action workflow YAML called build-push.yml. The workflow called &quot;Build and Push to ICR&quot; is executed when a push occurs against the main branch of the repository. Initially, it checks out the repository. In the next step, the ibm/code-engine-github-action will be used to build the container image (component: build) using Code Engine build run functionality and push the resulting container image to private ICR in eu-de using the auto generated registry secret created by Code Engine this can be omitted as this is the default value for the Code Engine GitHub Action. The build will be directed to the project MY-PROJECT within your default resource group in the Frankfurt region (eu-de). The build run will be named my-ce-build appended with the current timestamp the resulting image will be named private.de.icr.io/my-namespace/my-image:latest, utilizing the content of the my-ce-app directory as the source code used for the build step. The image refrerence and its digest is outputted for use in subsequent steps using ${{ steps.build-step.outputs.image-with-digest }}. For more information about Code Engine Push see the <a href="https://cloud.ibm.com/docs/codeengine?topic=codeengine-build-standalone">Code Engine Build Docs</a>.</p><p><strong>Please note</strong>: The example depicted above uses my-namespace as the IBM Container Registry namespace. As namespaces are unique, you&#39;ll need to use your own one.</p><h3>Building and Deploying Your Code Engine App Using the Dockerfile Build Strategy</h3><p>If you need more control over the build process — such as adding custom dependencies, performance optimzation, or fine-tuning configurations — the Dockerfile build strategy is the way to go. Unlike buildpacks, which handle most of the heavy lifting automatically, Dockerfile gives you full flexibility for advanced use cases.<br>Start by organizing your application source (main.go) code and a Dockerfile inside the my-docker-app directory. This directory will contain everything needed to build your container image.</p><p>main.go</p><pre>package main<br>import (<br>    &quot;fmt&quot;<br>    &quot;net/http&quot;<br>    &quot;time&quot;<br>)<br>func greet(w http.ResponseWriter, r *http.Request) {<br>    fmt.Fprintf(w, &quot;Hello World! %s&quot;, time.Now())<br>}<br>func main() {<br>    http.HandleFunc(&quot;/&quot;, greet)<br>    http.ListenAndServe(&quot;:3000&quot;, nil)<br>}</pre><p>Dockerfile</p><pre>FROM quay.io/projectquay/golang:1.24 AS build-env<br>WORKDIR /go/src/app<br>COPY main.go main.go<br>RUN CGO_ENABLED=0 go build -o /go/bin/app main.go<br>FROM gcr.io/distroless/static-debian12<br>EXPOSE 3000<br>COPY --from=build-env /go/bin/app /<br>ENTRYPOINT [&quot;/app&quot;]</pre><p>build-dockerfile-app.yml</p><pre>name: Deploy App to Code Engine using Dockerfile build-strategy<br>on:<br>  push:<br>    branches:<br>      - main<br>  workflow_dispatch:<br>jobs:<br>  deploy-app:<br>    runs-on: ubuntu-latest<br>    steps:<br>    - name: Check out code<br>      uses: actions/checkout@v3<br>    - name: Deploy App to Code Engine using Dockerfile build-strategy<br>      uses: IBM/code-engine-github-action@v1<br>      with:<br>        api-key: ${{ secrets.IBM_IAM_API_KEY }}<br>        resource-group: &#39;Default&#39;<br>        region: &#39;eu-de&#39;<br>        project: &#39;MY-PROJECT&#39;<br>        component: &#39;app&#39;<br>        build-strategy: &#39;dockerfile&#39;<br>        port: 3000<br>        name: &#39;my-docker-app&#39;<br>        build-source: &#39;./my-docker-app&#39;<br>        cpu: 1<br>        memory: 4G</pre><p>Next, navigate to the .github/workflows directory and create a new GitHub Actions workflow file named build-dockerfile-app.yml. This workflow is responsible for automating the build and deployment process for your application. Specifically, it will use IBM Cloud Code Engine to build the application from the source code located in the my-docker-app directory, leveraging the provided Dockerfile to create the container image. Once the image is successfully built, the workflow will deploy it as a Code Engine application, ensuring a streamlined and reproducible CI/CD pipeline.</p><h3>Deploying an Existing Container Image to Code Engine as an Application</h3><p>If you already have a container image built elsewhere — perhaps as part of another CI/CD pipeline or stored in a private registry — you can now deploy it directly to IBM Cloud Code Engine without rebuilding. This feature is perfect for teams that want to reuse pre-built images or integrate Code Engine into existing workflows.<br>Inside of the .github/workflows create the following GitHub Action workflow YAML called my-img-app.yml. Instead of specifying source code or a build strategy, you reference the container image you want to deploy. This can be an image stored in IBM Container Registry (ICR) or any other registry, including private ones. We will be using the Code Engine Hello World image: icr.io/codeengine/helloworld:latest. In your workflow configuration, you’ll define key parameters like the project name, region, and resource group, along with the image reference and application settings (such as CPU and memory). Once triggered—either on a push to the main branch or manually—the workflow will deploy your application to Code Engine using the specified image.</p><p>my-img-app.yml</p><pre>name: Deploy Application to Code Engine using existing container image<br>on:<br>  push:<br>    branches:<br>      - main<br>  workflow_dispatch:<br>jobs:<br>  deploy-app:<br>    runs-on: ubuntu-latest<br>    steps:<br>    - name: Check out code<br>      uses: actions/checkout@v3<br>    - name: Deploy Application to Code Engine using existing container image<br>      uses: IBM/code-engine-github-action@v1<br>      with:<br>        api-key: ${{ secrets.IBM_IAM_API_KEY }}<br>        resource-group: &#39;Default&#39;<br>        region: &#39;eu-de&#39;<br>        project: &#39;MY-PROJECT&#39;<br>        component: &#39;app&#39;<br>        name: &#39;my-img-app&#39;<br>        image: icr.io/codeengine/helloworld:latest<br>        cpu: 1<br>        memory: 4G</pre><p>These examples highlight how the new GitHub Action features make it easier to automate builds, manage deployments, and create advanced workflows for your cloud-native applications.</p><h3>Conclusion</h3><p>The IBM Cloud Code Engine GitHub Action makes deploying cloud-native workloads easier, faster, and more flexible than ever before. With support for multiple build strategies, image-based deployments, and seamless integration with GitHub Actions, you can automate your entire build-and-deploy pipeline without leaving your development workflow.</p><p>Whether you’re building from source using buildpacks, fine-tuning with a Dockerfile, or deploying pre-built images from your registry, these new capabilities empower you to create advanced CI/CD workflows tailored to your needs. No more manual steps — just streamlined automation that gets your applications, jobs, and functions running in the cloud with minimal effort.</p><p>Getting into the cloud has never been this easy — so why wait? Start automating your deployments now!</p><ul><li><a href="https://www.ibm.com/products/code-engine">Code Engine</a></li><li><a href="https://cloud.ibm.com/docs/codeengine">Code Engine Docs</a></li><li><a href="https://github.com/IBM/CodeEngine">Example Code</a></li><li><a href="https://github.com/marketplace/actions/code-engine-github-action">Code Engine Github Action</a></li><li><a href="https://github.com/IBM/CodeEngine/tree/main/github-action-workflows">Example Source Code</a></li><li><a href="https://medium.com/@luke.roy/ibm-cloud-code-engine-deploying-apps-jobs-and-functions-using-github-actions-76de1f8352a3">IBM Cloud Code Engine: Deploying Apps, Jobs and Functions using GitHub Actions</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4b75bd0fac9c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Upscaling Videos with IBM Cloud Code Engine Serverless Fleets]]></title>
            <link>https://medium.com/@luke.roy/upscaling-videos-with-ibm-cloud-code-engine-serverless-fleets-135aef42f1d7?source=rss-e26a536ae4a4------2</link>
            <guid isPermaLink="false">https://medium.com/p/135aef42f1d7</guid>
            <category><![CDATA[serverless]]></category>
            <category><![CDATA[ibm]]></category>
            <category><![CDATA[code-engine]]></category>
            <category><![CDATA[video-upscaler]]></category>
            <dc:creator><![CDATA[Luke Roy]]></dc:creator>
            <pubDate>Tue, 07 Oct 2025 13:17:50 GMT</pubDate>
            <atom:updated>2025-10-07T13:17:50.279Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://www.ibm.com/products/code-engine">IBM Cloud Code Engine</a> is IBM’s fully managed, strategic serverless platform that empowers developers to run container images, batch jobs, source code, and functions — all in one unified environment. It abstracts away the complexity of infrastructure management, automatically handling scaling, networking, and security so you can focus on building and deploying your applications.<br>With the introduction of <a href="https://www.ibm.com/new/announcements/ibm-cloud-code-engine-introduces-serverless-fleets-with-gpus">Serverless Fleets</a>, IBM Cloud Code Engine now supports large-scale, parallel execution of run-to-completion tasks across multiple virtual machines — securely hosted within your own <a href="https://www.ibm.com/solutions/vpc">Virtual Private Cloud</a> (VPC). This gives you the flexibility to define custom subnets and choose from a wide range of <a href="https://www.ibm.com/products/virtual-servers">Virtual Server Instance</a> (VSI) flavors, including GPU-enabled options, tailored to your workload’s performance needs.<br>What sets Code Engine apart is its serverless nature — it abstracts away the operational complexity of infrastructure management. You don’t need to worry about provisioning, scaling, or securing the underlying compute resources. Instead, you can focus entirely on your application logic and task definitions, while Code Engine handles the orchestration behind the scenes.<br>By running Code Engine Serverless Fleets in a single-tenant environment, you gain enhanced control over performance, security, and compliance. This architecture ensures that your workloads execute in isolated infrastructure, making it ideal for enterprise-grade use cases such as video processing, AI inference, and scientific computing — all with a streamlined developer experience. Check out the <a href="https://www.ibm.com/new/announcements/ibm-cloud-code-engine-introduces-serverless-fleets-with-gpus">introduction</a> to Code Engine Serverless Fleets or look at the <a href="https://cloud.ibm.com/docs/codeengine?topic=codeengine-cefleets">documentation</a>.</p><p>In this blog post, we’ll explore a hands-on use case: upscaling video files using the <a href="https://docs.video2x.org/">Video2X</a> framework powered by Real-ESRGAN, orchestrated entirely through IBM Cloud Code Engine Serverless Fleets with GPU support.</p><p>To follow along with this tutorial, you’ll need to have several IBM Cloud resources set up. These include an activated <a href="https://cloud.ibm.com/">IBM Cloud account</a>, a <a href="https://cloud.ibm.com/docs/codeengine?topic=codeengine-getting-started">Code Engine</a> project, and an <a href="https://www.ibm.com/products/cloud-object-storage">IBM Cloud Object Storage</a> instance configured with three COS buckets, each supporting built-in encryption and multi-region capabilities. The first bucket stores the data required to run your IBM Cloud Code Engine Serverless Fleets, the second holds the input files used by the fleet, and the third one is used to store the output files. Additionally, you’ll need a Virtual Private Cloud (VPC) with appropriately configured subnets.</p><p>To simplify the setup process, we’ll be using a one-time configuration script available in the following <a href="https://github.com/IBM/CodeEngine/tree/main/serverless-fleets">GitHub repository</a>, which automatically provisions and configures all the required IBM Cloud resources. This approach is ideal for users who are new to Code Engine Serverless Fleets or want a <a href="https://github.com/IBM/CodeEngine/tree/main/serverless-fleets#one-time-setup">quick start</a>. However, if you’re already familiar with Code Engine and have an existing environment, feel free to customise or integrate the example setup to suit your current infrastructure.</p><h3>Upscaling the videos</h3><p>Now that all the prerequisites for running Serverless Fleets on IBM Cloud Code Engine are in place, we can begin preparing our video upscaling use case. Start by uploading your video files to the designated COS input bucket. You can use the IBM Cloud UI, or any tool you’re comfortable with — such as rclone or other file transfer utilities. For consistency, we’ll store the uploaded videos in the COS input bucket using the prefix /videos. Once processed, the upscaled output files will be saved in the COS output bucket, also under the /videos prefix. This structure helps keep your input and output data organized and easy to manage.</p><p>With your video files now available in the COS input bucket, the next step is to create a videos.jsonl file. This file serves as a task list for the fleet, where each line contains a JSON object that defines how a specific video should be processed. Each task entry includes the necessary metadata and instructions for handling one video. For example, if you have eight videos to upscale, your videos.jsonl file might look something like this, with one line per video task.</p><pre>{ &quot;args&quot;: [&quot;--input&quot;, &quot;/input/video-1.mp4&quot;, &quot;--output&quot;, &quot;/output/video-1-upscale.mp4&quot;, &quot;--processor&quot;, &quot;realesrgan&quot;, &quot;--scaling-factor&quot;, &quot;4&quot;, &quot;--realesrgan-model&quot;,&quot;realesrgan-plus&quot;]}<br>{ &quot;args&quot;: [&quot;--input&quot;, &quot;/input/video-2.mp4&quot;, &quot;--output&quot;, &quot;/output/video-2-upscale.mp4&quot;, &quot;--processor&quot;, &quot;realesrgan&quot;, &quot;--scaling-factor&quot;, &quot;4&quot;, &quot;--realesrgan-model&quot;,&quot;realesrgan-plus&quot;]}<br>{ &quot;args&quot;: [&quot;--input&quot;, &quot;/input/video-3.mp4&quot;, &quot;--output&quot;, &quot;/output/video-3-upscale.mp4&quot;, &quot;--processor&quot;, &quot;realesrgan&quot;, &quot;--scaling-factor&quot;, &quot;4&quot;, &quot;--realesrgan-model&quot;,&quot;realesrgan-plus&quot;]}<br>{ &quot;args&quot;: [&quot;--input&quot;, &quot;/input/video-4.mp4&quot;, &quot;--output&quot;, &quot;/output/video-4-upscale.mp4&quot;, &quot;--processor&quot;, &quot;realesrgan&quot;, &quot;--scaling-factor&quot;, &quot;4&quot;, &quot;--realesrgan-model&quot;,&quot;realesrgan-plus&quot;]}<br>{ &quot;args&quot;: [&quot;--input&quot;, &quot;/input/video-5.mp4&quot;, &quot;--output&quot;, &quot;/output/video-5-upscale.mp4&quot;, &quot;--processor&quot;, &quot;realesrgan&quot;, &quot;--scaling-factor&quot;, &quot;4&quot;, &quot;--realesrgan-model&quot;,&quot;realesrgan-plus&quot;]}<br>{ &quot;args&quot;: [&quot;--input&quot;, &quot;/input/video-6.mp4&quot;, &quot;--output&quot;, &quot;/output/video-6-upscale.mp4&quot;, &quot;--processor&quot;, &quot;realesrgan&quot;, &quot;--scaling-factor&quot;, &quot;4&quot;, &quot;--realesrgan-model&quot;,&quot;realesrgan-plus&quot;]}<br>{ &quot;args&quot;: [&quot;--input&quot;, &quot;/input/video-7.mp4&quot;, &quot;--output&quot;, &quot;/output/video-7-upscale.mp4&quot;, &quot;--processor&quot;, &quot;realesrgan&quot;, &quot;--scaling-factor&quot;, &quot;4&quot;, &quot;--realesrgan-model&quot;,&quot;realesrgan-plus&quot;]}<br>{ &quot;args&quot;: [&quot;--input&quot;, &quot;/input/video-8.mp4&quot;, &quot;--output&quot;, &quot;/output/video-8-upscale.mp4&quot;, &quot;--processor&quot;, &quot;realesrgan&quot;, &quot;--scaling-factor&quot;, &quot;4&quot;, &quot;--realesrgan-model&quot;,&quot;realesrgan-plus&quot;]}</pre><p>Explanation of Parameters:</p><ul><li><strong>— input</strong>: Path to the input video file (input bucket mounted from COS)</li><li><strong>— output</strong>: Path where the upscaled video will be saved (output bucket mounted from COS)</li><li><strong>— processor</strong>: Specifies the upscaling engine (e.g. realesrgan)</li><li><strong>— scaling-factor</strong>: Determines the upscale factor (e.g., 2x, 4x)</li><li><strong>— realesrgan-model</strong>: Chooses the model variant (e.g., realesrgan-plus for live-action content)</li></ul><p>Dive into the <a href="https://github.com/k4yt3x/video2x/">Video2X GitHub repository</a> and its <a href="https://docs.video2x.org/">documentation</a> to explore alternative engines and models. This will allow you to fine-tune processing parameters and achieve optimal upscaling results tailored to your specific use case.</p><p>Now that your videos and tasks are prepared, it’s time to launch the fleet using IBM Cloud Code Engine. You can do this via the Code Engine UI or the CLI. In this example, we’ll use the CLI to run the Code Engine Serverless Fleets with the official Video2X container image (ghcr.io/k4yt3x/video2x:6.4.0). The Code Engine Serverless Fleets will be configured to process tasks defined in the videos.jsonl file, with two tasks running in parallel. Of course, this setup is fully customizable—you can scale the number of concurrent tasks, adjust resource allocations, and process as many videos as you upload and define.<br>Each task will be allocated substantial resources—20 CPU cores, 100 GB of RAM, and an NVIDIA L40 GPU—ensuring high-performance video upscaling. Since the maximum scale is set to two, Code Engine will provision two worker VSIs to handle the tasks concurrently, with each worker processing one video at a time.<br>The --tasks-state-store parameter points to a persistent COS bucket used to manage the operational state of the Code Engine Serverless Fleets. Additionally, the --mount-data-store options mount the input and output COS buckets into the container: the input bucket with the prefix /videos is mounted at /input, and the output bucket with the prefix /videos is mounted at the path /output inside the container.</p><pre>ibmcloud code-engine fleet create --name “upscale-videos” \<br>--image &quot;ghcr.io/k4yt3x/video2x:6.4.0&quot; \<br>--max-scale 2 \<br>--tasks-from-local-file videos.jsonl \<br>--gpu l40s \<br>--cpu 20 \<br>--memory 100G \<br>--tasks-state-store fleet-task-store \<br>--mount-data-store /input=fleet-input-store:/videos \<br>--mount-data-store /output=fleet-output-store:/videos</pre><h3>Conclusion</h3><p>Upscaling videos using IBM Cloud Code Engine Serverless Fleets showcases the power and flexibility of modern serverless architectures for high-performance, GPU-accelerated workloads. By combining the simplicity of Code Engine with the scalability of Serverless Fleets and the efficiency of the Video2X framework, developers can process large volumes of media files in parallel — without the burden of managing infrastructure.<br>This hands-on example demonstrates how easy it is to orchestrate complex tasks like video upscaling in a secure, isolated environment using IBM Cloud Code Engine Serverless Fleets. From provisioning resources with a one-time setup script to defining tasks in a structured videos.jsonl file and executing them with fine-tuned compute configurations, the entire workflow is streamlined for productivity and performance.<br>Whether you&#39;re working on media processing, AI inference, or scientific workloads, IBM Cloud Code Engine Serverless Fleets provides a robust and developer-friendly solution. With support for GPU-enabled VSIs, customisable networking, and seamless integration with IBM Cloud Object Storage, you can build scalable, enterprise-grade pipelines with minimal operational overhead.<br>Ready to take it further? Dive into the Video2X GitHub repository to explore various models and fine-tune parameters to suit your needs. Start building your own Code Engine Serverless Fleet powered video processing workflows on IBM Cloud today.<br>While you&#39;re at it, be sure to also check out the other powerful components of Code Engine—<a href="https://cloud.ibm.com/docs/codeengine?topic=codeengine-application-workloads">Applications</a>, <a href="https://cloud.ibm.com/docs/codeengine?topic=codeengine-job-plan">Jobs</a>, and <a href="https://cloud.ibm.com/docs/codeengine?topic=codeengine-fun-work">Functions</a>—as well as additional Serverless Fleets use cases like Batch Inferencing, Docling, and Monte Carlo Simulation available in the <a href="https://github.com/IBM/CodeEngine/">sample repository</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=135aef42f1d7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why IBM Cloud Code Engine Is the Perfect Home for LinuxServer.io Applications]]></title>
            <link>https://medium.com/@luke.roy/why-ibm-cloud-code-engine-is-the-perfect-home-for-linuxserver-io-applications-2d4e39ab6f77?source=rss-e26a536ae4a4------2</link>
            <guid isPermaLink="false">https://medium.com/p/2d4e39ab6f77</guid>
            <category><![CDATA[linux-server]]></category>
            <category><![CDATA[ibm-cloud]]></category>
            <category><![CDATA[code-engine]]></category>
            <dc:creator><![CDATA[Luke Roy]]></dc:creator>
            <pubDate>Mon, 29 Sep 2025 09:09:02 GMT</pubDate>
            <atom:updated>2025-09-29T12:21:50.014Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://www.linuxserver.io/">LinuxServer.io</a> is a global community of open-source enthusiasts who maintain one of the most extensive collections of standardized Docker images. These images are designed with simplicity, consistency, and transparency in mind — making them ideal for everyone from curious beginners to seasoned self-hosters. Whether you’re looking to run a media server, a productivity tool, or a creative application, LinuxServer.io offers a rich catalog of ready-to-use containers that are well-documented and regularly updated. Just deploy an image, and you can access the application directly in your browser — no complex setup required.</p><p>But where should you run these powerful, community-maintained applications?</p><p>Simple, <a href="https://www.ibm.com/products/code-engine">IBM Cloud Code Engine</a>! IBM’s fully managed, strategic serverless platform makes deploying and running functions, containers, batch jobs and web apps effortless. With Code Engine, you don’t need to worry about provisioning infrastructure, managing servers, or scaling workloads. It automatically handles all of that for you, allowing applications to scale up when needed and scale down to zero when idle, saving you time, money, and complexity.</p><h3><strong>A Match Made in the Cloud</strong></h3><p>Pairing LinuxServer.io with IBM Cloud Code Engine creates a seamless experience for anyone, be it developers, hobbyists, educators, or even small business owners. Whoever wants to run powerful applications in the cloud without the overhead of traditional infrastructure has come to the right place.</p><ul><li><strong>No DevOps Required</strong>: You don’t need to be a cloud expert to deploy LinuxServer.io containers on Code Engine. Code Engine handles scaling, networking, and resource management automatically.</li><li><strong>Cost-Efficient</strong>: Thanks to Code Engine’s scale-to-zero feature, your applications only consume resources when they’re actively used.</li><li><strong>Secure and Customizable</strong>: Easily add environment variables to configure access controls and personalize your deployments.</li><li><strong>Flexible Access</strong>: Use either the intuitive web UI or the CLI to deploy and manage your applications.</li></ul><h3><strong>Explore the Possibilities</strong></h3><p>LinuxServer.io offers containers for a wide range of use cases:</p><ul><li><strong>Productivity</strong>: LibreOffice, WPS Office, FileZilla…</li><li><strong>Creativity</strong>: Blender, Audacity, kdenlive, gimp…</li><li><strong>Media &amp; Reading</strong>: Jellyfin (Media Server), Calibre (eBook management) …</li><li><strong>Web Browsing</strong>: Chrome, Firefox…</li><li><strong>Development Tools</strong>: Visual Studio Code…</li><li><strong>Gaming: </strong>SteamOS, retroarch, dolphin…</li></ul><p>You can browse the full catalog of nearly 200 container images here: <a href="https://www.linuxserver.io/our-images">https://www.linuxserver.io/our-images</a></p><h3><strong>Getting Started with Code Engine</strong></h3><p>Before deploying your first container, make sure you have the following prerequisites: A activated <a href="https://cloud.ibm.com/">IBM Cloud Account</a> and a Code Engine Project in your preferred region. If you want to do this in the CLI make sure to install the <a href="https://cloud.ibm.com/docs/cli?topic=cli-getting-started">IBM Cloud CLI</a> and <a href="https://cloud.ibm.com/docs/codeengine?topic=codeengine-cli">Code Engine Plugin</a>.</p><h3><strong>Deploying a LinuxServer.io Container via CLI</strong></h3><p>Here’s how simple it is to deploy Blender using the Code Engine CLI. Specifly your apps name, the port the image that should be used and as a nice bonus each linuxserver.io image comes with Basic Auth which can be configured using the to environment variables CUSTOM_USER and PASSWORD. This ensures that only you have access to your applications—no complex setup required:</p><pre>ibmcloud ce app create \<br>--name linuxserver-blender \<br>--port 3000 \<br>--image lscr.io/linuxserver/blender:latest \<br>--env CUSTOM_USER=&quot;myuser&quot; \<br>--env PASSWORD=&quot;mypwd&quot;</pre><p>Once deployed, Code Engine will provide a secure URL to access your Blender instance. That’s it — your container is live and ready to use!</p><h3><strong>Deploying via the IBM Cloud UI</strong></h3><p>Prefer a visual approach? No problem. Navigate to your Code Engine project : <strong>Containers → Serverless Project → your-project → App. </strong>Then click the <strong>Create</strong> button and a creation form for you app will open. Fill in the following values:</p><ul><li><strong>Application Name</strong></li><li><strong>Container Image</strong> (e.g., lscr.io/linuxserver/chrome:latest)</li><li><strong>Port</strong> (usually 3000 for LinuxServer images)</li><li><strong>Environment Variables</strong> (CUSTOM_USER, PASSWORD)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*dc2jjXvTju4UH41y.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yLkayPmFHdDGy3MK.png" /></figure><p>Click <strong>Create</strong>, and your application will be up and running within minutes. Once deployed, simply grab the URL to access your app directly in your browser — no extra configuration needed.</p><p>Now that you know how easy it is to deploy containers, feel free to explore and run any other LinuxServer.io image. Just create a new application using the desired image, and you’re good to go!</p><h3><strong>Extending Functionality with Persistent Storage</strong></h3><p>Now that we’ve covered the basics of deploying LinuxServer.io containers on IBM Cloud Code Engine, let’s explore how to add <strong>persistent storage</strong> using a <a href="https://www.ibm.com/products/cloud-object-storage"><strong>IBM Cloud Object Storage (COS)</strong></a><strong> bucket </strong>— with built-in encryption and multi-region support. This feature is especially useful for applications that need to save files across sessions — like office suites, media editors, or file managers. By mounting a COS bucket directly into your running container, you gain a secure, scalable, and high-performance location to store and retrieve data. To proceed with this section, make sure you’ve completed the optional setup steps: creating a COS bucket and configuring a persistent data store within your Code Engine project.</p><p>To set up a persistent data storage using IBM Cloud Object Storage (COS) with Code Engine, start by creating a COS instance and bucket, then generate HMAC credentials. See the following <a href="https://cloud.ibm.com/docs/cloud-object-storage?topic=cloud-object-storage-getting-started-cloud-object-storage">documentation</a> for setting up COS. Use these credentials to create a <a href="https://cloud.ibm.com/docs/codeengine?topic=codeengine-secret#secret-create-ui-hmac">HMAC secret in Code Engine</a>, which you’ll reference when configuring a persistent data store for your COS bucket as described at the followin <a href="https://cloud.ibm.com/docs/codeengine?topic=codeengine-persistent-data-store">Code Engine documentation</a>.</p><p>After you have created your COS instance, bucket and HMAC credentials you can use the following Code Engine CLI commands to create your secret and persistent data store.</p><pre>ibmcloud ce secret create \<br>--name cos-hmac-secret \<br>--access-key-id &lt;your-access-key-id&gt; \<br>--secret-access-key &lt;your-secret-access-key&gt;</pre><pre>ibmcloud ce pds create \<br>--name my-cos-pds \<br>--cos-access-secret cos-hmac-secret \<br>--cos-bucket-name &lt;your-bucket-name&gt;</pre><p>For example, deploying <strong>WPS Office</strong> with persistent storage via the CLI is as simple as adding one extra flag:</p><pre>ibmcloud ce app create \<br>--name linuxserver-wps-office \<br>--port 3000 \<br>--image lscr.io/linuxserver/wps-office:latest \<br>--env CUSTOM_USER=&quot;User&quot; \<br>--env PASSWORD=&quot;mypwd&quot; \<br>--mount-data-store=/mydata=my-cos-pds</pre><p>The --mount-data-store=/mydata=my-cos-pds flag mounts your COS persistent data store (PDS) to the /mydata directory inside the container, allowing <strong>WPS Office</strong> to read and write files directly to cloud storage.</p><p>Using the <strong>UI</strong>, the process is just as straightforward. When deploying an app like <strong>LibreOffice</strong>, simply specify the persistent data store under the <strong>Volume Mounts</strong> section in addition to the previously specified configuration. This enables your application to retain documents, configurations, or media files between sessions — perfect for collaborative environments or long-term projects.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/443/0*b1aZ1J7OS1OS-D4Z.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*JKi5sjKF583Y-v-w.png" /></figure><h3><strong>Wrapping Up: What’s Next?</strong></h3><p>You’ve now successfully deployed a variety of LinuxServer.io container images on IBM Cloud Code Engine — all following a simple, standardized process. The only things that typically change are the <strong>application name</strong> and the <strong>container image</strong> you choose; everything else remains consistent, making it easy to replicate and deploy new applications.</p><p>As you explore more applications, consider experimenting with different <strong>CPU and memory configurations</strong> to optimize performance based on your specific use case. Code Engine also offers advanced features like <strong>custom domain mappings</strong>, which can help you make your applications more accessible and professional. For added security and flexibility, you can dive into <strong>advanced container configurations</strong>, or integrate more sophisticated <strong>authentication methods</strong> to protect your services.</p><h3><strong>Final Thoughts</strong></h3><p>IBM Cloud Code Engine and LinuxServer.io together provide a powerful, intuitive way to run open-source applications in the cloud. Whether you’re a developer building scalable services, an educator setting up browser-based labs, or a hobbyist exploring creative tools — this combination makes cloud-native computing accessible to everyone.</p><p><strong>Ready to get started?</strong><br>Explore the LinuxServer.io catalog, pick your favorite app, and deploy it with just a few clicks or a single command directly to <a href="https://www.ibm.com/products/code-engine">IBM Cloud Code Engine</a>. The cloud is yours to build with — simple, secure, and serverless.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2d4e39ab6f77" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Writing TypeScript Functions for IBM Cloud Code Engine]]></title>
            <link>https://medium.com/@luke.roy/writing-typescript-functions-for-ibm-cloud-code-engine-4099450b7ecf?source=rss-e26a536ae4a4------2</link>
            <guid isPermaLink="false">https://medium.com/p/4099450b7ecf</guid>
            <category><![CDATA[ibm]]></category>
            <category><![CDATA[code-engine]]></category>
            <category><![CDATA[ibm-cloud]]></category>
            <category><![CDATA[cloud-functions]]></category>
            <dc:creator><![CDATA[Luke Roy]]></dc:creator>
            <pubDate>Tue, 05 Aug 2025 06:01:34 GMT</pubDate>
            <atom:updated>2025-08-05T06:01:34.394Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://www.ibm.com/products/code-engine">IBM Cloud Code Engine</a> is IBM’s serverless platform that allows developers to run apps, jobs, and functions at scale — without the hassle of managing infrastructure. Among its workload types are functions, which currently support Node.js and Python runtimes.<br>In this post, we’ll explore how to write a TypeScript function and deploy it as a Node.js function on IBM Cloud Code Engine. This approach lets you enjoy the benefits of TypeScript — like static typing and modern language features — while still running your function as JavaScript.</p><p>TypeScript is a superset of JavaScript that adds optional static typing and other powerful features. It helps catch bugs early and improves code maintainability. However, IBM Cloud Code Engine functions expect JavaScript files, so we need to transpile our TypeScript code to JavaScript before deployment.</p><p>Let’s walk through setting up a simple TypeScript-based function that uses a third-party module. The Code can be found in the following <a href="https://github.com/IBM/CodeEngine/tree/main/helloworld-samples/function-typescript-codebundle-nodejs">GitHub Repository</a></p><h3>1. Create your main function file in TypeScript</h3><p>Write your function logic in index.ts. For example, the following function imports the lorem-ipsum module and returns a randomly generated paragraph:t:</p><pre>import { LoremIpsum } from &quot;lorem-ipsum&quot;;<br><br>interface Params {<br>  [key: string]: any;<br>}<br>interface Response {<br>  headers: { [key: string]: string };<br>  body: string;<br>}<br>export function main(params?: Params): Response {<br>  const lorem = new LoremIpsum();<br>  return {<br>    headers: { &quot;Content-Type&quot;: &quot;text/plain;charset=utf-8&quot; },<br>    body: lorem.generateWords(10),<br>  };<br>}</pre><h3>2. Set up your package.json</h3><p>Define your dependencies and scripts. Include TypeScript as a devDependency, and use the postinstall script to transpile your TypeScript code to JavaScript automatically after installation:.</p><pre>{<br>  &quot;name&quot;: &quot;ts-func&quot;,<br>  &quot;version&quot;: &quot;1.0.0&quot;,<br>  &quot;main&quot;: &quot;index.js&quot;,<br>  &quot;scripts&quot;: {<br>    &quot;postinstall&quot;: &quot;tsc&quot;<br>  },<br>  &quot;devDependencies&quot;: {<br>    &quot;typescript&quot;: &quot;^5.9.2&quot;<br>  },<br>  &quot;dependencies&quot;: {<br>    &quot;lorem-ipsum&quot;: &quot;^2.0.8&quot;<br>  }<br>}</pre><h3>3. Create a tsconfig.json file</h3><p>This configuration tells TypeScript how to transpile your code:</p><pre>{<br>  &quot;compilerOptions&quot;: {<br>    &quot;module&quot;: &quot;nodenext&quot;,<br>    &quot;target&quot;: &quot;esnext&quot;,<br>  }<br>}</pre><h3>4. Deploy your function to IBM Cloud Code Engine</h3><p>After setting up all required files (index.ts, package.json, and tsconfig.json), navigate to your project directory and use the IBM Cloud CLI to create or update your function. Since TypeScript is listed as a devDependency and the tsc command is defined in the postinstall script, IBM Cloud Code Engine will automatically run the TypeScript compiler during its build process — saving you the effort of manually transpiling your code.</p><pre>ibmcloud ce fn create --name ts-func --runtime nodejs-22 --build-source .</pre><p>You’ve now successfully created a Node.js function for IBM Cloud Code Engine — while taking full advantage of TypeScript’s type safety and modern features. Give it a try in your next project and experience the benefits of cleaner, more reliable serverless code.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4099450b7ecf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating a IBM Cloud Code Engine Function Code Bundle FROM scratch]]></title>
            <link>https://medium.com/@luke.roy/creating-a-ibm-cloud-code-engine-function-code-bundle-from-scratch-75657a1ef8b5?source=rss-e26a536ae4a4------2</link>
            <guid isPermaLink="false">https://medium.com/p/75657a1ef8b5</guid>
            <category><![CDATA[cloud-functions]]></category>
            <category><![CDATA[ibm]]></category>
            <category><![CDATA[code-engine]]></category>
            <dc:creator><![CDATA[Luke Roy]]></dc:creator>
            <pubDate>Mon, 04 Aug 2025 13:04:41 GMT</pubDate>
            <atom:updated>2025-08-04T13:04:41.251Z</atom:updated>
            <content:encoded><![CDATA[<p>Have you ever wanted to create a Code Engine Function code bundle that runs as a Python or Node.js function on <a href="https://www.ibm.com/products/code-engine">IBM Cloud Code Engine</a>, without relying on the Code Engine CLI to build it?</p><p>This guide walks you through a manual method to create a Code Bundle, giving you more control over the build process. While this approach is not encouraged as it can lead to unexplained behaviours it’s ideal for experienced developers who need flexibility in how their functions are packaged and deployed.</p><p><strong>Important:</strong> Ensure you run all commands in an <strong>amd64/Linux environment</strong> using the correct runtime version for your function. Refer to the <a href="https://cloud.ibm.com/docs/codeengine?topic=codeengine-fun-runtime">Code Engine Function Runtimes documentation</a> for supported versions. You should also have a IBM Cloud account and be familiar with IBM Cloud Code Engine and <a href="https://www.ibm.com/products/container-registry">IBM Cloud Container Registry</a>.</p><h3>Step-by-Step Guide</h3><h3>1. Prepare your source code</h3><p>You can create either a Python or Node.js function for IBM Cloud Code Engine. Example source code for both runtimes is available in the following GitHub repositories:</p><ul><li><a href="https://github.com/IBM/CodeEngine/tree/main/helloworld-samples/function-codebundle-python">Python code bundle</a></li><li><a href="https://github.com/IBM/CodeEngine/tree/main/helloworld-samples/function-codebundle-nodejs">Node.JS code bundle</a></li></ul><p>Typically, you would use the Code Engine CLI to build and deploy your function in a single step. For example:</p><p><strong>For Python:</strong><br>$ ibmcloud ce fn create -n lorem-python -runtime python-3.11 --build-source .</p><p><strong>For Node.JS:</strong><br>$ ibmcloud ce fn create -n lorem-node -runtime nodejs-20 --build-source .</p><p>After running one of these commands, your function is automatically built, deployed, and ready to invoke via the generated URL — no additional steps required.<br>However, in this guide, we’ll manually perform the build and packaging steps. This approach gives you deeper insight and greater control over how your function is constructed and deployed.</p><h3>2. Installing Dependencies for Your Function</h3><p>Once you’ve created your source code files __main__.py and requirements.txt for Python, or main.js and package.json for Node.js you can proceed to install any additional dependencies required by your function. Ensure you are in the directory where your source code is.</p><p><strong>For Python:</strong><br>Set up a virtual environment and install the dependencies listed in your requirements.txt file. This will create a virtualenv directory containing all the necessary packages:<br>$ virtualenv virtualenv<br>$ source virtualenv/bin/activate<br>$ pip install -r requirements.txt</p><p><strong>For Node.js:</strong><br>Use npm to install the dependencies defined in your package.json. This will generate a node_modules directory:<br>$ npm install</p><p>These steps ensure that all runtime dependencies are downloaded and ready for packaging into your Code Engine function.</p><h3>3. Packaging and Publishing Your Function Code and Dependencies</h3><p>With your source code and dependencies ready, the next step is to bundle everything into a .tar.gz archive. This archive will later be added to a container image for deployment.</p><p><strong>For Python:</strong><br>Include your code __main__.py, dependencies requirements.txt, and the virtual environment directory virtualenv:<br>$ tar -czf myfuncbundle.tar.gz __main__.py requirements.txt virtualenv</p><p><strong>For Node.js:</strong><br>Include your main.js, package.json, and the node_modules directory:<br>$ tar -czf myfuncbundle.tar.gz main.js package.json node_modules</p><p>Now that your code and dependencies are bundled in a tar.gz , the final step is to create a container image that can be stored in a container registry — specifically, the IBM Cloud Container Registry in this case.<br>This image will contain a single layer with your function. Note that this is not an executable container, it simply holds the function code for Code Engine to extract and run.</p><p>Create a file namedDockerfile with the following content.</p><p><strong>Dockerfile:</strong><br>FROM scratch<br>ADD myfuncbundle.tar.gz .</p><p>Build the image and push it to IBM Cloud Container Registry using the following commands. Replace mynamespace with your actual IBM Cloud Container Registry namespace:</p><p>$ docker build -t us.icr.io/mynamespace/myfuncbundle .<br>$ docker push us.icr.io/mynamespace/myfuncbundle</p><p>Once pushed, this image can be referenced when creating/updating your function in Code Engine.</p><h3>4. Deploying Your Function with a Custom Code Bundle</h3><p>With your function code bundle pushed to the IBM Cloud Container Registry, you’re ready to create/update your function using the Code Engine CLI. Instead of building from source, you’ll reference your pre-packaged code bundle stored in the registry.</p><p><strong>For Python:</strong><br>$ ibmcloud ce function create --name myfunc --runtime python-3.11 --code-bundle us.icr.io/mynamespace/myfuncbundle</p><p><strong>For Node.JS:</strong><br>$ ibmcloud ce function create --name myfunc --runtime nodejs-20 --code-bundle us.icr.io/mynamespace/myfuncbundle</p><p>Be sure to replace mynamespace with your actual IBM Cloud Container Registry namespace.</p><p>This command creates your function on IBM Cloud Code Engine, using your custom bundle as the source. Once created, the function is ready to be invoked via its generated URL.</p><h3>Summary</h3><p>By manually creating a Code Engine function bundle, you’ve unlocked a deeper understanding of how IBM Cloud Code Engine handles function packaging and deployment. This method gives you full control over your function dependencies and build, process — ideal for advanced use cases or custom CI/CD pipelines. However, for most scenarios, it is strongly recommended to use the Code Engine CLI, which simplifies the process and ensures compatibility with the platform’s evolving features. While the manual approach is powerful, the CLI remains the most reliable and supported way to build and deploy your functions. Happy coding — and may your functions run fast and fault-free!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=75657a1ef8b5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[IBM Cloud Code Engine: Running Binaries inside the IBM Cloud Code Engine Function Runtimes]]></title>
            <link>https://medium.com/@luke.roy/ibm-cloud-code-engine-running-binarys-inside-the-ibm-cloud-code-engine-function-runtimes-6216e34cad54?source=rss-e26a536ae4a4------2</link>
            <guid isPermaLink="false">https://medium.com/p/6216e34cad54</guid>
            <category><![CDATA[go]]></category>
            <category><![CDATA[ibm-cloud]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[code-engine]]></category>
            <category><![CDATA[functions-as-a-service]]></category>
            <dc:creator><![CDATA[Luke Roy]]></dc:creator>
            <pubDate>Thu, 30 Jan 2025 11:18:41 GMT</pubDate>
            <atom:updated>2025-02-03T13:36:11.203Z</atom:updated>
            <content:encoded><![CDATA[<p>In this blog post, we’ll explore how you can use <a href="https://www.ibm.com/de-de/products/code-engine">IBM Cloud Code Engine</a> to run binaries inside the existing Node.js and Python runtimes.</p><p>IBM Cloud Code Engine is IBMs Strategic serverless compute platform that supports a variety of workloads including functions. A function is a stateless code snippet, that perform tasks as it is invoked by HTTP. For Functions, Code Engine currently supports two programming languages: Node.js and Python. But what if you prefer to use a different language?</p><p>The solution lies in utilizing one of the existing runtimes, which is provided by IBM Cloud Code Engine. and bundling and executing a binary. In this example, we’ll create a simple function using the Python runtime which will run (subprocess.run), a binary written in Go. We’ll leverage the ability to add the binary to the function’s code bundle during the build process.</p><p>1. Start by writing a Python function that acts as a wrapper to execute the binary. This wrapper can take the functions parameters and serialize them into a JSON string. The wrapper function will then run the binary, passing the JSON string as a command-line argument. The binary’s output, which will be in JSON format, will be captured and deserialized into a Python dictionary. Finally, this dictionary will be returned as the result of the wrapper function invocation. __main__.py</p><pre>import subprocess<br>import json<br><br>output_dict={}<br>statusCode = 0<br>binary=&quot;my-program&quot;<br><br>def main(params):<br>    command = f&#39;./{binary} \&#39;{json.dumps(params)}\&#39;&#39;<br>    result = subprocess.run(command, shell=True, capture_output=True, text=True)<br><br>    if result.returncode == 0:<br>        statusCode = 200<br>        output_dict = json.loads(result.stdout)<br>    else:<br>        statusCode = 500<br>        output_dict = {&quot;error&quot;:&quot;an error as occured&quot;}<br><br>    return {<br>        &quot;headers&quot;: {<br>            &#39;Content-Type&#39;: &#39;application/json; charset=utf-8&#39;,<br>        },<br>        &quot;statusCode&quot;: statusCode,<br>        &quot;body&quot;: output_dict,<br>    }</pre><p>2. Implement the logic of your application in a Go source file (or multiple). The Go binary must be designed to handle input and output in JSON format. In this example, it should receive a JSON object that contains a key, such as “name”, and return a JSON object that includes the provided value along with additional data. This ensures a clear and consistent interface between the wrapper function and the Go binary. It is up to you to add whatever real world functionality you need inside the Go Code. main.go</p><pre>package main<br><br>import (<br>    &quot;encoding/json&quot;<br>    &quot;fmt&quot;<br>    &quot;os&quot;<br>)<br><br>type Response struct {<br>    Key   string      `json:&quot;key&quot;`<br>    Value string      `json:&quot;value&quot;`<br>    Data  interface{} `json:&quot;data&quot;`<br>}<br><br>func main() {<br>    // recive data as json string and unmarshal into variable<br>    var inputData map[string]interface{}<br>    if len(os.Args) &gt; 1 {<br>        jsonString := os.Args[1]<br>        err := json.Unmarshal([]byte(jsonString), &amp;inputData)<br>        if err != nil {<br>            os.Exit(1)<br>        }<br>    }<br><br>    // Here comes your logic<br>    name := &quot;placeholder&quot;<br>    if len(inputData) != 0 {<br>        name = inputData[&quot;name&quot;].(string)<br>    }<br><br>    // return the response json (to the python code)<br>    respones := Response{<br>        Key:   &quot;New Key&quot;,<br>        Value: name,<br>        Data:  inputData,<br>    }<br>    responseJSON, err := json.Marshal(respones)<br>    if err != nil {<br>        os.Exit(1)<br>    }<br>    fmt.Println(string(responseJSON))<br>}</pre><p>3. If deploying this setup from the directory where the Go source code is stored, create a .ceignore file. This file ensures that only the compiled binary, and not the raw Go source code is included in the function code bundle. This step is useful to exclude any unnecessary files. .ceignore</p><pre>main.go</pre><p>4. Compile your Go source code into a Go binary. Ensure the build is configured for the target architecture and operating system, for Code Engine this is linux/amd64. Proper compilation ensures compatibility and prevents runtime errors.</p><pre>GOOS=linux GOARCH=amd64 go build -o &quot;my-program&quot; -ldflags=&quot;-s -w&quot; ./main.go</pre><p>Your directory should look like this:</p><pre>├── __main__.py<br>├── main.go<br>├── .ceignore<br>└── my-program</pre><p>5. Create your code engine function using the <a href="https://cloud.ibm.com/docs/codeengine?topic=codeengine-cli">IBM Cloud Code Engine CLI</a> Make sure the binary is in the same directory as the Python function code __main__.py. After running the command you will have a code engine function which will execute your go binary as part of the function logic.</p><pre>ibmcloud ce fn create - name &lt;function-name&gt; - runtime python-3.11 - build-source .</pre><p>6. You can now call your function using the displayed URL</p><p>And that’s it! You have now successfully created a IBM Code Engine Function by deploying your Python wrapper code and your Go binary and executed it on the IBM Cloud.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6216e34cad54" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[IBM Cloud Code Engine: Deploying Apps, Jobs and Functions using GitHub Actions]]></title>
            <link>https://medium.com/@luke.roy/ibm-cloud-code-engine-deploying-apps-jobs-and-functions-using-github-actions-76de1f8352a3?source=rss-e26a536ae4a4------2</link>
            <guid isPermaLink="false">https://medium.com/p/76de1f8352a3</guid>
            <category><![CDATA[deployment]]></category>
            <category><![CDATA[code-engine]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[github-actions]]></category>
            <category><![CDATA[ibm-cloud]]></category>
            <dc:creator><![CDATA[Luke Roy]]></dc:creator>
            <pubDate>Fri, 23 Feb 2024 09:27:04 GMT</pubDate>
            <atom:updated>2026-06-02T13:05:22.205Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction:</h3><p>In the dynamic world of cloud computing, efficient deployment pipelines are a crucial part of a seamless development process. IBM <a href="https://www.ibm.com/products/code-engine">Code Engine</a>, a fully managed serverless offering, stands out by simplifying the deployment and running of Applications, Jobs, and Functions in the cloud at scale, eliminating the need for users to manage the underlying infrastructure.<br> To elevate the users development experience and workflow, we’ve introduced a dedicated GitHub Action designed to simplify the deployment process for GitHub users leveraging GitHub Actions as their CI/CD pipeline.</p><p>The GitHub Action ibm/code-engine-github-action empowers Code Engine users to seamlessly build and deploy applications, jobs, and functions directly from their GitHub repositories without the need to first manually build the program that they want to deploy or run multiple cli commands. This integration enhances the overall development lifecycle, providing a streamlined and automated approach to deploying and managing Code Engine resources.</p><h3>Getting Started</h3><p>To get started, ensure that the GitHub Actions feature is enabled for your repository. While GitHub Actions are enabled by default for public repositories, users with private repositories may need to enable it from the Actions tab. All workflow configurations are stored within the .github/workflows directory, making it easily accessible for users to customize and manage their deployment pipelines.</p><p>To use the ibm/code-engine-github-action GitHub Action you will also need to create an API Key <a href="https://cloud.ibm.com/docs/account?topic=account-userapikey&amp;interface=ui">(see the docs)</a> and save it as a secret for your repository (Settings -&gt; Secrets and variables &gt; Actions). In this example the secret is called IBM_IAM_API_KEY.</p><p>After you have prepared your repository we can get started with two simple examples: the first on how to deploy a Code Engine App and the second one how to deploy a Code Engine Python Function.</p><h3>Deploying an App</h3><p>Create a directory my-ce-app containing the source code you want to deploy to Code Engine. Inside the my-ce-app directory create the following files which make up a simple NodeJS Web Server.</p><p><a href="https://github.com/IBM/CodeEngine/blob/main/github-action-workflows/my-ce-app/app.js">app.js</a></p><pre>const express = require(&quot;express&quot;);<br>const app = express();<br>const port = 8080;<br>app.use(express.urlencoded({ extended: true }));<br>app.use(express.json());<br>app.get(&quot;/&quot;, (req, res) =&gt; {<br>  res.setHeader(&quot;Content-Type&quot;, &quot;application/json&quot;);<br>  res.status(200).send(JSON.stringify({ body: &quot;Hello from Node&quot; }));<br>});<br>const server = app.listen(port, () =&gt; {<br>  console.log(`Example app listening at http://localhost:${port}`);<br>});<br>process.on(&quot;SIGTERM&quot;, () =&gt; {<br>  console.info(&quot;SIGTERM signal received.&quot;);<br>  server.close(() =&gt; {<br>    console.log(&quot;Http server closed.&quot;);<br>  });<br>});</pre><p><a href="https://github.com/IBM/CodeEngine/blob/main/github-action-workflows/my-ce-app/package.json">package.json</a></p><pre>{<br>    &quot;dependencies&quot;: {<br>      &quot;express&quot;: &quot;^4.17.1&quot;<br>    }</pre><p>Next, inside of the .github/workflows create the following GitHub Action workflow YAML called deploy-ce-app.yml. The workflow called Deploy App to Code Engine is executed when a push occurs against the main branch of the repository. Initially it checks out the repository. In the next step, the ibm/code-engine-github-action will be used to deploy the application (component: app) to Code Engine. It uses Code Engine&#39;s push feature so we don&#39;t need to create the container image ourselves. The deployment will be directed to the project MY-PROJECT within your default resource group in the Frankfurt region (eu-de). The application will be named my-ce-node-app, utilizing the content of the my-ce-app directory as the source code used for the build step. For more information about Code Engine Push see the <a href="https://cloud.ibm.com/docs/codeengine?topic=codeengine-build-config-local">Code Engine Build Docs</a>.</p><p><a href="https://github.com/IBM/CodeEngine/blob/main/github-action-workflows/my-ce-app/deploy-ce-app.yml">deploy-ce-app.yml</a></p><pre>name: Deploy App to Code Engine<br>on:<br>  push:<br>    branches:<br>      - main<br>jobs:<br>  app:<br>    runs-on: ubuntu-latest<br>    steps:<br>    - name: Check out code<br>      uses: actions/checkout@v3<br>    - name: Deploy Application to Code Engine<br>      uses: ibm/code-engine-github-action@v1<br>      with:<br>        api-key: ${{ secrets.IBM_IAM_API_KEY }}<br>        region: &#39;eu-de&#39;<br>        project: &#39;MY-PROJECT&#39;<br>        component: &#39;app&#39;<br>        name: &#39;my-ce-app&#39;<br>        build-source: &#39;./my-ce-app&#39;</pre><p>Now, whenever changes are pushed into the main branch the Github Action is run and your Code is built and deployed to Code Engine always keeping your Application up to date with your latest changes.</p><h3>Deploying a Python Function</h3><p>Create a directory my-ce-py-func containing your function source code you want to deploy to Code Engine. Inside the my-ce-py-func directory create the following files which make up a simple python function.</p><p><a href="https://github.com/IBM/CodeEngine/blob/main/github-action-workflows/my-ce-py-func/__main__.py">__main__.py</a></p><pre>from lorem_text import lorem<br><br>def main(params):<br>     words = 10<br>     return {<br>          &quot;headers&quot;: {<br>              &quot;Content-Type&quot;: &quot;text/plain;charset=utf-8&quot;,<br>          },<br>          &quot;body&quot;: lorem.words(words),<br>      }</pre><p><a href="https://github.com/IBM/CodeEngine/blob/main/github-action-workflows/my-ce-py-func/requirements.txt">requirements.txt</a></p><pre>lorem-text</pre><p>Like the Application example inside of the .github/workflows create the following GitHub action Workflow YAML called deploy-ce-py-func.yml The workflow called Deploy Python Function to Code Engine is executed when a push occurs against the main branch of the repository. The ibm/code-engine-github-action will be used to deploy the Python Function (component: fn) to Code Engine. The deployment will be directed to the project MY-PROJECT within your default resource group in the Frankfurt region (eu-de). The Function will be named my-ce-py-fn, utilizing the content of the my-ce-py-func directory as the source code.</p><p><a href="https://github.com/IBM/CodeEngine/blob/main/github-action-workflows/my-ce-py-func/deploy-ce-py-func.yml">deploy-ce-py-func.yml</a></p><pre>name: Deploy Python Function to Code Engine<br>on:<br>  push:<br>    branches:<br>      - main<br>jobs:<br>  fn-py:<br>    runs-on: ubuntu-latest<br>    steps:<br>    - name: Check out code<br>      uses: actions/checkout@v3<br>    - name: Deploy Python Function to Code Engine<br>      uses: ibm/code-engine-github-action@v1<br>      with:<br>        api-key: ${{ secrets.IBM_IAM_API_KEY }}<br>        region: &#39;eu-de&#39;<br>        project: &#39;MY-PROJECT&#39;<br>        component: &#39;fn&#39;<br>        runtime: python-3.11<br>        name: &#39;my-ce-py-fn&#39;<br>        build-source: &#39;./my-ce-py-func&#39;</pre><h3>Conclusion</h3><p>In this blog, we learned how to create Applications and Functions and automatically deploy them to IBM Cloud Code Engine using GitHub Actions as a CI/CD solution. The Code Engine enables developers to effortlessly enhance their development workflows by leveraging a fully managed serverless solution. The workflows depicted above powered by ibm/codeengine-github-action simplify and enhance your deployment process and experience.</p><p>Now its up to you! To get started, head on over to <a href="https://www.ibm.com/products/code-engine">IBM Cloud Code Engine</a> and register for a new account or login to an existing IBM Cloud account and begin your serverless journey with Code Engine. Run your Applications, Jobs or Functions in the Cloud at scale. The documentation, additional information and examples can be found at the included links.</p><ul><li><a href="https://cloud.ibm.com/codeengine/overview">Code Engine</a></li><li><a href="https://cloud.ibm.com/docs/codeengine">Code Engine Docs</a></li><li><a href="https://github.com/IBM/CodeEngine">Example Code</a></li><li><a href="https://github.com/marketplace/actions/code-engine-github-action">Code Engine Github Action</a></li><li><a href="https://github.com/IBM/CodeEngine/tree/main/github-action-workflows">Example Source Code</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=76de1f8352a3" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>