RamenDR / ramen

Apache License 2.0
70 stars 51 forks source link

Addons cache #1397

Closed abhijeet219 closed 1 month ago

abhijeet219 commented 2 months ago

Currently, olm addon do not use kustomization, so introducing that. Also, this change will start using cache for those resources, so starting addons can directly use the cached resources.

Changes:

Example demonstrating how the cache works:

Fetching of resources for envs/olm.yaml:

$ drenv fetch envs/olm.yaml
2024-05-20 00:51:53,536 INFO    [olm] Fetching
2024-05-20 00:51:53,538 INFO    [olm] Running addons/olm/fetch
2024-05-20 00:51:58,611 INFO    [olm] addons/olm/fetch completed in 5.07 seconds
2024-05-20 00:51:58,611 INFO    [olm] Fetching finishied in 5.08 seconds

Fetching resources may take different amount of time for different runs. And once fetched, addons can directly use these resources to get started, saving time taken to fetch the resources(~5sec in this case) and escaping any network failure situation.

Size of the cache, the drenv directory tree:

$ tree -h ~/.cache/drenv/
[   20]  /home/abshakya/.cache/drenv/
└── [   53]  addons
    ├── [ 1.2M]  olm-crds.yaml
    └── [  10K]  olm-operators.yaml

Fixes: #1337 Fixes: #1260

nirs commented 2 months ago

@abhijeet219 would be nice to mention the issues fixed by this PR in the PR message. This makes reviewers life easier.