Rails: Implement CI caching or mirroring for external sources of nodejs and yarn
Summary
2023-10-19: curl nodejs download failure (gitlab-com/gl-infra/production#17005 - closed)
We are seeing unreliability of the downloads for Nodejs. While this is fronted by CloudFlare, somethings is causing regular interruptions.
To address this, we should implement use of CI cache for these sources if possible. To do this, we are discussing a few methods:
-
🚫 Use additional curl flag for "retry on all errors"-
⛔ This is not available in the curl version within UBI8
-
-
✅ Replacecurl
with a shimmed script to handle these failures (!1593 (merged))-
⚖ If curl fails during download, retry (exit codes18
and92
)
-
-
🔍 Replacecurl
with a shimmed script, which will attempt to make use of CI cache before performingcurl
- If not in cache, use curl
-
❔ Problem: CI cache insideDockerfile
?🤔
-
⌛ Mirror the tarball (by several means, onus on GitLab)- See also Self host tarballs of component software and mi... (gitlab-org/distribution/team-tasks#1355)
- Use generic package registry (this requires some flexibility for dev/com separation and fork reliability)
- No matter the implementation, we do not want to make Dev rely on .com, vice versa, or to cause problems for downstream / contributor forks.
-
👎 Use a different mirror (just shifting target, onus on unknown external)
External evidence of upstream's CDN issues
- https://github.com/nodejs/build/issues/3410
- https://github.com/nodejs/build/issues/1993
- https://github.com/nodejs/help/issues/4254 (exactly what we are seeing)
- https://github.com/tj/n/issues/784
Acceptance Criteria
-
Must work on GitLab.com -
Must work on Dev -
Must work for forks / unprivileged access -
Must work outside of CI
Edited by Jason Plum