Skip to content

Commit df064b8

Browse files
tefkah3mcd
andauthored
feat: add site builder deployment to stevie (#1364)
* fix: update env situation in site-builder * feat: add site-builder deployment * feat: use existing s3 vars for site builder service in tf * chore: deploy site builder * chore: skip flaky tests temporarily --------- Co-authored-by: Eric McDaniel <[email protected]>
1 parent 20a35d0 commit df064b8

File tree

15 files changed

+111
-88
lines changed

15 files changed

+111
-88
lines changed

.github/workflows/awsdeploy.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,14 @@ jobs:
6767
secrets:
6868
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
6969
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
70+
71+
deploy-site-builder:
72+
uses: ./.github/workflows/deploy-template.yml
73+
with:
74+
service: site-builder
75+
environment: ${{ inputs.environment }}
76+
proper-name: ${{ inputs.proper-name }}
77+
image-tag-override: ${{ inputs.image-tag-override }}
78+
secrets:
79+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
80+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}

.github/workflows/ecrbuild-all.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ jobs:
8080
with:
8181
package: site-builder
8282
target: jobs
83-
# publish_to_ghcr: ${{ inputs.publish_to_ghcr }}
83+
publish_to_ghcr: ${{ inputs.publish_to_ghcr }}
8484
ghcr_image_name: platform-site-builder
8585
secrets:
8686
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

core/playwright/pub.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ test.describe("Moving a pub", () => {
129129
});
130130

