Add docker execution environment

This commit is contained in:
Stone_Red
2025-12-27 00:08:01 +01:00
parent 252aca98b4
commit bf1b5506c0
31 changed files with 848 additions and 25 deletions
@@ -0,0 +1,10 @@
namespace RemoteExec.Shared.Models.Docker;
public class ContainerExecutionRequest
{
public required string AssemblyBytes { get; set; }
public required string TypeName { get; set; }
public required string MethodName { get; set; }
public required string[] ArgumentTypes { get; set; }
public required object[] Arguments { get; set; }
}
@@ -0,0 +1,8 @@
namespace RemoteExec.Shared.Models.Docker;
public class ContainerExecutionResponse
{
public bool Success { get; set; }
public object? Result { get; set; }
public string? Exception { get; set; }
}
@@ -0,0 +1,32 @@
namespace RemoteExec.Shared.Models;
/// <summary>
/// Represents a request to execute a static method on a remote server.
/// </summary>
public sealed class RemoteExecutionRequest
{
/// <summary>
/// Gets or sets the full name of the assembly containing the method.
/// </summary>
public required string AssemblyName { get; set; }
/// <summary>
/// Gets or sets the full name of the type containing the method.
/// </summary>
public required string TypeName { get; set; }
/// <summary>
/// Gets or sets the name of the method to execute.
/// </summary>
public required string MethodName { get; set; }
/// <summary>
/// Gets or sets the assembly-qualified names of the method's parameter types.
/// </summary>
public required string[] ArgumentTypes { get; set; }
/// <summary>
/// Gets or sets the arguments to pass to the method.
/// </summary>
public required object[] Arguments { get; set; }
}
@@ -0,0 +1,17 @@
namespace RemoteExec.Shared.Models;
/// <summary>
/// Represents the result of a remote method execution.
/// </summary>
public sealed class RemoteExecutionResult
{
/// <summary>
/// Gets or sets the return value of the executed method, or null if the method returns void.
/// </summary>
public object? Result { get; set; }
/// <summary>
/// Gets or sets the exception message if the execution failed, or null if successful.
/// </summary>
public string? Exception { get; set; }
}
+42
View File
@@ -0,0 +1,42 @@
namespace RemoteExec.Shared.Models;
/// <summary>
/// Represents performance and status metrics for a remote execution server.
/// </summary>
public sealed class ServerMetrics
{
/// <summary>
/// Gets or sets the number of active client connections to the server.
/// </summary>
public int ActiveConnections { get; set; }
/// <summary>
/// Gets or sets the number of tasks currently being executed on the server.
/// </summary>
public int ActiveTasks { get; set; }
/// <summary>
/// Gets or sets the maximum number of tasks that can execute concurrently on the server.
/// </summary>
public int MaxConcurrentTasks { get; set; }
/// <summary>
/// Gets or sets the total memory usage of the server process in bytes.
/// </summary>
public long TotalMemoryUsage { get; set; }
/// <summary>
/// Gets or sets the CPU usage percentage (0-100) of the server process.
/// </summary>
public double CpuUsage { get; set; }
/// <summary>
/// Gets or sets the timestamp when these metrics were captured.
/// </summary>
public DateTime Timestamp { get; set; }
/// <summary>
/// Gets or sets the unique identifier for the server.
/// </summary>
public string ServerId { get; set; } = string.Empty;
}
+17
View File
@@ -0,0 +1,17 @@
namespace RemoteExec.Shared.Models;
/// <summary>
/// Represents a task item in the execution stream, combining a task ID with its execution request.
/// </summary>
public class TaskItem
{
/// <summary>
/// Gets or sets the unique identifier for this task.
/// </summary>
public Guid TaskId { get; set; }
/// <summary>
/// Gets or sets the execution request details.
/// </summary>
public required RemoteExecutionRequest Request { get; set; }
}