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

Tools mirror/ caching CDN #972

Open
rarkins opened this issue May 12, 2023 · 9 comments · Fixed by #2743
Open

Tools mirror/ caching CDN #972

rarkins opened this issue May 12, 2023 · 9 comments · Fixed by #2743
Labels
priority-2-important User-visible bugs or very important features status:requirements Full requirements are not yet known, so implementation should not be started type:feature Feature (new functionality)

Comments

@rarkins
Copy link
Member

rarkins commented May 12, 2023

Today's approach has some downsides:

  1. Image builds sometime fail for periods if one of the hosts we download from is flaking
  2. Self-hosted users who build their own image may not be allowed or find it easy to "open up ports" to so many hosts

Example of flakiness:

 > [test 13/17] RUN install-tool rust 1.69.0:
#42 0.214 installing v2 tool rust v1.69.0
#42 0.842 curl: (56) OpenSSL SSL_read: Connection reset by peer, errno 104
#42 0.845 Download failed: https://static.rust-lang.org/dist/rust-1.69.0-x86_64-unknown-linux-gnu.tar.gz

We should aim to have centralization and control of such dependencies where possible or necessary. I can think of two main possibilities:

  1. We mirror everything onto github.com, probably as "Releases" because github doesn't yet support "generic" packages in its registry, or
  2. We mirror everything statically onto e.g. S3 and essentially host a public mirror ourselves (paid for by Mend)

Obviously either way we still can have flakiness if our host (GitHub or CDN) has flakiness, but at least it's centralized flakiness and likely less than we get today

@rarkins rarkins changed the title Tool mirror Tools mirror May 12, 2023
@viceice
Copy link
Member

viceice commented May 12, 2023

@viceice viceice added type:feature Feature (new functionality) priority-3-normal Default priority, "should be done" but isn't prioritised ahead of others status:ready Ready to start implementation labels Jul 13, 2023
@viceice
Copy link
Member

viceice commented Aug 23, 2023

maven issues caused by ban1

Footnotes

  1. https://infra.apache.org/infra-ban.html

@rarkins
Copy link
Member Author

rarkins commented Aug 30, 2023

So our goal here is:

  • Every custom tool we have is downloadable via a single host we control (e.g. mirror.containerbase.org)
  • This mirror is resilient towards outages of its upstream hosts

If we can achieve this with reasonable cost efficiency, we could then default Containerbase to only use this host instead of the variety we have today.

@rarkins
Copy link
Member Author

rarkins commented Aug 30, 2023

Cloudflare's cache reserve is one approach to reducing requests to the origin server(s) and providing more resiliency for those which might have availability problems: https://developers.cloudflare.com/cache/advanced-configuration/cache-reserve/

@viceice viceice added status:requirements Full requirements are not yet known, so implementation should not be started and removed status:ready Ready to start implementation labels Oct 12, 2023
@viceice
Copy link
Member

viceice commented Oct 12, 2023

          I've registered containerbase.dev just now and propose we aim to use cdn.containerbase.dev

Originally posted by @rarkins in #1507 (comment)

@viceice viceice changed the title Tools mirror Tools mirror/ caching CDN Oct 12, 2023
@viceice viceice added this to the v11 milestone May 31, 2024
@rarkins
Copy link
Member Author

rarkins commented May 31, 2024

Update: cdn.containerbase.dev is now ready

I would like to make this opt-in via CONTAINERBASE_CDN=https://cdn.containerbase.dev

Setting this would result in all known hosts to be redirected without the need for the http from/to being all set individually

@zharinov
Copy link

zharinov commented Jun 2, 2024

Just to clarify: setting CONTAINERBASE_CDN=https://cdn.containerbase.dev/ should transform requests like https://example.com/foo/bar to the form like https://cdn.containerbase.dev/example.com/foo/bar

@rarkins
Copy link
Member Author

rarkins commented Jun 2, 2024

I was thinking that it would need to have an explicit list but I suppose you could add a general http rewrite rule? Might break if there's 30x responses though

@viceice viceice removed this from the v11 milestone Jun 3, 2024
@viceice viceice added priority-2-important User-visible bugs or very important features status:in-progress Someone is working on implementation and removed priority-3-normal Default priority, "should be done" but isn't prioritised ahead of others status:requirements Full requirements are not yet known, so implementation should not be started labels Jun 3, 2024
@viceice
Copy link
Member

viceice commented Jun 3, 2024

@viceice viceice reopened this Jun 6, 2024
@viceice viceice closed this as completed Jun 6, 2024
viceice added a commit that referenced this issue Jun 6, 2024
This allows to enable the cdn for those managers selectively.

- #972
viceice added a commit that referenced this issue Jun 6, 2024
This allows to enable the cdn for those managers selectively.

- #972
@viceice viceice reopened this Jul 22, 2024
@viceice viceice added status:requirements Full requirements are not yet known, so implementation should not be started and removed status:in-progress Someone is working on implementation labels Jul 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority-2-important User-visible bugs or very important features status:requirements Full requirements are not yet known, so implementation should not be started type:feature Feature (new functionality)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants