-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate training into celery and upload results to s3 (#1157)
* upload train results to s3, add endpoint to get train results, frontend request from endpoint :art: Auto-generated directory tree for repository in Architecture.md :art: Format Python code with psf/black slight reformatting add refetch reduce duplicated code * resolve comments :art: Auto-generated directory tree for repository in Architecture.md * :art: Format Python code with psf/black * update dockerfiles so that it automatically spins up celery and redis in dev env * call createTrainspace, pass id to train() * modify get_trainspace to return detailedtrainresultsdata * resolve sonarcloud * :art: Format Python code with psf/black * resolve sonarcloud * :art: Auto-generated directory tree for repository in Architecture.md * :art: Format Python code with psf/black * pass tests * fix nits --------- Co-authored-by: andrewpeng02 <[email protected]>
- Loading branch information
1 parent
9cb69e4
commit 54a800c
Showing
47 changed files
with
2,146 additions
and
675 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
resource "aws_s3_bucket" "s3bucket_executions" { | ||
bucket = "dlp-executions" | ||
|
||
tags = { | ||
Name = "Execution data" | ||
} | ||
} | ||
resource "aws_s3_bucket_public_access_block" "access_block_uploads" { | ||
bucket = aws_s3_bucket.s3bucket_executions.id | ||
|
||
block_public_acls = true | ||
block_public_policy = true | ||
ignore_public_acls = true | ||
restrict_public_buckets = true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
resource "aws_sqs_queue" "training_queue" { | ||
name = "training-queue.fifo" | ||
fifo_queue = true | ||
message_retention_seconds = 60*24 | ||
|
||
redrive_policy = jsonencode({ | ||
deadLetterTargetArn = aws_sqs_queue.training_queue_deadletter.arn | ||
maxReceiveCount = 4 | ||
}) | ||
} | ||
|
||
resource "aws_sqs_queue" "training_queue_deadletter" { | ||
name = "training-deadletter-queue" | ||
} | ||
|
||
resource "aws_sqs_queue_redrive_allow_policy" "training_queue_redrive_allow_policy" { | ||
queue_url = aws_sqs_queue.training_queue_deadletter.id | ||
|
||
redrive_allow_policy = jsonencode({ | ||
redrivePermission = "byQueue", | ||
sourceQueueArns = [aws_sqs_queue.training_queue.arn] | ||
}) | ||
} | ||
|
||
output "sqs_queue_url" { | ||
value = aws_sqs_queue.training_queue.url | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.