Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
974822e
Создал структуру проекта и забабахал модель
PripyatskyPrometheus Feb 22, 2026
3a5a4ea
Delete SoftwareProject.ApiService directory
PripyatskyPrometheus Feb 22, 2026
b803d52
Delete SoftwareProject.Web directory
PripyatskyPrometheus Feb 22, 2026
5f6b884
Добавил генератор и контроллер.
PripyatskyPrometheus Feb 23, 2026
9761727
Устранение конфликтов
PripyatskyPrometheus Feb 23, 2026
4524147
Неболшая калибровка
PripyatskyPrometheus Feb 23, 2026
7467676
Добавил описание
PripyatskyPrometheus Feb 23, 2026
12dd63b
Добавил работу клиента, которую прошляпил до этого:)
PripyatskyPrometheus Feb 25, 2026
0922e68
Исправил замечания
PripyatskyPrometheus Feb 26, 2026
b6814d1
Побился над кодировкой
PripyatskyPrometheus Feb 26, 2026
f30d735
Исправил версии
PripyatskyPrometheus Feb 27, 2026
26a96a3
Ещё одна порция исправлений
PripyatskyPrometheus Feb 28, 2026
af34dbb
Сделал, как надо
PripyatskyPrometheus Feb 28, 2026
9b8bfaa
Добавил токе
PripyatskyPrometheus Mar 1, 2026
f48f222
Выполнил вторую лабу (надеюсь, что выполнил, потому что это был какой…
PripyatskyPrometheus Mar 3, 2026
a1ae1c2
Небольшие поправки
PripyatskyPrometheus Mar 3, 2026
276fd54
.
PripyatskyPrometheus Mar 3, 2026
93f7d6c
Упростил задачу и починил кодировку в консоли
PripyatskyPrometheus Mar 4, 2026
027fd1a
...
PripyatskyPrometheus Mar 4, 2026
ae3954d
Вместо 3 реплик сделал 5, как сказал лектор
PripyatskyPrometheus Mar 11, 2026
e1b02fc
Настроил таки ручную репликацию. Теперь у меня распределение по ерпли…
PripyatskyPrometheus Mar 15, 2026
12514d5
.
PripyatskyPrometheus Mar 15, 2026
2224c0d
..
PripyatskyPrometheus Mar 15, 2026
79ed316
Исправил замечания
PripyatskyPrometheus Mar 19, 2026
b968029
Сделано
PripyatskyPrometheus Mar 20, 2026
7f76cb6
Добавил SQS и Minio ля 3 лабы
PripyatskyPrometheus Apr 4, 2026
0e54024
Поправочки.
PripyatskyPrometheus Apr 5, 2026
85c95e8
Тесты доавлены (ох сколько они у меня крови попили!)
PripyatskyPrometheus Apr 5, 2026
b595aca
.
PripyatskyPrometheus Apr 5, 2026
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
12 changes: 6 additions & 6 deletions Client.Wasm/Components/StudentCard.razor
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<Card>
<Card>
<CardHeader>
<Heading Size="HeadingSize.Is5"><Icon Name="IconName.User" /> Лабораторная работа</Heading>
</CardHeader>
<CardBody>
<UnorderedList Unstyled>
<UnorderedListItem>Номер <Strong>№X "Название лабораторной"</Strong></UnorderedListItem>
<UnorderedListItem>Вариант <Strong>№Х "Название варианта"</Strong></UnorderedListItem>
<UnorderedListItem>Выполнена <Strong>Фамилией Именем 65ХХ</Strong> </UnorderedListItem>
<UnorderedListItem><Link To="https://puginarug.com/">Ссылка на форк</Link></UnorderedListItem>
<UnorderedListItem>Номер <Strong>№2 «Интеграционное тестирование»</Strong></UnorderedListItem>
<UnorderedListItem>Вариант <Strong>№35 "Программный проект"</Strong></UnorderedListItem>
<UnorderedListItem>Выполнена <Strong>Челаевым Петром 6512</Strong> </UnorderedListItem>
<UnorderedListItem><Link To="https://github.com/PripyatskyPrometheus/cloud-development">Ссылка на форк</Link></UnorderedListItem>
</UnorderedList>
</CardBody>
</Card>
</Card>
2 changes: 1 addition & 1 deletion Client.Wasm/wwwroot/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
}
},
"AllowedHosts": "*",
"BaseAddress": ""
"BaseAddress": "http://localhost:5232/api/projects"
}
36 changes: 36 additions & 0 deletions CloudDevelopment.sln
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@ VisualStudioVersion = 17.14.36811.4
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Client.Wasm", "Client.Wasm\Client.Wasm.csproj", "{AE7EEA74-2FE0-136F-D797-854FD87E022A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProgramProject.AppHost", "ProgramProject.AppHost\ProgramProject.AppHost.csproj", "{7FA94C9A-CD2C-4D76-A42C-5C0EEDC6D68D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProgramProject.ServiceDefaults", "ProgramProject.ServiceDefaults\ProgramProject.ServiceDefaults.csproj", "{213F5ADB-6769-02BA-8BFA-17C924D27341}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProgramProject.GenerationService", "ProgramProject.GenerationService\ProgramProject.GenerationService.csproj", "{66DBD8A2-6672-889D-9A17-D156226DCB66}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProgramProject.Gateway", "ProgramProject.Gateway\ProgramProject.Gateway.csproj", "{0C26CAD8-F259-19D3-8E5B-FB32D481F591}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProgramProject.FileService", "ProgramProject.FileService\ProgramProject.FileService.csproj", "{087EE229-CD64-E3B4-00A6-CE22B6C183AF}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProgramProject.IntegrationTests", "ProgramProject.IntegrationTests\ProgramProject.IntegrationTests.csproj", "{AD9978E4-F9F8-4ECB-BE1F-8B54B78EC81F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -15,6 +27,30 @@ Global
{AE7EEA74-2FE0-136F-D797-854FD87E022A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AE7EEA74-2FE0-136F-D797-854FD87E022A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AE7EEA74-2FE0-136F-D797-854FD87E022A}.Release|Any CPU.Build.0 = Release|Any CPU
{7FA94C9A-CD2C-4D76-A42C-5C0EEDC6D68D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7FA94C9A-CD2C-4D76-A42C-5C0EEDC6D68D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7FA94C9A-CD2C-4D76-A42C-5C0EEDC6D68D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7FA94C9A-CD2C-4D76-A42C-5C0EEDC6D68D}.Release|Any CPU.Build.0 = Release|Any CPU
{213F5ADB-6769-02BA-8BFA-17C924D27341}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{213F5ADB-6769-02BA-8BFA-17C924D27341}.Debug|Any CPU.Build.0 = Debug|Any CPU
{213F5ADB-6769-02BA-8BFA-17C924D27341}.Release|Any CPU.ActiveCfg = Release|Any CPU
{213F5ADB-6769-02BA-8BFA-17C924D27341}.Release|Any CPU.Build.0 = Release|Any CPU
{66DBD8A2-6672-889D-9A17-D156226DCB66}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{66DBD8A2-6672-889D-9A17-D156226DCB66}.Debug|Any CPU.Build.0 = Debug|Any CPU
{66DBD8A2-6672-889D-9A17-D156226DCB66}.Release|Any CPU.ActiveCfg = Release|Any CPU
{66DBD8A2-6672-889D-9A17-D156226DCB66}.Release|Any CPU.Build.0 = Release|Any CPU
{0C26CAD8-F259-19D3-8E5B-FB32D481F591}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0C26CAD8-F259-19D3-8E5B-FB32D481F591}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0C26CAD8-F259-19D3-8E5B-FB32D481F591}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0C26CAD8-F259-19D3-8E5B-FB32D481F591}.Release|Any CPU.Build.0 = Release|Any CPU
{087EE229-CD64-E3B4-00A6-CE22B6C183AF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{087EE229-CD64-E3B4-00A6-CE22B6C183AF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{087EE229-CD64-E3B4-00A6-CE22B6C183AF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{087EE229-CD64-E3B4-00A6-CE22B6C183AF}.Release|Any CPU.Build.0 = Release|Any CPU
{AD9978E4-F9F8-4ECB-BE1F-8B54B78EC81F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AD9978E4-F9F8-4ECB-BE1F-8B54B78EC81F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AD9978E4-F9F8-4ECB-BE1F-8B54B78EC81F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AD9978E4-F9F8-4ECB-BE1F-8B54B78EC81F}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
58 changes: 58 additions & 0 deletions ProgramProject.AppHost/AppHost.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
using Aspire.Hosting;

var builder = DistributedApplication.CreateBuilder(args);

var cache = builder.AddRedis("cache").WithRedisCommander();

// Minio (объектное хранилище)
var minio = builder.AddContainer("minio", "minio/minio")
.WithArgs("server", "/data", "--console-address", ":9001")
.WithHttpEndpoint(port: 9000, targetPort: 9000, name: "api")
.WithHttpEndpoint(port: 9001, targetPort: 9001, name: "console")
.WithVolume("minio-data", "/data");

// ElasticMQ
var sqs = builder.AddContainer("elasticmq", "softwaremill/elasticmq")
.WithHttpEndpoint(port: 9324, targetPort: 9324, name: "http");

// Создаём 5 генераторов в цикле
var generators = new List<IResourceBuilder<ProjectResource>>();

for (var i = 1; i <= 5; i++)
{
var generator = builder.AddProject<Projects.ProgramProject_GenerationService>($"generator-{i}")
.WithExternalHttpEndpoints()
.WithReference(cache)
.WaitFor(cache)
.WithEndpoint("http", endpoint => endpoint.Port = 6200 + i)
.WithEndpoint("https", endpoint => endpoint.Port = 7200 + i)
.WithEnvironment("SQS__ServiceURL", sqs.GetEndpoint("http"));

generators.Add(generator);
}

// Шлюз
var gateway = builder.AddProject<Projects.ProgramProject_Gateway>("gateway")
.WithExternalHttpEndpoints();

foreach (var generator in generators)
{
gateway.WaitFor(generator);
}

// Файловый сервис
var fileService = builder.AddProject<Projects.ProgramProject_FileService>("programproject-fileservice")
.WithExternalHttpEndpoints()
.WithEnvironment("SQS__ServiceURL", sqs.GetEndpoint("http"))
.WithEnvironment("Minio__Endpoint", minio.GetEndpoint("api"))
.WithEnvironment("Minio__AccessKey", "minioadmin")
.WithEnvironment("Minio__SecretKey", "minioadmin")
.WaitFor(sqs)
.WaitFor(minio);

// Клиент теперь связывается с генератором через шлюз
builder.AddProject<Projects.Client_Wasm>("client-wasm")
.WithExternalHttpEndpoints()
.WaitFor(gateway);

builder.Build().Run();
25 changes: 25 additions & 0 deletions ProgramProject.AppHost/ProgramProject.AppHost.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<Project Sdk="Microsoft.NET.Sdk">

<Sdk Name="Aspire.AppHost.Sdk" Version="9.5.2" />

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<UserSecretsId>f95b6f17-c3f7-4ae5-a722-409a54dda80d</UserSecretsId>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\Client.Wasm\Client.Wasm.csproj" />
<ProjectReference Include="..\ProgramProject.FileService\ProgramProject.FileService.csproj" />
<ProjectReference Include="..\ProgramProject.Gateway\ProgramProject.Gateway.csproj" />
<ProjectReference Include="..\ProgramProject.GenerationService\ProgramProject.GenerationService.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Aspire.Hosting.AppHost" Version="9.5.2" />
<PackageReference Include="Aspire.Hosting.Redis" Version="9.5.2" />
</ItemGroup>

</Project>
29 changes: 29 additions & 0 deletions ProgramProject.AppHost/Properties/launchSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"$schema": "https://json.schemastore.org/launchsettings.json",
"profiles": {
"https": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"applicationUrl": "https://localhost:17028;http://localhost:15016",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development",
"DOTNET_ENVIRONMENT": "Development",
"ASPIRE_DASHBOARD_OTLP_ENDPOINT_URL": "https://localhost:21209",
"ASPIRE_RESOURCE_SERVICE_ENDPOINT_URL": "https://localhost:22094"
}
},
"http": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"applicationUrl": "http://localhost:15016",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development",
"DOTNET_ENVIRONMENT": "Development",
"ASPIRE_DASHBOARD_OTLP_ENDPOINT_URL": "http://localhost:19079",
"ASPIRE_RESOURCE_SERVICE_ENDPOINT_URL": "http://localhost:20183"
}
}
}
}
8 changes: 8 additions & 0 deletions ProgramProject.AppHost/appsettings.Development.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
}
}
9 changes: 9 additions & 0 deletions ProgramProject.AppHost/appsettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning",
"Aspire.Hosting.Dcp": "Warning"
}
}
}
56 changes: 56 additions & 0 deletions ProgramProject.FileService/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
using Amazon.Runtime;
using Amazon.SQS;
using Minio;
using ProgramProject.FileService.Services;
using ProgramProject.ServiceDefaults;

var builder = WebApplication.CreateBuilder(args);

Console.OutputEncoding = System.Text.Encoding.UTF8;

builder.AddServiceDefaults();

// SQS — ÷èòàåì èç ïåðåìåííîé îêðóæåíèÿ (êîòîðàÿ ïðèõîäèò èç AppHost)
var sqsServiceUrl = builder.Configuration["SQS:ServiceURL"] ?? "http://localhost:9324";
var sqsConfig = new AmazonSQSConfig
{
ServiceURL = sqsServiceUrl,
UseHttp = true,
AuthenticationRegion = "us-east-1"
};
builder.Services.AddSingleton<IAmazonSQS>(sp => new AmazonSQSClient(new AnonymousAWSCredentials(), sqsConfig));

// Minio — ÷èòàåì èç ïåðåìåííûõ îêðóæåíèÿ
var minioEndpoint = builder.Configuration["Minio:Endpoint"] ?? "http://localhost:9000";
var minioAccessKey = builder.Configuration["Minio:AccessKey"] ?? "minioadmin";
var minioSecretKey = builder.Configuration["Minio:SecretKey"] ?? "minioadmin";

builder.Services.AddSingleton<Minio.IMinioClient>(sp =>
{
return new Minio.MinioClient()
.WithEndpoint(minioEndpoint.Replace("http://", "").Replace("https://", ""))
.WithCredentials(minioAccessKey, minioSecretKey)
.WithSSL(false)
.Build();
});

