Tutorial
Build a multi-architecture CI/CD pipeline for AI agents
Learn how to containerize, test, scan, and deploy AI agents across x86 and IBM Z using MCP, Docker, IBM DevSecOps, and IBM Cloud Container RegistryAI agents often need access to tools and services to complete user requests. Moving an AI agent from development to production requires additional controls for containerization, automated testing, security, compliance, and support for different hardware architectures.
A multi-architecture continuous integration and continuous delivery (CI/CD) pipeline provides a consistent way to build and validate AI agent applications for x86 and IBM Z environments. IBM Cloud Continuous Delivery provides the DevSecOps pipeline for building, testing, scanning, and publishing the container images.
In this tutorial, you build a CI/CD pipeline for an agentic AI application that uses the Model Context Protocol (MCP) for tool orchestration. The pipeline builds Docker images for amd64 and s390x architectures, runs integration tests against live containers to validate AI agent tool selection, and pushes validated images to IBM Cloud Container Registry (ICR). The pipeline also includes secrets detection, vulnerability scanning, compliance checks, and artifact signing.
The pipeline supports two deployment variants. The MCP variant uses Meta Llama 3.3 70B for general-purpose tool orchestration. The Spyre variant uses IBM Granite 3.3 8B for IBM Z hardware acceleration. The tutorial focuses on the MCP variant and explains the Spyre-specific configuration where required.
In this tutorial, you learn how to:
- Configure IBM Secure Pipeline Services for an agentic AI application.
- Build Docker images for amd64 and s390x architectures.
- Run automated integration tests to validate AI agent tool selection.
- Push validated container images to IBM Cloud Container Registry.
- Integrate security and compliance checks into the CI/CD pipeline.
Architecture of the multi-architecture CI/CD pipeline
The architecture uses IBM Secure Pipeline Services (SPS) to build, test, scan, and publish the AI agent container images. The following diagram shows how the pipeline processes amd64 and s390x builds in parallel and publishes the validated images to IBM Cloud Container Registry (ICR).

The pipeline starts when you push code to the application repository or when a scheduled pipeline run begins. IBM Secure Pipeline Services runs separate pipeline paths for amd64 and s390x architectures.
For each architecture, the pipeline builds an architecture-specific container image and runs integration tests against the MCP client and MCP server containers. The integration tests send sample questions to the AI agent and record the tool that the AI agent selects for each question.
The amd64 path pushes the validated image to IBM Cloud Container Registry and runs a Twistlock vulnerability scan. The s390x path also pushes the validated image to IBM Cloud Container Registry, with scan evidence saved for the image digest. Code checks run in parallel with the architecture-specific tasks.
After both architecture paths complete, the pipeline commits the test results to the SPS branch and notifies the team. A successful pipeline run produces validated container images for amd64 and s390x architectures, test results for each architecture, and security scan results.
Prerequisites
Before you begin, ensure that you have the following:
- An IBM Cloud account with access to the Continuous Delivery service.
- An IBM Cloud Container Registry (ICR) namespace. Follow Getting started with IBM Cloud Container Registry to create a namespace in your target region.
- A GitHub Enterprise (or GitHub) repository for your agentic application code, set up with the file structure described in Step 1.
- Python 3.12 and Poetry 2.2.1 (or later) for dependency management.
- Docker with Buildx support. See Install Docker Desktop for platform-specific installation steps.
- Familiarity with Docker multi-stage builds and basic CI/CD concepts.
- Access to IBM watsonx.ai for large language model (LLM) inference. See Getting started with watsonx.ai to create a deployment space and Managing user API keys to generate the API key.
- (Optional) Access to an IBM Z (s390x) build environment or LinuxONE instance for native Z builds. See IBM LinuxONE on IBM Cloud for provisioning options.
Step 1. Configure IBM Secure Pipeline Services
In this step, you add the pipeline configuration and required shell scripts to the application repository. You also create an IBM DevSecOps toolchain that uses the pipeline configuration to build and test the application.
At the root of the application repository, create and configure the
.pipeline-config.yamlfile. For more information, see Configure the .pipeline-config.yaml file. IBM Secure Pipeline Services (SPS) uses this file to configure the pipeline. The.pipeline-config.yamlfile defines a task for each architecture:code-buildbuilds the amd64 image.code-build-s390xbuilds the s390x image.
Each task runs the following four scripts as part of a single
build-artifactstep:build-artifact-setup.shbuild-artifact-execute.shbuild-artifact-test.shbuild-artifact-push.sh
Running the four scripts in the same
build-artifactstep keeps shell variables such asGLOBAL_IMAGE_NAMEandTAG_TIMESTAMPavailable throughout the build process. Create the four shell scripts at the root of the application repository. The remaining steps in this tutorial add the required logic to each script:Commit the pipeline files and push the changes to your GitHub branch.
In IBM Cloud, create a DevSecOps toolchain. Configure the Continuous Integration pipeline to use the application repository and the
.pipeline-config.yamlfile. For detailed instructions, see Creating a DevSecOps toolchain.You configure the pipeline properties, including the
IMAGE_NAMEproperty that selects the MCP or Spyre variant, in Step 2.Push a new commit or click Run pipeline in the DevSecOps toolchain to start the pipeline. The following screen capture shows an example of a successful pipeline run. Compare the pipeline stages and status with your pipeline run to verify the configuration.

