Skip to content

Commit

Permalink
fix: use different aws region for cas than us-east-1 (#180)
Browse files Browse the repository at this point in the history
  • Loading branch information
smrz2001 authored May 21, 2024
1 parent df36dea commit 7a4b051
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 84 deletions.
29 changes: 2 additions & 27 deletions operator/src/network/cas.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ pub fn cas_stateful_set_spec(
},
EnvVar {
name: "AWS_REGION".to_owned(),
value: Some("us-east-1".to_owned()),
value: Some("us-east-2".to_owned()),
..Default::default()
},
EnvVar {
Expand Down Expand Up @@ -270,11 +270,6 @@ pub fn cas_stateful_set_spec(
value: Some("s3".to_owned()),
..Default::default()
},
EnvVar {
name: "S3_BUCKET_NAME".to_owned(),
value: Some("merkle-car".to_owned()),
..Default::default()
},
EnvVar {
name: "S3_ENDPOINT".to_owned(),
value: Some("http://localstack:4566".to_owned()),
Expand Down Expand Up @@ -363,26 +358,6 @@ pub fn cas_stateful_set_spec(
name: "cas-migrations".to_owned(),
..Default::default()
},
Container {
env: Some(aws_env.clone()),
command: Some(
[
"aws",
"s3api",
"create-bucket",
"--bucket",
"merkle-car",
"--endpoint-url",
"http://localstack:4566",
]
.map(String::from)
.to_vec(),
),
image: Some("amazon/aws-cli".to_owned()),
image_pull_policy: Some("IfNotPresent".to_owned()),
name: "aws-cli".to_owned(),
..Default::default()
},
]),
containers: vec![
Container {
Expand Down Expand Up @@ -868,7 +843,7 @@ pub fn localstack_stateful_set_spec(
}),
spec: Some(PodSpec {
containers: vec![Container {
image: Some("gresau/localstack-persist:2".to_owned()),
image: Some("gresau/localstack-persist:3".to_owned()),
image_pull_policy: Some("IfNotPresent".to_owned()),
name: "localstack".to_owned(),
ports: Some(vec![ContainerPort {
Expand Down
18 changes: 9 additions & 9 deletions operator/src/network/controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2817,7 +2817,7 @@ mod tests {
stub.cas_stateful_set.patch(expect![[r#"
--- original
+++ modified
@@ -134,8 +134,8 @@
@@ -130,8 +130,8 @@
"value": "http://localstack:4566/000000000000/cas-anchor-dev-"
}
],
Expand All @@ -2828,7 +2828,7 @@ mod tests {
"name": "cas-api",
"ports": [
{
@@ -272,8 +272,8 @@
@@ -264,8 +264,8 @@
"value": "false"
}
],
Expand All @@ -2839,7 +2839,7 @@ mod tests {
"name": "cas-worker",
"resources": {
"limits": {
@@ -442,8 +442,8 @@
@@ -434,8 +434,8 @@
"value": "dev"
}
],
Expand All @@ -2848,8 +2848,8 @@ mod tests {
+ "image": "cas/cas:dev",
+ "imagePullPolicy": "Never",
"name": "cas-migrations"
},
{
}
],
"#]]);
let (testctx, api_handle) = Context::test(mock_rpc_client);
let fakeserver = ApiServerVerifier::new(api_handle);
Expand Down Expand Up @@ -2915,7 +2915,7 @@ mod tests {
stub.cas_stateful_set.patch(expect![[r#"
--- original
+++ modified
@@ -144,12 +144,12 @@
@@ -140,12 +140,12 @@
],
"resources": {
"limits": {
Expand All @@ -2930,7 +2930,7 @@ mod tests {
"ephemeral-storage": "1Gi",
"memory": "1Gi"
}
@@ -277,12 +277,12 @@
@@ -269,12 +269,12 @@
"name": "cas-worker",
"resources": {
"limits": {
Expand All @@ -2945,7 +2945,7 @@ mod tests {
"ephemeral-storage": "1Gi",
"memory": "1Gi"
}
@@ -365,12 +365,12 @@
@@ -357,12 +357,12 @@
"name": "cas-scheduler",
"resources": {
"limits": {
Expand Down Expand Up @@ -4352,7 +4352,7 @@ mod tests {
+ },
"containers": [
{
"image": "gresau/localstack-persist:2",
"image": "gresau/localstack-persist:3",
"#]]);

stub.ceramics[0].stateful_set.patch(expect![[r#"
Expand Down
50 changes: 3 additions & 47 deletions operator/src/network/testdata/default_stubs/cas_stateful_set
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Request {
},
{
"name": "AWS_REGION",
"value": "us-east-1"
"value": "us-east-2"
},
{
"name": "AWS_SECRET_ACCESS_KEY",
Expand Down Expand Up @@ -121,10 +121,6 @@ Request {
"name": "NODE_ENV",
"value": "dev"
},
{
"name": "S3_BUCKET_NAME",
"value": "merkle-car"
},
{
"name": "S3_ENDPOINT",
"value": "http://localstack:4566"
Expand Down Expand Up @@ -189,7 +185,7 @@ Request {
},
{
"name": "AWS_REGION",
"value": "us-east-1"
"value": "us-east-2"
},
{
"name": "AWS_ACCESS_KEY_ID",
Expand Down Expand Up @@ -235,10 +231,6 @@ Request {
"name": "MERKLE_CAR_STORAGE_MODE",
"value": "s3"
},
{
"name": "S3_BUCKET_NAME",
"value": "merkle-car"
},
{
"name": "S3_ENDPOINT",
"value": "http://localstack:4566"
Expand Down Expand Up @@ -322,7 +314,7 @@ Request {
},
{
"name": "AWS_REGION",
"value": "us-east-1"
"value": "us-east-2"
},
{
"name": "AWS_ACCESS_KEY_ID",
Expand Down Expand Up @@ -445,42 +437,6 @@ Request {
"image": "ceramicnetwork/ceramic-anchor-service:latest",
"imagePullPolicy": "Always",
"name": "cas-migrations"
},
{
"command": [
"aws",
"s3api",
"create-bucket",
"--bucket",
"merkle-car",
"--endpoint-url",
"http://localstack:4566"
],
"env": [
{
"name": "AWS_ACCOUNT_ID",
"value": "000000000000"
},
{
"name": "AWS_REGION",
"value": "us-east-1"
},
{
"name": "AWS_ACCESS_KEY_ID",
"value": "."
},
{
"name": "AWS_SECRET_ACCESS_KEY",
"value": "."
},
{
"name": "SQS_QUEUE_URL",
"value": "http://localstack:4566/000000000000/cas-anchor-dev-"
}
],
"image": "amazon/aws-cli",
"imagePullPolicy": "IfNotPresent",
"name": "aws-cli"
}
],
"volumes": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Request {
"spec": {
"containers": [
{
"image": "gresau/localstack-persist:2",
"image": "gresau/localstack-persist:3",
"imagePullPolicy": "IfNotPresent",
"name": "localstack",
"ports": [
Expand Down

0 comments on commit 7a4b051

Please sign in to comment.