Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE REQUEST] Ability to run a command before calculating cache key? #47

Open
Tracked by #52
willhughes-au opened this issue Apr 20, 2022 · 6 comments
Open
Tracked by #52
Assignees
Labels
enhancement New feature or request

Comments

@willhughes-au
Copy link

willhughes-au commented Apr 20, 2022

I have a situation where it would be useful to cache data, but the key needs to be a checksum of a file that isn't on the filesystem, yet.

An arbitrary example:

  - label: "Run Cached Step"
    command:
      - wget -O remote-config https://example.com
      - ./script-that-does-something.sh
    plugins:
      - gencer/cache#v2.4.10:
          key: "{{ id }}-{{ checksum 'remote-config' }}"
          paths:
            - .cache-dir

Running the wget command as a separate step won't work, as the file system gets cleaned, and even if there weren't, we run multiple agents.

Would it be possible/make sense to have a pre-run-command argument that I could have, Or perhaps be able to invoke the plugin manually?

Examples:

  - label: "Run Cached Step"
    command:
      - ./script-that-does-something.sh
    plugins:
      - gencer/cache#v2.4.10:
          key: "{{ id }}-{{ checksum 'remote-config' }}"
          pre-restore-command: wget -O remote-config https://example.com
          paths:
            - .cache-dir

or perhaps:

  - label: "Run Cached Step"
    command:
      - wget -O remote-config https://example.com
      - gencer-cache-restore
      - ./script-that-does-something.sh
    plugins:
      - gencer/cache#v2.4.10:
          key: "{{ id }}-{{ checksum 'remote-config' }}"
          defer_restore: true
          paths:
            - .cache-dir

This is probably a very niche/weird request.

@willhughes-au willhughes-au changed the title [FEATURE REQUEST] Ability to run a command before calculating cache? [FEATURE REQUEST] Ability to run a command before calculating cache key? Apr 20, 2022
@gencer gencer added the enhancement New feature or request label Apr 28, 2022
@gencer gencer self-assigned this Apr 28, 2022
@gencer
Copy link
Collaborator

gencer commented Apr 28, 2022

This is probably a very niche/weird request.

Normally, Yes. But not in this situation because of:

Running the wget command as a separate step won't work, as the file system gets cleaned, and even if there weren't, we run multiple agents.

Which makes this request meaningful.

There are 3 open requests incl. this one and I still not yet finished any of them. I'll try to implement ASAP. However, I am fully open for PRs (Generally speaking).

@stale
Copy link

stale bot commented May 31, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label May 31, 2022
@gencer
Copy link
Collaborator

gencer commented May 31, 2022

not stale

@stale stale bot removed the wontfix This will not be worked on label May 31, 2022
@stale
Copy link

stale bot commented Jun 22, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Jun 22, 2022
@gencer
Copy link
Collaborator

gencer commented Jun 26, 2022

not stale

@stale stale bot removed the wontfix This will not be worked on label Jun 26, 2022
@stale
Copy link

stale bot commented Aug 1, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Aug 1, 2022
@stale stale bot closed this as completed Aug 12, 2022
@gencer gencer reopened this Aug 12, 2022
@stale stale bot removed the wontfix This will not be worked on label Aug 12, 2022
@gencer gencer mentioned this issue Aug 29, 2022
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants