Skip to content

Conversation

mikebonnet
Copy link
Collaborator

@mikebonnet mikebonnet commented Aug 14, 2025

Publish ramalama images for additional platforms.

Summary by Sourcery

Extend support for big-endian architectures (s390x and ppc64le) across builds, CI pipelines, tests, and runtime; introduce a --verify flag for optional model verification after pull; and update build scripts, dependency versions, and documentation accordingly

New Features:

  • Add --verify CLI option to disable endianness verification after pulling models
  • Introduce test_model, skip_if_ppc64le, and skip_if_s390x helpers for big-endian compatibility in tests

Enhancements:

  • Propagate verify flag through url.py, store.py, hf_style_repo_base.py, and ollama.py when creating snapshots
  • Use test_model helper in system tests to select appropriate model for architecture
  • Add shortnames for big-endian Granite model references

Build:

  • Adapt build_llama_and_whisper.sh for s390x and ppc64le package installs and flags
  • Update build_rag.sh pip dependencies and container-images/Containerfile packages

CI:

  • Include linux/ppc64le and linux/s390x in build-platforms for Tekton pipelines
  • Adjust Makefile container mounts for tests

Documentation:

  • Document the --verify option in the ramalama pull manual

Tests:

  • Update system and unit tests to include --verify flag parsing and skip unsupported architectures on big-endian hosts
  • Add unit test for pull --verify value coercion

Copy link
Contributor

sourcery-ai bot commented Aug 14, 2025

Reviewer's Guide

This PR extends multi-arch support by including s390x and ppc64le in CI pipelines, introduces a --verify flag to control snapshot verification for cross-endian pulls, updates tests to handle endianness and skip unsupported architectures, and adjusts build scripts and dependencies for the new platforms.

Sequence diagram for ramalama pull with --verify flag

sequenceDiagram
    actor User
    participant CLI
    participant ModelStore
    User->>CLI: run "ramalama pull MODEL [--verify]"
    CLI->>ModelStore: new_snapshot(tag, hash, files, verify=args.verify)
    alt verify is True
        ModelStore->>ModelStore: verify_snapshot(model_tag)
        ModelStore-->>CLI: success or error
    else verify is False
        ModelStore-->>CLI: skip verification
    end
    CLI-->>User: result (success or error)
Loading

Class diagram for updated model_store.Store and CLI argument handling

classDiagram
    class Store {
      +verify_snapshot(model_tag: str)
      +new_snapshot(model_tag: str, snapshot_hash: str, snapshot_files: list[SnapshotFile], verify: bool = True)
    }
    class CLI {
      +pull_parser(subparsers)
      +--verify: bool
    }
    Store <.. CLI : uses
Loading

File-Level Changes

Change Details Files
Include s390x and ppc64le in CI build pipelines
  • Add linux/ppc64le and linux/s390x to build-platforms in Tekton YAML for pull and push pipelines
  • Update integration pipeline definitions to include the new platforms
.tekton/bats/bats-pull-request.yaml
.tekton/bats/bats-push.yaml
.tekton/ramalama/ramalama-pull-request.yaml
.tekton/ramalama/ramalama-push.yaml
.tekton/integration/pipelines/bats-integration.yaml
Enhance test suite for verify flag and arch skipping
  • Prefix pull commands in Bats tests with --verify=off
  • Add is_ppc64le, is_s390x, skip_if_ppc64le, skip_if_s390x helpers and test_model/model_base functions
  • Insert skip_if_ppc64le/skip_if_s390x in relevant tests to avoid unsupported arch failures
test/system/050-pull.bats
test/system/helpers.bash
test/system/040-serve.bats
test/system/055-convert.bats
test/system/030-run.bats
test/system/002-bench.bats
test/system/010-list.bats
test/system/100-inspect.bats
Add and propagate --verify option in CLI and core logic
  • Introduce --verify CLI argument and CoerceToBool action
  • Propagate verify flag into new_snapshot calls in URL, model_store, hf_style_repo_base and ollama modules
  • Control snapshot verification based on the flag
ramalama/cli.py
ramalama/url.py
ramalama/model_store/store.py
ramalama/hf_style_repo_base.py
ramalama/ollama.py
Update build scripts and containerfiles for s390x/ppc64le
  • Rename dnf_install_s390 to dnf_install_s390_ppc64le and branch install logic accordingly
  • Enable OpenBLAS flags for s390x and ppc64le in CMake flags
  • Adjust Python dependencies in build_rag.sh and add python3-pyyaml to Bats container
  • Modify Makefile runner options to mount /tmp
container-images/scripts/build_llama_and_whisper.sh
container-images/scripts/build_rag.sh
container-images/bats/Containerfile
Makefile
Add unit tests for pull verify behavior
  • Implement test_pull_verify parameterized tests for various --verify values
  • Adjust test_ollama_model_pull to pass mock verify argument
