#Does changing the address of a *dagger.Socket on invalidates the cache

1 messages ยท Page 1 of 1 (latest)

chilly vault
#

I have a pipeline running in an azure devops agent where the value of SSH_AUTH_SOCK changes dynamically on every build.

My build pipeline relies on that socket for SSH Authentication before the build of my code (to retrieve dependencies).

This is the pseudo code for my pipeline :

- New(*dagger.Socket)
- Build()
  - Set SSH Socket + SSH_AUTH_SOCK env variable on container
  - Retrieve dependencies (git pull etc )
  - Build the code

I noticed that i'm not hitting the cache. Is that because the address of the socket changes ? If so is there another way ?

#

Does changing the address of a *dagger.Socket on invalidates the cache

grand falcon
chilly vault
#

Thanks @grand falcon ! I will give it a shot and report back ๐Ÿ™‚

chilly vault
#

@grand falcon you legend. It indeed did the trick

- bash: |
    set -euo pipefail
    mkdir -p "$HOME/.ssh"

    ln -sf "$SSH_AUTH_SOCK" "$HOME/.ssh/agent-socket"

    echo "##vso[task.setvariable variable=SSH_AUTH_SOCK]$HOME/.ssh/agent-socket"
    echo "SSH_AUTH_SOCK is now: $SSH_AUTH_SOCK"

grand falcon
chilly vault
#

down from 13min to 25sec when no code changes

grand falcon
chilly vault
#

in this case it didnt run anything

grand falcon