Skip to content

Commit

Permalink
Append to MIRRORS instead of PREMIRRORS to limit egress
Browse files Browse the repository at this point in the history
For the first deployment of the S3 download mirror we will
err on the side of cost savings, and use the mirror as a
fallback not the primary source of downloads.

Revert this if we want the benefits of using our own mirrors
as the primary source, like download speed and no rate limits.

Change-type: patch
Signed-off-by: Kyle Harding <[email protected]>
  • Loading branch information
klutchell committed Dec 18, 2024
1 parent af98bea commit e53fa8f
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/yocto-build-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -510,22 +510,27 @@ jobs:
EOF
cat "${AUTO_CONF_FILE}"
# FIXME: We should probably change this to MIRRORS:append instead of PREMIRRORS:prepend
# to avoid using our S3 egress as much as possible?
# https://docs.yoctoproject.org/4.0.10/ref-manual/classes.html?highlight=source_mirror#own-mirrors-bbclass
# https://github.com/openembedded/openembedded/blob/master/classes/own-mirrors.bbclass
# The own-mirrors class makes it easier to set up your own PREMIRRORS from which to first fetch source before
# attempting to fetch it from the upstream specified in SRC_URI within each recipe.
- name: Add S3 shared-downloads to PREMIRRORS
- name: Add S3 shared-downloads to MIRRORS
if: env.SOURCE_MIRROR_URL
env:
SOURCE_MIRROR_URL: ${{ env.SOURCE_MIRROR_URL }}
run: |
mkdir -p "$(dirname "${AUTO_CONF_FILE}")"
cat <<EOF >> "${AUTO_CONF_FILE}"
INHERIT += "own-mirrors"
SOURCE_MIRROR_URL = "${SOURCE_MIRROR_URL}"
MIRRORS:append = "\\
cvs://.*/.* ${SOURCE_MIRROR_URL} \\
svn://.*/.* ${SOURCE_MIRROR_URL} \\
git://.*/.* ${SOURCE_MIRROR_URL} \\
hg://.*/.* ${SOURCE_MIRROR_URL} \\
bzr://.*/.* ${SOURCE_MIRROR_URL} \\
https?$://.*/.* ${SOURCE_MIRROR_URL} \\
ftp://.*/.* ${SOURCE_MIRROR_URL} \\
"
EOF
cat "${AUTO_CONF_FILE}"
Expand Down

0 comments on commit e53fa8f

Please sign in to comment.