Asking for advice for parameterisation / matrix s...
# general
f
Asking for advice for parameterisation / matrix style building of a 3rd party docker container (nXm testing) Goal Run "our code" against - n, n -1 and n-2 images (effectively building a container and testing our code inside it - using that container as the FROM: ) • the 3rd party images - the versions of - are Not known statically and change frequently - these versions are "found" via a separate API. The added complexity is we want to test ^^ those ^^ set of images, with more than one branch of our monorepo (scheduled) .. but lets start with just current branch Which way would you approach this ? Option 1 - Use chroot/sandbox _shell_command to fetch and depend upon_ • write a "shell_command" that produces 3 files - each file being the "version" of the 3rd party container .. ◦ (here is where I am unsure) ?? use a macro to generate 3x dynamic docker_images() with the appropriate "FROM $IMAGE_UNDER_TEST" sent in from env_vars ◦ •
pants run
a "uber-matrix-test" that uses that set of 3x docker images Option 2 - Use run_shell_command to "generate" ephemeral BUILD files • Using run_shell_command - write out one BUILD file, with 3x n, n-1, n-2 docker_images in it • Then run "pants run - some target, with the dependencies from ^^ • remove BUILD files. The goal is to do as much of this "as possible" inside the
pants
run --- and no resort to an external bootstrap if I can help it. For the
stretch
goal, actually we can get the "triggering system" to enumerate "our" branches and kick off the scheduled CI/CD pipelines for each Is there a simpler way or more
pants-onic
way of doing this ?
So expanding this a little - can see we would use each of the three images as a ‘docker_environment’ to run in . But can pants help there in dynamically producing the three docker_image/docker_environment dependencies — or do we have to generate them out of (before) pants runs