salesforce / salesforce/rules_docker_compose_test
multiarch to build a linux/x86_64 go_test() on a Darwin/arm64 host ?
Nobody has claimed this yet.
- Dominant language
- Starlark
- Stars
- 7
- Forks
- 5
- Avg merge
- 18h 49m
- Merged PRs (30d)
- 3
Description
hey.
Would you be accepting of a PR that allows the user to run go_docker_compose_test() on an platform_host not matching the container arch?
ie:
go_docker_compose_test(
name = "go-test-image-test",
docker_compose_file = ":docker-compose.yml",
docker_compose_test_container = "test_container",
+ platforms = platforms = [ ":linux_arm64", ":linux_amd64" ], # Mac and linux both run GOOS==linux
test_srcs = glob(["**/*_test.go"]),
test_deps = [],
test_image_base = "@ubuntu",
)
...to allow building a multi-arch OCI (index + 2 images), even on a Mac? User-story here would be a Mac user testing linux OCI images locally and wanting to compile that unittest with the proper linux GOOS so that the test-runner runs in the container arch/os.
Alternatively, plumbing through GOOS might suffice, but GOARCH may still depend on the host.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the go_docker_compose_test rule and trace how platform_host, GOOS/GOARCH, and the test container image are currently selected. Determine whether the requested platforms can produce a multi-architecture OCI image index and run tests for the container architecture; done means a Darwin/arm64 host can test the corresponding linux image without mismatched binaries.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, docker-compose, go
- Domain
- build-system, devops, testing
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100