is it possible to disable caching for the init pan...
# general
b
is it possible to disable caching for the init pants Github Actions? installing through the action takes considerably longer then through the get-pants script (15s vs 1~1:30min) most of the duration of the action is pulling from the cache
h
I don’t think there is currently a way to do so, but that is an interesting finding.
🥰 1
So maybe there should be a way
b
all cache options I see there are for pants to use internally, right? None of them govern the pants installation
f
I have a forked version of the action where you can disable caching: https://github.com/tdyas/pantsbuild-actions/tree/configure_enable_of_named_caches
(set
named-caches-hash: disable
when calling the action)
(probably something that could be upstreamed, especially given how simple the change is)
b
doesn't it disable all caching internally? for pex / docker builds
f
Do you mean the
init-pants
action or Pants itself?
Loading the Pants local cache from GHA's cache and Pants' own decision to cache are two different issues.
h
That’s the named cache, I think the OP means not caching the pants install itself
b
i am very happy with pants internal caching, for pex and docker (and everything else). during the pants install in github actions, it tries to pull from GHA's cache, and it takes longer then using the script
f
most of the duration of the action is pulling from the cache
For install Pants or downloading the named caches?
init-pants
does multiple things
> That’s the named cache, I think the OP means not caching the pants install itself Yeah, I did not speak particularly enough. The forked version only adds support for disabling the "named cache" part of the caches setup by the action.
b
that's a great question. and I think i was wrong, the part taking longer is for the named cache
so your action should work, @fast-nail-55400
i got here because i started using namespace.so, and using their cache for
Copy code
- name: Set up Namespace's cache path
        uses: namespacelabs/nscloud-cache-action@v1
        with:
          path: |
            ~/.cache/nce
            ~/.cache/pants/named_caches/
is much faster then pulling from GH's cache
👀 1
f
I can post my change upstream today.
b
that would be great, thank you
f
r
I think this broke us. We're currently getting
Error: pantsbuild/actions/main/init-pants/action.yaml (Line: 160, Col: 11): Unexpected symbol: '"disable"'. Located at position 29 within expression: inputs.named-caches-hash != "disable"
f
Are you consuming the
main
branch directly?
r
Yes we are
f
I would advise against that.
I found the issue, I didn't cherry pick the fix onto my PR. Will put that up now.
👍 1
r
This seems to be standard. It's in the example: https://github.com/pantsbuild/actions/tree/main/init-pants But if we can fix this by consuming another branch, I'll happily make that change.
f
You can just consume the commit ID of the prior commit.
r
Good idea
f
as for the Pants docs suggesting consuming
main
, we should change that since usually should consume as tag to make sure that we intended to release changes into people's production
r
That sounds sensible, thanks. I'll use
@v10
for now.
f
fix landed
r
Thanks for the quick action on this!
h
Sorry for the disruption
f
also points to some improvments to make in the pantsbuild/actions repository, it currently has no CI workflow