Skip to content

Comments

Allow setting architecture of containers#771

Closed
AndrewFerr wants to merge 1 commit intomatrix-org:mainfrom
AndrewFerr:af/multiplatform-arch
Closed

Allow setting architecture of containers#771
AndrewFerr wants to merge 1 commit intomatrix-org:mainfrom
AndrewFerr:af/multiplatform-arch

Conversation

@AndrewFerr
Copy link
Member

Support creating containers of multi-platform images for an architecture other than that of the host running Complement.

Signed-off-by: Andrew Ferrazzutti andrewf@element.io

Pull Request Checklist

Support creating containers of multi-platform images for an architecture
other than that of the host running Complement.
@AndrewFerr AndrewFerr requested review from a team and kegsay as code owners April 1, 2025 19:45
@AndrewFerr
Copy link
Member Author

These changes allowed me to run Complement tests locally on an (emulated) arm64 Synapse image, so I figured it'd be helpful to submit a PR for them.

containerName := fmt.Sprintf("complement_%s_%s_%s_%d", d.config.PackageNamespace, d.DeployNamespace, contextStr, counter)
deployment, err := deployImage(
d.Docker, img.ID, containerName,
d.Docker, img.ID, "", containerName,
Copy link
Member Author

Choose a reason for hiding this comment

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

Is an image ID tied to a particular architecture? If not, the correct arch has to be looked up here (and must consider the overrides per homeserver name).

Comment on lines +411 to +412
OS: "linux",
Architecture: imageArch,
Copy link
Member Author

Choose a reason for hiding this comment

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

Is hardcoding the OS here too rigid? Alternatively, the COMPLEMENT_BASE_ARCH could be BASE_PLATFORM and be a full <os>/<arch> string.

Copy link
Member

@kegsay kegsay left a comment

Choose a reason for hiding this comment

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

This feels rather niche, and can be solved in ways that don't expand the already huge API surface of Complement. What's stopping you from building arch-specific images and then referencing them as say homeserver-arm64:latest?

@AndrewFerr
Copy link
Member Author

What's stopping you from building arch-specific images and then referencing them as say homeserver-arm64:latest?

Nothing in particular; this PR was meant to work with Synapse's scripts-dev/complement.sh after being tweaked to build multi-platform images by putting --platform= on the build commands. But with that said, multi-platform images aren't a standard feature of all builders, which makes it even less worth expanding Complement's API surface for. So, I'm content to not carry this PR any further.

@AndrewFerr
Copy link
Member Author

It's been a while & this isn't important. Closing.

@AndrewFerr AndrewFerr closed this Apr 29, 2025
@AndrewFerr AndrewFerr deleted the af/multiplatform-arch branch November 13, 2025 16:23
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.

2 participants