Configure the .pipeline-config.yaml file
The .pipeline-config.yaml file defines the tasks that IBM Secure Pipeline Services (SPS) runs. The main tasks are code-build for amd64 and code-build-s390x for s390x. For more information, see the .pipeline-config.yaml schema reference for the full list of supported fields, task overrides, and when conditions.
The code-build-s390x task uses from: code-build to inherit the configuration from the amd64 task. The s390x task overrides the configuration required for the s390x architecture. This approach keeps the four build scripts in a single build-artifact step.
version: '2'
# These four flags are appropriate for development pipelines while you
# iterate on the build. Remove all four before promoting to production.
environment:
DEVSECOPS_SKIP_EVIDENCE_PUBLISH: "true"
DEVSECOPS_SKIP_EVALUATION: "true"
DEVSECOPS_SKIP_COMPLIANCE: "true"
DEVSECOPS_SKIP_SIGNING: "true"
tasks:
code-build:
displayName: code-build-amd64
runtimeClassName: x86-xxlarge
include:
- dind
steps:
- name: build-artifact
include:
- docker-socket
image: icr.io/continuous-delivery/base-images/base:v1.23.0
onError: stopAndFail
script: |
#!/usr/bin/env bash
export BLD_ARCH="amd64"
export BUILD_BRANCH="$(get_env BUILD_BRANCH)"
source build-artifact-setup.sh
source build-artifact-execute.sh
source build-artifact-test.sh
source build-artifact-push.sh
- name: scan-artifact
include:
- docker-socket
script: |
#!/usr/bin/env bash
${COMMONS_PATH}/scan-artifact/scan.sh
code-build-s390x:
from: code-build
displayName: code-build-s390x
steps:
- name: build-artifact
image: icr.io/continuous-delivery/pipeline/pipeline-base-ubi:3.66
script: |
#!/usr/bin/env bash
export BLD_ARCH="s390x"
export BUILD_BRANCH="$(get_env BUILD_BRANCH)"
source build-artifact-setup.sh
source build-artifact-execute.sh
source build-artifact-test.sh
source build-artifact-push.sh
- name: scan-artifact
when: 'false'
The complete .pipeline-config.yaml file also defines a code-checks task. The code-checks task runs detect-secrets.sh and the IBM compliance checks described in Step 6. For information about the complete configuration, including the deploy-checks and finally blocks, see the .pipeline-config.yaml schema reference.
Note: Use the
DEVSECOPS_SKIP_*flags only while you configure and test the pipeline. Remove all four flags before you promote the toolchain to production.
Step 2. Configure the build environment
In this step, you configure the credentials and pipeline properties required by the build process. The build-artifact-setup.sh script uses these values to prepare the environment for each amd64 and s390x build.
The build-artifact-setup.sh script performs the following tasks:
- Reads the required pipeline properties with
get_envand exports each value with aGLOBAL_prefix. The prefix identifies values that come from the toolchain. - Installs Python 3.12 and Poetry 2.2.1 if the build image does not include the required versions.
- Authenticates with IBM Cloud and IBM Cloud Container Registry (ICR) by using the IBM Cloud API key.
- Clones the application repository from the branch specified by
BUILD_BRANCH. - Checks for commits from the previous 24 hours. If the script finds a commit, the script sets
COMMIT=true. A later build step uses this value to determine whether to build a new image or reuse the previous image. - For s390x builds, installs the JFrog CLI. The build process uses the JFrog CLI to download precompiled vendor wheels from Artifactory.
Configure the required pipeline inputs as follows:
In the DevSecOps toolchain, go to Pipeline properties and add the following properties:
ICR_REGION: The region for the ICR namespace, such asus-south.ICR_NAMESPACE: The ICR namespace that you created in the prerequisites.IMAGE_NAME: The container image name. Use an image name that containsspyreto build the Spyre variant.IBMCLOUD_API_KEY: An IBM Cloud API key with permission to push images to ICR. Store the API key as a secret.GITHUB_ID: The GitHub ID that the pipeline uses to commit test results.BUILD_BRANCH: The Git branch that the pipeline builds.
- Upload the GitHub OAuth token as a secure file. The
build-artifact-setup.shscript reads the token from/config/GITHUB_OAUTH2_TOKEN. For instructions, see Managing secrets in your toolchain. For s390x builds, upload the Artifactory password as
/config/afpwdand addaf_useras a pipeline property. The build process uses these credentials to download the required vendor wheels from Artifactory.The
.pipeline-config.yamlfile automatically runsbuild-artifact-setup.shat the beginning of each build:source build-artifact-setup.shThe
require_envhelper reads each required pipeline property, verifies that the property has a value, and exports the value with aGLOBAL_prefix:function require_env() { local var_name=$1 local value=$(get_env "$var_name") if [[ -z "$value" ]]; then echo "ERROR: Missing required environment variable $var_name" exit 1 fi export GLOBAL_${var_name}="$value" } require_env ICR_REGION require_env ICR_NAMESPACE require_env IMAGE_NAME require_env IBMCLOUD_API_KEYNote: The setup script explicitly installs
poetry-plugin-exportbecause the pipeline uses the Poetry export command. If you modifybuild-artifact-setup.sh, keep thepoetry-plugin-exportinstallation.
Step 3. Build Docker images for amd64 and s390x
In this step, you configure the pipeline to build Docker images for amd64 and s390x from the same application source. The build-artifact-execute.sh script selects the Dockerfile and large language model (LLM) based on the IMAGE_NAME and BLD_ARCH values.
Verify the
IMAGE_NAMEpipeline property that you configured in Step 2.- An
IMAGE_NAMEvalue that containsspyreselects the Spyre variant with IBM Granite 3.3 8B. - Any other
IMAGE_NAMEvalue selects the MCP variant with Meta Llama 3.3 70B.
- An
Add
Dockerfile.amd64andDockerfile.s390xto the application repository. Thebuild-artifact-execute.shscript uses the appropriate Dockerfile for each architecture.Commit the files and push the changes to the GitHub branch. The pipeline runs
build-artifact-execute.sh. The script performs the following tasks:- Selects the LLM based on
IMAGE_NAME. - Exports the Python dependencies by using
poetry export. - For s390x builds, downloads the required vendor wheels from Artifactory.
- Updates the
torchversion inrequirements.txtto the version required for s390x. - Builds the Docker image for the selected architecture.
- Selects the LLM based on
The following code shows the model and architecture selection logic:
if [[ "${GLOBAL_IMAGE_NAME}" == *"spyre"* ]]; then
export VERSION="spyre"
export LLM_MODEL="ibm/granite-3-3-8b-instruct"
else
export VERSION="mcp"
export LLM_MODEL="meta-llama/llama-3-3-70b-instruct"
fi
if [[ "$GLOBAL_BLD_ARCH" == "amd64" ]]; then
docker build -t "${GLOBAL_IMAGE_NAME}:amd64" -f Dockerfile.amd64 .
elif [[ "$GLOBAL_BLD_ARCH" == "s390x" ]]; then
jf rt download "<your-artifactory-repo>/vendor_wheels/" --flat=false
sed -i 's/^torch==[^ ;]*/torch==2.9.0a0+git0fabc3b/' requirements.txt
docker build -t "${GLOBAL_IMAGE_NAME}:s390x" -f Dockerfile.s390x .
fi
After the build completes, verify that the pipeline created the Docker images for both architectures.

Dockerfile for amd64
The amd64 image uses a single-stage build based on UBI 9 minimal. The Dockerfile installs Python 3.12 and the required dependencies, copies the application code, and starts the application with main.py. The application uses the SERVICE_MODE environment variable at runtime to run the MCP server, the agent client, or both.
# Simple x86 Dockerfile for AI Agent
FROM registry.access.redhat.com/ubi9/ubi-minimal:latest
WORKDIR /app
# Install Python and basic tools
RUN microdnf install -y python3.12 python3.12-pip git \
&& ln -sf /usr/bin/python3.12 /usr/bin/python \
&& ln -sf /usr/bin/pip3.12 /usr/bin/pip \
&& microdnf clean all
# Copy requirements file
COPY requirements.txt /app/requirements.txt
# Install Python dependencies
# Use Docker secrets to avoid exposing GitHub token in image layers
RUN --mount=type=secret,id=github_token \
if [ -f /run/secrets/github_token ]; then \
GITHUB_TOKEN=$(cat /run/secrets/github_token) && \
git config --global url."https://oauth2:${GITHUB_TOKEN}@github.com/".insteadOf "https://github.com/"; \
fi && \
pip install --no-cache-dir -r /app/requirements.txt && \
git config --global --unset-all url."https://oauth2:.*@github.com/".insteadOf || true
# Copy application code
COPY . /app
# Expose ports for agent and MCP server
EXPOSE 9001 9002
# Entry point
CMD ["python", "/app/main.py"]
Dockerfile for s390x
The s390x image uses a multi-stage build. The builder stage compiles dependencies that require build tools on s390x. The runtime stage copies the installed Python packages from the builder stage without including the build tools in the final image.

