Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into feauture/juputerCod…
Browse files Browse the repository at this point in the history
…eExecutor2
  • Loading branch information
Leon0402 committed Jan 17, 2025
2 parents c178e20 + 6cb7d64 commit 60202f7
Show file tree
Hide file tree
Showing 71 changed files with 2,589 additions and 1,134 deletions.
59 changes: 39 additions & 20 deletions .azure/pipelines/templates/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,20 @@ jobs:
inputs:
useGlobalJson: true
workingDirectory: $(Build.SourcesDirectory)/dotnet
- task: PowerShell@2
displayName: 'Install uv'
inputs:
targetType: 'inline'
script: |
irm https://astral.sh/uv/install.ps1 | iex
$env:Path = "C:\Users\cloudtest\.local\bin;$env:Path"
uv --version
- task: Bash@3
displayName: Install .NET Aspire workload
inputs:
targetType: 'inline'
script: |
dotnet nuget locals all --clear
dotnet nuget locals all --clear
dotnet workload install aspire
- ${{ if eq(variables.runCodeQL3000, 'true') }}:
- task: CodeQL3000Init@0
Expand All @@ -106,6 +114,7 @@ jobs:
arguments: '$(build_flags) /bl:${{parameters.build_configuration}}-Build.binlog /p:Configuration=${{parameters.build_configuration}} $(solution)'
workingDirectory: $(Build.SourcesDirectory)/dotnet
env:
PATH: "C:\\Users\\cloudtest\\.local\\bin;$(PATH)"
${{ if and(eq(parameters.include_suffix, true), eq(parameters.publish_nuget, false)) }}:
VersionSuffix: ${{parameters.version_suffix}}
OfficialBuild: $(official_build)
Expand All @@ -125,16 +134,21 @@ jobs:
inputs:
SourceFolder: '$(build.sourcesdirectory)'
Contents: |
src/**/bin/${{parameters.build_configuration}}/**/AutoGen*.dll
src/**/bin/${{parameters.build_configuration}}/**/Microsoft.AutoGen.*.dll
**/bin/**/AutoGen*.dll
**/bin/**/Microsoft.AutoGen.*.dll
TargetFolder: '$(build.artifactstagingdirectory)\codesign'
CleanTargetFolder: true
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
displayName: 'Codesign: ESRP CodeSigning'
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@5
displayName: 'Codesign: ESRP CodeSigning (dlls)'
inputs:
ConnectedServiceName: 'CodeSign Service (NuGet)'
ConnectedServiceName: 'AI Frontiers ESRP'
AppRegistrationClientId: 'c1e7a5c0-ee6b-4cec-9e11-4dc3f4670042'
AppRegistrationTenantId: '975f013f-7f24-47e8-a7d3-abc4752bf346'
AuthAKVName: 'aif-autogen-esrp-kv'
AuthCertName: 'AIF-PME-InfrastructureAuth'
AuthSignCertName: 'AutoGenPublishESRPPKI' # this variable is only needed for codesign
FolderPath: '$(build.artifactstagingdirectory)\codesign'
Pattern: '*'
Pattern: '*.dll'
signConfigType: inlineSignParams
inlineOperation: |
[
Expand Down Expand Up @@ -163,15 +177,15 @@ jobs:
"parameterValue": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256"
}
],
"toolName": "sign",
"toolVersion": "1.0"
},
{
"keyCode": "CP-230012",
"operationSetCode": "SigntoolVerify",
"parameters": [ ],
"toolName": "sign",
"toolVersion": "1.0"
"toolName": "sign",
"toolVersion": "1.0"
},
{
"keyCode": "CP-230012",
"operationSetCode": "SigntoolVerify",
"parameters": [ ],
"toolName": "sign",
"toolVersion": "1.0"
}
]
SessionTimeout: 180
Expand Down Expand Up @@ -200,11 +214,16 @@ jobs:
inputs:
packageType: runtime
version: $(codesign_runtime)
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@5
displayName: 'Codesign: ESRP CodeSigning (nuget)'
inputs:
ConnectedServiceName: 'CodeSign Service (NuGet)'
FolderPath: '$(build.sourcesdirectory)/Artifacts/${{parameters.build_configuration}}'
ConnectedServiceName: 'AI Frontiers ESRP'
AppRegistrationClientId: 'c1e7a5c0-ee6b-4cec-9e11-4dc3f4670042'
AppRegistrationTenantId: '975f013f-7f24-47e8-a7d3-abc4752bf346'
AuthAKVName: 'aif-autogen-esrp-kv'
AuthCertName: 'AIF-PME-InfrastructureAuth'
AuthSignCertName: 'AutoGenPublishESRPPKI' # this variable is only needed for codesign
FolderPath: '$(build.sourcesdirectory)/dotnet/artifacts/package/${{parameters.build_configuration}}'
Pattern: '*.nupkg'
signConfigType: inlineSignParams
inlineOperation: |
Expand All @@ -225,4 +244,4 @@ jobs:
}
]
SessionTimeout: 180
VerboseLogin: true
VerboseLogin: true
57 changes: 35 additions & 22 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
version: "0.5.18"
- uses: actions/setup-python@v5
with:
python-version: "3.11"
Expand All @@ -36,6 +37,7 @@ jobs:
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
version: "0.5.18"
- uses: actions/setup-python@v5
with:
python-version: "3.11"
Expand Down Expand Up @@ -65,6 +67,7 @@ jobs:
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
version: "0.5.18"
- uses: actions/setup-python@v5
with:
python-version: "3.11"
Expand Down Expand Up @@ -94,6 +97,7 @@ jobs:
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
version: "0.5.18"
- uses: actions/setup-python@v5
with:
python-version: "3.11"
Expand Down Expand Up @@ -121,12 +125,14 @@ jobs:
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
version: "0.5.18"
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Run uv sync
run: |
uv sync --locked --all-extras
echo "PKG_NAME=$(basename '${{ matrix.package }}')" >> $GITHUB_ENV
working-directory: ./python
- name: Run task
Expand All @@ -135,8 +141,20 @@ jobs:
poe --directory ${{ matrix.package }} test
working-directory: ./python

