From f3e1326b62176a416358940f3ab2502bc4f8eff6 Mon Sep 17 00:00:00 2001 From: Magne Helleborg Date: Tue, 28 May 2024 11:08:18 +0200 Subject: [PATCH 1/3] Added multi-targeting dotnet 7 & 8 for runtime, and dotnet 8 for the CLI. Changed production image to target 8, while development is using dotnet 7 (to simplify MongoDB hosting in the container). --- .github/workflows/benchmarks.yml | 2 +- .github/workflows/integration-tests.yml | 2 +- .github/workflows/release.yml | 22 +++++++++---------- .github/workflows/runtime.yml | 2 +- Docker/Development/Dockerfile | 4 ++-- Docker/Production/Dockerfile | 6 ++--- Source/CLI/CLI.csproj | 2 +- .../Development/MongoDB/Dockerfile | 4 ++-- default.props | 2 +- specs.props | 2 +- tests.props | 3 +-- 11 files changed, 25 insertions(+), 26 deletions(-) diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index b00def840..be60ff8a8 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -25,7 +25,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-dotnet@v1 with: - dotnet-version: "7.0.x" + dotnet-version: "8.0.x" - name: Run Mongo container run: docker run -p 27017:27017 -d dolittle/mongodb:4.2.2 - name: Run Benchmarks diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index ccd04b482..561736216 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -17,7 +17,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-dotnet@v1 with: - dotnet-version: "7.0.x" + dotnet-version: "8.0.x" - name: Run Mongo container run: docker run -p 27017:27017 -d dolittle/mongodb:4.2.2 - name: Test diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ac343a756..24a22d7cc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -70,7 +70,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-dotnet@v1 with: - dotnet-version: "7.0.x" + dotnet-version: "8.0.x" - name: Run Mongo container run: docker run -p 27017:27017 -d dolittle/mongodb:4.2.2 - name: Run Benchmarks @@ -184,7 +184,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-dotnet@v1 with: - dotnet-version: "7.0.x" + dotnet-version: "8.0.x" - name: Update VersionInfo uses: dolittle/update-version-info-action@v1 with: @@ -204,7 +204,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ needs.setup.outputs.release-upload-url }} - asset_path: ./Source/CLI/bin/Release/net7.0/osx-x64/publish/Dolittle.Runtime.CLI + asset_path: ./Source/CLI/bin/Release/net8.0/osx-x64/publish/Dolittle.Runtime.CLI asset_name: dolittle-macos-x64 asset_content_type: application/octet-stream - name: Publish for macOS arm64 @@ -216,7 +216,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ needs.setup.outputs.release-upload-url }} - asset_path: ./Source/CLI/bin/Release/net7.0/osx.11.0-arm64/publish/Dolittle.Runtime.CLI + asset_path: ./Source/CLI/bin/Release/net8.0/osx.11.0-arm64/publish/Dolittle.Runtime.CLI asset_name: dolittle-macos-arm64 asset_content_type: application/octet-stream - name: Publish for Windows x64 @@ -228,7 +228,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ needs.setup.outputs.release-upload-url }} - asset_path: ./Source/CLI/bin/Release/net7.0/win-x64/publish/Dolittle.Runtime.CLI.exe + asset_path: ./Source/CLI/bin/Release/net8.0/win-x64/publish/Dolittle.Runtime.CLI.exe asset_name: dolittle-win-x64.exe asset_content_type: application/octet-stream - name: Publish for Windows x86 @@ -240,7 +240,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ needs.setup.outputs.release-upload-url }} - asset_path: ./Source/CLI/bin/Release/net7.0/win-x86/publish/Dolittle.Runtime.CLI.exe + asset_path: ./Source/CLI/bin/Release/net8.0/win-x86/publish/Dolittle.Runtime.CLI.exe asset_name: dolittle-win-x86.exe asset_content_type: application/octet-stream - name: Publish for Windows arm64 @@ -252,7 +252,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ needs.setup.outputs.release-upload-url }} - asset_path: ./Source/CLI/bin/Release/net7.0/win-arm64/publish/Dolittle.Runtime.CLI.exe + asset_path: ./Source/CLI/bin/Release/net8.0/win-arm64/publish/Dolittle.Runtime.CLI.exe asset_name: dolittle-win-arm64.exe asset_content_type: application/octet-stream - name: Publish for Windows arm @@ -264,7 +264,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ needs.setup.outputs.release-upload-url }} - asset_path: ./Source/CLI/bin/Release/net7.0/win-arm/publish/Dolittle.Runtime.CLI.exe + asset_path: ./Source/CLI/bin/Release/net8.0/win-arm/publish/Dolittle.Runtime.CLI.exe asset_name: dolittle-win-arm.exe asset_content_type: application/octet-stream - name: Publish for Linux x64 @@ -276,7 +276,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ needs.setup.outputs.release-upload-url }} - asset_path: ./Source/CLI/bin/Release/net7.0/linux-x64/publish/Dolittle.Runtime.CLI + asset_path: ./Source/CLI/bin/Release/net8.0/linux-x64/publish/Dolittle.Runtime.CLI asset_name: dolittle-linux-x64 asset_content_type: application/octet-stream - name: Publish for Linux arm64 @@ -288,7 +288,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ needs.setup.outputs.release-upload-url }} - asset_path: ./Source/CLI/bin/Release/net7.0/linux-arm64/publish/Dolittle.Runtime.CLI + asset_path: ./Source/CLI/bin/Release/net8.0/linux-arm64/publish/Dolittle.Runtime.CLI asset_name: dolittle-linux-arm64 asset_content_type: application/octet-stream - name: Publish for Linux arm @@ -300,6 +300,6 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ needs.setup.outputs.release-upload-url }} - asset_path: ./Source/CLI/bin/Release/net7.0/linux-arm/publish/Dolittle.Runtime.CLI + asset_path: ./Source/CLI/bin/Release/net8.0/linux-arm/publish/Dolittle.Runtime.CLI asset_name: dolittle-linux-arm asset_content_type: application/octet-stream diff --git a/.github/workflows/runtime.yml b/.github/workflows/runtime.yml index e3817e65a..9ad3de6a5 100644 --- a/.github/workflows/runtime.yml +++ b/.github/workflows/runtime.yml @@ -14,7 +14,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-dotnet@v1 with: - dotnet-version: "7.0.x" + dotnet-version: "8.0.x" - name: Build run: dotnet build --configuration Release - name: Test diff --git a/Docker/Development/Dockerfile b/Docker/Development/Dockerfile index 8c6ded8ed..736a0b4cd 100644 --- a/Docker/Development/Dockerfile +++ b/Docker/Development/Dockerfile @@ -1,5 +1,5 @@ # DotNet Build -FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:7.0 AS dotnet-build +FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0 AS dotnet-build SHELL ["/bin/bash", "-c"] ARG VERSION ARG TARGETARCH @@ -12,7 +12,7 @@ COPY Specifications /app/Specifications/ WORKDIR /app/Source/Server RUN dotnet restore -RUN dotnet publish -c "Release" -p:Version=${VERSION} -p:RuntimeIdentifier="linux-${TARGETARCH/amd64/x64}" -o out +RUN dotnet publish -c "Release" -p:Version=${VERSION} -f net7.0 -p:RuntimeIdentifier="linux-${TARGETARCH/amd64/x64}" -o out # Runtime Image FROM mcr.microsoft.com/dotnet/aspnet:7.0 diff --git a/Docker/Production/Dockerfile b/Docker/Production/Dockerfile index dbd38b6e3..19e04b0a8 100644 --- a/Docker/Production/Dockerfile +++ b/Docker/Production/Dockerfile @@ -1,5 +1,5 @@ # DotNet Build -FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:7.0 AS dotnet-build +FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0 AS dotnet-build SHELL ["/bin/bash", "-c"] ARG VERSION ARG TARGETARCH @@ -12,10 +12,10 @@ COPY Specifications /app/Specifications/ WORKDIR /app/Source/Server RUN dotnet restore -RUN dotnet publish -c "Release" -p:Version=${VERSION} -p:RuntimeIdentifier="linux-${TARGETARCH/amd64/x64}" -o out +RUN dotnet publish -c "Release" -p:Version=${VERSION} -f net8.0 -p:RuntimeIdentifier="linux-${TARGETARCH/amd64/x64}" -o out # Runtime Image -FROM mcr.microsoft.com/dotnet/aspnet:7.0 +FROM mcr.microsoft.com/dotnet/aspnet:8.0 SHELL ["/bin/bash", "-c"] ENV Logging__Console__FormatterName="" diff --git a/Source/CLI/CLI.csproj b/Source/CLI/CLI.csproj index b718cde1d..e339451f6 100644 --- a/Source/CLI/CLI.csproj +++ b/Source/CLI/CLI.csproj @@ -5,7 +5,7 @@ Dolittle.Runtime.CLI Dolittle.Runtime.CLI Exe - net7.0 + net8.0 latest true dolittle diff --git a/Source/Events.Store.MongoDB/Development/MongoDB/Dockerfile b/Source/Events.Store.MongoDB/Development/MongoDB/Dockerfile index aecb4dae5..04eb19d60 100644 --- a/Source/Events.Store.MongoDB/Development/MongoDB/Dockerfile +++ b/Source/Events.Store.MongoDB/Development/MongoDB/Dockerfile @@ -1,5 +1,5 @@ -FROM mongo:4.2.2-bionic +FROM mongo:7.0.2-bionic COPY replicaset-initiate.js /docker-entrypoint-initdb.d/ -CMD ["mongod", "--replSet", "rs0"] \ No newline at end of file +CMD ["mongod", "--replSet", "rs0"] diff --git a/default.props b/default.props index 876723ef8..c65c26351 100644 --- a/default.props +++ b/default.props @@ -2,7 +2,7 @@ - net7.0 + net7.0;net8.0 true $(NoWarn);SYSLIB1002;SYSLIB1006;SYSLIB1007 enable diff --git a/specs.props b/specs.props index b1ac5759e..e4a21df9a 100644 --- a/specs.props +++ b/specs.props @@ -2,7 +2,7 @@ - net7.0 + net7.0;net8.0 true IDE1006;IDE0044;IDE0051;IDE0052;CA2211;CS0612;CS0169;CS8981;RCS1169;RCS1018;RCS1213 diff --git a/tests.props b/tests.props index c19f173da..a29934a49 100644 --- a/tests.props +++ b/tests.props @@ -2,9 +2,8 @@ - net7.0 + net8.0 true - net7.0 enable enable false From 288cc5de2469c11e81de300c59e037a21a31dd53 Mon Sep 17 00:00:00 2001 From: Magne Helleborg Date: Tue, 28 May 2024 11:25:14 +0200 Subject: [PATCH 2/3] Test with net8 --- .github/workflows/integration-tests.yml | 2 +- .github/workflows/runtime.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 561736216..c048242d9 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -21,4 +21,4 @@ jobs: - name: Run Mongo container run: docker run -p 27017:27017 -d dolittle/mongodb:4.2.2 - name: Test - run: dotnet test --filter Tag=IntegrationTest --configuration Release + run: dotnet test --filter Tag=IntegrationTest -f net8.0 --configuration Release diff --git a/.github/workflows/runtime.yml b/.github/workflows/runtime.yml index 9ad3de6a5..f90329d92 100644 --- a/.github/workflows/runtime.yml +++ b/.github/workflows/runtime.yml @@ -16,9 +16,9 @@ jobs: with: dotnet-version: "8.0.x" - name: Build - run: dotnet build --configuration Release + run: dotnet build --configuration Release -f net8.0 - name: Test - run: dotnet test --filter Tag!=IntegrationTest --no-build --configuration Release --collect:"XPlat Code Coverage" + run: dotnet test --filter Tag!=IntegrationTest --no-build -f net8.0 --configuration Release --collect:"XPlat Code Coverage" build-prod-docker-image: name: Build Production Docker Image From 8bfb9a9bc64ccce4a2194db512b62e99f10ca91e Mon Sep 17 00:00:00 2001 From: Magne Helleborg Date: Tue, 28 May 2024 11:36:05 +0200 Subject: [PATCH 3/3] Fixed MongoDB image ref --- Source/Events.Store.MongoDB/Development/MongoDB/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Events.Store.MongoDB/Development/MongoDB/Dockerfile b/Source/Events.Store.MongoDB/Development/MongoDB/Dockerfile index 04eb19d60..b75d11fe5 100644 --- a/Source/Events.Store.MongoDB/Development/MongoDB/Dockerfile +++ b/Source/Events.Store.MongoDB/Development/MongoDB/Dockerfile @@ -1,4 +1,4 @@ -FROM mongo:7.0.2-bionic +FROM mongo:7.0 COPY replicaset-initiate.js /docker-entrypoint-initdb.d/