#Dagger cache in python or node sdk with dagger github action.

1 messages · Page 1 of 1 (latest)

junior fossil
#

Hi,

I would like to know if this feature is available in that sdks, I tried this but the cache does not work. I did the same for the cue sdk and it works.

on:
  workflow_dispatch: 

jobs:
  dagger:
    runs-on: ubuntu-latest
    env:
      DAGGER_CACHE_FROM: type=gha,scope=dagger-cache-example
      DAGGER_CACHE_TO: type=gha,mode=max,scope=dagger-cache-example
    steps:
      - uses: actions/checkout@v3
     
      - name: "Run Dagger"
        uses: dagger/dagger-for-github@v3
        with:
          install-only: true
     
      - uses: actions/setup-python@v4
        with:
          python-version: '3.10' 
      
      - name: Pip install
        run: |
          pip install anyio
          pip install dagger-io
          pip install python-dotenv
          
      - name: Run dagger script
        run: python simple-dagger.py
          
        ```

Is it possible to do it with python or node? Thanks in advance
junior fossil
#

It would be nice to have that feature, because we would like to use the github cache to save time in large projects . It takes several minutes to pass the CI checks when we are pushing changes to a PR. Github runs each push in a new runner, so with that cache we would be x1000 faster.

silver marsh
#

there is an experiment action in the master branch. It isn't available publically.

you can see it used in my github action: https://github.com/kjuulh/dagger-rs/blob/88b055cb47d3d474e2c37d8fa8259df5faad9da5/.github/workflows/ci.yaml#L11

that said. You will the master build of the dagger go sdk to use it. As far as I can tell 😄

GitHub

A dagger sdk written in rust for rust. Contribute to kjuulh/dagger-rs development by creating an account on GitHub.

orchid knot
#

Yes it's highly experimental right now, far from finished, hence being hidden behind that env var and not being documented 🙂 We're actively working on it though so improvements will be coming soon in upcoming releases

junior fossil
#

Thank you for the info! @orchid knot @silver marsh Sounds good that you are working on it, I think it is something that will be highly demanded. I will be on the ball.

tired drum
#

Hi! I'm exploring Node.js Dagger SDK for our JavaScript based monorepo. I have built some scripts and ran them locally, the cache works amazing! Are there any updates on how to use remove cache in Github Actions?

I tried using the _EXPERIMENTAL_DAGGER_CACHE_CONFIG: type=gha;mode=max but didn't seem to work. If gha is not ready because it's experimental even for docker buildx. I wonder if other types like s3 or registry are supported?

viscid crater