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

Nexus Agent #2

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 41 additions & 25 deletions .github/workflows/build-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@ on:
push:
branches:
- master
- dev

tags:
- '*'

pull_request:
branches:
- master

jobs:

build:
Expand Down Expand Up @@ -36,41 +39,54 @@ jobs:
if: ${{ env.IS_RELEASE == 'true' }}
run: python build/create_tag_body.py

- name: Set up Python
uses: actions/setup-python@v3
- name: Set up dotnet
uses: actions/setup-dotnet@v4
with:
python-version: '3.9'
dotnet-version: "9.0.x"
dotnet-quality: "preview"

- name: Install
run: |
sudo apt install jq
npm install -g pyright
python -m pip install build wheel pytest pytest-asyncio
python -m pip install --pre --index-url https://www.myget.org/F/apollo3zehn-dev/python/ nexus-extensibility
# - name: Set up Python
# uses: actions/setup-python@v3
# with:
# python-version: '3.9'

- name: Prepare
run: |
chmod +x tests/Nexus.Sources.Remote.Tests/bash/remote.sh
- name: Create Docker Output Folder
run: mkdir --parent artifacts/images

# - name: Install
# run: |
# npm install -g pyright
# python -m pip install build wheel pytest pytest-asyncio
# python -m pip install --pre --index-url https://www.myget.org/F/apollo3zehn-dev/python/ nexus-extensibility

- name: Docker Setup
id: buildx
uses: docker/setup-buildx-action@v1

- name: Build
run: |
dotnet build -c Release /p:GeneratePackage=true src/remoting/dotnet-remoting/dotnet-remoting.csproj
python -m build --wheel --outdir artifacts/package --no-isolation src/remoting/python-remoting
dotnet publish -c Release -o app /p:GeneratePackage=true src/Nexus.Agent/Nexus.Agent.csproj
# python -m build --wheel --outdir artifacts/package --no-isolation src/remoting/python-remoting

- name: Test
run: |
dotnet test -c Release --filter TestCategory=local
pyright
pytest
sudo bash tests/Nexus.Sources.Remote.Tests/SetupDockerTests.sh
dotnet test -c Release
# pyright
# pytest

- name: Docker Build
run: |
docker build -t nexus-main/nexus-agent:v_next -f src/Nexus.Agent/Dockerfile .
docker save --output artifacts/images/nexus_agent_image.tar nexus-main/nexus-agent:v_next

- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: artifacts
path: |
artifacts/tag_body.txt
artifacts/*.txt
artifacts/package/
artifacts/images/

outputs:
is_release: ${{ env.IS_RELEASE }}
Expand Down Expand Up @@ -98,11 +114,11 @@ jobs:
env:
MYGET_API_KEY: ${{ secrets.MYGET_API_KEY }}

# GitHub Package Registry does not support Python packages: https://github.community/t/pypi-compatible-github-package-registry/14615
- name: Python package (MyGet)
run: 'for filePath in artifacts/package/*.whl; do curl -k -X POST https://www.myget.org/F/apollo3zehn-dev/python/upload -H "Authorization: Bearer ${MYGET_API_KEY}" -F "data=@$filePath"; done'
env:
MYGET_API_KEY: ${{ secrets.MYGET_API_KEY }}
# # GitHub Package Registry does not support Python packages: https://github.community/t/pypi-compatible-github-package-registry/14615
# - name: Python package (MyGet)
# run: 'for filePath in artifacts/package/*.whl; do curl -k -X POST https://www.myget.org/F/apollo3zehn-dev/python/upload -H "Authorization: Bearer ${MYGET_API_KEY}" -F "data=@$filePath"; done'
# env:
# MYGET_API_KEY: ${{ secrets.MYGET_API_KEY }}

publish_release:

Expand Down
10 changes: 10 additions & 0 deletions .nexus-agent/config/packages.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"c05b592f-e198-472d-9902-3f60cf0a6332": {
"Provider": "local",
"Configuration": {
"path": "../../tests/Nexus.Sources.Remote.Tests/dotnet",
"version": "v1",
"csproj": "remote.csproj"
}
}
}
19 changes: 19 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch Nexus.Agent",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build-nexus-agent",
"program": "${workspaceFolder}/artifacts/bin/Nexus.Agent/debug/Nexus.Agent.dll",
"args": [],
"cwd": "${workspaceFolder}/src/Nexus.Agent",
"stopAtEntry": false,
"env": {
"ASPNETCORE_ENVIRONMENT": "Development",
"NEXUSAGENT_Paths__Config": "../../.nexus-agent/config"
}
}
]
}
18 changes: 9 additions & 9 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,38 @@
"version": "2.0.0",
"tasks": [
{
"label": "build",
"label": "build-nexus-agent",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/src/Nexus.Sources.Remote/Nexus.Sources.Remote.csproj",
"${workspaceFolder}/src/Nexus.Agent/Nexus.Agent.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"label": "publish",
"label": "build",
"command": "dotnet",
"type": "process",
"args": [
"publish",
"build",
"${workspaceFolder}/src/Nexus.Sources.Remote/Nexus.Sources.Remote.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"label": "watch",
"label": "publish",
"command": "dotnet",
"type": "process",
"args": [
"watch",
"run",
"--project",
"${workspaceFolder}/src/Nexus.Sources.Remote/Nexus.Sources.Remote.csproj"
"publish",
"${workspaceFolder}/src/Nexus.Sources.Remote/Nexus.Sources.Remote.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
}
Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<TargetFrameworkVersion>net8.0</TargetFrameworkVersion>
<TargetFrameworkVersion>net9.0</TargetFrameworkVersion>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
Expand Down
7 changes: 7 additions & 0 deletions Remote.sln
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "benchmarks", "benchmarks",
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Nexus.Benchmarks", "benchmarks\Nexus.Benchmarks\Nexus.Benchmarks.csproj", "{B602750B-5E89-453F-841B-8D7F22DE58EB}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Nexus.Agent", "src\Nexus.Agent\Nexus.Agent.csproj", "{71F41120-5BC2-4684-ADB7-C8C97CCE8EAF}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -41,6 +43,10 @@ Global
{B602750B-5E89-453F-841B-8D7F22DE58EB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B602750B-5E89-453F-841B-8D7F22DE58EB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B602750B-5E89-453F-841B-8D7F22DE58EB}.Release|Any CPU.Build.0 = Release|Any CPU
{71F41120-5BC2-4684-ADB7-C8C97CCE8EAF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{71F41120-5BC2-4684-ADB7-C8C97CCE8EAF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{71F41120-5BC2-4684-ADB7-C8C97CCE8EAF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{71F41120-5BC2-4684-ADB7-C8C97CCE8EAF}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -51,6 +57,7 @@ Global
{59CBCE56-7832-4B55-854F-C9B5E4FBEA86} = {F226553B-2E5B-4910-AF31-0B718872AF18}
{FC047115-277B-448E-854F-275B5B8343A5} = {59CBCE56-7832-4B55-854F-C9B5E4FBEA86}
{B602750B-5E89-453F-841B-8D7F22DE58EB} = {40C5CF08-E45E-4F25-BE8F-B5BBD4B0EDB3}
{71F41120-5BC2-4684-ADB7-C8C97CCE8EAF} = {F226553B-2E5B-4910-AF31-0B718872AF18}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {B035E550-8A68-427B-92F1-9B1A6977BF8F}
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/Nexus.Benchmarks/Nexus.Benchmarks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.13.12" />
<PackageReference Include="BenchmarkDotNet" Version="0.14.0" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion benchmarks/Nexus.Benchmarks/PipeVsTcp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public void GlobalSetup()
{
Arguments = $"{assemblyPath} pipe",
UseShellExecute = false,
RedirectStandardInput = true,
RedirectStandardInput = false,
RedirectStandardOutput = true,
RedirectStandardError = true
};
Expand Down
9 changes: 9 additions & 0 deletions sample/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: "3.7"

services:

nexus-agent:
container_name: nexus-agent
image: mcr.microsoft.com/dotnet/sdk:9.0
entrypoint: bash -c "git clone https://github.com/nexus-main/nexus-sources-remote; dotnet run --project src/Nexus.Agent/Nexus.Agent.csproj"
restart: always
18 changes: 0 additions & 18 deletions setup/README.md

This file was deleted.

27 changes: 0 additions & 27 deletions setup/docker/docker-compose.yml

This file was deleted.

27 changes: 0 additions & 27 deletions setup/docker/dotnet/satellite.sh

This file was deleted.

34 changes: 0 additions & 34 deletions setup/docker/python/satellite.sh

This file was deleted.

Loading
Loading