- name: Move coverage file
run: |
mv ${{ matrix.package }}/coverage.xml coverage_${{ env.PKG_NAME }}.xml
working-directory: ./python

- name: Upload coverage artifact
uses: actions/upload-artifact@v4
with:
name: coverage-${{ env.PKG_NAME }}
path: ./python/coverage_${{ env.PKG_NAME }}.xml

codecov:
runs-on: ubuntu-latest
needs: [test]
strategy:
matrix:
package:
Expand All @@ -148,30 +166,20 @@ jobs:
]
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Run uv sync
run: |
uv sync --locked --all-extras
working-directory: ./python
- name: Run task
- name: Set up environment
run: |
source ${{ github.workspace }}/python/.venv/bin/activate
poe --directory ${{ matrix.package }} coverage
working-directory: ./python
- name: Upload coverage
uses: codecov/codecov-action@v5
echo "PKG_NAME=$(basename '${{ matrix.package }}')" >> $GITHUB_ENV
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: coverage-${{ env.PKG_NAME }}
path: ./
- uses: codecov/codecov-action@v5
with:
fail_ci_if_error: true # optional (default = false)
files: ${{ matrix.package }}/coverage.xml # optional
flags: unittests # optional
name: codecov-umbrella # optional
verbose: true # optional (default = false)
files: coverage_${{ env.PKG_NAME }}.xml
flags: unittests
name: codecov-umbrella
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}

