Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

slower cleaner run pop #373

Merged
merged 6 commits into from
Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions api/lib/types/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ export default class Run extends Generic {
}
}

const errors = [];
for (let i = 0; i < jobs.length; i++) {
try {
jobs[i] = await Job.generate(pool, {
Expand All @@ -205,8 +206,13 @@ export default class Run extends Generic {

await jobs[i].batch(run.github && run.github.check);
} catch (err) {
// TODO return list of successful ids
throw new Err(500, err, 'jobs only partially queued');
errors.push({
error: err.message,
run: run_id,
source: jobs[i].source,
layer: jobs[i].layer,
name: jobs[i].name
})
}
}

Expand All @@ -220,6 +226,7 @@ export default class Run extends Generic {

return {
run: run_id,
errors: errors,
jobs: jobs.map((job) => {
return job.id;
})
Expand Down
6 changes: 6 additions & 0 deletions api/schema/res.SingleJobsCreate.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@
"run": {
"type": "integer"
},
"errors": {
"type": "array",
"items": {
"type": "object"
}
},
"jobs": {
"type": "array",
"items": {
Expand Down
6 changes: 5 additions & 1 deletion cloudformation/lib/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ export default {
Name: cf.stackName,
Type: 'application',
SecurityGroups: [cf.ref('APIELBSecurityGroup')],
"LoadBalancerAttributes": [{
Key: "idle_timeout.timeout_seconds",
Value: 600
}],
Subnets: [
'subnet-de35c1f5',
'subnet-e67dc7ea',
Expand Down Expand Up @@ -231,7 +235,7 @@ export default {
{ Name: 'ECS_LOG_LEVEL', Value: 'debug' },
{ Name: 'MAPBOX_TOKEN', Value: cf.ref('MapboxToken') },
{ Name: 'OPENCOLLECTIVE_API_KEY', Value: cf.ref('OpenCollective') },
{ Name: 'POSTGRES', Value: cf.join(['postgresql://openaddresses:', cf.ref('DatabasePassword'), '@', cf.getAtt('DBInstanceVPC', 'Endpoint.Address'), ':5432/openaddresses']) },
{ Name: 'POSTGRES', Value: cf.join(['postgresql://openaddresses:', cf.ref('DatabasePassword'), '@', cf.getAtt('DBInstanceVPC', 'Endpoint.Address'), ':5432/openaddresses?sslmode=no-verify']) },
{ Name: 'SharedSecret', Value: cf.sub('{{resolve:secretsmanager:${AWS::StackName}/api/signing-secret:SecretString::AWSCURRENT}}') },
{ Name: 'GithubSecret', Value: cf.ref('GithubSecret') },
{ Name: 'Bucket', Value: cf.ref('Bucket') },
Expand Down
3 changes: 2 additions & 1 deletion cloudformation/lib/db.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ export default {
DBName: 'openaddresses',
DBInstanceIdentifier: cf.stackName,
KmsKeyId: cf.ref('OAKMS'),
EngineVersion: '14.3',
EngineVersion: '16.2',
AllowMajorVersionUpgrade: false,
MasterUsername: 'openaddresses',
MasterUserPassword: cf.ref('DatabasePassword'),
AllocatedStorage: 10,
Expand Down
Loading
Loading