Closed
Bug 966152
Opened 12 years ago
Closed 12 years ago
Create two S3 buckets and make them available from build slaves
Categories
(Release Engineering :: General, defect)
Release Engineering
General
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: glandium, Assigned: rail)
References
Details
Now that the test phase is over, to deploy shared cache on S3, we need to setup two buckets, one in each region (use1, usw2). Note this means that if we ever deploy build infrastructure on another region, that will need to be part of the deal.
On those buckets, there needs to be a bucket policy to make objects public readable (makes download faster than requiring authentication). The bucket policy i've been using during testing was the following (replace {bucket_name} with the relevant name):
{
"Version": "2008-10-17",
"Statement": [
{
"Sid": "AllowPublicRead",
"Effect": "Allow",
"Principal": {
"AWS": "*"
},
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::{bucket_name}/*"
}
]
}
We should also set an expiration on all objects in the bucket. I suggest 15 days from creation start.
We also need an IAM policy for the build slaves:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowPut",
"Effect": "Allow",
"Action": [
"s3:GetObject",
"s3:PutObject"
],
"Resource": [
"arn:aws:s3:::{bucket_name}/*"
]
}
]
}
| Reporter | ||
Comment 1•12 years ago
|
||
According to the last comments in bug 966301, try spot instances have an IAM role now. Can we go ahead with the buckets so that we can at least test on try?
| Assignee | ||
Updated•12 years ago
|
Assignee: nobody → rail
| Assignee | ||
Comment 2•12 years ago
|
||
I suggest to create separate buckets for production and try pools. We use separate pools of machines for try and other branches to address security concerns. The same may apply to S3 cache.
| Assignee | ||
Comment 3•12 years ago
|
||
I created 4 buckets:
Production:
mozilla-releng-s3-cache-us-east-1-prod
mozilla-releng-s3-cache-us-west-2-prod
Try:
mozilla-releng-s3-cache-us-east-1-try
mozilla-releng-s3-cache-us-west-2-try
All 4 have a life cycle rule deleting objects older than 15 days.
I attached a read-only policy to these buckets.
In IAM, I created the following role policies:
try-linux64: can read/write to both *try* buckets (to avoid region specific role policies)
dev-linux64: can read/write to both *try* buckets
bld-linux64: can read/write to both *prod* buckets
ATM, the roles are available only for spot instances (on-demand instances still to be recreated).
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
| Reporter | ||
Comment 4•12 years ago
|
||
I'm getting 403 errors on HTTP GET on try. I guess this is a bucket policy problem.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
| Reporter | ||
Comment 5•12 years ago
|
||
This was e.g. from try-linux64-spot-355 to mozilla-releng-s3-cache-us-west-2-try
| Reporter | ||
Comment 6•12 years ago
|
||
(Note that PUT did work properly afaict)
| Assignee | ||
Comment 7•12 years ago
|
||
Hmm, this is weird...
The S3 policy looks like this:
{
"Version": "2008-10-17",
"Statement": [
{
"Sid": "AllowPublicRead",
"Effect": "Allow",
"Principal": {
"AWS": "*"
},
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::mozilla-releng-s3-cache-us-east-1-try/*"
}
]
}
I can see a lot of objects created under this bucket, which means that PutObject works as expected.
Investigating...
| Assignee | ||
Comment 8•12 years ago
|
||
The corresponding role policy looks like this:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowPut",
"Effect": "Allow",
"Action": [
"s3:GetObject",
"s3:PutObject"
],
"Resource": [
"arn:aws:s3:::mozilla-releng-s3-cache-us-west-2-try/*"
]
}
]
}
BTW, I think we will also need to add permission to get/put objects for inhouse slaves as well (by IP?).
| Reporter | ||
Comment 9•12 years ago
|
||
(In reply to Rail Aliiev [:rail] from comment #8)
> BTW, I think we will also need to add permission to get/put objects for
> inhouse slaves as well (by IP?).
We're not going touse S3 for inhouse slaves. Too much latency.
| Reporter | ||
Comment 10•12 years ago
|
||
So it turns out S3 returns 403 for missing objects. I had broken exception handling in my test and instead of gracefully falling back to compiling when there was a cache miss, it was throwing. Fixing that made it work properly.
Status: REOPENED → RESOLVED
Closed: 12 years ago → 12 years ago
Resolution: --- → FIXED
Updated•8 years ago
|
Component: General Automation → General
You need to log in
before you can comment on or make changes to this bug.
Description
•