# Simplified s390x Dockerfile for AI Agent on IBM Z
# Uses multi-stage build to compile dependencies
# ============================================
# Stage 1: Build dependencies
# ============================================
FROM registry.access.redhat.com/ubi9/ubi-minimal:latest AS builder
WORKDIR /app
# Install build tools
RUN microdnf install -y \
gcc gcc-c++ python3.12 python3.12-pip python3.12-devel \
git curl-minimal \
&& ln -sf /usr/bin/python3.12 /usr/bin/python \
&& ln -sf /usr/bin/pip3.12 /usr/bin/pip
# Install Rust for Python packages that require Rust on s390x
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
ENV PATH="/root/.cargo/bin:$PATH"
# Copy and install dependencies
COPY requirements.txt /app/requirements.txt
RUN pip install --no-cache-dir -r requirements.txt
# ============================================
# Stage 2: Runtime image
# ============================================
FROM registry.access.redhat.com/ubi9/ubi-minimal:latest
WORKDIR /app
# Install runtime dependencies
RUN microdnf install -y python3.12 python3.12-pip git \
&& ln -sf /usr/bin/python3.12 /usr/bin/python \
&& ln -sf /usr/bin/pip3.12 /usr/bin/pip \
&& microdnf clean all
# Copy installed packages from builder
COPY --from=builder /usr/local/lib/python3.12/site-packages /usr/local/lib/python3.12/site-packages
COPY --from=builder /usr/local/lib64/python3.12/site-packages /usr/local/lib64/python3.12/site-packages
# Copy application code
COPY . /app
# Expose ports
EXPOSE 9001 9002
# Start application
CMD ["python", "/app/main.py"]
The main difference between the Dockerfiles is how each Dockerfile installs the Python dependencies. The amd64 Dockerfile installs the dependencies directly in the runtime image. The s390x Dockerfile uses a separate builder stage to prepare the dependencies before copying the installed packages into the runtime image.
Step 4. Test the AI agent in containers
In this step, you run automated integration tests to verify that the AI agent selects the expected tools for test questions. The build-artifact-test.sh script starts the MCP server and agent client in separate containers, runs the tests, saves the test results, and commits the results to the sps branch.
In the application repository, create
tests/questions/build-test.txt. Add one test question per line. For example:What are the open critical vulnerabilities in my application? Show me the compliance posture for the production environment. List all unresolved incidents from the last 7 days.Add
batchtest-stream.pyto the application repository. The test runner reads each question frombuild-test.txt, sends the question to the running AI agent on port9001, and records the tool that the AI agent selects.#!/usr/bin/env python3 import argparse import sys from pathlib import Path import requests AGENT_URL = "http://localhost:9001/invoke" parser = argparse.ArgumentParser( description="Run test questions through the agent and record tool selections." ) parser.add_argument( "-f", "--questions-file", required=True, help="Path to the questions file, one question per line." ) parser.add_argument( "-o", "--output-file", default="/app/toolSelection.txt", help="Where to write the results." ) args = parser.parse_args() questions_path = Path(args.questions_file) if not questions_path.exists(): print(f"Questions file not found: {questions_path}") sys.exit(1) out_path = Path(args.output_file) with out_path.open("w") as out: for line in questions_path.read_text().splitlines(): question = line.strip() if not question or question.startswith("#"): continue print(f"Testing: {question}") try: resp = requests.post( AGENT_URL, json={"input": question}, timeout=300 ) resp.raise_for_status() tool = resp.json().get("tool_selected") or "None" except (requests.RequestException, ValueError) as e: tool = f"ERROR: {e}" out.write(f"Q: {question}\nTool selected: {tool}\n\n") print(f"\nDone. Results written to {out_path}")Update
AGENT_URL, the request body, and the response field to match the AI agent API. For example, if the AI agent uses/api/v1/chatand returns the selected tool inselected_tool, update the test runner to use the following values:AGENT_URL = "http://localhost:9001/api/v1/chat"tool = resp.json().get("selected_tool") or "None"Commit the test files and push the changes to the
developbranch. The pipeline starts the MCP server and agent client containers on the same Docker network.The
build-artifact-test.shscript waits up to 60 seconds for the MCP server and up to 6000 seconds for the agent client. The longer s390x timeout allows the AI agent additional time to load the PyTorch model weights without GPU acceleration.After both containers are ready, the pipeline runs
batchtest-stream.pyagainst the agent client.After the pipeline completes, open the
spsbranch and review the results in:results/<branch-name>/toolSelection_<arch>.txtThe pipeline also saves the results URL in RESULTS_FILE_URL so that the toolchain can include the URL in its message channel.
A test result can look like this:
Q: What are the open critical vulnerabilities in my application? Tool selected: get_vulnerabilities Q: What is the weather like today? Tool selected: None Q: List all unresolved incidents from the last 7 days. Tool selected: ERROR: HTTPConnectionPool(host='localhost', port=9001): Read timed out.Review the tool selection results for each architecture.
Tool selected: <tool_name>indicates that the AI agent selected a tool. Verify that the selected tool matches the expected tool for the question.Tool selected: Noneindicates that the AI agent returned a response without selecting a tool. Review the system prompt and tool descriptions if the test question requires a tool.Tool selected: ERRORindicates that the request failed. Review the container status, connection, and startup time before investigating tool selection.

