Skip to content

Enable PPM ARM64 builds#282

Merged
bschwedler merged 13 commits intomainfrom
ppm-arm64-dev-builds
Dec 30, 2025
Merged

Enable PPM ARM64 builds#282
bschwedler merged 13 commits intomainfrom
ppm-arm64-dev-builds

Conversation

@ianpittwood
Copy link
Contributor

I took a slightly different approach here. I think it's easiest to use the $TARGETARCH build argument in Dockerfiles since it allows for multiplatform builds on the same file for both emulation and native builds. The only tricky part is when the platforms use a different naming convention, but this can be solved for with some bash expressions.

We can continue to clean up this implementation, but I believe this is our shortest path to working builds.

@github-actions
Copy link

github-actions bot commented Dec 22, 2025

Test Results

858 tests   858 ✅  11m 45s ⏱️
  1 suites    0 💤
  1 files      0 ❌

Results for commit 1c40aa8.

♻️ This comment has been updated with latest results.

Copy link
Contributor

@bschwedler bschwedler left a comment

Choose a reason for hiding this comment

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

I like this approach. It is much simpler than having to replace a placeholder value at runtime.

My biggest concern is the implactions of using mv and how it will affect uv. I expect that we will probably be installing uv by default in at least the standard workbench & connect container images.

Comment on lines +14 to +25
{# Normalizes Python installation paths for one or more Python versions with uv

:param versions: A list of Python versions to install, e.g. ["3.11", "3.12"].
#}
{% macro run_normalize_uv_python_paths(versions) -%}
{%- if versions is string -%}
{%- set versions = versions | split(",") | map('trim') -%}
{%- endif -%}
{% for version in versions -%}
{% if loop.first %}RUN {% endif %}mv /opt/python/cpython-{{ version }}-linux-*/ /opt/python/{{ version }}{% if not loop.last %} && \{% endif %}
{% endfor -%}
{%- endmacro %}
Copy link
Contributor

Choose a reason for hiding this comment

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

Will using mv will cause problems if/when we start installing uv in the container?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think we would modify the macros if we move to managing using uv. I imagine it would break on this as it would look for that matching {python}-{version}-{os}-{arch}-{compiler} pattern. It's possible that fully committing to uv would be the best path, but I wouldn't want to do that in this PR.

return _get_value_from_env("versionEnvVar", self.versionEnvVar)

def get_url_by_os(self) -> dict[str, str]:
def get_url_by_os(self, **kwargs) -> dict[str, str]:
Copy link
Contributor

Choose a reason for hiding this comment

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

Is generalize_architecture the only kwarg that is passed in?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, but it should go unused in this context I'd think since this would intake an environment variable? Unless you think I should have it do a search and replace on amd64/x86_64 here too. I went back and forth on it. What do you think?

r"(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?"
r"(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?"
)
URL_WITH_ENV_VARS_REGEX_PATTERN = re.compile(
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you please add some tests around this to make sure the regex does what we expect?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good call, it was wrong before. I fixed it and added tests. I actually ended up removing it from the RelaseStreamResult.downloadUrl parameter too since those should always be valid URLs in the current impl.

@bschwedler bschwedler merged commit 2d3946e into main Dec 30, 2025
12 checks passed
@bschwedler bschwedler deleted the ppm-arm64-dev-builds branch December 30, 2025 22:20
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.

AMD64/ARM64 platform compatibility for image tool/package installation

2 participants