builder.Services.AddHostedService<SqsBackgroundService>();

builder.Services.AddControllers();
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();

var app = builder.Build();

app.MapDefaultEndpoints();

if (app.Environment.IsDevelopment())
{
app.UseSwagger();
app.UseSwaggerUI();
}

app.UseAuthorization();
app.MapControllers();

app.Run();
21 changes: 21 additions & 0 deletions ProgramProject.FileService/ProgramProject.FileService.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="AWSSDK.Extensions.NETCore.Setup" Version="4.0.3.31" />
<PackageReference Include="AWSSDK.SQS" Version="4.0.2.23" />
<PackageReference Include="Minio" Version="7.0.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.6.2" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\ProgramProject.GenerationService\ProgramProject.GenerationService.csproj" />
<ProjectReference Include="..\ProgramProject.ServiceDefaults\ProgramProject.ServiceDefaults.csproj" />
</ItemGroup>

</Project>
41 changes: 41 additions & 0 deletions ProgramProject.FileService/Properties/launchSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"$schema": "http://json.schemastore.org/launchsettings.json",
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:38561",
"sslPort": 44371
}
},
"profiles": {
"http": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"launchUrl": "swagger",
"applicationUrl": "http://localhost:5028",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"https": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"launchUrl": "swagger",
"applicationUrl": "https://localhost:7063;http://localhost:5028",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"launchUrl": "swagger",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}
Loading
Loading