@@ -5,17 +5,30 @@ on: workflow_dispatch
5
5
env :
6
6
PLATFORM : x64
7
7
FRAMEWORK : net80
8
- DOTNET_ROOT : /usr/share/dotnet
9
- DOTNETSDKVER : 8.0.303
10
- DOTNETFWKVER : 8.0.7
8
+ FRAMEWORKDOT : net8.0
11
9
12
10
jobs :
13
11
tritonservercppsharp :
14
12
runs-on : ubuntu-22.04
15
13
steps :
16
- - uses : actions/checkout@v2
14
+ - name : Clone tritonserver
15
+ run : |
16
+ git clone --single-branch --depth 1 --branch r24.08 https://github.com/triton-inference-server/core
17
+ git clone --single-branch --depth 1 --branch r24.08 https://github.com/triton-inference-server/developer_tools
17
18
18
- - name : Write down the bindings code
19
+ - name : Clone and build CppSharp
20
+ run : |
21
+ git clone --single-branch --depth 1 https://github.com/mono/CppSharp
22
+ cd CppSharp
23
+ bash build/build.sh generate -configuration Release -platform $PLATFORM -target-framework $FRAMEWORK
24
+ bash build/build.sh download_llvm -platform $PLATFORM -target-framework $FRAMEWORK
25
+ bash build/build.sh restore -platform $PLATFORM -target-framework $FRAMEWORK
26
+ bash build/build.sh -platform $PLATFORM -build_only -target-framework $FRAMEWORK
27
+
28
+ - name : Variant 1
29
+ run : ./CppSharp/bin/Release_x64/CppSharp.CLI -m tritonserver -g csharp -p linux -a x64 -o ./variant1/ -I=core/include core/include/triton/core/tritonserver.h core/include/triton/core/tritonbackend.h core/include/triton/core/tritoncache.h core/include/triton/core/tritonrepoagent.h
30
+
31
+ - name : Variant 2
19
32
run : |
20
33
echo '<Project Sdk="Microsoft.NET.Sdk"><PropertyGroup><RunWorkingDirectory>$(MSBuildProjectDirectory)</RunWorkingDirectory><OutputType>Exe</OutputType><TargetFramework>net8.0</TargetFramework><EnableDefaultItems>false</EnableDefaultItems></PropertyGroup><ItemGroup><Compile Remove="**/*.cs"/><Compile Include="tritonservercppsharp.cs"/><Reference Include="MyAssembly"><HintPath>./CppSharp/bin/Release_x64/CppSharp.dll</HintPath></Reference><Reference Include="MyAssembly"><HintPath>./CppSharp/bin/Release_x64/CppSharp.Runtime.dll</HintPath></Reference><Reference Include="MyAssembly"><HintPath>./CppSharp/bin/Release_x64/CppSharp.AST.dll</HintPath></Reference><Reference Include="MyAssembly"><HintPath>./CppSharp/bin/Release_x64/CppSharp.Generator.dll</HintPath></Reference><Reference Include="MyAssembly"><HintPath>./CppSharp/bin/Release_x64/CppSharp.CLI.dll</HintPath></Reference><Reference Include="MyAssembly"><HintPath>./CppSharp/bin/Release_x64/CppSharp.Parser.dll</HintPath></Reference><Reference Include="MyAssembly"><HintPath>./CppSharp/bin/Release_x64/CppSharp.Parser.CSharp.dll</HintPath></Reference><Reference Include="MyAssembly"><HintPath>./CppSharp/bin/Release_x64/CppSharp.Parser.Bootstrap.dll</HintPath></Reference><Reference Include="MyAssembly"><HintPath>./CppSharp/bin/Release_x64/CppSharp.Parser.Gen.dll</HintPath></Reference></ItemGroup></Project>' > tritonservercppsharp.csproj
21
34
tee tritonservercppsharp.cs <<EOF
28
41
var options = driver.Options;
29
42
options.GeneratorKind = CppSharp.Generators.GeneratorKind.CSharp;
30
43
var module = options.AddModule("tritonserver");
31
- options.OutputDir = "output2 ";
44
+ options.OutputDir = "variant2 ";
32
45
module.IncludeDirs.Add(".");
33
46
module.IncludeDirs.Add("core/include");
34
47
module.Headers.Add("core/include/triton/core/tritonserver.h");
@@ -40,33 +53,12 @@ jobs:
40
53
} } }
41
54
EOF
42
55
43
- - name : Clone and build CppSharp
44
- run : |
45
- git clone --single-branch --depth 1 https://github.com/mono/CppSharp
46
- cd CppSharp
47
- bash build/build.sh generate -configuration Release -platform $PLATFORM -target-framework $FRAMEWORK
48
- bash build/build.sh download_llvm -platform $PLATFORM -target-framework $FRAMEWORK
49
- bash build/build.sh restore -platform $PLATFORM -target-framework $FRAMEWORK
50
- bash build/build.sh -platform $PLATFORM -build_only -target-framework $FRAMEWORK
51
- find bin
52
-
53
- - name : Generating bindings
54
- run : |
55
- git clone --single-branch --depth 1 --branch r24.08 https://github.com/triton-inference-server/core
56
- git clone --single-branch --depth 1 --branch r24.08 https://github.com/triton-inference-server/developer_tools
57
-
58
- #cp -r ./CppSharp/bin/Release_x64/libCppSharp.CppParser.so ./CppSharp/bin/Release_x64/libStd-symbols.so ./CppSharp/bin/Release_x64/lib .
59
-
60
- ./CppSharp/bin/Release_x64/CppSharp.CLI -m tritonserver -g csharp -p linux -a x64 -o ./output1/ -I=core/include core/include/triton/core/tritonserver.h core/include/triton/core/tritonbackend.h core/include/triton/core/tritoncache.h core/include/triton/core/tritonrepoagent.h
61
-
62
- echo AFTER CLI
63
-
64
- mkdir -p bin/x64/Release/net8.0 && cp -r ./CppSharp/bin/Release_x64/lib bin/x64/Release/net8.0/lib
56
+ mkdir -p bin/x64/Release/$FRAMEWORKDOT && cp -r ./CppSharp/bin/Release_x64/lib bin/x64/Release/$FRAMEWORKDOT/lib
65
57
LD_PRELOAD=$PWD/CppSharp/bin/Release_x64/libCppSharp.CppParser.so:$PWD/CppSharp/bin/Release_x64/libStd-symbols.so dotnet run -c Release
66
58
67
59
68
60
- uses : actions/upload-artifact@v4
69
61
with :
70
62
path : |
71
- output1 /
72
- output2 /
63
+ variant1 /
64
+ variant2 /
0 commit comments