test/unit/test_cli.py
test/unit/test_ollama.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary of Changes

Hello @mikebonnet, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request expands the build capabilities for various ramalama container images by introducing support for additional CPU architectures. Specifically, it enables the building and publishing of these images for ppc64le and s390x platforms, alongside the existing amd64 and arm64 architectures. This enhancement improves the reach and compatibility of the ramalama images across diverse hardware environments.

Highlights

  • Expanded Architecture Support: The build configurations for multiple ramalama images have been updated to include ppc64le and s390x architectures.
  • Tekton Pipeline Updates: Both pull request and push event Tekton pipeline definitions (*-pull-request.yaml and *-push.yaml) were modified to specify the new build platforms.
  • Integration Pipeline Defaults: The bats-integration.yaml pipeline now defaults to testing on ppc64le and s390x in addition to amd64 and arm64.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds ppc64le and s390x as build platforms to numerous Tekton pipeline configurations, enabling multi-architecture image builds. While the changes are consistent across files, the widespread duplication of the build-platforms block across more than 20 files introduces a significant maintainability challenge. Future changes to the platform list will require updating all these files. I recommend exploring methods to centralize this configuration, such as using YAML anchors or a configuration management tool like Kustomize, to improve maintainability. Additionally, while enabling builds for new architectures, it's crucial to ensure all software dependencies within the container images support these platforms. I've added specific comments regarding potential issues with ollama and vLLM dependencies which appear to lack support for ppc64le and s390x.

@mikebonnet mikebonnet force-pushed the konflux-s390x-ppc64le branch 18 times, most recently from 48ef6f5 to 92e7631 Compare August 18, 2025 13:35
@mikebonnet mikebonnet force-pushed the konflux-s390x-ppc64le branch 9 times, most recently from 16f65dc to 3a029aa Compare August 28, 2025 15:58
@mikebonnet mikebonnet force-pushed the konflux-s390x-ppc64le branch 7 times, most recently from cd79e40 to bca8a0b Compare September 8, 2025 21:11
@mikebonnet mikebonnet marked this pull request as ready for review September 8, 2025 22:57
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey there - I've reviewed your changes - here's some feedback:

  • Consider consolidating the repeated build-platforms lists in your Tekton pipeline YAMLs (e.g. via a shared template or common include) to reduce duplication and potential drift.
  • The repeated use of getattr(args, 'verify', True) across different pull implementations could be centralized in a single helper or extension to avoid boilerplate and make flag handling more consistent.
  • Since test_model alters test behavior on big-endian architectures, it would be helpful to document its logic in your test helpers so future readers understand why model selection differs by arch.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider consolidating the repeated `build-platforms` lists in your Tekton pipeline YAMLs (e.g. via a shared template or common include) to reduce duplication and potential drift.
- The repeated use of `getattr(args, 'verify', True)` across different pull implementations could be centralized in a single helper or extension to avoid boilerplate and make flag handling more consistent.
- Since `test_model` alters test behavior on big-endian architectures, it would be helpful to document its logic in your test helpers so future readers understand why model selection differs by arch.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@mikebonnet
Copy link
Collaborator Author

@rhatdan Ready for review

ramalama/cli.py Outdated
)
parser.add_argument(
"--verify",
default=True,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add a flag to ramalama.conf to allow users to always pull without verifying?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a verify option to ramalama.conf in the most recent revision.

@rhatdan
Copy link
Member

rhatdan commented Sep 9, 2025

LGTM with one question.

@taronaeo
Copy link
Collaborator

Generally I think ppc64le does not need the OpenBLAS installation because they have already implemented their own custom tinyBLAS SGEMM kernel via Llamafile. But I don't have a ppc64le machine to verify so let's keep it this way until someone can check on it :)

@mikebonnet mikebonnet force-pushed the konflux-s390x-ppc64le branch from bca8a0b to 08c61a2 Compare September 10, 2025 22:10
@rhatdan
Copy link
Member

rhatdan commented Sep 11, 2025

LGTM

@mikebonnet
Copy link
Collaborator Author

/retest ramalama-on-pull-request

Allows "make unit-tests-in-container" to succeed.

Signed-off-by: Mike Bonnet <[email protected]>
Publish ramalama images for additional platforms.

Signed-off-by: Mike Bonnet <[email protected]>
GGML_VXE defaults to ON, so passing the parameter is not required.

Signed-off-by: Mike Bonnet <[email protected]>
This allows models of different endianness to be pulled and inspected.
Handle endianness mismatches more gracefully in the cli.

Signed-off-by: Mike Bonnet <[email protected]>
@mikebonnet mikebonnet force-pushed the konflux-s390x-ppc64le branch from 08c61a2 to cb67ddc Compare September 11, 2025 06:13
@rhatdan rhatdan merged commit 26a450e into main Sep 11, 2025
37 of 54 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants