Hi Community, I have a question regarding parallel...
# general
s
Hi Community, I have a question regarding parallelization of
pants package
within Github CI and
--changed-since
flag. We are currently building our packages within the Github CI using
pants package --changed-since=$GITHUB_SHA^1 --changed-dependents=transitive
. We have about multiple projects with various images to build. So far pants works like a charm when building them. Sometimes all images are build again, e.g. when we do version upgrades or major changes is some projects. To speed up this process we aim to parallalelize the package step within the CI pipeline. Essentially we would have a separate pipeline for each project, by using Githubs Matrix, sth like this.
Copy code
package 
    strategy:
      matrix:
        project: ["p1", "p2", "p3"]
    steps:
      - name: Pants Package
        pants package src/${{ matrix.project }}:: --changed-since=$GITHUB_SHA^1 --changed-dependents=transitive
Unfortunately specifying a directory does not work with the
--changed-since=$GITHUB_SHA^1
command. So the above example will throw an error. Building the parallelization without
--changed-since
we lose another great tool to speed things up and we would indeed build everytime everything new. Do you have any ideas on suggestions on this topic? Or is there already something I might be missing? I haven't found a solution to this challenge yet in either the documentation or this channel. Would really appreciate your help!
b
Sorry for the trouble. I think https://www.pantsbuild.org/2.19/reference/subsystems/filter#address_regex would allow this, something like adding:
--filter-address-regex=^src/{{ matrix.project}}/
to the invocation . See also https://www.pantsbuild.org/2.19/docs/using-pants/advanced-target-selection#filter-options
1
s
Thank you @broad-processor-92400. This is exactly what I was looking for. Works like a charm.