Skip to content

feat: allow an optional platform definition for container arch #33

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

chickenandpork
Copy link

@chickenandpork chickenandpork commented Jan 23, 2025

This enhancement (with accompanying example) shows how to set a list of platforms for the os/arch of the docker env so that the go_test can be executed in a controlled platform. For example, this allows a macOS/arm64 build to trigger a linux/amd64 test container.

The example is duplicated and extended from the existing go-test-image-test to preserve that example, and to show what changes when the pathname of the test changes (which some additional documentation).

I was unable, however, to create a functional example with a second built image in the docker-compose: the functionality of local_image_targets and data attributes just didn't cause the install script from the oci_load() to be present, earning no install script present.

fixes #32

Copy link

Thanks for the contribution! Before we can merge this, we need @chickenandpork to sign the Salesforce Inc. Contributor License Agreement.

@chickenandpork chickenandpork force-pushed the feat/platform-specific-testcontainers branch from e3f9104 to 8674094 Compare January 23, 2025 20:15
Copy link

Thanks for the contribution! Unfortunately we can't verify the commit author(s): Allan Clark <a***@c***.com>. One possible solution is to add that email to your GitHub account. Alternatively you can change your commits to another email and force push the change. After getting your commits associated with your GitHub account, sign the Salesforce Inc. Contributor License Agreement and this Pull Request will be revalidated.

@chickenandpork chickenandpork force-pushed the feat/platform-specific-testcontainers branch from 8674094 to 582a746 Compare January 23, 2025 20:15
@chickenandpork
Copy link
Author

chickenandpork commented Jan 23, 2025

(@kriscfoster waiting on the CLA-bot to catch up... -- iterated emails to find one on my account)

@chickenandpork chickenandpork force-pushed the feat/platform-specific-testcontainers branch from 582a746 to fcbcb21 Compare January 24, 2025 00:24
@chickenandpork
Copy link
Author

(pushed a different email address to get the CLA workflow to restart)

@chickenandpork
Copy link
Author

chickenandpork commented Jan 24, 2025

@kriscfoster I see exec format error in what I can see from the logs. That's an Ubuntu -- linux/amd64 then?

I don't see this failure, but I'm on a darwin/arm64, maybe for some reason the platform is preferring am arm64, so it doesn't hurt me but hurts th x86_64/amd64 arch ? I'm guessing a bit :(

Maybe we build a multi-arch-manifest image, with arch matching the container, and let the host docker decide which architecture fits? (such would be another multi_platform() wrap and an oci_index() )

@kriscfoster
Copy link
Contributor

@kriscfoster I see exec format error in what I can see from the logs. That's an Ubuntu -- linux/amd64 then?

I don't see this failure, but I'm on a darwin/arm64, maybe for some reason the platform is preferring am arm64, so it doesn't hurt me but hurts th x86_64/amd64 arch ? I'm guessing a bit :(

Maybe we build a multi-arch-manifest image, with arch matching the container, and let the host docker decide which architecture fits? (such would be another multi_platform() wrap and an oci_index() )

Yeah, that sounds possible. I'm not so familiar with this issue so unfortunately don't have a quick answer :(
However, I can probably take a look in a few days (today is just a little busy).

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.

multiarch to build a linux/x86_64 go_test() on a Darwin/arm64 host ?
2 participants