Skip to content

Commit 9269b71

Browse files
LLT21LLT21Luc Lefever
authored
Upgrade to .NET 8 (#8523)
* Upgrade to .NET 8 and native Npgsql * Main docker file upgraded to .NET 8 * Reverse odbc mariadb upgrade * Reverse unix upgrade for mysql * Downgrade odbc implementation to .NET 7 * Odbc upgrade to .NET 8; exclude mysql as connector does not work with .NET 8 * Upgrade to official .NET 8 release * Correct package references * Make the package reference more generic * Remove unused files and simplify docker files * Better framework keywords --------- Co-authored-by: LLT21 <[email protected]> Co-authored-by: Luc Lefever <[email protected]>
1 parent c49cf09 commit 9269b71

12 files changed

+28
-247
lines changed

frameworks/CSharp/appmpower/appmpower-ado-pg.dockerfile

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
1-
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
1+
FROM mcr.microsoft.com/dotnet/sdk:8.0.100 AS build
22
RUN apt-get update
33
RUN apt-get -yqq install clang zlib1g-dev libkrb5-dev libtinfo5
44

55
WORKDIR /app
66
COPY src .
7-
RUN mv ./appMpower.ado ./appMpower.csproj
8-
RUN dotnet publish -c Release -o out -r linux-x64
7+
RUN dotnet publish -c Release -o out /p:Driver=ado
98

109
# Construct the actual image that will run
11-
FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS runtime
12-
RUN apt-get update
10+
FROM mcr.microsoft.com/dotnet/aspnet:8.0.0 AS runtime
1311

1412
WORKDIR /app
1513
COPY --from=build /app/out ./

frameworks/CSharp/appmpower/appmpower-odbc-my.dockerfile

Lines changed: 0 additions & 62 deletions
This file was deleted.

frameworks/CSharp/appmpower/appmpower-odbc-pg.dockerfile

Lines changed: 3 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,20 @@
1-
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
1+
FROM mcr.microsoft.com/dotnet/sdk:8.0.100 AS build
22
RUN apt-get update
33
RUN apt-get -yqq install clang zlib1g-dev libkrb5-dev libtinfo5
4-
RUN apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev \
5-
libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev \
6-
xz-utils tk-dev libffi-dev liblzma-dev pgpool2 vim-tiny
7-
8-
WORKDIR /odbc
9-
10-
# To compile the latest postgresql odbc driver, postgresql itself needs to be installed
11-
#RUN curl -L -o postgresql-14.1.tar.gz https://ftp.postgresql.org/pub/source/v14.1/postgresql-14.1.tar.gz
12-
#RUN curl -L -o unixODBC-2.3.9.tar.gz ftp://ftp.unixodbc.org/pub/unixODBC/unixODBC-2.3.9.tar.gz
13-
RUN curl -L -o unixODBC-2.3.11.tar.gz ftp://ftp.unixodbc.org/pub/unixODBC/unixODBC-2.3.11.tar.gz
14-
#RUN curl -L -o psqlodbc-13.02.0000.tar.gz https://ftp.postgresql.org/pub/odbc/versions/src/psqlodbc-13.02.0000.tar.gz
15-
16-
#RUN tar -xvf postgresql-14.1.tar.gz
17-
#RUN tar -xvf unixODBC-2.3.9.tar.gz
18-
RUN tar -xvf unixODBC-2.3.11.tar.gz
19-
#RUN tar -xvf psqlodbc-13.02.0000.tar.gz
20-
21-
#WORKDIR /odbc/postgresql-14.1
22-
#RUN ./configure
23-
#RUN make
24-
#RUN make install
25-
26-
#ENV PATH=/usr/local/pgsql/bin:$PATH
27-
28-
#WORKDIR /odbc/unixODBC-2.3.9
29-
WORKDIR /odbc/unixODBC-2.3.11
30-
RUN ./configure --prefix=/usr/local/unixODBC
31-
RUN make
32-
RUN make install
33-
34-
ENV PATH=/usr/local/unixODBC/lib:$PATH
35-
36-
#WORKDIR /odbc/psqlodbc-13.02.0000
37-
#RUN ./configure --with-unixodbc=/usr/local/unixODBC --with-libpq=/usr/local/pgsql --prefix=/usr/local/pgsqlodbc
38-
#RUN make
39-
#RUN make install
404

415
WORKDIR /app
426
COPY src .
43-
RUN dotnet publish -c Release -o out -r linux-x64 /p:Database=postgresql
7+
RUN dotnet publish -c Release -o out /p:Driver=odbc
448

459
# Construct the actual image that will run
46-
FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS runtime
10+
FROM mcr.microsoft.com/dotnet/aspnet:8.0.0 AS runtime
4711

4812
RUN apt-get update
49-
# The following installs standard versions unixodbc 2.3.6 and pgsqlodbc 11
5013
RUN apt-get install -y unixodbc odbc-postgresql
5114
# unixodbc still needs to be installed even if compiled locally
52-
#RUN apt-get install -y unixodbc wget curl libpq-dev build-essential
53-
54-
WORKDIR /odbc
55-
56-
#RUN curl -L -o pgpool-II-4.2.3.tar.gz https://www.pgpool.net/mediawiki/download.php?f=pgpool-II-4.2.3.tar.gz
57-
#RUN tar -xvf pgpool-II-4.2.3.tar.gz
58-
59-
#WORKDIR /odbc/pgpool-II-4.2.3
60-
#RUN ./configure
61-
#RUN make
62-
#RUN make install
63-
64-
COPY --from=build /usr/local/unixODBC /usr/local/unixODBC
65-
66-
# Check unixODBC version by:
67-
# 1. Logging into containter: docker run --rm -it --entrypoint=/bin/bash techempower/tfb.test.appmpower
68-
# 2. odbcinst --version
6915

7016
ENV PATH=/usr/local/unixODBC/bin:$PATH
7117

72-
#COPY --from=build /usr/local/pgsqlodbc /usr/local/pgsqlodbc
73-
7418
WORKDIR /etc/
7519
COPY odbcinst.ini .
7620

frameworks/CSharp/appmpower/appmpower.dockerfile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1-
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
1+
FROM mcr.microsoft.com/dotnet/sdk:8.0.100 AS build
22
RUN apt-get update
33
RUN apt-get -yqq install clang zlib1g-dev libkrb5-dev libtinfo5
44

55
WORKDIR /app
66
COPY src .
7-
RUN dotnet publish -c Release -o out -r linux-x64
7+
RUN dotnet publish -c Release -o out
88

99
# Construct the actual image that will run
10-
FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS runtime
11-
RUN apt-get update
10+
FROM mcr.microsoft.com/dotnet/aspnet:8.0.0 AS runtime
1211

1312
WORKDIR /app
1413
COPY --from=build /app/out ./

frameworks/CSharp/appmpower/benchmark_config.json

Lines changed: 6 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
"webserver": "Kestrel",
1818
"os": "Linux",
1919
"database_os": "Linux",
20-
"display_name": "appMpower [Middleware]",
20+
"display_name": "appMpower [aot-no-reflection]",
2121
"notes": "",
22-
"versus": "aspcore-mw"
22+
"versus": "aspnetcore-minimal"
2323
},
2424
"odbc-pg": {
2525
"db_url": "/db",
@@ -39,31 +39,9 @@
3939
"webserver": "Kestrel",
4040
"os": "Linux",
4141
"database_os": "Linux",
42-
"display_name": "appMpower [Middleware, Pg, Odbc]",
42+
"display_name": "appMpower [aot-no-reflection,odbc]",
4343
"notes": "",
44-
"versus": "aspcore-mw-ado-pg"
45-
},
46-
"odbc-my": {
47-
"db_url": "/db",
48-
"query_url": "/queries?c=",
49-
"update_url": "/updates?c=",
50-
"fortune_url": "/fortunes",
51-
"cached_query_url": "/cached-worlds?c=",
52-
"port": 8080,
53-
"approach": "Realistic",
54-
"classification": "Platform",
55-
"database": "MySQL",
56-
"framework": "appmpower",
57-
"language": "C#",
58-
"orm": "Raw",
59-
"platform": ".NET",
60-
"flavor": "CoreCLR",
61-
"webserver": "Kestrel",
62-
"os": "Linux",
63-
"database_os": "Linux",
64-
"display_name": "appMpower [Middleware, My, Odbc]",
65-
"notes": "",
66-
"versus": "aspcore-mw-ado-my"
44+
"versus": "aspnetcore-minimal"
6745
},
6846
"ado-pg": {
6947
"db_url": "/db",
@@ -83,9 +61,9 @@
8361
"webserver": "Kestrel",
8462
"os": "Linux",
8563
"database_os": "Linux",
86-
"display_name": "appMpower [Middleware, Pg, Ado]",
64+
"display_name": "appMpower [aot-no-reflection,ado]",
8765
"notes": "",
88-
"versus": "aspcore-mw-ado-pg"
66+
"versus": "aspnetcore-minimal"
8967
}
9068
}
9169
]

frameworks/CSharp/appmpower/config.toml

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ os = "Linux"
1212
orm = "Raw"
1313
platform = ".NET"
1414
webserver = "kestrel"
15-
versus = "aspcore-mw"
15+
versus = "aspnetcore-minimal"
1616

1717
[odbc-pg]
1818
urls.db = "/db"
@@ -28,23 +28,7 @@ os = "Linux"
2828
orm = "Raw"
2929
platform = ".NET"
3030
webserver = "Kestrel"
31-
versus = "aspcore-mw-ado-pg"
32-
33-
[odbc-my]
34-
urls.db = "/db"
35-
urls.query = "/queries?c="
36-
urls.update = "/updates?c="
37-
urls.fortune = "/fortunes"
38-
urls.cached_query = "/cached-worlds?c="
39-
approach = "Realistic"
40-
classification = "Micro"
41-
database = "MySQL"
42-
database_os = "Linux"
43-
os = "Linux"
44-
orm = "Raw"
45-
platform = ".NET"
46-
webserver = "Kestrel"
47-
versus = "aspcore-mw-ado-my"
31+
versus = "aspnetcore-minimal"
4832

4933
[ado-pg]
5034
urls.db = "/db"
@@ -60,4 +44,4 @@ os = "Linux"
6044
orm = "Raw"
6145
platform = ".NET"
6246
webserver = "Kestrel"
63-
versus = "aspcore-mw-ado-pg"
47+
versus = "aspnetcore-minimal"

frameworks/CSharp/appmpower/odbcinst.ini

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ Pooling=0
55

66
[ODBC Drivers]
77
PostgreSQL = Installed
8-
MariaDB = Installed
98

109
;
1110
; odbcinst.ini
@@ -20,8 +19,3 @@ Driver = /usr/lib/x86_64-linux-gnu/odbc/psqlodbcw.so
2019
;Driver =/usr/local/pgsqlodbc/lib/psqlodbcw.so
2120
Threading = 0
2221
CPTimeout = 0
23-
24-
[MariaDB]
25-
Description=MariaDB ODBC for MySQL
26-
Driver = /usr/lib/libmaodbc.so
27-
Threading = 0

frameworks/CSharp/appmpower/src/Data/DbProviderFactory.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ public static class DbProviderFactory
77
#if MYSQL
88
public const string ConnectionString = "Driver={MariaDB};Server=tfb-database;Database=hello_world;Uid=benchmarkdbuser;Pwd=benchmarkdbpass;Pooling=false;OPTIONS=67108864;FLAG_FORWARD_CURSOR=1";
99
#elif ADO
10-
public const string ConnectionString = "Server=tfb-database;Database=hello_world;User Id=benchmarkdbuser;Password=benchmarkdbpass;SSL Mode=Disable;Maximum Pool Size=18;NoResetOnClose=true;Enlist=false;Max Auto Prepare=4;Multiplexing=true;Write Coalescing Buffer Threshold Bytes=1000";
10+
public const string ConnectionString = "Server=tfb-database;Database=hello_world;User Id=benchmarkdbuser;Password=benchmarkdbpass;SSL Mode=0;Maximum Pool Size=18;NoResetOnClose=true;Enlist=false;Max Auto Prepare=4;Multiplexing=true;Write Coalescing Buffer Threshold Bytes=1000";
1111
//public const string ConnectionString = "Server=localhost;Database=hello_world;User Id=benchmarkdbuser;Password=benchmarkdbpass;SSL Mode=Disable;Maximum Pool Size=18;NoResetOnClose=true;Enlist=false;Max Auto Prepare=4;Multiplexing=true;Write Coalescing Buffer Threshold Bytes=1000";
1212
#else
1313
public const string ConnectionString = "Driver={PostgreSQL};Server=tfb-database;Database=hello_world;Uid=benchmarkdbuser;Pwd=benchmarkdbpass;UseServerSidePrepare=1;Pooling=false";

frameworks/CSharp/appmpower/src/__BlockAllReflectionAttribute.cs

Lines changed: 0 additions & 7 deletions
This file was deleted.

frameworks/CSharp/appmpower/src/appMpower.ado

Lines changed: 0 additions & 49 deletions
This file was deleted.

0 commit comments

Comments
 (0)