Skip to content

Commit

Permalink
Use 1 and 2 as defaults for CPU and memory
Browse files Browse the repository at this point in the history
  • Loading branch information
cnunciato committed Oct 20, 2022
1 parent f63cc3e commit 24d805f
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 26 deletions.
4 changes: 2 additions & 2 deletions container-azure-csharp/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
var appPath = config.Get("appPath") ?? "./app";
var imageName = config.Get("imageName") ?? "my-app";
var containerPort = config.GetInt32("containerPort") ?? 80;
var cpu = Math.Max(config.GetObject<double>("cpu"), 1.0);
var memory = Math.Max(config.GetObject<double>("memory"), 1.5);
var cpu = config.GetInt32("cpu") ?? 1;
var memory = config.GetInt32("memory") ?? 2;

// Create a resource group for the container registry.
var resourceGroup = new AzureNative.Resources.ResourceGroup("resource-group");
Expand Down
8 changes: 4 additions & 4 deletions container-azure-csharp/Pulumi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ template:
description: The port to expose on the container
default: 80
cpu:
description: The CPU limit of the container instance
default: 1.0
description: The number of CPU cores to allocate on the container
default: 1
memory:
description: The memory limit, in GB, of the container instance
default: 1.5
description: The amount of memory, in GB, to allocate on the container
default: 2
8 changes: 4 additions & 4 deletions container-azure-go/Pulumi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ template:
description: The port to expose on the container
default: 80
cpu:
description: The CPU limit of the container instance
default: 1.0
description: The number of CPU cores to allocate on the container
default: 1
memory:
description: The memory limit, in GB, of the container instance
default: 1.5
description: The amount of memory, in GB, to allocate on the container
default: 2
8 changes: 4 additions & 4 deletions container-azure-go/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ func main() {
if param := cfg.GetInt("containerPort"); param != 0 {
containerPort = param
}
cpu := 1.0
if param := cfg.GetFloat64("cpu"); param != 0 {
cpu := 1
if param := cfg.GetInt("cpu"); param != 0 {
cpu = param
}
memory := 1.5
if param := cfg.GetFloat64("memory"); param != 0 {
memory := 2
if param := cfg.GetInt("memory"); param != 0 {
memory = param
}

Expand Down
8 changes: 4 additions & 4 deletions container-azure-python/Pulumi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ template:
description: The port to expose on the container
default: 80
cpu:
description: The CPU limit of the container instance
default: 1.0
description: The number of CPU cores to allocate on the container
default: 1
memory:
description: The memory limit, in GB, of the container instance
default: 1.5
description: The amount of memory, in GB, to allocate on the container
default: 2
4 changes: 2 additions & 2 deletions container-azure-python/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
app_path = config.get("appPath", "./app")
image_name = config.get("imageName", "my-app")
container_port = config.get_int("containerPort", 80)
cpu = config.get_float("cpu", 1.0)
memory = config.get_float("memory", 1.5)
cpu = config.get_int("cpu", 1)
memory = config.get_int("memory", 2)

# Create a resource group for the container registry.
resource_group = resources.ResourceGroup("resource-group")
Expand Down
8 changes: 4 additions & 4 deletions container-azure-typescript/Pulumi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ template:
description: The port to expose on the container
default: 80
cpu:
description: The CPU limit of the container instance
default: 1.0
description: The number of CPU cores to allocate on the container
default: 1
memory:
description: The memory limit, in GB, of the container instance
default: 1.5
description: The amount of memory, in GB, to allocate on the container
default: 2
4 changes: 2 additions & 2 deletions container-azure-typescript/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ const config = new pulumi.Config();
const appPath = config.get("appPath") || "./app";
const imageName = config.get("imageName") || "my-app";
const containerPort = config.getNumber("containerPort") || 80;
const cpu = config.getNumber("cpu") || 1.0;
const memory = config.getNumber("memory") || 1.5;
const cpu = config.getNumber("cpu") || 1;
const memory = config.getNumber("memory") || 2;

// Create a resource group for the container registry.
const resourceGroup = new resources.ResourceGroup("resource-group");
Expand Down

0 comments on commit 24d805f

Please sign in to comment.