Skip to content

Commit ce19489

Browse files
committed
New marimo-launcher Container
Why these changes are being introduced: MVP for running marimo notebooks in AWS as on-demand Fargate tasks. This builds the necessary infrastructure for storing the container image. How this addresses that need: * Create the ECR repository and associated resources Side effects of this change: None. Relevant ticket(s): * https://mitlibraries.atlassian.net/browse/IN-1416
1 parent eb0b9e6 commit ce19489

File tree

2 files changed

+76
-1
lines changed

2 files changed

+76
-1
lines changed

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,9 @@ This is a core infrastructure repository that defines infrastructure related to
112112
* [ETD](https://github.com/MITLibraries/mitlib-tf-workloads-etd)
113113
* [HRQB](https://github.com/MITLibraries/mitlib-tf-workloads-hrqb-loader)
114114
* [HRQB Client](https://github.com/MITLibraries/hrqb-client)
115+
* [marimo notebooks](https://github.com/MITLibraries/mitlib-tf-workloads-notebooks)
116+
* [marimo-launcher](https://github.com/MITLibraries/marimo-launcher)
117+
* [marimo-helloworld](https://github.com/MITLibraries/marimo-helloworld)
115118
* [Matomo](https://github.com/MITLibraries/mitlib-tf-workloads-matomo)
116119
* [Matomo Application Container](https://github.com/MITLibraries/docker-matomo)
117120
* [PPOD](https://github.com/MITLibraries/mitlib-tf-workloads-ppod)
@@ -134,7 +137,7 @@ This is a core infrastructure repository that defines infrastructure related to
134137

135138
* Owner: See [CODEOWNERS](./.github/CODEOWNERS)
136139
* Team: See [CODEOWNERS](./.github/CODEOWNERS)
137-
* Last Maintenance: 2025-06
140+
* Last Maintenance: 2025-08
138141

139142
## TF markdown is automatically inserted at the bottom of this file, nothing should be written beyond this point
140143

@@ -168,6 +171,7 @@ This is a core infrastructure repository that defines infrastructure related to
168171
| ecr\_dsc | ./modules/ecr | n/a |
169172
| ecr\_dss | ./modules/ecr | n/a |
170173
| ecr\_hrqb\_client | ./modules/ecr | n/a |
174+
| ecr\_marimo | ./modules/ecr | n/a |
171175
| ecr\_matomo | ./modules/ecr | n/a |
172176
| ecr\_oaiharvester | ./modules/ecr | n/a |
173177
| ecr\_patronload | ./modules/ecr | n/a |
@@ -256,6 +260,10 @@ This is a core infrastructure repository that defines infrastructure related to
256260
| hrqb\_client\_fargate\_makefile | Full contents of the Makefile for the hrqb-client repo (allows devs to push to Dev account only) |
257261
| hrqb\_client\_fargate\_prod\_promote\_workflow | Full contents of the prod-promote.yml for the hrqb-client repo |
258262
| hrqb\_client\_fargate\_stage\_build\_workflow | Full contents of the stage-build.yml for the hrqb-client repo |
263+
| marimo\_fargate\_dev\_build\_workflow | Full contents of the dev-build.yml for the marimo-launcher repo |
264+
| marimo\_fargate\_makefile | Full contents of the Makefile for the marimo-launcher repo (allows devs to push to Dev account only) |
265+
| marimo\_fargate\_prod\_promote\_workflow | Full contents of the prod-promote.yml for the marimo-launcher repo |
266+
| marimo\_fargate\_stage\_build\_workflow | Full contents of the stage-build.yml for the marimo-launcher repo |
259267
| matomo\_fargate\_dev\_build\_workflow | Full contents of the dev-build.yml for the matomo repo |
260268
| matomo\_fargate\_makefile | Full contents of the Makefile for the matomo repo (allows devs to push to Dev account only) |
261269
| matomo\_fargate\_prod\_promote\_workflow | Full contents of the prod-promote.yml for the matomo repo |

marimo_ecr.tf

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
2+
# marimo-launcher containers
3+
# This is a standard ECR for an ECS with a Fargate launch type
4+
locals {
5+
ecr_marimo = "marimo-${var.environment}"
6+
}
7+
module "ecr_marimo" {
8+
source = "./modules/ecr"
9+
repo_name = "marimo-launcher"
10+
login_policy_arn = aws_iam_policy.login.arn
11+
oidc_arn = data.aws_ssm_parameter.oidc_arn.value
12+
environment = var.environment
13+
tfoutput_ssm_path = var.tfoutput_ssm_path
14+
tags = {
15+
app-repo = "marimo-launcher"
16+
}
17+
}
18+
19+
## Outputs to Terraform Cloud for devs ##
20+
21+
## For marimo-launcher application repo and ECR repository
22+
# Outputs in dev
23+
output "marimo_fargate_dev_build_workflow" {
24+
value = var.environment == "prod" || var.environment == "stage" ? null : templatefile("${path.module}/files/dev-build.tpl", {
25+
region = var.aws_region
26+
role = module.ecr_marimo.gha_role
27+
ecr = module.ecr_marimo.repository_name
28+
function = ""
29+
}
30+
)
31+
description = "Full contents of the dev-build.yml for the marimo-launcher repo"
32+
}
33+
output "marimo_fargate_makefile" {
34+
value = var.environment == "prod" || var.environment == "stage" ? null : templatefile("${path.module}/files/makefile.tpl", {
35+
ecr_name = module.ecr_marimo.repository_name
36+
ecr_url = module.ecr_marimo.repository_url
37+
function = ""
38+
}
39+
)
40+
description = "Full contents of the Makefile for the marimo-launcher repo (allows devs to push to Dev account only)"
41+
}
42+
43+
# Outputs in stage
44+
output "marimo_fargate_stage_build_workflow" {
45+
value = var.environment == "prod" || var.environment == "dev" ? null : templatefile("${path.module}/files/stage-build.tpl", {
46+
region = var.aws_region
47+
role = module.ecr_marimo.gha_role
48+
ecr = module.ecr_marimo.repository_name
49+
function = ""
50+
}
51+
)
52+
description = "Full contents of the stage-build.yml for the marimo-launcher repo"
53+
}
54+
55+
# Outputs after promotion to prod
56+
output "marimo_fargate_prod_promote_workflow" {
57+
value = var.environment == "stage" || var.environment == "dev" ? null : templatefile("${path.module}/files/prod-promote.tpl", {
58+
region = var.aws_region
59+
role_stage = "${module.ecr_marimo.repo_name}-gha-stage"
60+
role_prod = "${module.ecr_marimo.repo_name}-gha-prod"
61+
ecr_stage = "${module.ecr_marimo.repo_name}-stage"
62+
ecr_prod = "${module.ecr_marimo.repo_name}-prod"
63+
function = ""
64+
}
65+
)
66+
description = "Full contents of the prod-promote.yml for the marimo-launcher repo"
67+
}

0 commit comments

Comments
 (0)