Skip to content
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
114 changes: 114 additions & 0 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ name: CI/CD for Deep Learning Protocol
on:
push:
branches: [ main, master, develop ]
tags: ['v*']
pull_request:
branches: [ main, master, develop ]

env:
DOTNET_VERSION: '10.0.x'
BUILD_CONFIGURATION: Release
VERSION: '3.2'
ARTIFACT_RETENTION_DAYS: 30
RELEASE_ARTIFACT_RETENTION_DAYS: 90

Expand Down Expand Up @@ -131,6 +133,30 @@ jobs:
- name: Publish framework-dependent release
run: dotnet publish DeepLearningProtocol/DeepLearningProtocol.csproj -c ${{ env.BUILD_CONFIGURATION }} -o ./release-build/framework-dependent

# Docker build validation
docker-build:
needs: build-and-test
runs-on: ubuntu-latest
if: github.event_name == 'push'

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build Docker image (validate)
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile
push: false
tags: deeplearningprotocol:${{ env.VERSION }}

- name: Create release archive (Linux)
run: tar -czf release-build/deeplearning-protocol-linux-x64.tar.gz -C release-build linux-x64

Expand All @@ -143,6 +169,87 @@ jobs:
- name: Create release archive (Framework-dependent)
run: tar -czf release-build/deeplearning-protocol-framework-dependent.tar.gz -C release-build framework-dependent

# Installer creation
- name: Create Windows Installer (NSIS/Batch)
run: |
mkdir -p release-build/installers
cp Installers/install-windows.bat release-build/installers/
echo "Windows installer created"

- name: Create Linux Installer Script
run: |
cp Installers/install-linux.sh release-build/installers/
chmod +x release-build/installers/install-linux.sh
echo "Linux installer created"

- name: Create macOS Installer Script
run: |
cp Installers/install-macos.sh release-build/installers/
chmod +x release-build/installers/install-macos.sh
echo "macOS installer created"

- name: Package Installers
run: |
cd release-build/installers
tar -czf ../deeplearning-protocol-installers.tar.gz *.sh *.bat
zip -r ../deeplearning-protocol-installers.zip *.sh *.bat
cd ../..
ls -lh release-build/deeplearning-protocol-installers.*

- name: Create Release on GitHub
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
release-build/deeplearning-protocol-linux-x64.tar.gz
release-build/deeplearning-protocol-win-x64.zip
release-build/deeplearning-protocol-osx-x64.tar.gz
release-build/deeplearning-protocol-framework-dependent.tar.gz
release-build/deeplearning-protocol-installers.tar.gz
release-build/deeplearning-protocol-installers.zip
body: |
# Deep Learning Protocol v${{ env.VERSION }}

**Highlights:** This release adds a SignalR server endpoint (`/hub/notifications`) and updates Docker to use the ASP.NET runtime with port 80 exposed for web/SignalR support.

## Release Contents

### Self-Contained Binaries
- **deeplearning-protocol-linux-x64.tar.gz** - Linux executable (x64)
- **deeplearning-protocol-win-x64.zip** - Windows executable (x64)
- **deeplearning-protocol-osx-x64.tar.gz** - macOS executable (x64)
- **deeplearning-protocol-framework-dependent.tar.gz** - Framework-dependent build

### Installers (Recommended)
- **deeplearning-protocol-installers.tar.gz** - All installer scripts (Unix format)
- **deeplearning-protocol-installers.zip** - All installer scripts (Windows format)

## Installation Instructions

### Windows
1. Extract `deeplearning-protocol-installers.zip`
2. Right-click `install-windows.bat` and select "Run as Administrator"
3. Follow the installation wizard

### Linux
1. Extract `deeplearning-protocol-installers.tar.gz`
2. Run: `sudo bash install-linux.sh`
3. Start the service: `sudo systemctl start deep-learning-protocol`

### macOS
1. Extract `deeplearning-protocol-installers.tar.gz`
2. Run: `sudo bash install-macos.sh`
3. Load the launch agent: `launchctl load /Library/LaunchAgents/com.quickattach0tech.deeplearningprotocol.plist`

