-
Notifications
You must be signed in to change notification settings - Fork 72
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
Add queue to delete site builds older than 180 days #4352
Conversation
Open questions:
|
Going with yes on question 1. |
Going with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks good just a couple of comments.
Also, let's add a Queues
section to OPERATIONS.md with the subsection on this delete older builds job. We need to start documenting more of the platform.
api/workers/index.js
Outdated
@@ -85,6 +87,8 @@ function pagesWorker(connection) { | |||
new QueueWorker(ArchiveBuildLogsQueueName, connection, | |||
path.join(__dirname, 'jobProcessors', 'archiveBuildLogsDaily.js')), | |||
new QueueWorker(BuildTasksQueueName, connection, buildTasksProcessor), | |||
new QueueWorker(DeleteOlderBuildsQueueName, connection, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an older syntax and we hadn't updated the queue worker for ArchiveBuildLogsQueueName
yet. Let's import the processor function and then create a new job function in this file like how we did the buildTasksProcessor
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is done.
appEnv === 'production' | ||
? archiveBuildLogsQueue.add('archiveBuildLogsDaily', {}, nightlyJobConfig) | ||
: Promise.resolve(), | ||
archiveBuildLogsQueue.add('archiveBuildLogsDaily', {}, nightlyJobConfig), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did we create the buckets for log archives in dev and staging and added the bucket service to the app manifest?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only change I have made is this provisional code change. I didn't realize the buckets didn't exist, so that probably has to happen.
But FWIW the bucket service is already parameterized in manifest.yml
as federalist-((env))-s3-build-logs
. Would that not allow for the presence of these dev and staging buckets?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it looks like non of the archive build log jobs were successful in dev so I was flagging as a possible culprit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just checked dev and build logs aren't archiving nightly and builds over 180 days aren't deleting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True. It also looks like the migration on this PR hasn't run:
[...] column Build.deletedAt does not exist
52a3b37
to
352aa12
Compare
@apburnes As of this writing this is back on dev, and |
352aa12
to
440ec49
Compare
This is also done. |
@apburnes, it looks like both |
Closing this, since we cancelled #4336 and are going a different route. |
Resolves #4336
Changes proposed in this pull request:
security considerations
None. The new nightly job will remove build records from the application database for which build logs have already expired and been removed from S3.