-
-
Notifications
You must be signed in to change notification settings - Fork 268
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[INFRA-2615] [INFRA-1021] More flexible tiering (#376)
Co-authored-by: Daniel Beck <daniel-beck@users.noreply.github.com>
- Loading branch information
1 parent
59b6ae2
commit 5526acc
Showing
13 changed files
with
976 additions
and
147 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,67 +1,53 @@ | ||
# OSS Update Center Site Architecture | ||
This script generate the code and data behind https://updates.jenkins-ci.org/ | ||
|
||
The service this website provides is as follows. | ||
The service this website provides is as follows: | ||
|
||
1. Jenkins will hit well-known URLs hard-coded into Jenkins binaries with | ||
the Jenkins version number attached as a query string, like | ||
http://updates.jenkins-ci.org/update-center.json.html?version=1.345 | ||
https://updates.jenkins.io/update-center.json?version=1.345 | ||
|
||
1. We use the version number to redirect the traffic to the right update site, | ||
among all the ones that we generate. | ||
|
||
1. HTTP traffic will be directed to mirrors through http://mirror.jenkins-ci.org/ | ||
HTTPS traffic will be served locally because we don't have any HTTPS mirrors. | ||
In this way, Jenkins running in HTTPS will not see the insecure content warning | ||
in the browser. | ||
|
||
## Multiple update sites for different version ranges | ||
|
||
Update center metadata can contain only one version per a plugin. | ||
Because newer versions of the same plugin may depend on newer version of Jenkins, | ||
if we just serve one update center for every Jenkins out there, older versions of | ||
Jenkins will see plugin versions that do not work with them, making it impossible to install | ||
the said plugin. This is unfortunate because some younger versions of the plugin might have | ||
worked with that Jenkins core. This creates a disincentive for plugin developers | ||
to move to the new base version, and slows down the pace in which it adopts new core features. | ||
|
||
So in this "v3" UC, we generate several update centers targeted for different | ||
version ranges. Consider the following example: | ||
|
||
|
||
### Dynamic update site tiers | ||
|
||
1.532 1.554 1.565 | ||
-----------+-----------+-----------+---------------> 1.590 | ||
\ \ \ | ||
\ \ \ | ||
---------> ---------> -----------> | ||
Update center metadata can contain only one version per a plugin. | ||
Because newer versions of the same plugin may depend on newer version of Jenkins, if we just serve one update center for every Jenkins out there, older versions of Jenkins will see plugin versions that do not work with them, making it impossible to install the said plugin. | ||
This is unfortunate because some younger versions of the plugin might have worked with that Jenkins core. | ||
This creates a disincentive for plugin developers to move to the new base version, and slows down the pace in which it adopts new core features. | ||
|
||
So we generate several update centers targeted for different version ranges. | ||
|
||
The version range is defined based on LTS branch points. We pick up 3 or 4 recent | ||
LTS branch points to create 6 or 8 ranges. | ||
To accommodate all recent Jenkins releases, we first inspect all plugin releases for their Jenkins core dependencies. | ||
We then generate tiered update sites for all releases identified this way that are more recent than a cutoff (~3 months). | ||
Directories containing these tiered update sites have the prefix `dynamic-`. | ||
|
||
* version in the range (,1.532] will see the UC that advertises 1.590 as the core release, | ||
and they will only see plugins that are compatible with 1.532 or earlier. | ||
mod_rewrite rules in an `.htaccess` file are then used to redirect requests from Jenkins versions to the next lower update site. | ||
It will serve the newest release of each plugin that is compatible with the specified Jenkins version. | ||
See [generate-htaccess.sh](generate-htaccess.sh) for how these rules are generated. | ||
|
||
* next, version range in (1.532, 1.532.*], which is basically 1.532.x LTS, will see | ||
the UC that advertises 1.532.x as the core release, and only see plugins that are | ||
compatible with 1.532.* or earlier. | ||
### Static update site tiers | ||
|
||
* next, version in the range (1.532, 1.554] will see 1.590 as the core, and | ||
only see plugins compatible with 1.554 or earlier. | ||
Before June 2020, update site tiers were fixed: | ||
Update sites were generated for the five most recent LTS baselines, and each update site would offer plugins compatible with the latest release of each LTS line. | ||
|
||
* next, version range is (1,554, 1.554.*] and you get the idea | ||
These update site tiers are *deprecated*: They are currently still being generated, but `.htaccess` no longer reference them. | ||
See e.g. https://github.com/jenkinsci/docker/issues/954 | ||
|
||
* finally, the catch-all update center advertises 1.590 core release and latest plugins | ||
regardless of their required core versions. This applies to (1.565,*] | ||
|
||
## Redirection logic | ||
## Generating update sites | ||
|
||
[generate.sh](generate.sh) is run by [a CI job](https://trusted.ci.jenkins.io/job/update_center/) | ||
and generates all the different sites as static files, and deploys the directory into Apache. | ||
|
||
A part of this is [.htaccess](static/.htaccess) that uses `mod_rewrite` to | ||
redirect inbound requests to the right version specific website. | ||
|
||
|
||
## Layout | ||
See [a separate doc](LAYOUT.md) for the layout of the generated update site. | ||
|
||
See [a separate doc](LAYOUT.md) for the layout of the generated update site. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.