You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 13, 2019. It is now read-only.
One thing we discovered in the https://bugzilla.mozilla.org/show_bug.cgi?id=1456244 is the obvious problem that since Buildhub isn't a web server, it's really hard to find out; "What version of Buildhub do we use?" to which the counter-question is "Do you mean the scraper or the Lambda?"
The information is useful when reconciling the state of deployments. At the moment, you either trust that...
Making a release automatically upgraded the scraper.
That OPs has upgraded Stage/Prod Lambda/cron (check the latest "Upgrade This That for Buildhub v1.2.3" bug's status)
Another option is to instead inject an extra piece of information with each HTTP POST/PUT to Kinto that we don't pass along to kinto-elasticsearch.
For example:
Instead of:
kinto_client.create_record(record)
We do:
withopen('./version.json') asf:
record['_metadata'] = {
'environment': 'cron', # or 'lambda' or 'sqs''timestamp': time.time(),
'version': json.load(f.read()),
}
kinto_client.create_record(record)
Perhaps it should be called _buildhub_metadata so it's never confused with any of the data coming in from that buildhub.json whence it's ready.
How do you even get the version.json stuff in the Lambda code? One way would be to generate the file into the buildhub python package as package data. E.g. from buildhub import version; print(version.get_data())
It still doesn't reduce down to 1 URL you can read (e.g. Whatsdeployed.io) but it's important to appreciate that Buildhub is two distinct things.
Another option is to write this information to another collection in the same kinto. E.g. Instead of
kinto_client.create_record(record)
we do:
kinto_client.create_record(record)
withopen('./version.json') asf:
metadata= {
'environment': 'cron', # or 'lambda' or 'sqs''timestamp': time.time(),
'version': json.load(f.read()),
}
kinto_client_metadata.create_record(metadata)
Ideas? Thoughts?
The text was updated successfully, but these errors were encountered:
That would be neat indeed to diagnose data holes or issues on updates...
I like the idea of using an alternate collection. Timestamp should come from the server (instead of time.time() though in order to be able to use them in _since queries etc.
An alternative would be to track the versions that were used at the collection metadata level, to avoid growing the DB size.
Something like (please forgive the bad naming...):
And then you can obtain records /v1/buckets/build-hub/collections/releases?min_last_modified={a}&max_last_modified={b} with a= timestamp-by-versions[N] and b = timestamp-by-versions[N+1]
In order to maintain that list, you could compare the current version with the latest known one and do something like:
One thing we discovered in the https://bugzilla.mozilla.org/show_bug.cgi?id=1456244 is the obvious problem that since Buildhub isn't a web server, it's really hard to find out; "What version of Buildhub do we use?" to which the counter-question is "Do you mean the scraper or the Lambda?"
The information is useful when reconciling the state of deployments. At the moment, you either trust that...
Another option is to instead inject an extra piece of information with each HTTP POST/PUT to Kinto that we don't pass along to kinto-elasticsearch.
For example:
Instead of:
We do:
Then you can look up what environment/tool/version wrote the latest record from https://buildhub.prod.mozaws.net/v1/buckets/build-hub/collections/releases/records?_limit=3
_buildhub_metadata
so it's never confused with any of the data coming in from thatbuildhub.json
whence it's ready.version.json
stuff in the Lambda code? One way would be to generate the file into thebuildhub
python package as package data. E.g.from buildhub import version; print(version.get_data())
Another option is to write this information to another collection in the same kinto. E.g. Instead of
we do:
Ideas? Thoughts?
The text was updated successfully, but these errors were encountered: