Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve submitter client ext #39

Draft
wants to merge 13 commits into
base: main
Choose a base branch
from
27 changes: 27 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,33 @@ jobs:
protoc -I/usr/include -Iprotos --doc_out=/out --doc_opt=markdown,index.md protos/*.proto

build:
runs-on: ubuntu-latest
needs: versionning
env:
VERSION: ${{ needs.versionning.outputs.version }}
strategy:
fail-fast: true
matrix:
package:
- Api/csharp/ArmoniK.Api.Client.Tests/ArmoniK.Api.Client.Tests.csproj
- Api/csharp/ArmoniK.Api.Worker.Tests/ArmoniK.Api.Worker.Tests.csproj
steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: ${{ github.ref }}

# Install the .NET Core workload
- name: Install .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.x

- name: Build the package
run: |
dotnet build ${{ matrix.package }} -c Release

pack:
runs-on: ubuntu-latest
needs: versionning
env:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net48</TargetFrameworks>
<Company>ANEO</Company>
<Copyright>Copyright (C) ANEO, 2021-2022</Copyright>
<IsPackable>true</IsPackable>
<LangVersion>10</LangVersion>
<Optimize>true</Optimize>
<DebugType>Embedded</DebugType>
<IncludeSymbols>true</IncludeSymbols>
<OutputType>Exe</OutputType>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<DefineConstants>DEBUG;TRACE</DefineConstants>
</PropertyGroup>


<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="6.0.1" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\ArmoniK.Api.Client\ArmoniK.Api.Client.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
// This file is part of the ArmoniK project
//
// Copyright (C) ANEO, 2021-2022. All rights reserved.
// W. Kirschenmann <[email protected]>
// J. Gurhem <[email protected]>
// D. Dubuc <[email protected]>
// L. Ziane Khodja <[email protected]>
// F. Lemaitre <[email protected]>
// S. Djebbar <[email protected]>
// J. Fonseca <[email protected]>
//
// Licensed under the Apache License, Version 2.0 (the "License")
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.


using System;

using ArmoniK.Api.Client.Options;
using ArmoniK.Api.Client.Submitter;
using ArmoniK.Api.gRPC.V1;
using ArmoniK.Api.gRPC.V1.Submitter;

using Microsoft.Extensions.Configuration;

var configuration = new ConfigurationBuilder().AddEnvironmentVariables()
.Build();

var options = configuration.GetRequiredSection(GrpcClient.SettingSection)
.Get<GrpcClient>();

var channel = GrpcChannelFactory.CreateChannel(options);

var client = new Submitter.SubmitterClient(channel);

var reply = client.GetServiceConfiguration(new Empty());

Console.WriteLine(reply.DataChunkMaxSize);

if (reply.DataChunkMaxSize == 0)
{
throw new Exception("DataChunkMaxSize is 0");
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0</TargetFrameworks>
<Company>ANEO</Company>
<Copyright>Copyright (C) ANEO, 2021-2022</Copyright>
<IsPackable>false</IsPackable>
<LangVersion>10</LangVersion>
<Optimize>true</Optimize>
<DebugType>Embedded</DebugType>
<IncludeSymbols>true</IncludeSymbols>
<AssemblyOriginatorKeyFile>../kp.snk</AssemblyOriginatorKeyFile>
<SignAssembly>True</SignAssembly>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<DefineConstants>DEBUG;TRACE</DefineConstants>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.2.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="6.0.1" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\ArmoniK.Api.Client\ArmoniK.Api.Client.csproj" />
</ItemGroup>

</Project>
Loading