The
spsbranch maintains test results from pipeline runs. Use the commit history to compare how the AI agent selects tools across different builds and architectures.
Note: The 6000-second timeout provides additional startup time for s390x builds. After you measure the typical s390x startup time, reduce the timeout in
build-artifact-test.shto avoid long waits when a container fails to start.
Step 5. Push validated images to IBM Cloud Container Registry
In this step, the pipeline tags the validated Docker images and pushes the images to IBM Cloud Container Registry (ICR). The pipeline also registers image metadata so that the security scan in Step 6 can identify the images.
- Verify the
ICR_REGIONandICR_NAMESPACEpipeline properties that you configured in Step 2. Push a commit to the GitHub branch to start the pipeline. The pipeline uses the
COMMITvalue thatbuild-artifact-setup.shset in Step 2 to determine whether to build and push a new image.If
COMMIT=true, the pipeline builds and pushes a new image. Fordevelopandmcp-ga-developbranches, the pipeline uses the build timestamp as the image tag. For other branches, the pipeline uses the lowercase branch name as the image tag.
If
COMMIT=false, the pipeline retrieves the latest image for the architecture from ICR and reuses the image instead of building and pushing another image. This path can occur during a scheduled pipeline run when no recent commits exist.
After the pipeline completes, verify the images in ICR. Run the following command:
ibmcloud cr image-list --restrict <your-namespace>You can also open Container Registry > Images in the IBM Cloud console.

