Skip to content

Commit 09bf181

Browse files
author
Pascal van Buijtene
committed
Upgrade to net8
1 parent 19d3946 commit 09bf181

File tree

46 files changed

+106
-170
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+106
-170
lines changed

.config/dotnet-tools.json

+2-14
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,11 @@
22
"version": 1,
33
"isRoot": true,
44
"tools": {
5-
"dotnet-retire": {
6-
"version": "4.0.1",
7-
"commands": [
8-
"dotnet-retire"
9-
]
10-
},
115
"minver-cli": {
12-
"version": "2.2.0",
6+
"version": "4.3.0",
137
"commands": [
148
"minver"
159
]
16-
},
17-
"gpr": {
18-
"version": "0.1.122",
19-
"commands": [
20-
"gpr"
21-
]
2210
}
2311
}
24-
}
12+
}

.github/workflows/build-container-bullseye-slim.yml .github/workflows/build-container-bookworm-slim.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build Bullseye Slim Container
1+
name: Build Bookworm Slim Container
22

33
on:
44
pull_request:
@@ -21,5 +21,5 @@ jobs:
2121
build-container:
2222
uses: ./.github/workflows/build-container-reusable.yml
2323
with:
24-
container-runtime: bullseye-slim
24+
container-runtime: bookworm-slim
2525

.github/workflows/build-container-reusable.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ jobs:
1818
uses: actions/checkout@v3
1919
with:
2020
fetch-depth: 0
21-
- name: Install net7.0
21+
- name: Install net8.0
2222
uses: actions/setup-dotnet@v3
2323
with:
24-
dotnet-version: 7.0.x
24+
dotnet-version: 8.0.x
2525
- name: Setup QEMU
2626
uses: docker/setup-qemu-action@v2
2727
- name: Set up Docker Buildx
@@ -47,11 +47,11 @@ jobs:
4747
"jammy": {
4848
"runtime": "linux-x64"
4949
},
50-
"bullseye-slim": {
50+
"bookworm-slim": {
5151
"runtime": "linux-x64"
5252
},
5353
"alpine": {
54-
"runtime": "alpine-x64"
54+
"runtime": "linux-musl-x64"
5555
}
5656
}
5757
export_to: output

.github/workflows/build-reusable.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ jobs:
2828
uses: actions/setup-dotnet@v3
2929
with:
3030
dotnet-version: 3.1.x
31-
- name: Install net7.0
31+
- name: Install net8.0
3232
uses: actions/setup-dotnet@v3
3333
with:
34-
dotnet-version: 7.0.x
34+
dotnet-version: 8.0.x
3535
- name: Clear Nuget Cache
3636
shell: powershell
3737
if: inputs.os == 'windows-2019'

.github/workflows/common.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ jobs:
2424
steps:
2525
- name: Checkout
2626
uses: actions/checkout@v3
27-
- name: Install net7.0
27+
- name: Install net8.0
2828
uses: actions/setup-dotnet@v3
2929
with:
30-
dotnet-version: 7.0.x
30+
dotnet-version: 8.0.x
3131
- name: Scan for Vulnerabilities
3232
run: |
3333
cd src

Dockerfile

+6-14
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,37 @@
11
# "build" image
22
ARG CONTAINER_RUNTIME=jammy
3-
FROM mcr.microsoft.com/dotnet/sdk:7.0-jammy AS build
3+
FROM mcr.microsoft.com/dotnet/sdk:8.0-jammy AS build
44
ARG RUNTIME=linux-x64
55

66
WORKDIR /build/ci
7-
87
COPY ./ci ./
98

109
WORKDIR /build/docs
11-
1210
COPY ./docs ./
1311

1412
WORKDIR /build/src
15-
1613
COPY ./src/EventStore.sln ./src/*/*.csproj ./src/Directory.Build.* ./
17-
1814
RUN for file in $(ls *.csproj); do mkdir -p ./${file%.*}/ && mv $file ./${file%.*}/; done
19-
2015
RUN dotnet restore --runtime=${RUNTIME}
21-
2216
COPY ./src .
2317

2418
WORKDIR /build/.git
25-
2619
COPY ./.git .
2720

2821
WORKDIR /build/src
29-
3022
RUN find /build/src -maxdepth 1 -type d -name "*.Tests" -print0 | xargs -I{} -0 -n1 sh -c \
3123
'dotnet publish --runtime=${RUNTIME} --no-self-contained --configuration Release --output /build/published-tests/`basename $1` $1' - '{}'
3224

3325
# "test" image
34-
FROM mcr.microsoft.com/dotnet/sdk:7.0-${CONTAINER_RUNTIME} as test
26+
FROM mcr.microsoft.com/dotnet/sdk:8.0-${CONTAINER_RUNTIME} as test
3527
WORKDIR /build
3628
COPY --from=build ./build/published-tests ./published-tests
3729
COPY --from=build ./build/ci ./ci
3830
COPY --from=build ./build/src/EventStore.Core.Tests/Services/Transport/Tcp/test_certificates/ca/ca.crt /usr/local/share/ca-certificates/ca_eventstore_test.crt
3931
RUN mkdir ./test-results
4032
RUN printf '#!/usr/bin/env sh\n\
4133
update-ca-certificates\n\
42-
find /build/published-tests -maxdepth 1 -type d -name "*.Tests" -print0 | xargs -I{} -0 -n1 sh -c '"'"'proj=`basename $1` && dotnet test --blame --settings /build/ci/ci.runsettings --logger:"GitHubActions;report-warnings=false" --logger:html --logger:trx --logger:"console;verbosity=normal" --results-directory /build/test-results/$proj $1/$proj.dll'"'"' - '"'"'{}'"'"'\n\
34+
find /build/published-tests -maxdepth 1 -type d -name "*.Tests" -print0 | xargs -I{} -0 -n1 sh -c '"'"'proj=`basename $1` && dotnet test --blame --blame-hang-timeout 5min --settings /build/ci/ci.runsettings --logger:"GitHubActions;report-warnings=false" --logger:html --logger:trx --logger:"console;verbosity=normal" --results-directory /build/test-results/$proj $1/$proj.dll'"'"' - '"'"'{}'"'"'\n\
4335
exit_code=$?\n\
4436
echo $(find /build/test-results -name "*.html" | xargs cat) > /build/test-results/test-results.html\n\
4537
exit $exit_code' \
@@ -53,15 +45,15 @@ FROM build as publish
5345
ARG RUNTIME=linux-x64
5446

5547
RUN dotnet publish --configuration=Release --runtime=${RUNTIME} --self-contained \
56-
--framework=net7.0 --output /publish EventStore.ClusterNode
48+
--framework=net8.0 --output /publish EventStore.ClusterNode
5749

5850
# "runtime" image
59-
FROM mcr.microsoft.com/dotnet/runtime-deps:7.0-${CONTAINER_RUNTIME} AS runtime
51+
FROM mcr.microsoft.com/dotnet/runtime-deps:8.0-${CONTAINER_RUNTIME} AS runtime
6052
ARG RUNTIME=linux-x64
6153
ARG UID=1000
6254
ARG GID=1000
6355

64-
RUN if [[ "${RUNTIME}" = "alpine-x64" ]];\
56+
RUN if [[ "${RUNTIME}" = "linux-musl-x64" ]];\
6557
then \
6658
apk update && \
6759
apk add --no-cache \

README.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ EventStoreDB is written in a mixture of C# and JavaScript. It can run on Windows
103103

104104
**Prerequisites**
105105

106-
- [.NET Core SDK 6.0](https://dotnet.microsoft.com/download/dotnet/6.0)
106+
- [.NET Core SDK 8.0](https://dotnet.microsoft.com/download/dotnet/8.0)
107107

108108
Once you've installed the prerequisites for your system, you can launch a `Release` build of EventStore as follows:
109109

@@ -116,7 +116,7 @@ The build scripts: `build.sh` and `build.ps1` are also available for Linux and W
116116
To start a single node, you can then run:
117117

118118
```
119-
dotnet ./src/EventStore.ClusterNode/bin/x64/Release/net7.0/EventStore.ClusterNode.dll --dev --db ./tmp/data --index ./tmp/index --log ./tmp/log
119+
dotnet ./src/EventStore.ClusterNode/bin/x64/Release/net8.0/EventStore.ClusterNode.dll --dev --db ./tmp/data --index ./tmp/index --log ./tmp/log
120120
```
121121

122122
### Running the tests
@@ -141,23 +141,23 @@ For instance:
141141

142142
```
143143
docker build --tag myeventstore . \
144-
--build-arg CONTAINER_RUNTIME=bullseye-slim \
144+
--build-arg CONTAINER_RUNTIME=bookworm-slim \
145145
--build-arg RUNTIME=linux-x64
146146
```
147147

148148
**_Note:_** Because of the [Docker issue](https://github.com/moby/buildkit/issues/1900), if you're building a Docker image on Windows, you may need to set the `DOCKER_BUILDKIT=0` environment variable. For instance, running in PowerShell:
149149

150150
```
151151
$env:DOCKER_BUILDKIT=0; docker build --tag myeventstore . `
152-
--build-arg CONTAINER_RUNTIME=bullseye-slim `
152+
--build-arg CONTAINER_RUNTIME=bookworm-slim `
153153
--build-arg RUNTIME=linux-x64
154154
```
155155

156156
Currently, we support the following configurations:
157157

158-
1. Bullseye slim:
158+
1. Bookworm slim:
159159

160-
- `CONTAINER_RUNTIME=bullseye-slim`
160+
- `CONTAINER_RUNTIME=bookworm-slim`
161161
- `RUNTIME=linux-x64`
162162

163163
2. Jammy:
@@ -168,7 +168,7 @@ Currently, we support the following configurations:
168168
3. Alpine:
169169

170170
- `CONTAINER_RUNTIME=alpine`
171-
- `RUNTIME=alpine-x64`
171+
- `RUNTIME=linux-musl-x64`
172172

173173
You can verify the built image by running:
174174

@@ -192,6 +192,6 @@ docker run --rm myeventstore --insecure --what-if
192192

193193
![Build](https://github.com/EventStore/EventStore/actions/workflows/build-container-alpine.yml/badge.svg)
194194

195-
![Build](https://github.com/EventStore/EventStore/actions/workflows/build-container-bullseye-slim.yml/badge.svg)
195+
![Build](https://github.com/EventStore/EventStore/actions/workflows/build-container-bookworm-slim.yml/badge.svg)
196196

197197
![Build](https://github.com/EventStore/EventStore/actions/workflows/build-container-jammy.yml/badge.svg)

build.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ COPYRIGHT="Copyright 2021 Event Store Ltd. All rights reserved."
1010

1111
CONFIGURATION="Release"
1212
BUILD_UI="no"
13-
NET_FRAMEWORK="net7.0"
13+
NET_FRAMEWORK="net8.0"
1414

1515
function usage() {
1616
cat <<EOF

src/EventStore.BufferManagement.Tests/EventStore.BufferManagement.Tests.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project Sdk="Microsoft.NET.Sdk">
33
<PropertyGroup>
4-
<TargetFramework>net7.0</TargetFramework>
4+
<TargetFramework>net8.0</TargetFramework>
55
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
66
<DebugSymbols>true</DebugSymbols>
77
<Platforms>x64;ARM64</Platforms>

src/EventStore.BufferManagement/EventStore.BufferManagement.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project Sdk="Microsoft.NET.Sdk">
33
<PropertyGroup>
4-
<TargetFramework>net7.0</TargetFramework>
4+
<TargetFramework>net8.0</TargetFramework>
55
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
66
<Platforms>x64;ARM64</Platforms>
77
</PropertyGroup>

src/EventStore.ClusterNode.Web/EventStore.ClusterNode.Web.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project Sdk="Microsoft.NET.Sdk">
33
<PropertyGroup>
4-
<TargetFramework>net7.0</TargetFramework>
4+
<TargetFramework>net8.0</TargetFramework>
55
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
66
<Platforms>x64;ARM64</Platforms>
77
</PropertyGroup>

src/EventStore.ClusterNode/EventStore.ClusterNode.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project Sdk="Microsoft.NET.Sdk">
33
<PropertyGroup>
4-
<TargetFramework>net7.0</TargetFramework>
4+
<TargetFramework>net8.0</TargetFramework>
55
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
66
<OutputType>Exe</OutputType>
77
<ApplicationIcon>app2.ico</ApplicationIcon>

src/EventStore.Common.Tests/EventStore.Common.Tests.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<Project Sdk="Microsoft.NET.Sdk">
33

44
<PropertyGroup>
5-
<TargetFramework>net7.0</TargetFramework>
5+
<TargetFramework>net8.0</TargetFramework>
66
<Platforms>x64;ARM64</Platforms>
77
<ImplicitUsings>enable</ImplicitUsings>
88
<Nullable>enable</Nullable>

src/EventStore.Common.Utils/EventStore.Common.Utils.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project Sdk="Microsoft.NET.Sdk">
33
<PropertyGroup>
4-
<TargetFramework>net7.0</TargetFramework>
4+
<TargetFramework>net8.0</TargetFramework>
55
<Platforms>x64;ARM64</Platforms>
66
</PropertyGroup>
77
<ItemGroup>

src/EventStore.Common/EventStore.Common.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project Sdk="Microsoft.NET.Sdk">
33
<PropertyGroup>
4-
<TargetFramework>net7.0</TargetFramework>
4+
<TargetFramework>net8.0</TargetFramework>
55
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
66
<Platforms>x64;ARM64</Platforms>
77
</PropertyGroup>

src/EventStore.Core.Tests/EventStore.Core.Tests.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project Sdk="Microsoft.NET.Sdk">
33
<PropertyGroup>
4-
<TargetFramework>net7.0</TargetFramework>
4+
<TargetFramework>net8.0</TargetFramework>
55
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
66
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
77
<Platforms>x64;ARM64</Platforms>
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net7.0</TargetFramework>
4+
<TargetFramework>net8.0</TargetFramework>
55
</PropertyGroup>
66

77
</Project>

src/EventStore.Core.Tests/Helpers/MiniClusterNode.cs

+15-17
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
using EventStore.Core.Authorization;
1414
using EventStore.Core.Bus;
1515
using EventStore.Core.Certificates;
16-
using EventStore.Core.LogAbstraction;
1716
using EventStore.Core.Messages;
1817
using EventStore.Core.Services.Monitoring;
1918
using EventStore.Core.Tests.Http;
@@ -24,7 +23,6 @@
2423
using Microsoft.AspNetCore.Hosting;
2524
using Microsoft.AspNetCore.Server.Kestrel.Core;
2625
using Microsoft.AspNetCore.Server.Kestrel.Https;
27-
using Microsoft.AspNetCore.TestHost;
2826
using ILogger = Serilog.ILogger;
2927
using EventStore.Core.Services.Storage.ReaderIndex;
3028

@@ -56,8 +54,6 @@ public class MiniClusterNode<TLogFormat, TStreamId> {
5654
public VNodeState NodeState = VNodeState.Unknown;
5755
private readonly IWebHost _host;
5856

59-
private readonly TestServer _kestrelTestServer;
60-
6157
private static bool EnableHttps() {
6258
return !RuntimeInformation.IsOSPlatform(OSPlatform.OSX);
6359
}
@@ -168,8 +164,7 @@ public MiniClusterNode(string pathname, int debugIndex, IPEndPoint internalTcp,
168164
GC.MaxGeneration == 0
169165
? "NON-GENERATION (PROBABLY BOEHM)"
170166
: $"{GC.MaxGeneration + 1} GENERATIONS", "DBPATH:", _dbPath, "ExTCP ENDPOINT:",
171-
ExternalTcpEndPoint, "ExHTTP ENDPOINT:",
172-
HttpEndPoint);
167+
ExternalTcpEndPoint, "ExHTTP ENDPOINT:", HttpEndPoint);
173168

174169
var logFormatFactory = LogFormatHelper<TLogFormat, TStreamId>.LogFormatFactory;
175170
Node = new ClusterVNode<TStreamId>(options, logFormatFactory, new AuthenticationProviderFactory(
@@ -210,10 +205,6 @@ public MiniClusterNode(string pathname, int debugIndex, IPEndPoint internalTcp,
210205
})
211206
.UseStartup(Node.Startup)
212207
.Build();
213-
214-
_kestrelTestServer = new TestServer(new WebHostBuilder()
215-
.UseKestrel()
216-
.UseStartup(Node.Startup));
217208
}
218209

219210
public void Start() {
@@ -257,24 +248,31 @@ void WaitForAdminUser(StorageMessage.EventCommitted m) {
257248

258249
_host.Start();
259250
Node.Start();
260-
261251
}
262-
252+
263253
public HttpClient CreateHttpClient() {
264-
return new HttpClient(_kestrelTestServer.CreateHandler());
254+
var httpClient = new HttpClient(new SocketsHttpHandler {
255+
AllowAutoRedirect = false,
256+
SslOptions = {
257+
RemoteCertificateValidationCallback = delegate { return true; }
258+
}
259+
}, true);
260+
261+
var scheme = Node.DisableHttps ? "http://" : "https://";
262+
httpClient.BaseAddress = new Uri($"{scheme}{HttpEndPoint}");
263+
return httpClient;
265264
}
266265

267266
public async Task Shutdown(bool keepDb = false) {
268267
StoppingTime.Start();
269-
_kestrelTestServer?.Dispose();
270-
await Node.StopAsync().WithTimeout(TimeSpan.FromSeconds(20));
268+
_host?.Dispose();
269+
await Node.StopAsync().WithTimeout(TimeSpan.FromSeconds(20));
271270

272271
// the same message 'BecomeShutdown' triggers the disposal of the ReadIndex
273272
// and also the notification here that the node as stopped so there is a race.
274273
// For now let's wait for a moment before we try to delete the directory.
275274
await Task.Delay(500);
276-
277-
_host?.Dispose();
275+
278276
if (!keepDb)
279277
TryDeleteDirectory(_dbPath);
280278

0 commit comments

Comments
 (0)