docs:
Expand All @@ -184,6 +192,7 @@ jobs:
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
version: "0.5.18"
- uses: actions/setup-python@v5
with:
python-version: "3.11"
Expand All @@ -205,6 +214,7 @@ jobs:
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
version: "0.5.18"
- uses: actions/setup-python@v5
with:
python-version: "3.11"
Expand All @@ -223,6 +233,7 @@ jobs:
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
version: "0.5.18"
- uses: actions/setup-python@v5
with:
python-version: "3.11"
Expand All @@ -241,6 +252,7 @@ jobs:
- uses: astral-sh/setup-uv@v3
with:
enable-cache: true
version: "0.5.18"
- uses: actions/setup-python@v5
with:
python-version: "3.11"
Expand All @@ -259,6 +271,7 @@ jobs:
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
version: "0.5.18"
- uses: actions/setup-python@v5
with:
python-version: "3.11"
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ jobs:
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
version: "0.5.18"
- run: uv sync --locked --all-extras
working-directory: ./python
- name: Prepare python venv
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
[
# For main use the workflow target
{ ref: "${{github.ref}}", dest-dir: dev, uv-version: "0.5.13", sphinx-release-override: "dev" },
{ ref: "v0.4.1", dest-dir: stable, uv-version: "0.5.13", sphinx-release-override: "stable" },
{ ref: "v0.4.2", dest-dir: stable, uv-version: "0.5.13", sphinx-release-override: "stable" },
{ ref: "v0.4.0.dev0", dest-dir: "0.4.0.dev0", uv-version: "0.5.11", sphinx-release-override: "" },
{ ref: "v0.4.0.dev1", dest-dir: "0.4.0.dev1", uv-version: "0.5.11", sphinx-release-override: "" },
{ ref: "v0.4.0.dev2", dest-dir: "0.4.0.dev2", uv-version: "0.5.11", sphinx-release-override: "" },
Expand All @@ -50,6 +50,7 @@ jobs:
{ ref: "v0.4.0.dev13", dest-dir: "0.4.0.dev13", uv-version: "0.5.13", sphinx-release-override: "" },
{ ref: "v0.4.0.post1", dest-dir: "0.4.0", uv-version: "0.5.13", sphinx-release-override: "" },
{ ref: "v0.4.1", dest-dir: "0.4.1", uv-version: "0.5.13", sphinx-release-override: "" },
{ ref: "v0.4.2", dest-dir: "0.4.2", uv-version: "0.5.13", sphinx-release-override: "" },
]
steps:
- name: Checkout
Expand Down Expand Up @@ -110,6 +111,7 @@ jobs:
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
version: "0.5.18"
- uses: actions/setup-python@v5
with:
python-version: "3.11"
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/dotnet-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ jobs:
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
version: "0.5.18"
- run: uv sync --locked --all-extras
working-directory: ./python
- name: Prepare python venv
Expand Down Expand Up @@ -122,6 +123,7 @@ jobs:
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
version: "0.5.18"
- uses: actions/setup-python@v5
with:
python-version: "3.11"
Expand Down Expand Up @@ -206,6 +208,7 @@ jobs:
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
version: "0.5.18"
- uses: actions/setup-python@v5
with:
python-version: "3.11"
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/single-python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ jobs:
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
version: "0.5.18"
- run: uv build --package ${{ github.event.inputs.package }} --out-dir dist/
working-directory: python
- name: Publish package to PyPI
Expand Down
30 changes: 30 additions & 0 deletions docs/dotnet/user-guide/core-user-guide/defining-message-types.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Defining Message Types

Messages are currently required to be Protocol Buffers. To define them, it is necessary to include the Protocol Buffers compiler, through the `Grpc.Tools` package. In your `.csproj` file, add/edit:

```xml
<PackageReference Include="Grpc.Tools" PrivateAssets="All" />
```

Then create an include a `.proto` file in the project:

```xml
<ItemGroup>
<Protobuf Include="messages.proto" GrpcServices="Client;Server" Link="messages.proto" />
</ItemGroup>
```

Then define your messages as specified in the [Protocol Buffers Language Guide](https://protobuf.dev/programming-guides/proto3/)

```proto
syntax = "proto3";
package HelloAgents;
option csharp_namespace = "AgentsProtocol";
message TextMessage {
string Source = 1;
string Content = 2;
}
```
Loading

0 comments on commit 60202f7

Please sign in to comment.