The pipeline uses the SPS
save_artifactfunction to register the image name, image type, and SHA-256 digest. Thescan-artifactstep in Step 6 uses this metadata to identify the image to scan.The following code shows the core image tagging, push, and artifact registration logic:
IMAGE_PATH_ICR="icr.io/${GLOBAL_ICR_NAMESPACE}/${GLOBAL_IMAGE_NAME}" if [[ "${BUILD_BRANCH}" == "develop" || "${BUILD_BRANCH}" == "mcp-ga-develop" ]]; then IMAGE_TAG_TIMESTAMP="${IMAGE_PATH_ICR}:${TAG_TIMESTAMP}" else BUILD_BRANCH_LOWERCASE=$(echo "$BUILD_BRANCH" | tr '[:upper:]' '[:lower:]') IMAGE_TAG_TIMESTAMP="${IMAGE_PATH_ICR}:${BUILD_BRANCH_LOWERCASE}" fi if [ "${COMMIT}" = "true" ]; then docker tag "${GLOBAL_IMAGE_NAME}:${BLD_ARCH}" "${IMAGE_TAG_TIMESTAMP}" docker push "${IMAGE_TAG_TIMESTAMP}" fi # Register the image metadata for the scan-artifact step. save_artifact "${GLOBAL_IMAGE_NAME}" "name=${IMGINFO}" save_artifact "${GLOBAL_IMAGE_NAME}" "type=image" save_artifact "${GLOBAL_IMAGE_NAME}" "digest=${IMGSHA}"When
COMMIT=false, the script usesibmcloud cr image-listto find the latest image for the architecture in ICR and reuses the existing image.
Step 6. Configure and review security scans
In this step, you configure and review the security checks in the IBM DevSecOps pipeline. The pipeline checks the source code for secrets, protects credentials during Docker builds, scans container images for vulnerabilities, and runs compliance checks.
Verify that
detect-secrets.shexists at the root of the application repository. Verify that thecode-checkstask in.pipeline-config.yamlrunsdetect-secrets.shbefore the image build begins.
Protect credentials that the Docker build requires. Use
RUN --mount=type=secret,id=<id>in the Dockerfile and pass the secret from the pipeline with--secret id=<id>,src=/config/<file>.The Dockerfiles from Step 3 use this approach for
github_token.After the pipeline completes, open the pipeline run in the Pipelines view. Review the
code-checksandcode-buildlogs.- The
detect-secretsstep reports whether the source code contains potential secrets. - The
scan-artifactstep reports container image vulnerabilities and vulnerability severity counts.
- The
Before you promote the toolchain to production, remove
DEVSECOPS_SKIP_COMPLIANCE: "true"and the otherDEVSECOPS_SKIP_*settings from.pipeline-config.yaml. Removing these settings enables the configured DevSecOps checks for production.The pipeline includes the following security checks:
Security check Pipeline stage Tool or method What the check does Secrets detection code-checksbefore the buildIBM detect-secrets Detects credentials or other potential secrets committed to the source code. Docker build secrets code-buildduring the buildDocker secret mounts Provides build credentials without storing the credentials in container image layers. Vulnerability scan code-buildafter the image pushTwistlock (Prisma Cloud) Detects known Common Vulnerabilities and Exposures (CVEs) in operating system packages and Python dependencies. Compliance checks code-checksIBM DevSecOps commons Runs configured license, Center for Internet Security (CIS) benchmark, and policy checks. Secrets detection
The
code-checkstask runsdetect-secrets.shbefore the image build. If the script detects a potential secret, the script stops the pipeline.#!/usr/bin/env bash # detect-secrets.sh detect-secrets scan --all-files --exclude-files '\.git/.*' > .secrets.baseline FINDINGS_COUNT=$(python3 -c " import json baseline = json.load(open('.secrets.baseline')) results = baseline.get('results', {}) print(sum(len(v) for v in results.values())) ") if [[ "$FINDINGS_COUNT" -gt 0 ]]; then echo "ERROR: Potential secrets detected ($FINDINGS_COUNT finding(s))" detect-secrets audit .secrets.baseline exit 1 fi echo "No secrets detected. Scan passed."Docker build secrets
Use Docker build secrets for credentials that the Docker build requires. Docker makes the secret available to the build command without copying the secret into the Dockerfile.
For example:
RUN --mount=type=secret,id=github_token \ GITHUB_TOKEN=$(cat /run/secrets/github_token) \ pip install --no-cache-dir -r requirements.txtContainer image vulnerability scan
After the pipeline pushes an amd64 image to IBM Cloud Container Registry, the
scan-artifactstep runs the configured Twistlock (Prisma Cloud) vulnerability scan. Thescan-artifactstep uses the artifact metadata that thesave_artifactfunction registered in Step 5.The
scan-artifactlog includes vulnerability counts by severity. For example:=== Image scan results for icr.io/<your-namespace>/<your-image>@sha256:... (amd64) === (C)ritical|(H)igh|(M)edium|(L)ow|(O)ther|(U)nspecified|(T)otal C:0|H:0|M:4|L:12|O:0|U:0|T:16The scan output also provides details about individual vulnerabilities. Review the findings and resolve or triage relevant vulnerabilities before promoting the image.
The
.pipeline-config.yamlfile enablesscan-artifactfor amd64 and disables the step for s390x withwhen: 'false'. The pipeline saves the s390x image digest so that the s390x image can be scanned separately.Compliance checks
The
compliance-checksstep in thecode-checkstask runs the compliance checks configured for the IBM DevSecOps toolchain. Review the compliance results in the pipeline logs and resolve failed checks before promoting the application.Note: The development configuration uses
DEVSECOPS_SKIP_*settings to skip selected DevSecOps functions. Remove the requiredDEVSECOPS_SKIP_*settings before you use the pipeline for production.
Summary
In this tutorial, you built a production-ready continuous integration and continuous delivery (CI/CD) pipeline for an agentic AI application. The pipeline includes:
- Multi-architecture Docker builds for x86 (amd64) and IBM Z (s390x).
- Model selection for MCP and Spyre deployment variants.
- Automated integration tests that validate AI agent tool selection.
- Versioned test results stored through Git commits.
- Validated container images pushed to IBM Cloud Container Registry with artifact metadata.
- Security and compliance checks integrated into the IBM DevSecOps pipeline.
The CI/CD pipeline provides a consistent process for building, testing, securing, and publishing agentic AI applications across multiple hardware architectures. The pipeline also provides the security, compliance, and validation controls required for production deployments.