Separate question. I am using the scie-pants boot ...
# general
f
Separate question. I am using the scie-pants boot strap runner. in the docker container where pants lives, each CI build, it is "downloading" the pants distribution - what command can I run, in the docker build phase, to pre-seed the docker image, with the right pants download... e.g. I want to avoid this
Copy code
$ pants ....
Bootstrapping Pants 2.16.0rc3
Installing pantsbuild.pants==2.16.0rc3 into a virtual environment at /root/.cache/nce/68f5608a60df9b97aab453d453817a4ded400d1d8ec7ede7ec14bcac83421a7b/bindings/venvs/2.16.0rc3
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.1/2.1 MB 27.0 MB/s eta 0:00:00
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 819.3/819.3 KB 25.0 MB/s eta 0:00:00
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 64.8/64.8 KB 10.1 MB/s eta 0:00:00
New virtual environment successfully created at /root/.cache/nce/68f5608a60df9b97aab453d453817a4ded400d1d8ec7ede7ec14bcac83421a7b/bindings/venvs/2.16.0rc3.
(I of course could just run pants, but at docker build time, the "version" pants is using, is not "with" the docker build. I am looking for something like
pants -preseed 2.16.0rc3,2.17
to run in the docker build phase.
1
g
Copy code
ENV PANTS_VERSION 2.17.0
RUN touch pants.toml && pants --help && rm pants.toml
Should do it, I think.
(Actually, don't use
ENV
here; since that'll stick in the container... I'd have to experiment, but something like
RUN PANTS_VERSION=2.17.0touch pants.toml && pants --help && rm pants.toml
would be safe.)
e
Yeah, like that. Also discussed here: https://pantsbuild.slack.com/archives/C046T6T9U/p1695256557256939?thread_ts=1693953199.755779&cid=C046T6T9U Perhaps Pants should grow an internal goal like
help
to deal with this and other things (like update of scie-pants).
c
FWIW for CI I "pre-seed" scie-pants in the docker image (https://github.com/pantsbuild/setup/blob/gh-pages/get-pants.sh)
Copy code
# Pants
RUN /var/tmp/get-pants.sh --bin-dir /usr/local/bin/ --version 0.10.3
And then use GitLab caching for the versions of Pants it self (the
nce
cache)
f
@curved-manchester-66006 do you have an example of the config for the caching in gitlab ? I put it in in Feb this year but I don’t think it’s working. I’m doing a refactor with gitlab a.tm. To multi package build / monorepo / conventional commits 2 semver for each / with auto change log : auto mr release branches — wild
c
Copy code
cache:
    - &cache_pants_nce
      key: "pants.toml"
      paths:
        - "${CI_PROJECT_DIR}/.cache/nce"
    - &cache_pants_named_caches
      key:
        files:
          - "**/pants*.toml"
          - "3rdparty/**/*.lock"
      paths:
        - "${CI_PROJECT_DIR}/.cache/pants/named_caches"