Skip to content

Commit

Permalink
fix: update default resources for rust ipfs (#177)
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanielc authored May 16, 2024
1 parent 7343c7a commit df36dea
Show file tree
Hide file tree
Showing 15 changed files with 125 additions and 68 deletions.
85 changes: 71 additions & 14 deletions operator/src/network/controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2317,6 +2317,25 @@ mod tests {
"name": "ipfs",
"ports": [
{
@@ -278,14 +240,14 @@
],
"resources": {
"limits": {
- "cpu": "1",
+ "cpu": "250m",
"ephemeral-storage": "1Gi",
- "memory": "1Gi"
+ "memory": "512Mi"
},
"requests": {
- "cpu": "1",
+ "cpu": "250m",
"ephemeral-storage": "1Gi",
- "memory": "1Gi"
+ "memory": "512Mi"
}
},
"volumeMounts": [
@@ -292,6 +254,11 @@
{
"mountPath": "/data/ipfs",
Expand Down Expand Up @@ -2450,17 +2469,17 @@ mod tests {
],
"resources": {
"limits": {
- "cpu": "250m",
- "cpu": "1",
- "ephemeral-storage": "1Gi",
- "memory": "512Mi"
- "memory": "1Gi"
+ "cpu": "4",
+ "ephemeral-storage": "4Gi",
+ "memory": "4Gi"
},
"requests": {
- "cpu": "250m",
- "cpu": "1",
- "ephemeral-storage": "1Gi",
- "memory": "512Mi"
- "memory": "1Gi"
+ "cpu": "4",
+ "ephemeral-storage": "4Gi",
+ "memory": "4Gi"
Expand Down Expand Up @@ -2594,6 +2613,25 @@ mod tests {
"name": "ipfs",
"ports": [
{
@@ -278,14 +240,14 @@
],
"resources": {
"limits": {
- "cpu": "1",
+ "cpu": "250m",
"ephemeral-storage": "1Gi",
- "memory": "1Gi"
+ "memory": "512Mi"
},
"requests": {
- "cpu": "1",
+ "cpu": "250m",
"ephemeral-storage": "1Gi",
- "memory": "1Gi"
+ "memory": "512Mi"
}
},
"volumeMounts": [
@@ -292,6 +254,16 @@
{
"mountPath": "/data/ipfs",
Expand Down Expand Up @@ -2718,17 +2756,17 @@ mod tests {
],
"resources": {
"limits": {
- "cpu": "250m",
- "cpu": "1",
- "ephemeral-storage": "1Gi",
- "memory": "512Mi"
- "memory": "1Gi"
+ "cpu": "4",
+ "ephemeral-storage": "4Gi",
+ "memory": "4Gi"
},
"requests": {
- "cpu": "250m",
- "cpu": "1",
- "ephemeral-storage": "1Gi",
- "memory": "512Mi"
- "memory": "1Gi"
+ "cpu": "4",
+ "ephemeral-storage": "4Gi",
+ "memory": "4Gi"
Expand Down Expand Up @@ -2930,17 +2968,17 @@ mod tests {
],
"resources": {
"limits": {
- "cpu": "250m",
- "cpu": "1",
- "ephemeral-storage": "1Gi",
- "memory": "512Mi"
- "memory": "1Gi"
+ "cpu": "2",
+ "ephemeral-storage": "2Gi",
+ "memory": "2Gi"
},
"requests": {
- "cpu": "250m",
- "cpu": "1",
- "ephemeral-storage": "1Gi",
- "memory": "512Mi"
- "memory": "1Gi"
+ "cpu": "2",
+ "ephemeral-storage": "2Gi",
+ "memory": "2Gi"
Expand Down Expand Up @@ -4086,6 +4124,25 @@ mod tests {
"name": "ipfs",
"ports": [
{
@@ -278,14 +240,14 @@
],
"resources": {
"limits": {
- "cpu": "1",
+ "cpu": "250m",
"ephemeral-storage": "1Gi",
- "memory": "1Gi"
+ "memory": "512Mi"
},
"requests": {
- "cpu": "1",
+ "cpu": "250m",
"ephemeral-storage": "1Gi",
- "memory": "1Gi"
+ "memory": "512Mi"
}
},
"volumeMounts": [
@@ -292,6 +254,11 @@
{
"mountPath": "/data/ipfs",
Expand Down Expand Up @@ -4410,7 +4467,7 @@ mod tests {
],
"resources": {
@@ -288,6 +313,13 @@
"memory": "512Mi"
"memory": "1Gi"
}
},
+ "securityContext": {
Expand Down Expand Up @@ -4462,7 +4519,7 @@ mod tests {
],
"resources": {
@@ -105,6 +114,13 @@
"memory": "512Mi"
"memory": "1Gi"
}
},
+ "securityContext": {
Expand Down
4 changes: 2 additions & 2 deletions operator/src/network/ipfs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ impl Default for RustIpfsConfig {
image: "public.ecr.aws/r5b3e0r5/3box/ceramic-one:latest".to_owned(),
image_pull_policy: "Always".to_owned(),
resource_limits: ResourceLimitsConfig {
cpu: Some(Quantity("250m".to_owned())),
memory: Some(Quantity("512Mi".to_owned())),
cpu: Some(Quantity("1".to_owned())),
memory: Some(Quantity("1Gi".to_owned())),
storage: Quantity("1Gi".to_owned()),
},
storage_class: None,
Expand Down
8 changes: 4 additions & 4 deletions operator/src/network/testdata/ceramic_ss_1
Original file line number Diff line number Diff line change
Expand Up @@ -278,14 +278,14 @@ Request {
],
"resources": {
"limits": {
"cpu": "250m",
"cpu": "1",
"ephemeral-storage": "1Gi",
"memory": "512Mi"
"memory": "1Gi"
},
"requests": {
"cpu": "250m",
"cpu": "1",
"ephemeral-storage": "1Gi",
"memory": "512Mi"
"memory": "1Gi"
}
},
"volumeMounts": [
Expand Down
8 changes: 4 additions & 4 deletions operator/src/network/testdata/ceramic_ss_weighted_0
Original file line number Diff line number Diff line change
Expand Up @@ -278,14 +278,14 @@ Request {
],
"resources": {
"limits": {
"cpu": "250m",
"cpu": "1",
"ephemeral-storage": "1Gi",
"memory": "512Mi"
"memory": "1Gi"
},
"requests": {
"cpu": "250m",
"cpu": "1",
"ephemeral-storage": "1Gi",
"memory": "512Mi"
"memory": "1Gi"
}
},
"volumeMounts": [
Expand Down
8 changes: 4 additions & 4 deletions operator/src/network/testdata/ceramic_ss_weighted_1
Original file line number Diff line number Diff line change
Expand Up @@ -278,14 +278,14 @@ Request {
],
"resources": {
"limits": {
"cpu": "250m",
"cpu": "1",
"ephemeral-storage": "1Gi",
"memory": "512Mi"
"memory": "1Gi"
},
"requests": {
"cpu": "250m",
"cpu": "1",
"ephemeral-storage": "1Gi",
"memory": "512Mi"
"memory": "1Gi"
}
},
"volumeMounts": [
Expand Down
8 changes: 4 additions & 4 deletions operator/src/network/testdata/ceramic_ss_weighted_2
Original file line number Diff line number Diff line change
Expand Up @@ -278,14 +278,14 @@ Request {
],
"resources": {
"limits": {
"cpu": "250m",
"cpu": "1",
"ephemeral-storage": "1Gi",
"memory": "512Mi"
"memory": "1Gi"
},
"requests": {
"cpu": "250m",
"cpu": "1",
"ephemeral-storage": "1Gi",
"memory": "512Mi"
"memory": "1Gi"
}
},
"volumeMounts": [
Expand Down
8 changes: 4 additions & 4 deletions operator/src/network/testdata/ceramic_ss_weighted_3
Original file line number Diff line number Diff line change
Expand Up @@ -278,14 +278,14 @@ Request {
],
"resources": {
"limits": {
"cpu": "250m",
"cpu": "1",
"ephemeral-storage": "1Gi",
"memory": "512Mi"
"memory": "1Gi"
},
"requests": {
"cpu": "250m",
"cpu": "1",
"ephemeral-storage": "1Gi",
"memory": "512Mi"
"memory": "1Gi"
}
},
"volumeMounts": [
Expand Down
8 changes: 4 additions & 4 deletions operator/src/network/testdata/ceramic_ss_weighted_4
Original file line number Diff line number Diff line change
Expand Up @@ -278,14 +278,14 @@ Request {
],
"resources": {
"limits": {
"cpu": "250m",
"cpu": "1",
"ephemeral-storage": "1Gi",
"memory": "512Mi"
"memory": "1Gi"
},
"requests": {
"cpu": "250m",
"cpu": "1",
"ephemeral-storage": "1Gi",
"memory": "512Mi"
"memory": "1Gi"
}
},
"volumeMounts": [
Expand Down
8 changes: 4 additions & 4 deletions operator/src/network/testdata/ceramic_ss_weighted_5
Original file line number Diff line number Diff line change
Expand Up @@ -278,14 +278,14 @@ Request {
],
"resources": {
"limits": {
"cpu": "250m",
"cpu": "1",
"ephemeral-storage": "1Gi",
"memory": "512Mi"
"memory": "1Gi"
},
"requests": {
"cpu": "250m",
"cpu": "1",
"ephemeral-storage": "1Gi",
"memory": "512Mi"
"memory": "1Gi"
}
},
"volumeMounts": [
Expand Down
8 changes: 4 additions & 4 deletions operator/src/network/testdata/ceramic_ss_weighted_6
Original file line number Diff line number Diff line change
Expand Up @@ -278,14 +278,14 @@ Request {
],
"resources": {
"limits": {
"cpu": "250m",
"cpu": "1",
"ephemeral-storage": "1Gi",
"memory": "512Mi"
"memory": "1Gi"
},
"requests": {
"cpu": "250m",
"cpu": "1",
"ephemeral-storage": "1Gi",
"memory": "512Mi"
"memory": "1Gi"
}
},
"volumeMounts": [
Expand Down
8 changes: 4 additions & 4 deletions operator/src/network/testdata/ceramic_ss_weighted_7
Original file line number Diff line number Diff line change
Expand Up @@ -278,14 +278,14 @@ Request {
],
"resources": {
"limits": {
"cpu": "250m",
"cpu": "1",
"ephemeral-storage": "1Gi",
"memory": "512Mi"
"memory": "1Gi"
},
"requests": {
"cpu": "250m",
"cpu": "1",
"ephemeral-storage": "1Gi",
"memory": "512Mi"
"memory": "1Gi"
}
},
"volumeMounts": [
Expand Down
8 changes: 4 additions & 4 deletions operator/src/network/testdata/ceramic_ss_weighted_8
Original file line number Diff line number Diff line change
Expand Up @@ -278,14 +278,14 @@ Request {
],
"resources": {
"limits": {
"cpu": "250m",
"cpu": "1",
"ephemeral-storage": "1Gi",
"memory": "512Mi"
"memory": "1Gi"
},
"requests": {
"cpu": "250m",
"cpu": "1",
"ephemeral-storage": "1Gi",
"memory": "512Mi"
"memory": "1Gi"
}
},
"volumeMounts": [
Expand Down
8 changes: 4 additions & 4 deletions operator/src/network/testdata/ceramic_ss_weighted_9
Original file line number Diff line number Diff line change
Expand Up @@ -278,14 +278,14 @@ Request {
],
"resources": {
"limits": {
"cpu": "250m",
"cpu": "1",
"ephemeral-storage": "1Gi",
"memory": "512Mi"
"memory": "1Gi"
},
"requests": {
"cpu": "250m",
"cpu": "1",
"ephemeral-storage": "1Gi",
"memory": "512Mi"
"memory": "1Gi"
}
},
"volumeMounts": [
Expand Down
Loading

0 comments on commit df36dea

Please sign in to comment.