Serve stream clone bundles for requests originating from private IP addresses
Categories
(Developer Services :: Mercurial: hg.mozilla.org, enhancement)
Tracking
(Not tracked)
People
(Reporter: sheehan, Assigned: sheehan)
References
(Blocks 1 open bug)
Details
Attachments
(6 files)
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review |
After making a few try pushes that clone mozilla-unified from
a private hgweb instance running in AWS, I noticed that the
clones are zstd-max
format (as seen here, on line 29) and not
packed.hg1
(as seen here, line 30). This is because the code that
forces hosts in AWS to receive streamed bundles is checking the
public IP address against all known AWS IP address blocks, when the
private instances are being accessed from the private IP address
space (hence, they do not register as coming from AWS, and the
fast-but-compressed zstd-max bundle is sent instead). We should
add code to the hgmo extension that causes clones from anywhere
in the private IP address space to receive streamed clone bundles,
under the assumption that any clones coming from private hosts
should be in AWS. Alternatively we could add the known Taskcluster
private IP address blocks to the hgmo extension (or have them
somewhere else we can query) and prioritize streamed clone bundles
for requests originating from those blocks.
Assignee | ||
Comment 1•6 years ago
|
||
I did a little digging through mozilla-central and I found this neat
little hack that lets you query the internal Amazon DNS server (at
http://169.254.169.254/latest/meta-data/placement/availability-zone)
and retrieve the AWS region of the current host. We can leverage
this to determine which region a host is living in, and serve bundles
from the appropriate region using that value. It might be worth
running this query out of band on startup, and writing a file to
disk that we can reference on subsequent clones/pulls.
Assignee | ||
Comment 2•6 years ago
|
||
Even better, we can use the cloud-init instance metadata object. This object contains
some of the metadata collected by cloud-init during first boot as is written
to a common location on hosts in different cloud environments. The AWS
region is included in this object.
Assignee | ||
Comment 3•6 years ago
|
||
Assignee | ||
Comment 4•6 years ago
|
||
Assignee | ||
Comment 5•6 years ago
|
||
Assignee | ||
Comment 6•6 years ago
|
||
Assignee | ||
Comment 7•6 years ago
|
||
Pushed by cosheehan@mozilla.com:
https://hg.mozilla.org/hgcustom/version-control-tools/rev/54de0d1af317
hgmo: don't split manifest into lines to check for ec2region
parameter r=smacleod
https://hg.mozilla.org/hgcustom/version-control-tools/rev/f8673c2b125b
hgmo: move stream_clone_cmp
to a standalone function r=smacleod
https://hg.mozilla.org/hgcustom/version-control-tools/rev/c2862b0dbf63
hgmo: move manifest filter and sort into standalone function r=smacleod
https://hg.mozilla.org/hgcustom/version-control-tools/rev/3548753ac274
terraform: move instance_data.json
object to /var/hg
on bootstrap r=smacleod
https://hg.mozilla.org/hgcustom/version-control-tools/rev/09fa6119e23b
hgmo: serve stream clone bundles to private IP address on cloud instances r=smacleod
Assignee | ||
Comment 9•6 years ago
|
||
Comment 10•6 years ago
|
||
Comment 11•6 years ago
|
||
Description
•