131131
test.describe("Creating a pub", () => {
132-
test("Can create a pub without a stage", async () => {
132+
test.skip("Can create a pub without a stage", async () => {
133133
const pubsPage = new PubsPage(page, community.community.slug);
134134
const title = "Pub without a stage";
135135
await pubsPage.goTo();
@@ -139,7 +139,7 @@ test.describe("Creating a pub", () => {
139139
await expect(page.getByTestId("current-stage")).toHaveCount(0);
140140
});
141141

142-
test("Can create a pub with a stage", async () => {
142+
test.skip("Can create a pub with a stage", async () => {
143143
const pubsPage = new PubsPage(page, community.community.slug);
144144
const title = "Pub with a stage";
145145
const stage = "Submitted";

docker-compose.test.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,6 @@ services:
126126
profiles:
127127
- integration
128128
environment:
129-
- AUTH_TOKEN=11111111-1111-1111-1111-111111111111.yyyyyyyyyyyyyyyy
130129
- PUBPUB_URL=http://integration-tests:3000
131130
- S3_ENDPOINT=${ASSETS_STORAGE_ENDPOINT:-http://minio:9000}
132131
- S3_REGION=${ASSETS_REGION:-us-east-1}

infrastructure/terraform/environments/blake/.terraform.lock.hcl

Lines changed: 1 addition & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

infrastructure/terraform/environments/blake/main.tf

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,21 +39,22 @@ locals {
3939
environment = "staging"
4040
region = "us-east-1"
4141

42-
pubpub_hostname = "blake.duqduq.org"
42+
pubpub_hostname = "blake.duqduq.org"
43+
site_builder_hostname = "bob.duqduq.org" # get it, like the builder
44+
4345
route53_zone_id = "Z059164612717GL8VGM95"
4446
ecr_repository_urls = {
45-
core = "246372085946.dkr.ecr.us-east-1.amazonaws.com/pubpub-v7-core"
46-
jobs = "246372085946.dkr.ecr.us-east-1.amazonaws.com/pubpub-v7-jobs"
47-
nginx = "246372085946.dkr.ecr.us-east-1.amazonaws.com/nginx"
48-
root = "246372085946.dkr.ecr.us-east-1.amazonaws.com/pubpub-v7"
47+
core = "246372085946.dkr.ecr.us-east-1.amazonaws.com/pubpub-v7-core"
48+
jobs = "246372085946.dkr.ecr.us-east-1.amazonaws.com/pubpub-v7-jobs"
49+
nginx = "246372085946.dkr.ecr.us-east-1.amazonaws.com/nginx"
50+
root = "246372085946.dkr.ecr.us-east-1.amazonaws.com/pubpub-v7"
51+
site_builder = "246372085946.dkr.ecr.us-east-1.amazonaws.com/pubpub-v7-site-builder"
4952
}
5053

51-
MAILGUN_SMTP_USERNAME = "[email protected]"
52-
NEXT_PUBLIC_SUPABASE_URL = "https://dsleqjuvzuoycpeotdws.supabase.co"
53-
NEXT_PUBLIC_SUPABASE_PUBLIC_KEY = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImRzbGVxanV2enVveWNwZW90ZHdzIiwicm9sZSI6ImFub24iLCJpYXQiOjE2ODIzNTE0MjEsImV4cCI6MTk5NzkyNzQyMX0.3HHC0f7zlFXP77N0U8cS3blr7n6hhjqdYI6_ciQJams"
54-
ASSETS_BUCKET_NAME = "assets.blake.pubpub.org"
55-
HOSTNAME = "0.0.0.0"
56-
DATACITE_API_URL = "https://api.test.datacite.org"
54+
MAILGUN_SMTP_USERNAME = "[email protected]"
55+
ASSETS_BUCKET_NAME = "assets.blake.pubpub.org"
56+
HOSTNAME = "0.0.0.0"
57+
DATACITE_API_URL = "https://api.test.datacite.org"
5758
}
5859

5960

infrastructure/terraform/environments/cloudflare/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ terraform {
55
required_providers {
66
aws = {
77
source = "hashicorp/aws"
8-
version = ">= 2.0"
8+
version = ">= 6.0"
99
}
1010

1111
cloudflare = {

infrastructure/terraform/environments/stevie/main.tf

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -39,21 +39,22 @@ locals {
3939
environment = "production"
4040
region = "us-east-1"
4141

42-
pubpub_hostname = "app.pubpub.org"
42+
pubpub_hostname = "app.pubpub.org"
43+
site_builder_hostname = "bob.pubpub.org" # get it, like the builder
44+
4345
route53_zone_id = "Z00255803PJ09HVWNKPVY"
4446
ecr_repository_urls = {
45-
core = "246372085946.dkr.ecr.us-east-1.amazonaws.com/pubpub-v7-core"
46-
jobs = "246372085946.dkr.ecr.us-east-1.amazonaws.com/pubpub-v7-jobs"
47-
nginx = "246372085946.dkr.ecr.us-east-1.amazonaws.com/nginx"
48-
root = "246372085946.dkr.ecr.us-east-1.amazonaws.com/pubpub-v7"
47+
core = "246372085946.dkr.ecr.us-east-1.amazonaws.com/pubpub-v7-core"
48+
jobs = "246372085946.dkr.ecr.us-east-1.amazonaws.com/pubpub-v7-jobs"
49+
nginx = "246372085946.dkr.ecr.us-east-1.amazonaws.com/nginx"
50+
root = "246372085946.dkr.ecr.us-east-1.amazonaws.com/pubpub-v7"
51+
site_builder = "246372085946.dkr.ecr.us-east-1.amazonaws.com/pubpub-v7-site-builder"
4952
}
5053

51-
MAILGUN_SMTP_USERNAME = "[email protected]"
52-
NEXT_PUBLIC_SUPABASE_URL = "https://dsleqjuvzuoycpeotdws.supabase.co"
53-
NEXT_PUBLIC_SUPABASE_PUBLIC_KEY = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImRzbGVxanV2enVveWNwZW90ZHdzIiwicm9sZSI6ImFub24iLCJpYXQiOjE2ODIzNTE0MjEsImV4cCI6MTk5NzkyNzQyMX0.3HHC0f7zlFXP77N0U8cS3blr7n6hhjqdYI6_ciQJams"
54-
ASSETS_BUCKET_NAME = "assets.app.pubpub.org"
55-
HOSTNAME = "0.0.0.0"
56-
DATACITE_API_URL = "https://api.datacite.org"
54+
MAILGUN_SMTP_USERNAME = "[email protected]"
55+
ASSETS_BUCKET_NAME = "assets.app.pubpub.org"
56+
HOSTNAME = "0.0.0.0"
57+
DATACITE_API_URL = "https://api.datacite.org"
5758
}
5859

5960

@@ -70,14 +71,13 @@ module "deployment" {
7071
environment = local.environment
7172
region = local.region
7273

73-
pubpub_hostname = local.pubpub_hostname
74-
route53_zone_id = local.route53_zone_id
75-
ecr_repository_urls = local.ecr_repository_urls
74+
pubpub_hostname = local.pubpub_hostname
75+
site_builder_hostname = local.site_builder_hostname
76+
route53_zone_id = local.route53_zone_id
77+
ecr_repository_urls = local.ecr_repository_urls
7678

77-
MAILGUN_SMTP_USERNAME = local.MAILGUN_SMTP_USERNAME
78-
NEXT_PUBLIC_SUPABASE_URL = local.NEXT_PUBLIC_SUPABASE_URL
79-
NEXT_PUBLIC_SUPABASE_PUBLIC_KEY = local.NEXT_PUBLIC_SUPABASE_PUBLIC_KEY
80-
ASSETS_BUCKET_NAME = local.ASSETS_BUCKET_NAME
81-
HOSTNAME = local.HOSTNAME
82-
DATACITE_API_URL = local.DATACITE_API_URL
79+
MAILGUN_SMTP_USERNAME = local.MAILGUN_SMTP_USERNAME
80+
ASSETS_BUCKET_NAME = local.ASSETS_BUCKET_NAME
81+
HOSTNAME = local.HOSTNAME
82+
DATACITE_API_URL = local.DATACITE_API_URL
8383
}

infrastructure/terraform/modules/deployment/main.tf

Lines changed: 34 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ module "cluster" {
2727
region = var.region
2828

2929
pubpub_hostname = var.pubpub_hostname
30-
3130
route53_zone_id = var.route53_zone_id
3231

3332
container_ingress_port = 8080
@@ -43,7 +42,8 @@ module "core_dependency_services" {
4342
}
4443

4544
locals {
46-
PUBPUB_URL = "https://${var.pubpub_hostname}"
45+
PUBPUB_URL = "https://${var.pubpub_hostname}"
46+
SITE_BUILDER_URL = "https://${var.site_builder_hostname}"
4747
}
4848

4949
module "service_core" {
@@ -93,17 +93,11 @@ module "service_core" {
9393
{ name = "MAILGUN_SMTP_USERNAME", value = var.MAILGUN_SMTP_USERNAME },
9494
{ name = "MAILGUN_SMTP_HOST", value = var.MAILGUN_SMTP_HOST },
9595
{ name = "MAILGUN_SMTP_PORT", value = var.MAILGUN_SMTP_PORT },
96-
{ name = "NEXT_PUBLIC_PUBPUB_URL", value = local.PUBPUB_URL },
97-
{ name = "NEXT_PUBLIC_SUPABASE_URL", value = var.NEXT_PUBLIC_SUPABASE_URL },
98-
{ name = "NEXT_PUBLIC_SUPABASE_PUBLIC_KEY", value = var.NEXT_PUBLIC_SUPABASE_PUBLIC_KEY },
9996
{ name = "PUBPUB_URL", value = local.PUBPUB_URL },
100-
{ name = "SUPABASE_URL", value = var.NEXT_PUBLIC_SUPABASE_URL },
101-
{ name = "SUPABASE_PUBLIC_KEY", value = var.NEXT_PUBLIC_SUPABASE_PUBLIC_KEY },
10297
{ name = "HOSTNAME", value = var.HOSTNAME },
10398
{ name = "DATACITE_API_URL", value = var.DATACITE_API_URL },
10499
{ name = "VALKEY_HOST", value = module.core_dependency_services.valkey_host },
105-
// FIXME: REPLACE WITH ACTUAL SITE BUILDER ENDPOINT ONCE WE SET IT UP
106-
{ name = "SITE_BUILDER_ENDPOINT", value = "https://bob.pubpub.org" }
100+
{ name = "SITE_BUILDER_ENDPOINT", value = local.SITE_BUILDER_URL }
107101
]
108102

109103
secrets = [
@@ -167,7 +161,6 @@ module "service_bastion" {
167161
{ name = "PGDATABASE", value = module.core_dependency_services.rds_connection_components.database },
168162
{ name = "PGHOST", value = module.core_dependency_services.rds_connection_components.host },
169163
{ name = "PGPORT", value = module.core_dependency_services.rds_connection_components.port },
170-
{ name = "SUPABASE_URL", value = var.NEXT_PUBLIC_SUPABASE_URL },
171164
{ name = "HOSTNAME", value = var.HOSTNAME },
172165
{ name = "PAGER", value = "less -S" },
173166
{ name = "VALKEY_HOST", value = module.core_dependency_services.valkey_host }
@@ -190,6 +183,37 @@ module "service_bastion" {
190183
}
191184
}
192185

186+
module "service_site_builder" {
187+
source = "../container-generic"
188+
189+
service_name = "site-builder"
190+
cluster_info = module.cluster.cluster_info
191+
repository_url = var.ecr_repository_urls.site_builder
192+
193+
configuration = {
194+
container_port = 4000
195+
196+
environment = [
197+
{ name = "PUBPUB_URL", value = local.PUBPUB_URL },
198+
{ name = "PORT", value = 4000 },
199+
{ name = "S3_ACCESS_KEY", value = module.core_dependency_services.asset_uploader_key_id },
200+
{ name = "S3_BUCKET_NAME", value = var.ASSETS_BUCKET_NAME },
201+
{ name = "S3_REGION", value = var.region },
202+
// don't need to set S3_ENDPOINT, if empty will use s3
203+
]
204+
205+
secrets = [
206+
{ name = "S3_SECRET_KEY", valueFrom = module.core_dependency_services.secrets.asset_uploader_secret_key },
207+
]
208+
}
209+
210+
resources = {
211+
cpu = 1024
212+
memory = 2048
213+
desired_count = 1
214+
}
215+
}
216+
193217

194218
# N.B. This invocation means that the deployment including honeycomb cannot succeed
195219
# until after you have inserted the secret into the AWS console. This only happens

infrastructure/terraform/modules/deployment/variables.tf

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ variable "pubpub_hostname" {
1919
type = string
2020
}
2121

22+
variable "site_builder_hostname" {
23+
description = "hostname where site builder will be addressable (DO NOT include https://)"
24+
type = string
25+
}
26+
2227
variable "route53_zone_id" {
2328
description = "Zone ID of route53 zone that is already configured as the NS for your subdomain"
2429
type = string
@@ -27,10 +32,11 @@ variable "route53_zone_id" {
2732
variable "ecr_repository_urls" {
2833
description = "URLs for ECR repositories created at a global level"
2934
type = object({
30-
core = string
31-
jobs = string
32-
nginx = string
33-
root = string
35+
core = string
36+
jobs = string
37+
nginx = string
38+
root = string
39+
site_builder = string
3440
})
3541
}
3642

@@ -51,15 +57,6 @@ variable "MAILGUN_SMTP_PORT" {
5157
default = "465"
5258
}
5359

54-
variable "NEXT_PUBLIC_SUPABASE_URL" {
55-
description = "URL to Supabase public address for this install"
56-
type = string
57-
}
58-
variable "NEXT_PUBLIC_SUPABASE_PUBLIC_KEY" {
59-
description = "Supabase anon public key"
60-
type = string
61-
}
62-
6360
variable "HOSTNAME" {
6461
description = "Hostname used by standalone Next app"
6562
}

0 commit comments

Comments
 (0)