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

feat: cleanup up artifacts from containers during ingestion #7496

Open
wants to merge 43 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
e079dab
feat: deprecate rds conversion (mark as skipped) (#7406)
nayib-jose-gloria Jan 10, 2025
921aa4a
feat: constant memory dataset DownloadValidate (#7407)
nayib-jose-gloria Jan 10, 2025
d1af140
fix: use dask to speed up cxg conversion and run in constant memory (…
Bento007 Jan 14, 2025
c30b7c1
Merge branch 'refs/heads/main' into feature/schema-5-3
Bento007 Feb 4, 2025
cea2a54
Merge remote-tracking branch 'refs/remotes/origin/main' into feature/…
Bento007 Feb 9, 2025
e0887f0
feat(multiome): add manifest validator and converter (#7426)
Bento007 Feb 10, 2025
07a6435
Merge branch 'main' into feature/schema-5-3
ivirshup Feb 10, 2025
de911dc
feat: PUT for manifest files (#7431)
ivirshup Feb 11, 2025
ffeb5aa
feat(multiome): split validation and add labels into separate SF step…
Bento007 Feb 12, 2025
77d0000
feat: GET for manifest (#7434)
ivirshup Feb 18, 2025
05f7743
feat: Check other endpoints for ATAC artifacts (#7442)
ivirshup Feb 20, 2025
86eb630
chore: Ivirshup/sync main w schema 5.3 (#7454)
ivirshup Feb 24, 2025
5584ea8
feat: support reingestion of a published dataset (#7443)
Bento007 Feb 25, 2025
96ca0fd
feat: add validation for reingesting atac fragment url (#7453)
Bento007 Feb 25, 2025
ced2f7f
Merge branch 'main' into feature/schema-5-3
Bento007 Feb 26, 2025
50128ac
feat: remove submission handler (#7459)
Bento007 Feb 27, 2025
2dacce4
feat: Add DatasetStatus.atac_status and default to skipped (#7466)
Bento007 Feb 27, 2025
e78e750
fix: cleanup processing code and tests (#7467)
Bento007 Feb 27, 2025
93f1ace
fix: visium test in schema 5.3 branch (#7462)
joyceyan Feb 28, 2025
353b271
feat: Add ValidateATAC (#7468)
Bento007 Feb 28, 2025
c34595f
feat: track status of anndata and atac validation (#7469)
Bento007 Feb 28, 2025
1c649ef
feat: update sfn with validate atac (#7458)
Bento007 Feb 28, 2025
a8b2624
feat: append fragment files with -fragment in s3 and public url (#7470)
Bento007 Feb 28, 2025
e5d1698
feat: cleanup fragment files (#7474)
Bento007 Mar 4, 2025
c9f0c7f
feat: ingestion manifest is used during migration (#7476)
Bento007 Mar 4, 2025
11cfa48
Merge branch 'refs/heads/main' into feature/schema-5-3
Bento007 Mar 6, 2025
ad0646d
fix: ingestion error handler (#7478)
Bento007 Mar 6, 2025
7ad1ac3
feat: Change DatasetArtifact.type from enum to String (#7479)
Bento007 Mar 7, 2025
bca5669
fix: add new artifact types to portal API (#7481)
Bento007 Mar 7, 2025
5aaa699
fix: support uploading files from a cellxgene public url (#7484)
Bento007 Mar 11, 2025
398bb07
fix: type hint on DatasetArtifactType + persist using DatasetArtifact…
nayib-jose-gloria Mar 19, 2025
2468d16
update ATAC_SEQ_MANIFEST to point to latest atac.h5ad file; latest fi…
Mar 20, 2025
58f7975
Store all downloaded and generated files in a temporary directory and…
Bento007 Mar 20, 2025
33fb664
fix tests
Bento007 Mar 20, 2025
0e55724
fix tests
Bento007 Mar 20, 2025
6363e93
fix tests
Bento007 Mar 20, 2025
8ea1f38
cleanup data after tests
Bento007 Mar 20, 2025
7529e5d
fix: update rdev db seed to include visium and atac datasets (#7494)
Bento007 Mar 20, 2025
0830b88
undo silly change
Bento007 Mar 20, 2025
172446f
Merge branch 'refs/heads/main' into feature/schema-5-3
Bento007 Mar 21, 2025
8d031b5
Merge remote-tracking branch 'origin/feature/schema-5-3' into feature…
Bento007 Mar 21, 2025
0296ffb
fix: speed up seed test db
Bento007 Mar 21, 2025
12fa68e
Merge branch 'refs/heads/feature/schema-5-3' into tsmith/cleanup-proc…
Bento007 Mar 21, 2025
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
1 change: 0 additions & 1 deletion .github/workflows/build-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ jobs:
- frontend # pushed both the frontend and backend images
- upload_failures
- upload_success
- dataset_submissions
- processing
- wmg_processing
- cellguide_pipeline
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/rdev-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,6 @@ jobs:
if: always()
with:
name: logged-in-test-results
path: frontend/playwright-report/
path: /home/runner/work/single-cell-data-portal/single-cell-data-portal/frontend/playwright-report
retention-days: 30
if-no-files-found: error
4 changes: 0 additions & 4 deletions .happy/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
"backend-wmg",
"cellguide_pipeline",
"processing",
"dataset_submissions",
"upload_failures",
"upload_success",
"wmg_processing"
Expand All @@ -38,9 +37,6 @@
"wmg_processing": {
"profile": "wmg_processing"
},
"dataset_submissions": {
"profile": "dataset_submissions"
},
"upload_failures": {
"profile": "upload_failures"
},
Expand Down
56 changes: 50 additions & 6 deletions .happy/terraform/modules/batch/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ resource aws_batch_job_definition batch_job_def {
container_properties = jsonencode({
"jobRoleArn": "${var.batch_role_arn}",
"image": "${var.image}",
"memory": var.batch_container_memory_limit,
"memory": 8000,
"environment": [
{
"name": "ARTIFACT_BUCKET",
Expand Down Expand Up @@ -42,11 +42,55 @@ resource aws_batch_job_definition batch_job_def {
"value": "${var.frontend_url}"
}
],
"vcpus": 8,
"linuxParameters": {
"maxSwap": 800000,
"swappiness": 60
},
"vcpus": 1,
"logConfiguration": {
"logDriver": "awslogs",
"options": {
"awslogs-group": "${aws_cloudwatch_log_group.cloud_watch_logs_group.id}",
"awslogs-region": "${data.aws_region.current.name}"
}
}
})
}

resource aws_batch_job_definition cxg_job_def {
type = "container"
name = "dp-${var.deployment_stage}-${var.custom_stack_name}-convert"
container_properties = jsonencode({
"jobRoleArn": "${var.batch_role_arn}",
"image": "${var.image}",
"memory": 16000,
"environment": [
{
"name": "ARTIFACT_BUCKET",
"value": "${var.artifact_bucket}"
},
{
"name": "CELLXGENE_BUCKET",
"value": "${var.cellxgene_bucket}"
},
{
"name": "DATASETS_BUCKET",
"value": "${var.datasets_bucket}"
},
{
"name": "DEPLOYMENT_STAGE",
"value": "${var.deployment_stage}"
},
{
"name": "AWS_DEFAULT_REGION",
"value": "${data.aws_region.current.name}"
},
{
"name": "REMOTE_DEV_PREFIX",
"value": "${var.remote_dev_prefix}"
},
{
"name": "FRONTEND_URL",
"value": "${var.frontend_url}"
}
],
"vcpus": 2,
"logConfiguration": {
"logDriver": "awslogs",
"options": {
Expand Down
5 changes: 5 additions & 0 deletions .happy/terraform/modules/batch/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ output batch_job_definition_no_revision {
description = "ARN for the batch job definition"
}

output cxg_job_definition_no_revision {
value = "arn:aws:batch:${data.aws_region.current.name}:${data.aws_caller_identity.current.account_id}:job-definition/${aws_batch_job_definition.cxg_job_def.name}"
description = "ARN for the cxg batch job definition"
}

output batch_job_log_group {
value = aws_cloudwatch_log_group.cloud_watch_logs_group.id
description = "Name of the CloudWatch log group for the batch job"
Expand Down
36 changes: 1 addition & 35 deletions .happy/terraform/modules/ecs-stack/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,7 @@ module upload_error_lambda {
module upload_sfn {
source = "../sfn"
job_definition_arn = module.upload_batch.batch_job_definition_no_revision
cxg_definition_arn = module.upload_batch.cxg_job_definition_no_revision
job_queue_arn = local.job_queue_arn
role_arn = local.sfn_role_arn
custom_stack_name = local.custom_stack_name
Expand All @@ -404,22 +405,6 @@ module upload_sfn {
batch_job_log_group = module.upload_batch.batch_job_log_group
}

module dataset_submissions_lambda {
source = "../lambda"
image = "${local.lambda_dataset_submissions_repo}:${local.image_tag}"
name = "dataset-submissions"
custom_stack_name = local.custom_stack_name
remote_dev_prefix = local.remote_dev_prefix
deployment_stage = local.deployment_stage
artifact_bucket = local.artifact_bucket
cellxgene_bucket = local.cellxgene_bucket
datasets_bucket = local.datasets_bucket
lambda_execution_role = aws_iam_role.dataset_submissions_lambda_service_role.arn
step_function_arn = module.upload_sfn.step_function_arn
subnets = local.subnets
security_groups = local.security_groups
}

module schema_migration {
source = "../schema_migration"
image = "${local.upload_image_repo}:${local.image_tag}"
Expand Down Expand Up @@ -527,22 +512,3 @@ resource "aws_iam_role_policy_attachment" "lambda_step_function_execution_policy
role = aws_iam_role.dataset_submissions_lambda_service_role.name
policy_arn = aws_iam_policy.lambda_step_function_execution_policy.arn
}

resource "aws_lambda_permission" "allow_dataset_submissions_lambda_execution" {
statement_id = "AllowExecutionFromS3Bucket"
action = "lambda:InvokeFunction"
function_name = module.dataset_submissions_lambda.arn
principal = "s3.amazonaws.com"
source_arn = try(local.secret["s3_buckets"]["dataset_submissions"]["arn"], "")
}

resource "aws_s3_bucket_notification" "on_dataset_submissions_object_created" {
bucket = local.dataset_submissions_bucket

lambda_function {
lambda_function_arn = module.dataset_submissions_lambda.arn
events = ["s3:ObjectCreated:*"]
}

depends_on = [aws_lambda_permission.allow_dataset_submissions_lambda_execution]
}
75 changes: 11 additions & 64 deletions .happy/terraform/modules/schema_migration/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,66 +5,13 @@ data aws_caller_identity current {}
locals {
name = "schema-migration"
job_definition_arn = "arn:aws:batch:${data.aws_region.current.name}:${data.aws_caller_identity.current.account_id}:job-definition/dp-${var.deployment_stage}-${var.custom_stack_name}-schema-migration"
swap_job_definition_arn = "${local.job_definition_arn}-swap"
}

resource aws_cloudwatch_log_group batch_cloud_watch_logs_group {
retention_in_days = 365
name = "/dp/${var.deployment_stage}/${var.custom_stack_name}/${local.name}-batch"
}

resource aws_batch_job_definition schema_migrations_swap {
type = "container"
name = "dp-${var.deployment_stage}-${var.custom_stack_name}-${local.name}-swap"
container_properties = jsonencode({
jobRoleArn= var.batch_role_arn,
image= var.image,
environment= [
{
name= "ARTIFACT_BUCKET",
value= var.artifact_bucket
},
{
name= "DEPLOYMENT_STAGE",
value= var.deployment_stage
},
{
name= "AWS_DEFAULT_REGION",
value= data.aws_region.current.name
},
{
name= "REMOTE_DEV_PREFIX",
value= var.remote_dev_prefix
},
{
name= "DATASETS_BUCKET",
value= var.datasets_bucket
},
],
resourceRequirements = [
{
type= "VCPU",
Value="32"
},
{
Type="MEMORY",
Value = "256000"
}
]
linuxParameters= {
maxSwap= 0,
swappiness= 60
},
logConfiguration= {
logDriver= "awslogs",
options= {
awslogs-group= aws_cloudwatch_log_group.batch_cloud_watch_logs_group.id,
awslogs-region= data.aws_region.current.name
}
}
})
}

resource aws_batch_job_definition schema_migrations {
type = "container"
name = "dp-${var.deployment_stage}-${var.custom_stack_name}-${local.name}"
Expand Down Expand Up @@ -94,14 +41,14 @@ resource aws_batch_job_definition schema_migrations {
},
],
resourceRequirements = [
{
type= "VCPU",
Value="2"
},
{
Type="MEMORY",
Value = "2048"
}
{
type= "VCPU",
Value="1"
},
{
Type="MEMORY",
Value = "8000"
}
]
logConfiguration= {
logDriver= "awslogs",
Expand Down Expand Up @@ -385,7 +332,7 @@ resource aws_sfn_state_machine sfn_schema_migration {
"Type": "Task",
"Resource": "arn:aws:states:::batch:submitJob.sync",
"Parameters": {
"JobDefinition": "${resource.aws_batch_job_definition.schema_migrations_swap.arn}",
"JobDefinition": "${resource.aws_batch_job_definition.schema_migrations.arn}",
"JobName": "dataset_migration",
"JobQueue": "${var.job_queue_arn}",
"Timeout": {
Expand Down Expand Up @@ -458,7 +405,7 @@ resource aws_sfn_state_machine sfn_schema_migration {
"Name.$": "$.result.sfn_name",
"Input": {
"AWS_STEP_FUNCTIONS_STARTED_BY_EXECUTION_ID.$": "$$.Execution.Id",
"url.$": "$.result.uri",
"manifest.$": "$.result.manifest",
"dataset_version_id.$": "$.result.dataset_version_id",
"collection_version_id.$": "$.result.collection_version_id",
"job_queue": "${var.job_queue_arn}"
Expand Down Expand Up @@ -518,7 +465,7 @@ resource aws_sfn_state_machine sfn_schema_migration {
"Key.$": "$.key_name"
}
},
"MaxConcurrency": 10,
"MaxConcurrency": 30,
"Next": "report",
"Catch": [
{
Expand Down
Loading
Loading