From 81362e5bc439f901c00254bce5968543046da020 Mon Sep 17 00:00:00 2001
From: Jatin Sanghvi <20547963+JatinSanghvi@users.noreply.github.com>
Date: Fri, 22 Nov 2024 19:42:26 +0530
Subject: [PATCH] Target all projects to .NET 8
Signed-off-by: Jatin Sanghvi <20547963+JatinSanghvi@users.noreply.github.com>
---
.github/workflows/main-build.yml | 2 +-
.github/workflows/pr-build.yml | 2 +-
.github/workflows/release-build.yml | 2 +-
.vscode/launch.json | 2 +-
src/Scaler.Demo/OrderGenerator/Dockerfile | 4 ++--
...CosmosDb.Scaler.Demo.OrderGenerator.csproj | 8 +++----
src/Scaler.Demo/OrderProcessor/Dockerfile | 4 ++--
...CosmosDb.Scaler.Demo.OrderProcessor.csproj | 8 +++----
src/Scaler.Demo/README.md | 24 +++++++++++++++++++
.../Keda.CosmosDb.Scaler.Demo.Shared.csproj | 6 ++---
.../Keda.CosmosDb.Scaler.Tests.csproj | 6 ++---
src/Scaler/Dockerfile | 4 ++--
src/Scaler/Keda.CosmosDb.Scaler.csproj | 8 +++----
13 files changed, 52 insertions(+), 28 deletions(-)
diff --git a/.github/workflows/main-build.yml b/.github/workflows/main-build.yml
index 1ac0f25..8037ed3 100644
--- a/.github/workflows/main-build.yml
+++ b/.github/workflows/main-build.yml
@@ -23,7 +23,7 @@ jobs:
- name: Setup dotnet environment
uses: actions/setup-dotnet@v4
with:
- dotnet-version: 6
+ dotnet-version: 8
- name: Install dependencies
run: dotnet restore src
diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml
index e7b0c2e..a76dab5 100644
--- a/.github/workflows/pr-build.yml
+++ b/.github/workflows/pr-build.yml
@@ -23,7 +23,7 @@ jobs:
- name: Setup dotnet environment
uses: actions/setup-dotnet@v4
with:
- dotnet-version: 6
+ dotnet-version: 8
- name: Install dependencies
run: dotnet restore src
diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml
index 85efc3f..ba4a092 100644
--- a/.github/workflows/release-build.yml
+++ b/.github/workflows/release-build.yml
@@ -22,7 +22,7 @@ jobs:
- name: Setup dotnet environment
uses: actions/setup-dotnet@v4
with:
- dotnet-version: 6
+ dotnet-version: 8
- name: Install dependencies
run: dotnet restore src
diff --git a/.vscode/launch.json b/.vscode/launch.json
index 1da3396..ee97dc5 100644
--- a/.vscode/launch.json
+++ b/.vscode/launch.json
@@ -10,7 +10,7 @@
"request": "launch",
"preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path.
- "program": "${workspaceFolder}/src/Scaler/bin/Debug/net6.0/Keda.CosmosDb.Scaler.dll",
+ "program": "${workspaceFolder}/src/Scaler/bin/Debug/net8.0/Keda.CosmosDb.Scaler.dll",
"args": [],
"cwd": "${workspaceFolder}/src/Scaler",
"stopAtEntry": false,
diff --git a/src/Scaler.Demo/OrderGenerator/Dockerfile b/src/Scaler.Demo/OrderGenerator/Dockerfile
index 250855e..361b62a 100644
--- a/src/Scaler.Demo/OrderGenerator/Dockerfile
+++ b/src/Scaler.Demo/OrderGenerator/Dockerfile
@@ -1,7 +1,7 @@
# https://hub.docker.com/_/microsoft-dotnet
# Restore, build and publish project.
-FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
+FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
WORKDIR /
COPY src/Scaler.Demo/OrderGenerator/ src/Scaler.Demo/OrderGenerator/
COPY src/Scaler.Demo/Shared/ src/Scaler.Demo/Shared/
@@ -10,7 +10,7 @@ WORKDIR /src/Scaler.Demo/OrderGenerator
RUN dotnet publish --configuration Release --output /app
# Stage application.
-FROM mcr.microsoft.com/dotnet/runtime:6.0
+FROM mcr.microsoft.com/dotnet/runtime:8.0
WORKDIR /app
COPY --from=build /app .
ENTRYPOINT ["dotnet", "Keda.CosmosDb.Scaler.Demo.OrderGenerator.dll"]
diff --git a/src/Scaler.Demo/OrderGenerator/Keda.CosmosDb.Scaler.Demo.OrderGenerator.csproj b/src/Scaler.Demo/OrderGenerator/Keda.CosmosDb.Scaler.Demo.OrderGenerator.csproj
index 8c4f466..790707b 100644
--- a/src/Scaler.Demo/OrderGenerator/Keda.CosmosDb.Scaler.Demo.OrderGenerator.csproj
+++ b/src/Scaler.Demo/OrderGenerator/Keda.CosmosDb.Scaler.Demo.OrderGenerator.csproj
@@ -2,13 +2,13 @@
Exe
- net6.0
+ net8.0
-
-
-
+
+
+
diff --git a/src/Scaler.Demo/OrderProcessor/Dockerfile b/src/Scaler.Demo/OrderProcessor/Dockerfile
index 0e8a0d6..de6dc6d 100644
--- a/src/Scaler.Demo/OrderProcessor/Dockerfile
+++ b/src/Scaler.Demo/OrderProcessor/Dockerfile
@@ -1,7 +1,7 @@
# https://hub.docker.com/_/microsoft-dotnet
# Restore, build and publish project.
-FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
+FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
WORKDIR /
COPY src/Scaler.Demo/OrderProcessor/ src/Scaler.Demo/OrderProcessor/
COPY src/Scaler.Demo/Shared/ src/Scaler.Demo/Shared/
@@ -10,7 +10,7 @@ WORKDIR /src/Scaler.Demo/OrderProcessor
RUN dotnet publish --configuration Release --output /app
# Stage application.
-FROM mcr.microsoft.com/dotnet/runtime:6.0
+FROM mcr.microsoft.com/dotnet/runtime:8.0
WORKDIR /app
COPY --from=build /app .
ENTRYPOINT ["dotnet", "Keda.CosmosDb.Scaler.Demo.OrderProcessor.dll"]
diff --git a/src/Scaler.Demo/OrderProcessor/Keda.CosmosDb.Scaler.Demo.OrderProcessor.csproj b/src/Scaler.Demo/OrderProcessor/Keda.CosmosDb.Scaler.Demo.OrderProcessor.csproj
index 11023d0..8a9d250 100644
--- a/src/Scaler.Demo/OrderProcessor/Keda.CosmosDb.Scaler.Demo.OrderProcessor.csproj
+++ b/src/Scaler.Demo/OrderProcessor/Keda.CosmosDb.Scaler.Demo.OrderProcessor.csproj
@@ -1,13 +1,13 @@
- net6.0
+ net8.0
-
-
-
+
+
+
diff --git a/src/Scaler.Demo/README.md b/src/Scaler.Demo/README.md
index 3cbde1e..0bdcd9e 100644
--- a/src/Scaler.Demo/README.md
+++ b/src/Scaler.Demo/README.md
@@ -212,3 +212,27 @@ We will later deploy the order-processor application to Kubernetes cluster and u
2021-09-03 12:57:53 info: Keda.CosmosDb.Scaler.Demo.OrderProcessor.Worker[0]
Processing order ca17597f-7aa2-4b04-abd8-724139b2c370 - 1 unit(s) of Gloves bought by Donny Shanahan
```
+
+## Cleaning sample application from cluster
+
+1. Delete the scaled object and order-processor application.
+
+ ```text
+ # kubectl delete scaledobject cosmosdb-order-processor-scaledobject
+ # kubectl delete deployment cosmosdb-order-processor
+ ```
+
+1. Optionally, delete the external scaler and KEDA from cluster. The following commands assume that KEDA was installed with Helm.
+
+ ```text
+ # kubectl delete service cosmosdb-scaler
+ # kubectl delete deployment cosmosdb-scaler
+ # helm uninstall keda --namespace keda
+ # kubectl delete namespace keda
+ ```
+
+1. The monitored container can be deleted with the below command. The lease container can be deleted on Azure Portal.
+
+ ```text
+ # docker run --env CosmosDbConfig__Connection="" --interactive --rm --tty cosmosdb-order-generator teardown
+ ```
diff --git a/src/Scaler.Demo/Shared/Keda.CosmosDb.Scaler.Demo.Shared.csproj b/src/Scaler.Demo/Shared/Keda.CosmosDb.Scaler.Demo.Shared.csproj
index 0d4135e..e370a29 100644
--- a/src/Scaler.Demo/Shared/Keda.CosmosDb.Scaler.Demo.Shared.csproj
+++ b/src/Scaler.Demo/Shared/Keda.CosmosDb.Scaler.Demo.Shared.csproj
@@ -1,12 +1,12 @@
- net6.0
+ net8.0
-
-
+
+
diff --git a/src/Scaler.Tests/Keda.CosmosDb.Scaler.Tests.csproj b/src/Scaler.Tests/Keda.CosmosDb.Scaler.Tests.csproj
index b35fa38..965f845 100644
--- a/src/Scaler.Tests/Keda.CosmosDb.Scaler.Tests.csproj
+++ b/src/Scaler.Tests/Keda.CosmosDb.Scaler.Tests.csproj
@@ -1,20 +1,20 @@
- net6.0
+ net8.0
false
-
+
runtime; build; native; contentfiles; analyzers; buildtransitive
all
-
+
runtime; build; native; contentfiles; analyzers; buildtransitive
all
diff --git a/src/Scaler/Dockerfile b/src/Scaler/Dockerfile
index 8dc7f6f..1724405 100644
--- a/src/Scaler/Dockerfile
+++ b/src/Scaler/Dockerfile
@@ -1,7 +1,7 @@
# https://hub.docker.com/_/microsoft-dotnet
# Restore, build and publish project.
-FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
+FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
WORKDIR /
COPY src/Scaler/ src/Scaler/
@@ -9,7 +9,7 @@ WORKDIR /src/Scaler
RUN dotnet publish --configuration Release --output /app
# Stage application.
-FROM mcr.microsoft.com/dotnet/aspnet:6.0
+FROM mcr.microsoft.com/dotnet/aspnet:8.0
WORKDIR /app
COPY --from=build /app .
ENTRYPOINT ["dotnet", "Keda.CosmosDb.Scaler.dll"]
diff --git a/src/Scaler/Keda.CosmosDb.Scaler.csproj b/src/Scaler/Keda.CosmosDb.Scaler.csproj
index 5c19585..b8725a2 100644
--- a/src/Scaler/Keda.CosmosDb.Scaler.csproj
+++ b/src/Scaler/Keda.CosmosDb.Scaler.csproj
@@ -1,7 +1,7 @@
- net6.0
+ net8.0
@@ -9,9 +9,9 @@
-
-
-
+
+
+