Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Allow caching artifacts without privileged containers and volumes #758

Closed
3 tasks done
9p4 opened this issue Feb 7, 2022 · 3 comments
Closed
3 tasks done

Allow caching artifacts without privileged containers and volumes #758

9p4 opened this issue Feb 7, 2022 · 3 comments
Labels
feature add new functionality

Comments

@9p4
Copy link
Contributor

9p4 commented Feb 7, 2022

Clear and concise description of the problem

Allow for the pipeline to cache artifacts, much like what Travis CI allows you to do: https://docs.travis-ci.com/user/caching/

This is currently possible in Woodpecker, but only if using volumes. It would be pretty neat if volumes weren't required and Woodpecker could cache items without exposing security issues.

Suggested solution

When the pipeline completes, save the indicated directories somewhere. Then, on subsequent runs of the pipeline, mount that directory automatically. Perhaps automatic volume creation?

Alternative

The current method is insecure and should not be available to untrusted users.

Additional context

No response

Validations

@anbraten
Copy link
Member

anbraten commented Feb 7, 2022

Caching is a highly requested feature and we talked a lot about it already. I would prefer to have some official plugins which help the user to do caching. How the caching works really depends on the "backend" you want to use IMO. Most users will probably be fine with simply putting caches in a folder on the server, but as you can have multiple agents for your Woodpecker instance or could even use Kubernetes (#9) as backend, most larger deployments probably need some kind of clustered caching backend like s3 as well. Woodpecker should probably be the generic base for it and the caching plugins could do the magic in the background. If we have some nice plugins we should add a sample about them somewhere in the docs as well (#316).

@wxiaoguang
Copy link

wxiaoguang commented Feb 7, 2022

Although putting cache into S3 is a choice but it is still slow and wastes bandwidth.

In some cases, we have predictable hosts to run agents. So on every host, we can cache the files separately. I do not care about if the cache is sync-ed. If there is cache, then I'd like to reuse it; if there is no cache, then I can let the job to init a new cache, instead of restoring it from somewhere else.

ps: now I am using such local cache mechanism, and I use Docker-in-Docker to isolate the agents from hosts, then I can set trusted to all repositories. But if the CI agent could support local cache, then users do not need to set trusted anymore, and do not need to setup Docker-in-Docker.

@6543
Copy link
Member

6543 commented Feb 8, 2022

"Allow agent to cache" would be the feature then I guess?

@fnetX fnetX mentioned this issue Feb 9, 2022
3 tasks
@anbraten anbraten added feature add new functionality and removed pending:feature labels Feb 28, 2023
CobaltCause added a commit to CobaltCause/lemmy that referenced this issue Jun 9, 2023
Woodpecker has a severe deficiency in that caching artifacts across CI
runs is not supported. There has been an open issue for this feature for
over 1 year [here][0]. It is also not possible to run its CI definition
file locally; creating a pull request and pushing commits is the only
way to get the CI pipeline to check your code.

In Lemmy's case, the result of these facts is that the edit-compile-test
feedback loop is drawn out to 46 minutes just for the test portion. See
[here for an example][1]. Having to wait this long is a pretty serious
reduction in current productivity and potential productivity of developers
who lose interest/patience and give up before being able to contribute a
working patch.

While the maintainers understandably ["don't want to rely on
Microsoft"][0], the repository, code review, and issue tracker all live
on GitHub already. Lemmy can reduce its feedback loop latency
substantially by making use of GitHub Actions' ability to cache
artifacts between runs. Further, by defining the vast majority of the CI
pipeline via a third party tool, Lemmy can avoid relying heavily on
*any and all* CI vendors. I argue that the tradeoff between

* adding this 72 line GitHub Actions file
* large reduction in feedback loop latency and wasted CPU recompiling
  dependencies

is massively worth it.

Additionally, this particular third party tool is also capable of being
run locally without any middleware in the way like Docker. The result is
seamless caching of intermediate artifacts when running locally, which
amounts to a reduction in CI run time from 46 minutes in Woodpecker to 3
minutes on my computer with a warm cache.

[0]: woodpecker-ci/woodpecker#758
[1]: https://woodpecker.join-lemmy.org/LemmyNet/lemmy/pipeline/72/1
[2]: https://matrix.to/#/!tUnhsBRCsiePXfsIGe:matrix.org/$kV3XDo15eRPPb3xiq3gRrYr5Iix9fTGywTC53cMDRR0?via=matrix.org&via=chapo.chat&via=tchncs.de
CobaltCause added a commit to CobaltCause/lemmy that referenced this issue Jun 9, 2023
Woodpecker has a severe deficiency in that caching artifacts across CI
runs is not supported. There has been an open issue for this feature for
over 1 year [here][0]. It is also not possible to run its CI definition
file locally; creating a pull request and pushing commits is the only
way to get the CI pipeline to check your code.

In Lemmy's case, the result of these facts is that the edit-compile-test
feedback loop is drawn out to 46 minutes just for the test portion. See
[here for an example][1]. Having to wait this long is a pretty serious
reduction in current productivity and potential productivity of developers
who lose interest/patience and give up before being able to contribute a
working patch.

While the maintainers understandably ["don't want to rely on
Microsoft"][0], the repository, code review, and issue tracker all live
on GitHub already. Lemmy can reduce its feedback loop latency
substantially by making use of GitHub Actions' ability to cache
artifacts between runs. Further, by defining the vast majority of the CI
pipeline via a third party tool, Lemmy can avoid relying heavily on
*any and all* CI vendors. I argue that the tradeoff between

* adding this 72 line GitHub Actions file
* large reduction in feedback loop latency and wasted CPU recompiling
  dependencies

is massively worth it.

Additionally, this particular third party tool is also capable of being
run locally without any middleware in the way like Docker. The result is
seamless caching of intermediate artifacts when running locally, which
amounts to a reduction in CI run time from 46 minutes in Woodpecker to 3
minutes on my computer with a warm cache.

[0]: woodpecker-ci/woodpecker#758
[1]: https://woodpecker.join-lemmy.org/LemmyNet/lemmy/pipeline/72/1
[2]: https://matrix.to/#/!tUnhsBRCsiePXfsIGe:matrix.org/$kV3XDo15eRPPb3xiq3gRrYr5Iix9fTGywTC53cMDRR0?via=matrix.org&via=chapo.chat&via=tchncs.de
CobaltCause added a commit to CobaltCause/lemmy that referenced this issue Jun 9, 2023
Woodpecker has a severe deficiency in that caching artifacts across CI
runs is not supported. There has been an open issue for this feature for
over 1 year [here][0]. It is also not possible to run its CI definition
file locally; creating a pull request and pushing commits is the only
way to get the CI pipeline to check your code.

In Lemmy's case, the result of these facts is that the edit-compile-test
feedback loop is drawn out to 46 minutes just for the test portion. See
[here for an example][1]. Having to wait this long is a pretty serious
reduction in current productivity and potential productivity of developers
who lose interest/patience and give up before being able to contribute a
working patch.

While the maintainers understandably ["don't want to rely on
Microsoft"][0], the repository, code review, and issue tracker all live
on GitHub already. Lemmy can reduce its feedback loop latency
substantially by making use of GitHub Actions' ability to cache
artifacts between runs. Further, by defining the vast majority of the CI
pipeline via a third party tool, Lemmy can avoid relying heavily on
*any and all* CI vendors. I argue that the tradeoff between

* adding this 72 line GitHub Actions file
* large reduction in feedback loop latency and wasted CPU recompiling
  dependencies

is massively worth it.

Additionally, this particular third party tool is also capable of being
run locally without any middleware in the way like Docker. The result is
seamless caching of intermediate artifacts when running locally, which
amounts to a reduction in CI run time from 46 minutes in Woodpecker to 3
minutes on my computer with a warm cache.

[0]: woodpecker-ci/woodpecker#758
[1]: https://woodpecker.join-lemmy.org/LemmyNet/lemmy/pipeline/72/1
[2]: https://matrix.to/#/!tUnhsBRCsiePXfsIGe:matrix.org/$kV3XDo15eRPPb3xiq3gRrYr5Iix9fTGywTC53cMDRR0?via=matrix.org&via=chapo.chat&via=tchncs.de
CobaltCause added a commit to CobaltCause/lemmy that referenced this issue Jun 9, 2023
Woodpecker has a severe deficiency in that caching artifacts across CI
runs is not supported. There has been an open issue for this feature for
over 1 year [here][0]. It is also not possible to run its CI definition
file locally; creating a pull request and pushing commits is the only
way to get the CI pipeline to check your code.

In Lemmy's case, the result of these facts is that the edit-compile-test
feedback loop is drawn out to 46 minutes just for the test portion. See
[here for an example][1]. Having to wait this long is a pretty serious
reduction in current productivity and potential productivity of developers
who lose interest/patience and give up before being able to contribute a
working patch.

While the maintainers understandably ["don't want to rely on
Microsoft"][0], the repository, code review, and issue tracker all live
on GitHub already. Lemmy can reduce its feedback loop latency
substantially by making use of GitHub Actions' ability to cache
artifacts between runs. Further, by defining the vast majority of the CI
pipeline via a third party tool, Lemmy can avoid relying heavily on
*any and all* CI vendors. I argue that the tradeoff between

* adding this 72 line GitHub Actions file
* large reduction in feedback loop latency and wasted CPU recompiling
  dependencies

is massively worth it.

Additionally, this particular third party tool is also capable of being
run locally without any middleware in the way like Docker. The result is
seamless caching of intermediate artifacts when running locally, which
amounts to a reduction in CI run time from 46 minutes in Woodpecker to 3
minutes on my computer with a warm cache.

[0]: woodpecker-ci/woodpecker#758
[1]: https://woodpecker.join-lemmy.org/LemmyNet/lemmy/pipeline/72/1
[2]: https://matrix.to/#/!tUnhsBRCsiePXfsIGe:matrix.org/$kV3XDo15eRPPb3xiq3gRrYr5Iix9fTGywTC53cMDRR0?via=matrix.org&via=chapo.chat&via=tchncs.de
CobaltCause added a commit to CobaltCause/lemmy that referenced this issue Jun 9, 2023
Woodpecker has a severe deficiency in that caching artifacts across CI
runs is not supported. There has been an open issue for this feature for
over 1 year [here][0]. It is also not possible to run its CI definition
file locally; creating a pull request and pushing commits is the only
way to get the CI pipeline to check your code.

In Lemmy's case, the result of these facts is that the edit-compile-test
feedback loop is drawn out to 46 minutes just for the test portion. See
[here for an example][1]. Having to wait this long is a pretty serious
reduction in current productivity and potential productivity of developers
who lose interest/patience and give up before being able to contribute a
working patch.

While the maintainers understandably ["don't want to rely on
Microsoft"][0], the repository, code review, and issue tracker all live
on GitHub already. Lemmy can reduce its feedback loop latency
substantially by making use of GitHub Actions' ability to cache
artifacts between runs. Further, by defining the vast majority of the CI
pipeline via a third party tool, Lemmy can avoid relying heavily on
*any and all* CI vendors. I argue that the tradeoff between

* adding this 72 line GitHub Actions file
* large reduction in feedback loop latency and wasted CPU recompiling
  dependencies[^1]

is massively worth it.

Additionally, this particular third party tool is also capable of being
run locally without any middleware in the way like Docker. The result is
seamless caching of intermediate artifacts when running locally, which
amounts to a reduction in CI run time from 46 minutes in Woodpecker to 3
minutes on my computer with a warm cache.

[^1]: With an empty cache, the CI run on GitHub Actions takes 30
minutes, which is already a 15 minute improvement over the previous
Woodpecker setup.

[0]: woodpecker-ci/woodpecker#758
[1]: https://woodpecker.join-lemmy.org/LemmyNet/lemmy/pipeline/72/1
[2]: https://matrix.to/#/!tUnhsBRCsiePXfsIGe:matrix.org/$kV3XDo15eRPPb3xiq3gRrYr5Iix9fTGywTC53cMDRR0?via=matrix.org&via=chapo.chat&via=tchncs.de
CobaltCause added a commit to CobaltCause/lemmy that referenced this issue Jun 9, 2023
Fixes <LemmyNet#2652>.

Woodpecker has a severe deficiency in that caching artifacts across CI
runs is not supported. There has been an open issue for this feature for
over 1 year [here][0]. It is also not possible to run its CI definition
file locally; creating a pull request and pushing commits is the only
way to get the CI pipeline to check your code.

In Lemmy's case, the result of these facts is that the edit-compile-test
feedback loop is drawn out to 46 minutes just for the test portion. See
[here for an example][1]. Having to wait this long is a pretty serious
reduction in current productivity and potential productivity of developers
who lose interest/patience and give up before being able to contribute a
working patch.

While the maintainers understandably ["don't want to rely on
Microsoft"][0], the repository, code review, and issue tracker all live
on GitHub already. Lemmy can reduce its feedback loop latency
substantially by making use of GitHub Actions' ability to cache
artifacts between runs. Further, by defining the vast majority of the CI
pipeline via a third party tool, Lemmy can avoid relying heavily on
*any and all* CI vendors. I argue that the tradeoff between

* adding this 72 line GitHub Actions file
* large reduction in feedback loop latency and wasted CPU recompiling
  dependencies[^1]

is massively worth it.

Additionally, this particular third party tool is also capable of being
run locally without any middleware in the way like Docker. The result is
seamless caching of intermediate artifacts when running locally, which
amounts to a reduction in CI run time from 46 minutes in Woodpecker to 3
minutes on my computer with a warm cache.

(It's likely you're reading this and wondering what Engage is, so I'll
elaborate on that: Engage is a task scheduler and executor based on a
directed acyclic graph of dependencies between those tasks, and you can
read more about it [here][3]. I've seen a few similar tools but I'm
partial to this one due to its simplicity and also the fact that I wrote
it.)

[^1]: With an empty cache, the CI run on GitHub Actions takes 30
minutes, which is already a 15 minute improvement over the previous
Woodpecker setup. With a warm cache, the CI run on GitHub Actions takes
16 minutes, one third as much time as the previous Woodpecker setup.

[0]: woodpecker-ci/woodpecker#758
[1]: https://woodpecker.join-lemmy.org/LemmyNet/lemmy/pipeline/72/1
[2]: https://matrix.to/#/!tUnhsBRCsiePXfsIGe:matrix.org/$kV3XDo15eRPPb3xiq3gRrYr5Iix9fTGywTC53cMDRR0?via=matrix.org&via=chapo.chat&via=tchncs.de
[3]: https://or.computer.surgery/charles/engage
CobaltCause added a commit to CobaltCause/lemmy that referenced this issue Jun 9, 2023
Fixes <LemmyNet#2652>.

Woodpecker has a severe deficiency in that caching artifacts across CI
runs is not supported. There has been an open issue for this feature for
over 1 year [here][0]. It is also not possible to run its CI definition
file locally; creating a pull request and pushing commits is the only
way to get the CI pipeline to check your code.

In Lemmy's case, the result of these facts is that the edit-compile-test
feedback loop is drawn out to 46 minutes just for the test portion. See
[here for an example][1]. Having to wait this long is a pretty serious
reduction in current productivity and potential productivity of developers
who lose interest/patience and give up before being able to contribute a
working patch.

While the maintainers understandably ["don't want to rely on
Microsoft"][0], the repository, code review, and issue tracker all live
on GitHub already. Lemmy can reduce its feedback loop latency
substantially by making use of GitHub Actions' ability to cache
artifacts between runs. Further, by defining the vast majority of the CI
pipeline via a third party tool, Lemmy can avoid relying heavily on
*any and all* CI vendors. I argue that the tradeoff between

* adding this 72 line GitHub Actions file
* large reduction in feedback loop latency and wasted CPU recompiling
  dependencies[^1]

is massively worth it.

Additionally, this particular third party tool is also capable of being
run locally without any middleware in the way like Docker. The result is
seamless caching of intermediate artifacts when running locally, which
amounts to a reduction in CI run time from 46 minutes in Woodpecker to 3
minutes on my computer with a warm cache.

(It's likely you're reading this and wondering what Engage is, so I'll
elaborate on that: Engage is a task scheduler and executor based on a
directed acyclic graph of dependencies between those tasks, and you can
read more about it [here][3]. I've seen a few similar tools but I'm
partial to this one due to its simplicity and also the fact that I wrote
it.)

[^1]: With an empty cache, the CI run on GitHub Actions takes 30
minutes, which is already a 15 minute improvement over the previous
Woodpecker setup. With a warm cache, the CI run on GitHub Actions takes
16 minutes, one third as much time as the previous Woodpecker setup.

[0]: woodpecker-ci/woodpecker#758
[1]: https://woodpecker.join-lemmy.org/LemmyNet/lemmy/pipeline/72/1
[2]: https://matrix.to/#/!tUnhsBRCsiePXfsIGe:matrix.org/$kV3XDo15eRPPb3xiq3gRrYr5Iix9fTGywTC53cMDRR0?via=matrix.org&via=chapo.chat&via=tchncs.de
[3]: https://or.computer.surgery/charles/engage
@woodpecker-ci woodpecker-ci locked and limited conversation to collaborators Aug 20, 2023
@anbraten anbraten converted this issue into discussion #2296 Aug 20, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
feature add new functionality
Projects
None yet
Development

No branches or pull requests

4 participants