Skip to content

Commit 9c9b867

Browse files
authored
Appmpowerv8.0.5: using native AOT dll instead of exe (#9214)
* New Npgsql security update * Middleware alternative * NativeAOT calls * hellloWorld -> helloWorld * Reduce external calls * JsonMiddleware * JsonMessage built in NativeAOT * mac dylibs * Size and content separate * Small corrections * JsonMessage * JsonMessage struct * Rename nativeAOT -> appMpowerAot * Working single query, but slow * Odbc test * dockerfile changes * Try to get correct capitalization * 2nd part trial for correct capitalization * Dbms and DbProvider parameterization * linux-x64 * NativeMethods * Kestrel header * Header http * Using marshalling and out parameter * Header changes * FreeUnmanagedPointer * Correction single query * JsonMessage pointer handling * Native last methods for JsonMessage and hello world * Sync db read * Create new json message * Rename appMpowerAot -> appMpower.Orm * Fortunes * Synchronous fortunes read * Server settings * Empty line * More correct special characters length * Remove ADO and InternalConnection * Synchronous only * Cleanup * Name changes * Multiple queries * Cleanup * Alternative native methods * MultipleUpdates * odbcCommand dictionary * keyed commands * Refactoring * Remove comments * First MySQL trial * MySQL odbc * zip file mariadb connector * Better download ? * dockerfile cleanup * charset * Cached queries * Improved caching * Improved caching * Removal unnecessary packages * Cleanup project * appMpower cleanup * appMpower.Orm cleanup * Too much cleanup --------- Co-authored-by: LLT21 <>
1 parent 02764eb commit 9c9b867

Some content is hidden

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

65 files changed

+1728
-2303
lines changed

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

Lines changed: 0 additions & 17 deletions
This file was deleted.
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
FROM mcr.microsoft.com/dotnet/sdk:8.0.100 AS build
2+
RUN apt-get update
3+
RUN apt-get -yqq install clang zlib1g-dev
4+
RUN apt-get update
5+
6+
WORKDIR /app
7+
COPY src .
8+
RUN dotnet publish -c Release -o out /p:Database=mysql
9+
10+
# Construct the actual image that will run
11+
FROM mcr.microsoft.com/dotnet/aspnet:8.0.0 AS runtime
12+
13+
RUN apt-get update
14+
# The following installs standard versions unixodbc and pgsqlodbc
15+
# unixodbc still needs to be installed even if compiled locally
16+
RUN apt-get install -y unixodbc wget curl
17+
RUN apt-get update
18+
19+
WORKDIR /odbc
20+
21+
RUN curl -L -o mariadb-connector-odbc-3.1.20-debian-bookworm-amd64.tar.gz https://downloads.mariadb.com/Connectors/odbc/connector-odbc-3.1.20/mariadb-connector-odbc-3.1.20-debian-bookworm-amd64.tar.gz
22+
RUN tar -xvzf mariadb-connector-odbc-3.1.20-debian-bookworm-amd64.tar.gz
23+
RUN cp mariadb-connector-odbc-3.1.20-debian-bookworm-amd64/lib/mariadb/libm* /usr/lib/
24+
RUN cp -r /odbc/mariadb-connector-odbc-3.1.20-debian-bookworm-amd64/lib/mariadb /usr/local/lib/mariadb
25+
RUN rm mariadb-connector-odbc-3.1.20-debian-bookworm-amd64.tar.gz
26+
#TODOLOCAL
27+
#RUN curl -L -o mariadb-connector-odbc-3.1.20-debian-bookworm-aarch64.tar.gz https://downloads.mariadb.com/Connectors/odbc/connector-odbc-3.1.20/mariadb-connector-odbc-3.1.20-debian-bookworm-aarch64.tar.gz
28+
#RUN tar -xvzf mariadb-connector-odbc-3.1.20-debian-bookworm-aarch64.tar.gz
29+
#RUN cp mariadb-connector-odbc-3.1.20-debian-bookworm-aarch64/lib/mariadb/libm* /usr/lib/
30+
#RUN cp -r /odbc/mariadb-connector-odbc-3.1.20-debian-bookworm-aarch64/lib/mariadb /usr/local/lib/mariadb
31+
#RUN rm mariadb-connector-odbc-3.1.20-debian-bookworm-aarch64.tar.gz
32+
33+
ENV PATH=/usr/local/unixODBC/bin:$PATH
34+
35+
WORKDIR /etc/
36+
COPY odbcinst.ini .
37+
38+
# Full PGO
39+
ENV DOTNET_TieredPGO 1
40+
ENV DOTNET_TC_QuickJitForLoops 1
41+
ENV DOTNET_ReadyToRun 0
42+
43+
ENV ASPNETCORE_URLS http://+:8080
44+
WORKDIR /app
45+
COPY --from=build /app/out ./
46+
47+
RUN cp /usr/lib/libm* /app
48+
49+
EXPOSE 8080
50+
51+
ENTRYPOINT ["./appMpower"]

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ 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 /p:Driver=odbc
7+
RUN dotnet publish -c Release -o out /p:Database=postgresql
88

99
# Construct the actual image that will run
1010
FROM mcr.microsoft.com/dotnet/aspnet:8.0.0 AS runtime
@@ -18,6 +18,12 @@ ENV PATH=/usr/local/unixODBC/bin:$PATH
1818
WORKDIR /etc/
1919
COPY odbcinst.ini .
2020

21+
# Full PGO
22+
ENV DOTNET_TieredPGO 1
23+
ENV DOTNET_TC_QuickJitForLoops 1
24+
ENV DOTNET_ReadyToRun 0
25+
26+
ENV ASPNETCORE_URLS http://+:8080
2127
WORKDIR /app
2228
COPY --from=build /app/out ./
2329

frameworks/CSharp/appmpower/appmpower.dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,17 @@ RUN apt-get -yqq install clang zlib1g-dev libkrb5-dev libtinfo5
44

55
WORKDIR /app
66
COPY src .
7+
#RUN dotnet publish appMpower/appMpower.csproj -c Release -o out
78
RUN dotnet publish -c Release -o out
89

910
# Construct the actual image that will run
1011
FROM mcr.microsoft.com/dotnet/aspnet:8.0.0 AS runtime
12+
# Full PGO
13+
ENV DOTNET_TieredPGO 1
14+
ENV DOTNET_TC_QuickJitForLoops 1
15+
ENV DOTNET_ReadyToRun 0
1116

17+
ENV ASPNETCORE_URLS http://+:8080
1218
WORKDIR /app
1319
COPY --from=build /app/out ./
1420

frameworks/CSharp/appmpower/benchmark_config.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@
3939
"webserver": "Kestrel",
4040
"os": "Linux",
4141
"database_os": "Linux",
42-
"display_name": "appMpower [aot-no-reflection,odbc]",
42+
"display_name": "appMpower [aot-no-reflection,pg,odbc]",
4343
"notes": "",
4444
"versus": "aspnetcore-minimal"
4545
},
46-
"ado-pg": {
46+
"odbc-my": {
4747
"db_url": "/db",
4848
"query_url": "/queries?c=",
4949
"update_url": "/updates?c=",
@@ -52,7 +52,7 @@
5252
"port": 8080,
5353
"approach": "Realistic",
5454
"classification": "Platform",
55-
"database": "Postgres",
55+
"database": "MySQL",
5656
"framework": "appmpower",
5757
"language": "C#",
5858
"orm": "Raw",
@@ -61,7 +61,7 @@
6161
"webserver": "Kestrel",
6262
"os": "Linux",
6363
"database_os": "Linux",
64-
"display_name": "appMpower [aot-no-reflection,ado]",
64+
"display_name": "appMpower [aot-no-reflection,my,odbc]",
6565
"notes": "",
6666
"versus": "aspnetcore-minimal"
6767
}

frameworks/CSharp/appmpower/config.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@ platform = ".NET"
3030
webserver = "Kestrel"
3131
versus = "aspnetcore-minimal"
3232

33-
[ado-pg]
33+
[odbc-my]
3434
urls.db = "/db"
3535
urls.query = "/queries?c="
3636
urls.update = "/updates?c="
3737
urls.fortune = "/fortunes"
3838
urls.cached_query = "/cached-worlds?c="
3939
approach = "Realistic"
4040
classification = "Micro"
41-
database = "Postgres"
41+
database = "MySQL"
4242
database_os = "Linux"
4343
os = "Linux"
4444
orm = "Raw"

frameworks/CSharp/appmpower/odbcinst.ini

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

66
[ODBC Drivers]
77
PostgreSQL = Installed
8+
MariaDB = Installed
89

910
;
1011
; odbcinst.ini
@@ -15,7 +16,16 @@ Description=ODBC for PostgreSQL
1516
; in version 08.x. Note that the library can also be installed under an other
1617
; path than /usr/local/lib/ following your installation.
1718
; This is the standard location used by apt-get install -y unixodbc
19+
;ON SERVER
1820
Driver = /usr/lib/x86_64-linux-gnu/odbc/psqlodbcw.so
21+
;TODOLOCAL: ON MAC
22+
;Driver =/usr/lib/aarch64-linux-gnu/odbc/psqlodbcw.so
23+
1924
;Driver =/usr/local/pgsqlodbc/lib/psqlodbcw.so
2025
Threading = 0
2126
CPTimeout = 0
27+
28+
[MariaDB]
29+
Description=MariaDB ODBC for MySQL
30+
Driver = /usr/lib/libmaodbc.so
31+
Threading = 0

frameworks/CSharp/appmpower/src/CachedWorldSerializer.cs

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

0 commit comments

Comments
 (0)