- name: Publish NuGet package
if: ${{ startsWith(github.ref, 'refs/tags/') && secrets.NUGET_API_KEY != '' }}
run: |
echo "Packing NuGet package for DeepLearningProtocol v${{ env.VERSION }}"
dotnet pack DeepLearningProtocol/DeepLearningProtocol.csproj -c Release -o ./nupkgs /p:PackageVersion=${{ env.VERSION }}
ls -l ./nupkgs || true
echo "Publishing package to nuget.org (skip if already exists)"
dotnet nuget push ./nupkgs/*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json --skip-duplicate || true

- name: Upload multi-platform release artifacts
uses: actions/upload-artifact@v4
with:
Expand All @@ -152,6 +259,13 @@ jobs:
release-build/deeplearning-protocol-*.zip
retention-days: ${{ env.RELEASE_ARTIFACT_RETENTION_DAYS }}

- name: Upload installers artifact
uses: actions/upload-artifact@v4
with:
name: deeplearning-protocol-installers
path: release-build/installers/
retention-days: ${{ env.RELEASE_ARTIFACT_RETENTION_DAYS }}

- name: Upload binaries artifact
uses: actions/upload-artifact@v4
with:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x64</Platform>
<ProductVersion>3.10</ProductVersion>
<ProjectGuid>e4d10f5f-5e2f-4e4e-8e8e-8e8e8e8e8e8e</ProjectGuid>
<SchemaVersion>2.0</SchemaVersion>
<OutputName>DeepLearningProtocol</OutputName>
<OutputType>Package</OutputType>
<WixToolPath Condition="!Exists('$(WixToolPath)')">$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x</WixToolPath>
<WixTargetsPath Condition="!Exists('$(WixTargetsPath)')">$(WixToolPath)\Wix.targets</WixTargetsPath>
<Title>Deep Learning Protocol</Title>
<Version>3.2.0.0</Version>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
<OutputPath>bin\$(Configuration)\</OutputPath>
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
<DefineConstants>Debug</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
<OutputPath>bin\$(Configuration)\</OutputPath>
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
</PropertyGroup>
<ItemGroup>
<Compile Include="Product.wxs" />
</ItemGroup>
<Import Project="$(WixTargetsPath)" />
</Project>
86 changes: 86 additions & 0 deletions DeepLearningProtocol.Installer/Product.wxs
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<?define ProductVersion="3.2.0" ?>
<?define ProductUpgradeCode="7E4A1F3C-6B2F-4F1D-9E8B-3D5C2F4A1E9D" ?>
<?define BinPath="..\DeepLearningProtocol\bin\Release\net10.0\win-x64\publish" ?>

<Product Id="*"
Name="Deep Learning Protocol"
Language="1033"
Version="$(var.ProductVersion)"
Manufacturer="quickattach0-tech"
UpgradeCode="$(var.ProductUpgradeCode)">

<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" Platform="x64" />

<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate EmbedCab="yes" />

<Feature Id="ProductFeature" Title="Deep Learning Protocol" Level="1">
<ComponentRef Id="ProgramFilesComponent" />
<ComponentRef Id="DesktopShortcut" />
<ComponentRef Id="StartMenuShortcut" />
</Feature>

<WixUI Id="WixUI_InstallDir" />
<UIRef Id="WixUI_ErrorProgressText" />
</Product>

<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLFOLDER" Name="Deep Learning Protocol" />
</Directory>
<Directory Id="ProgramMenuFolder">
<Directory Id="ApplicationProgramsFolder" Name="Deep Learning Protocol" />
</Directory>
<Directory Id="DesktopFolder" Name="Desktop" />
</Directory>
</Fragment>

<Fragment>
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
<Component Id="ProgramFilesComponent" Guid="*">
<File Id="DeepLearningProtocolExe"
Source="$(var.BinPath)\DeepLearningProtocol.exe"
KeyPath="yes"
Checksum="yes" />
<File Id="DeepLearningProtocolDll"
Source="$(var.BinPath)\DeepLearningProtocol.dll" />
<!-- Include resource files -->
<File Id="ConfigJson" Source="$(var.BinPath)\appsettings.json" />
</Component>
</ComponentGroup>

<Component Id="DesktopShortcut" Directory="DesktopFolder" Guid="*">
<Shortcut Id="DesktopShortcut"
Name="Deep Learning Protocol"
Target="[INSTALLFOLDER]DeepLearningProtocol.exe"
WorkingDirectory="INSTALLFOLDER" />
<RegistryValue Root="HKCU"
Key="Software\Deep Learning Protocol"
Name="DesktopShortcut"
Type="integer"
Value="1"
KeyPath="yes" />
</Component>

<Component Id="StartMenuShortcut" Directory="ApplicationProgramsFolder" Guid="*">
<Shortcut Id="StartMenuShortcut"
Name="Deep Learning Protocol"
Target="[INSTALLFOLDER]DeepLearningProtocol.exe"
WorkingDirectory="INSTALLFOLDER" />
<Shortcut Id="UninstallProduct"
Name="Uninstall Deep Learning Protocol"
Target="[System64Folder]msiexec.exe"
Arguments="/x [ProductCode]" />
<RemoveFolder Id="ApplicationProgramsFolder" On="uninstall" />
<RegistryValue Root="HKCU"
Key="Software\Deep Learning Protocol"
Name="StartMenuShortcut"
Type="integer"
Value="1"
KeyPath="yes" />
</Component>
</Fragment>
</Wix>
4 changes: 2 additions & 2 deletions DeepLearningProtocol/DeepLearningProtocol.csproj
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Version>3.1</Version>
<Version>3.2</Version>
<Title>Deep Learning Protocol</Title>
<Description>A hierarchical multi-interface reasoning system with Quality Translation capabilities, multi-language support, 24-hour uptime tracking, and enterprise-grade code management.</Description>
<Authors>quickattach0-tech</Authors>
Expand Down
32 changes: 30 additions & 2 deletions DeepLearningProtocol/Program.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,44 @@
using System;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.DependencyInjection;
using DeepLearningProtocol.SignalR;

namespace DeepLearningProtocol
{
/// <summary>
/// Main entry point for the Deep Learning Protocol application.
/// Delegates to MenuSystem for interactive menu display and protocol execution.
/// Hosts a SignalR endpoint and continues to provide the interactive menu.
/// </summary>
class Program
{
static void Main(string[] args)
static async Task Main(string[] args)
{
var builder = WebApplication.CreateBuilder(args);

// Enable SignalR
builder.Services.AddSignalR();

// Configure web host URLs
builder.WebHost.UseUrls("http://0.0.0.0:80");

var app = builder.Build();

// Health endpoint
app.MapGet("/health", () => Results.Ok(new { version = "3.2" }));

// SignalR Hub
app.MapHub<NotificationHub>("/hub/notifications");

// Start web host without blocking
var webHostTask = app.RunAsync();

// Run existing interactive menu on the main thread
MenuSystem.DisplayMainMenu();

// Wait for the web host to finish (it won't unless stopped)
await webHostTask;
}
}
}
Expand Down
13 changes: 13 additions & 0 deletions DeepLearningProtocol/SignalR/NotificationHub.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using Microsoft.AspNetCore.SignalR;
using System.Threading.Tasks;

namespace DeepLearningProtocol.SignalR
{
public class NotificationHub : Hub
{
public async Task SendNotification(string message)
{
await Clients.All.SendAsync("ReceiveNotification", message);
}
}
}
16 changes: 11 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ RUN dotnet restore DeepLearningProtocol.sln
# Copy source code
COPY . .

# Ensure packages (including analyzers) are restored after copying source
RUN dotnet restore

# Build the application
RUN dotnet build DeepLearningProtocol.sln --configuration Release --no-restore

Expand All @@ -32,7 +35,7 @@ RUN dotnet publish DeepLearningProtocol/DeepLearningProtocol.csproj \


# Stage 2: Runtime stage
FROM mcr.microsoft.com/dotnet/runtime:10.0-alpine
FROM mcr.microsoft.com/dotnet/aspnet:10.0-alpine

WORKDIR /app

Expand All @@ -42,14 +45,17 @@ RUN mkdir -p .dlp_backups
# Copy published application from builder stage
COPY --from=builder /app/publish .

# Expose HTTP port
EXPOSE 80

# Add labels for metadata
LABEL maintainer="Deep Learning Protocol Contributors"
LABEL description="Deep Learning Protocol - A hierarchical multi-interface reasoning system with Data Loss Prevention"
LABEL version="1.0.0"
LABEL description="Deep Learning Protocol - A hierarchical multi-interface reasoning system with SignalR support"
LABEL version="3.2"

# Set entry point
ENTRYPOINT ["dotnet", "DeepLearningProtocol.dll"]

# Health check
# Health check (checks /health endpoint)
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD dotnet DeepLearningProtocol.dll --version || exit 1
CMD wget -qO- http://localhost/health || exit 1
Loading