100 Commits

Author SHA1 Message Date
Liza275
5419906828 Лабораторная работа 8 2023-12-19 01:58:09 +04:00
efd9d1bd47 Merge pull request '[Л/Р 5] Халитова Ангелина' (#116) from angelina/distributed-computing:khalitova-am-lab-5 into main
Reviewed-on: http://student.git.athene.tech/v.moiseev/distributed-computing/pulls/116
2023-12-18 11:25:57 +04:00
Khalitova Angelina
d04e2f8c23 rep 2023-12-18 10:39:35 +04:00
Khalitova Angelina
e64bed2d07 add 2023-12-18 10:38:04 +04:00
a21123fbd8 Merge pull request '[Л/Р 8] Островская Софья' (#98) from ostrovsofa/distributed-computing:ostrovskaya-sf-lab-8 into main
Reviewed-on: http://student.git.athene.tech/v.moiseev/distributed-computing/pulls/98
2023-12-17 23:50:45 +04:00
274f304374 Merge pull request '[Л/Р 7] Островская Софья' (#97) from ostrovsofa/distributed-computing:ostrovskaya-sf-lab-7 into main
Reviewed-on: http://student.git.athene.tech/v.moiseev/distributed-computing/pulls/97
2023-12-17 23:45:48 +04:00
5844b9b63c Merge pull request '[Л/Р 6] Островская Софья' (#96) from ostrovsofa/distributed-computing:ostrovskaya-sf-lab-6 into main
Reviewed-on: http://student.git.athene.tech/v.moiseev/distributed-computing/pulls/96
2023-12-17 23:45:07 +04:00
4769eadfec Merge pull request '[Л/Р 5] Островская Софья' (#95) from ostrovsofa/distributed-computing:ostrovskaya-sf-lab-5 into main
Reviewed-on: http://student.git.athene.tech/v.moiseev/distributed-computing/pulls/95
2023-12-17 23:43:35 +04:00
eff4d671f3 Merge pull request '[Л/Р 6] Плаксина Александра' (#94) from Sanechka_Plaksina/distributed-computing:plaksina-av-lab-6 into main
Reviewed-on: http://student.git.athene.tech/v.moiseev/distributed-computing/pulls/94
2023-12-17 23:42:26 +04:00
21bb9f5e7b Merge pull request '[Л/Р 5] Плаксина Александра' (#93) from Sanechka_Plaksina/distributed-computing:plaksina-av-lab-5 into main
Reviewed-on: http://student.git.athene.tech/v.moiseev/distributed-computing/pulls/93
2023-12-17 23:39:50 +04:00
bcbaf031e9 Merge pull request '[Л/Р 4] Зиновьева Анна' (#92) from Sentimental_anna/distributed-computing:zinoveva-ad-lab-4 into main
Reviewed-on: http://student.git.athene.tech/v.moiseev/distributed-computing/pulls/92
2023-12-17 23:38:36 +04:00
b4272099f1 Merge pull request '[Л/Р 3] Зиновьева Анна' (#91) from Sentimental_anna/distributed-computing:zinoveva-ad-lab-3 into main
Reviewed-on: http://student.git.athene.tech/v.moiseev/distributed-computing/pulls/91
2023-12-17 23:38:07 +04:00
45618a1799 Merge pull request '[Л/Р 8] Савицкий Александр' (#90) from Savitskiy_ISEbd-41/distributed-computing:savitskiy_av_lab8 into main
Reviewed-on: http://student.git.athene.tech/v.moiseev/distributed-computing/pulls/90
2023-12-17 23:37:44 +04:00
e6c80fd353 Merge pull request '[Л/Р 7] Савицкий Александр' (#89) from Savitskiy_ISEbd-41/distributed-computing:savitskiy_av_lab7 into main
Reviewed-on: http://student.git.athene.tech/v.moiseev/distributed-computing/pulls/89
2023-12-17 23:33:07 +04:00
9b6eb0794c Merge pull request '[Л/Р 6] Савицкий Александр' (#88) from Savitskiy_ISEbd-41/distributed-computing:savitskiy_av_lab6 into main
Reviewed-on: http://student.git.athene.tech/v.moiseev/distributed-computing/pulls/88
2023-12-17 23:28:36 +04:00
faa5f5206a Merge pull request '[Л/Р 8] Миронов Евгений' (#85) from MironovEvgeniy/distributed-computing:mironov-eo-lab-8 into main
Reviewed-on: http://student.git.athene.tech/v.moiseev/distributed-computing/pulls/85
2023-12-17 23:26:09 +04:00
3e23cc1880 Merge pull request '[Л/Р 7] Миронов Евгений' (#84) from MironovEvgeniy/distributed-computing:mironov-eo-lab-7 into main
Reviewed-on: http://student.git.athene.tech/v.moiseev/distributed-computing/pulls/84
2023-12-17 23:18:20 +04:00
fcb6fb0e4e Merge pull request '[Л/Р 8] Клементьева Жанна' (#83) from klementeva/distributed-computing:klementeva-ja-lab-8 into main
Reviewed-on: http://student.git.athene.tech/v.moiseev/distributed-computing/pulls/83
2023-12-17 23:17:02 +04:00
cc2092323d Merge pull request '[Л/Р 7] Клементьева Жанна' (#82) from klementeva/distributed-computing:klementeva-ja-lab-7 into main
Reviewed-on: http://student.git.athene.tech/v.moiseev/distributed-computing/pulls/82
2023-12-17 23:16:22 +04:00
8313a92d16 Merge pull request '[Л/Р 6] Клементьева Жанна' (#81) from klementeva/distributed-computing:klementeva-ja-lab-6 into main
Reviewed-on: http://student.git.athene.tech/v.moiseev/distributed-computing/pulls/81
2023-12-17 23:15:28 +04:00
961c8885f5 Merge pull request '[Л/Р 4] Плаксина Александра' (#80) from Sanechka_Plaksina/distributed-computing:plaksina-av-lab-4 into main
Reviewed-on: http://student.git.athene.tech/v.moiseev/distributed-computing/pulls/80
2023-12-17 23:14:58 +04:00
8e69835321 Merge pull request '[Л/Р 3] Плаксина Александра' (#79) from Sanechka_Plaksina/distributed-computing:plaksina-av-lab-3 into main
Reviewed-on: http://student.git.athene.tech/v.moiseev/distributed-computing/pulls/79
2023-12-17 23:07:41 +04:00
196d2d2a1b Merge pull request '[Л/Р 5] Савицкий Александр' (#78) from Savitskiy_ISEbd-41/distributed-computing:savitskiy_av_lab5 into main
Reviewed-on: http://student.git.athene.tech/v.moiseev/distributed-computing/pulls/78
2023-12-17 23:05:30 +04:00
915b8bb68c Merge pull request '[Л/Р 4] Островская Софья' (#77) from ostrovsofa/distributed-computing:ostrovskaya-sf-lab-4 into main
Reviewed-on: http://student.git.athene.tech/v.moiseev/distributed-computing/pulls/77
2023-12-17 23:05:11 +04:00
8ad85b8049 Merge pull request '[Л/Р 4] Савицкий Александр' (#75) from Savitskiy_ISEbd-41/distributed-computing:savitskiy_av_lab4 into main
Reviewed-on: http://student.git.athene.tech/v.moiseev/distributed-computing/pulls/75
2023-12-17 23:03:46 +04:00
ed7d0467c3 Merge pull request '[Л/Р 3] Савицкий Александр' (#74) from Savitskiy_ISEbd-41/distributed-computing:savitskiy_av_lab3 into main
Reviewed-on: http://student.git.athene.tech/v.moiseev/distributed-computing/pulls/74
2023-12-17 23:00:30 +04:00
4b7ceb94c1 Merge pull request '[Л/Р 5] Клементьева Жанна' (#73) from klementeva/distributed-computing:klementeva-ja-lab-5 into main
Reviewed-on: http://student.git.athene.tech/v.moiseev/distributed-computing/pulls/73
2023-12-17 23:00:12 +04:00
210a7480ed Merge pull request '[Л/Р 4] Клементьева Жанна' (#72) from klementeva/distributed-computing:klementeva-ja-lab-4 into main
Reviewed-on: http://student.git.athene.tech/v.moiseev/distributed-computing/pulls/72
2023-12-17 22:58:36 +04:00
1f6f04f1af Merge pull request '[Л/Р 3] Островская Софья' (#70) from ostrovsofa/distributed-computing:ostrovskaya-sf-lab-3 into main
Reviewed-on: http://student.git.athene.tech/v.moiseev/distributed-computing/pulls/70
2023-12-17 22:55:15 +04:00
9c060b9fbf Merge pull request '[Л/Р 3] Клементьева Жанна' (#67) from klementeva/distributed-computing:klementeva-ja-lab-3 into main
Reviewed-on: http://student.git.athene.tech/v.moiseev/distributed-computing/pulls/67
2023-12-17 22:51:22 +04:00
a92812b322 Merge pull request '[Л/Р 2,3] Горбылева Антонина' (#66) from antonina_gorbyleva/distributed-computing:gorbyleva-ai-lab-3 into main
Reviewed-on: http://student.git.athene.tech/v.moiseev/distributed-computing/pulls/66
2023-12-17 22:50:44 +04:00
7020bd0de9 Merge pull request '[Л/Р 6] Миронов Евгений' (#60) from MironovEvgeniy/distributed-computing:mironov-eo-lab-6 into main
Reviewed-on: http://student.git.athene.tech/v.moiseev/distributed-computing/pulls/60
2023-12-17 22:47:11 +04:00
3da11c8b28 Merge pull request '[Л/Р 2] Савицкий Александр' (#55) from Savitskiy_ISEbd-41/distributed-computing:savitskiy_av_lab_2 into main
Reviewed-on: http://student.git.athene.tech/v.moiseev/distributed-computing/pulls/55
2023-12-17 22:42:56 +04:00
4c75073793 Merge pull request '[Л/Р 5] Миронов Евгений' (#53) from MironovEvgeniy/distributed-computing:mironov-eo-lab-5 into main
Reviewed-on: http://student.git.athene.tech/v.moiseev/distributed-computing/pulls/53
2023-12-17 22:38:52 +04:00
ca99bd565c Merge pull request '[Л/Р 4] Миронов Евгений' (#52) from MironovEvgeniy/distributed-computing:mironoveo-lab-4 into main
Reviewed-on: http://student.git.athene.tech/v.moiseev/distributed-computing/pulls/52
2023-12-17 22:38:15 +04:00
ae0ecc8743 Merge pull request '[Л/Р 3] Миронов Евгений' (#49) from MironovEvgeniy/distributed-computing:mironov-eo-lab-3 into main
Reviewed-on: http://student.git.athene.tech/v.moiseev/distributed-computing/pulls/49
2023-12-17 22:14:57 +04:00
fd35de8f4f Merge pull request '[Л/Р 2] Горбылева Антонина' (#47) from antonina_gorbyleva/distributed-computing:gorbyleva-ai-lab-2 into main
Reviewed-on: http://student.git.athene.tech/v.moiseev/distributed-computing/pulls/47
2023-12-17 22:11:43 +04:00
40105e274e Merge pull request '[Л/Р 1] Савицкий Александр' (#45) from Savitskiy_ISEbd-41/distributed-computing:savitskiy_av_lab_1 into main
Reviewed-on: http://student.git.athene.tech/v.moiseev/distributed-computing/pulls/45
2023-12-17 22:10:12 +04:00
d5b14449e3 Merge pull request '[Л/Р 1] Костенко Карина' (#41) from karinakostenko/distributed-computing:lab1-kostenko-kd into main
Reviewed-on: http://student.git.athene.tech/v.moiseev/distributed-computing/pulls/41
2023-12-17 22:05:08 +04:00
a16e0f20c5 Merge pull request '[Л/Р 1,2] Клементьева Жанна' (#38) from klementeva/distributed-computing:klementeva-ja-lab-2 into main
Reviewed-on: http://student.git.athene.tech/v.moiseev/distributed-computing/pulls/38
2023-12-17 22:03:59 +04:00
986d9359e6 Merge pull request '[Л/Р 2] Миронов Евгений' (#36) from MironovEvgeniy/distributed-computing:mironov-eo-lab-2 into main
Reviewed-on: http://student.git.athene.tech/v.moiseev/distributed-computing/pulls/36
2023-12-17 22:02:36 +04:00
ab129e6d5e Merge pull request '[Л/Р 2] Никифорова Татьяна' (#28) from tanya_nik16/distributed-computing:Nikiforova-TS-Lab-2 into main
Reviewed-on: http://student.git.athene.tech/v.moiseev/distributed-computing/pulls/28
2023-12-17 22:01:51 +04:00
Софья Островская
9a5dca9616 laba done 2023-12-17 16:11:55 +04:00
Софья Островская
7c9f835e1e laba done 2023-12-17 15:48:27 +04:00
Софья Островская
f75432d5f7 fix readme 2023-12-17 15:31:55 +04:00
Софья Островская
6dc434cbf3 . 2023-12-17 15:30:42 +04:00
Софья Островская
267ba3b73c laba done 2023-12-17 14:35:09 +04:00
Софья Островская
bc1845c05d . 2023-12-17 14:10:19 +04:00
Софья Островская
3ab942f78a gitignore 2023-12-17 13:50:01 +04:00
Софья Островская
40ce78dc39 . 2023-12-17 13:48:12 +04:00
Софья Островская
9afb8e93d6 . 2023-12-17 13:45:21 +04:00
Софья Островская
a308ede4ad laba done 2023-12-17 13:37:17 +04:00
e6cb8bd420 lab6_done 2023-12-17 00:55:54 +04:00
1627b65411 lab5_done 2023-12-16 23:31:32 +04:00
6bcfec3c0f fix 2023-12-16 21:04:41 +04:00
07a0377cbb laba done 2023-12-16 20:09:40 +04:00
0c1493a9d9 laba done 2023-12-16 16:41:40 +04:00
cedaaa513f lab 8 2023-12-16 16:14:20 +04:00
abd3959270 lab 7 2023-12-16 16:09:46 +04:00
3afd35140d lab6 2023-12-16 15:58:30 +04:00
Софья Островская
8679c69ca6 . 2023-12-16 14:54:30 +04:00
a9933fb842 mironov-eo-lab-8 2023-12-16 12:02:18 +03:00
615783c819 mironov-eo-lab-7 2023-12-16 11:12:30 +03:00
873c3cab34 Lab 8 Ready 2023-12-16 11:48:57 +04:00
a88ad333ab Lab 7 Ready 2023-12-16 11:47:24 +04:00
f52723e603 Lab 6 Ready 2023-12-16 11:45:24 +04:00
ab801f7c01 fix_lab4 2023-12-16 02:07:00 +04:00
918816654a lab4_done 2023-12-16 01:46:18 +04:00
083170f861 lab3_done 2023-12-15 22:14:31 +04:00
f269126281 lab 5 2023-12-15 21:02:23 +04:00
Софья Островская
7ea3ef3097 laba done 2023-12-15 19:09:53 +04:00
2415d60373 lab 4 2023-12-15 14:24:54 +04:00
d2143a8034 lab 3 2023-12-15 14:17:16 +04:00
0a02071d52 Lab 5 ready 2023-12-15 14:03:54 +04:00
8fb52539f0 Lab 4 ready 2023-12-15 13:58:35 +04:00
Софья Островская
32a64d3455 . 2023-12-15 03:06:09 +04:00
Софья Островская
6ecf75ae4e laba done 2023-12-15 03:04:47 +04:00
Софья Островская
8badb568b7 check 2023-12-15 02:50:10 +04:00
c7730ffee2 Lab 3 Ready 2023-12-14 13:53:47 +04:00
824ea4bf47 [Л/Р 3] Горбылева Антонина 2023-12-13 23:35:57 +04:00
19eebbbd5d Add other lws 2023-12-13 10:55:00 +04:00
b36b4f8587 mironov-eo-lab-6 2023-12-12 22:45:59 +03:00
7103a914a5 Merge pull request 'lr 3' (#2) from v.moiseev/distributed-computing:main into main
Reviewed-on: http://student.git.athene.tech/angelina/distributed-computing/pulls/2
2023-12-07 18:07:14 +04:00
a1a2cd75c8 lab_2 2023-12-07 00:34:42 +04:00
774069d984 mironov-eo-lab-5 2023-12-06 13:58:56 +03:00
67d9a7be51 mironov-eo-lab-4 2023-12-06 00:12:01 +03:00
993d701ee6 mironor-eo-lab-3 2023-12-04 23:02:10 +03:00
04436abf69 [Л/Р 2] Горбылева Антонина 2023-12-03 21:12:57 +04:00
fd8b56ad1e fix 2023-12-03 20:11:27 +03:00
458057c4ea Merge branch 'Nikiforova-TS-lab-1' into Nikiforova-TS-Lab-2 2023-12-02 11:00:12 +04:00
cf0e532652 иСПРАВ 2023-12-02 10:45:25 +04:00
4aef01c1bf add_lab_1 2023-11-30 20:25:59 +04:00
39090162a2 Merge pull request 'Добавление работы 4' (#42) from lw4 into main
Reviewed-on: http://student.git.athene.tech/v.moiseev/distributed-computing/pulls/42
2023-11-30 18:01:33 +04:00
Софья Островская
930c316a5d create folder 2023-11-29 12:53:21 +04:00
6c7ee0909b fixes 2023-11-22 20:57:32 +04:00
befd5915f6 lab1 2023-11-10 15:46:28 +03:00
953738c4d7 Created Lab 2 2023-11-03 22:22:15 +04:00
1cdac31a5d lab-2 2023-10-30 23:41:47 +03:00
6a5999478a Перенос в tasks 2023-10-18 22:29:14 +04:00
ca857e1581 Готовый отчет/удалила ветвь1 2023-10-18 10:45:47 +04:00
693 changed files with 27325 additions and 4 deletions

View File

@@ -9,7 +9,7 @@
2. [Разработка простейшего распределённого приложения](labs/lab_2/README.md)
3. [REST API, Gateway и синхронный обмен между микросервисами](labs/lab_3/README.md)
4. [Работа с брокером сообщений](labs/lab_4/README.md)
5. TBA
6. TBA
7. TBA
8. TBA
5. [Параллельное умножение матриц](http://student.git.athene.tech/Alexey/DAS_2023_1/src/branch/main/labs/lab_5.md)
6. [Параллельный поиск значения детерминанта матрицы](http://student.git.athene.tech/Alexey/DAS_2023_1/src/branch/main/labs/lab_6.md)
7. [Балансировка нагрузки в распределённых системах](http://student.git.athene.tech/Alexey/DAS_2023_1/src/branch/main/labs/lab_7.md)
8. [Про устройство распределенных систем](http://student.git.athene.tech/Alexey/DAS_2023_1/src/branch/main/labs/lab_8.md)

477
tasks/gorbyleva-ai/lab_2/.gitignore vendored Normal file
View File

@@ -0,0 +1,477 @@
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore
# User-specific files
*.rsuser
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Mono auto generated files
mono_crash.*
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
[Ww][Ii][Nn]32/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
[Ll]ogs/
# Visual Studio 2015/2017 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# Visual Studio 2017 auto generated files
Generated\ Files/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUnit
*.VisualState.xml
TestResult.xml
nunit-*.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# Benchmark Results
BenchmarkDotNet.Artifacts/
# .NET
project.lock.json
project.fragment.lock.json
artifacts/
# Tye
.tye/
# ASP.NET Scaffolding
ScaffoldingReadMe.txt
# StyleCop
StyleCopReport.xml
# Files built by Visual Studio
*_i.c
*_p.c
*_h.h
*.ilk
*.meta
*.obj
*.iobj
*.pch
*.pdb
*.ipdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*_wpftmp.csproj
*.log
*.tlog
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb
# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap
# Visual Studio Trace Files
*.e2e
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# AxoCover is a Code Coverage Tool
.axoCover/*
!.axoCover/settings.json
# Coverlet is a free, cross platform Code Coverage Tool
coverage*.json
coverage*.xml
coverage*.info
# Visual Studio code coverage results
*.coverage
*.coveragexml
# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# Note: Comment the next line if you want to checkin your web deploy settings,
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/
# NuGet Packages
*.nupkg
# NuGet Symbol Packages
*.snupkg
# The packages folder can be ignored because of Package Restore
**/[Pp]ackages/*
# except build/, which is used as an MSBuild target.
!**/[Pp]ackages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/[Pp]ackages/repositories.config
# NuGet v3's project.json files produces more ignorable files
*.nuget.props
*.nuget.targets
# Microsoft Azure Build Output
csx/
*.build.csdef
# Microsoft Azure Emulator
ecf/
rcf/
# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
*.appx
*.appxbundle
*.appxupload
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!?*.[Cc]ache/
# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.jfm
*.pfx
*.publishsettings
orleans.codegen.cs
# Including strong name files can present a security risk
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
#*.snk
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
ServiceFabricBackup/
*.rptproj.bak
# SQL Server files
*.mdf
*.ldf
*.ndf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
*.rptproj.rsuser
*- [Bb]ackup.rdl
*- [Bb]ackup ([0-9]).rdl
*- [Bb]ackup ([0-9][0-9]).rdl
# Microsoft Fakes
FakesAssemblies/
# GhostDoc plugin setting file
*.GhostDoc.xml
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
node_modules/
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw
# Visual Studio 6 auto-generated project file (contains which files were open etc.)
*.vbp
# Visual Studio 6 workspace and project file (working project files containing files to include in project)
*.dsw
*.dsp
# Visual Studio 6 technical files
*.ncb
*.aps
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# Paket dependency manager
.paket/paket.exe
paket-files/
# FAKE - F# Make
.fake/
# CodeRush personal settings
.cr/personal
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
# Cake - Uncomment if you are using it
# tools/**
# !tools/packages.config
# Tabs Studio
*.tss
# Telerik's JustMock configuration file
*.jmconfig
# BizTalk build output
*.btp.cs
*.btm.cs
*.odx.cs
*.xsd.cs
# OpenCover UI analysis results
OpenCover/
# Azure Stream Analytics local run output
ASALocalRun/
# MSBuild Binary and Structured Log
*.binlog
# NVidia Nsight GPU debugger configuration file
*.nvuser
# MFractors (Xamarin productivity tool) working folder
.mfractor/
# Local History for Visual Studio
.localhistory/
# Visual Studio History (VSHistory) files
.vshistory/
# BeatPulse healthcheck temp database
healthchecksdb
# Backup folder for Package Reference Convert tool in Visual Studio 2017
MigrationBackup/
# Ionide (cross platform F# VS Code tools) working folder
.ionide/
# Fody - auto-generated XML schema
FodyWeavers.xsd
# VS Code files for those working on multiple tools
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
*.code-workspace
# Local History for Visual Studio Code
.history/
# Windows Installer files from build outputs
*.cab
*.msi
*.msix
*.msm
*.msp
# JetBrains Rider
*.sln.iml
##
## Visual studio for Mac
##
# globs
Makefile.in
*.userprefs
*.usertasks
config.make
config.status
aclocal.m4
install-sh
autom4te.cache/
*.tar.gz
tarballs/
test-results/
# Mac bundle stuff
*.dmg
*.app
# content below from: https://github.com/github/gitignore/blob/master/Global/macOS.gitignore
# General
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
# content below from: https://github.com/github/gitignore/blob/master/Global/Windows.gitignore
# Windows thumbnail cache files
Thumbs.db
ehthumbs.db
ehthumbs_vista.db
# Dump file
*.stackdump
# Folder config file
[Dd]esktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp
# Windows shortcuts
*.lnk

View File

@@ -0,0 +1,69 @@
# Отчёт по лабораторной работе №2
Выполнил: студентка гр. ИСЭбд-41 Горбылева Антонина
Вариант программы 1 (вариант 4): Формирует файл /var/result/data.txt так, что каждая строка файла - количество символов в именах файлов из каталога /var/data.
Вариант программы 2 (вариант 2): Ищет наименьшее число из файла /var/data/data.txt и сохраняет его третью степень в /var/result/result.txt.
## Создание приложений
Создадим 2 приложения.
Был выбран язык C# и технология .NET 7.
Для создания обычных консольных приложений воспользуемся командами:
dotnet new console -o worker-1
dotnet new console -o worker-2
Согласно варианту программа 1 должна брать все файлы из папки `/var/data`, и записывать длины имен файлов в `/var/result/data.txt`.
[Исходный текст программы worker-1](worker-1/Program.cs)
Согласно варианту программа 2 должна найти наименьшее число из файла `/var/data/data.txt` и сохранить его третью степень в `/var/result/result.txt`.
[Исходный текст программы worker-2](worker-2/Program.cs)
Дополнительно создан файл [.gitignore](.gitignore) для того, чтобы не закоммитить в git ничего лишнего.
## Настройка окружения
Для связи двух приложений воспользуемся следующей схемой:
1. Каталог ./data должен быть примонтирован в каталог /var/data для программы 1.
Оттуда будут браться исходные данные.
2. Каталог ./result-1 должен быть примонтирован в каталог /var/result для программы 2.
Туда будут складываться промежуточные данные.
3. Каталог ./result-1 также должен быть примонтирован в каталог /var/data для программы 2.
Оттуда будут браться промежуточные результаты.
4. Каталог ./result должен быть примонтирован в каталог /var/result для программы 2.
Туда будут складывать результаты финальной обработки.
Для каждой программы были созданы файлы Dockerfile ([программа 1](worker-1/Dockerfile), [программа 2](worker-2/Dockerfile)) с подробным описанием процесса сборки.
Был создан файл [docker-compose.yml](docker-compose.yml), в котором указан манифест для запуска распределённого приложения.
Дополнительно был создан файл [.dockerignore](.dockerignore) и дополнен [.gitignore](.gitignore), чтобы исключить для сборки и коммита всё лишнее.
## Сборка и запуск
В каталог ./data помещены 3 файла.
3 файла с общим количеством символов в названии 12
Для запуска приложения необходимо ввести команду docker compose up ---build.
Результат запуска после сборки:
[+] Running 2/0
- Container lab_2-worker-1-1 Created
- Container lab_2-worker-2-1 Created
Attaching to lab_2-worker-1-1, lab_2-worker-2-1
lab_2-worker-1-1 | Начало обработки файла /var/data/another data.txt
lab_2-worker-1-1 | Начало обработки файла /var/data/data.txt
lab_2-worker-1-1 exited with code 0
lab_2-worker-2-1 | Чисел для обработки: 8
lab_2-worker-2-1 exited with code 0
В результате в каталоге ./result создался файл result.txt с содержимым 12, что соответствует входным данным.
В результате в каталоге `./result` создался файл `result.txt` с содержимым `1728`, что соответствует входным данным, так как наименьшим числом в нашем случае является `12`.

View File

@@ -0,0 +1,13 @@
version: "3.1"
services:
worker-1:
build: ./worker-1
volumes:
- ./data:/var/data
- ./result:/var/result
worker-2:
build: ./worker-2
volumes:
- ./result:/var/result
depends_on:
- worker-1

View File

@@ -0,0 +1,28 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "worker-1", "worker-1\worker-1.csproj", "{EBC8C06D-600B-4767-944D-108047DEDCDC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "worker-2", "worker-2\worker-2.csproj", "{70B6ABE2-A602-4881-931E-65DC63DC03D0}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{EBC8C06D-600B-4767-944D-108047DEDCDC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EBC8C06D-600B-4767-944D-108047DEDCDC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EBC8C06D-600B-4767-944D-108047DEDCDC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EBC8C06D-600B-4767-944D-108047DEDCDC}.Release|Any CPU.Build.0 = Release|Any CPU
{70B6ABE2-A602-4881-931E-65DC63DC03D0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{70B6ABE2-A602-4881-931E-65DC63DC03D0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{70B6ABE2-A602-4881-931E-65DC63DC03D0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{70B6ABE2-A602-4881-931E-65DC63DC03D0}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal

View File

@@ -0,0 +1,15 @@
#указываем образ из которого будем брать все слои
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build-env
#наша папка, с которой будем работать
WORKDIR /App
#копируем файл в рабочую дерикторию
COPY . ./
#запускаем команду
RUN dotnet restore
RUN dotnet publish -c Release -o out
FROM mcr.microsoft.com/dotnet/aspnet:7.0
WORKDIR /App
#копирует не из файловой системы хоста, а из того, что собрали на прерыдущей стадии
COPY --from=build-env /App/out .
ENTRYPOINT ["dotnet", "worker-1.dll"]

View File

@@ -0,0 +1,34 @@
using System;
using System.IO;
using System.Net.Http;
var dir = new DirectoryInfo("/var/data");
var files = dir.GetFiles();
string resultFilePath = "/var/result/data.txt";
try
{
int[] mass = new int[files.Length];
int i = 0;
// Создаем новый файл или перезаписываем существующий
using (StreamWriter writer = new StreamWriter(resultFilePath, false))
{
foreach (var file in files)
{
// Записываем в файл количество символов в имени каждого файла
writer.WriteLine(file.Name.Length);
mass[i] = file.Name.Length;
i++;
}
}
Console.WriteLine("Успешно! Результат: ");
foreach (var item in mass)
{
Console.WriteLine(item);
}
}
catch (Exception ex)
{
Console.WriteLine("Ошибка: " + ex.Message);
}

View File

@@ -0,0 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<RootNamespace>worker_1</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1,15 @@
#указываем образ из которого будем брать все слои
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build-env
#наша папка, с которой будем работать
WORKDIR /App
#копируем файл в рабочую дерикторию
COPY . ./
#запускаем команду
RUN dotnet restore
RUN dotnet publish -c Release -o out
FROM mcr.microsoft.com/dotnet/aspnet:7.0
WORKDIR /App
#копирует не из файловой системы хоста, а из того, что собрали на прерыдущей стадии
COPY --from=build-env /App/out .
ENTRYPOINT ["dotnet", "worker-2.dll"]

View File

@@ -0,0 +1,34 @@
using System.ComponentModel.DataAnnotations;
using System;
using System.IO;
string inputFile = "/var/data/data.txt";
string resultFilePath = "/var/result/result.txt";
using (StreamWriter writer = new StreamWriter(resultFilePath, false))
{
int min = int.MaxValue;
using (StreamReader sr = new StreamReader(inputFile))
{
string line;
int i = 0;
while ((line = sr.ReadLine()) != null)
{
i++;
if (int.TryParse(line, out int value))
{
if (value < min)
{
min = value;
}
}
}
Console.WriteLine("Наименьшее число: " + min.ToString());
}
double triplemin = Math.Pow(min, 3);
writer.WriteLine(triplemin.ToString());
Console.WriteLine("Файл успешно создан: " + resultFilePath);
}

View File

@@ -0,0 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<RootNamespace>worker_2</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>

477
tasks/gorbyleva-ai/lab_3/.gitignore vendored Normal file
View File

@@ -0,0 +1,477 @@
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore
# User-specific files
*.rsuser
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Mono auto generated files
mono_crash.*
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
[Ww][Ii][Nn]32/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
[Ll]ogs/
# Visual Studio 2015/2017 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# Visual Studio 2017 auto generated files
Generated\ Files/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUnit
*.VisualState.xml
TestResult.xml
nunit-*.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# Benchmark Results
BenchmarkDotNet.Artifacts/
# .NET
project.lock.json
project.fragment.lock.json
artifacts/
# Tye
.tye/
# ASP.NET Scaffolding
ScaffoldingReadMe.txt
# StyleCop
StyleCopReport.xml
# Files built by Visual Studio
*_i.c
*_p.c
*_h.h
*.ilk
*.meta
*.obj
*.iobj
*.pch
*.pdb
*.ipdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*_wpftmp.csproj
*.log
*.tlog
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb
# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap
# Visual Studio Trace Files
*.e2e
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# AxoCover is a Code Coverage Tool
.axoCover/*
!.axoCover/settings.json
# Coverlet is a free, cross platform Code Coverage Tool
coverage*.json
coverage*.xml
coverage*.info
# Visual Studio code coverage results
*.coverage
*.coveragexml
# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# Note: Comment the next line if you want to checkin your web deploy settings,
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/
# NuGet Packages
*.nupkg
# NuGet Symbol Packages
*.snupkg
# The packages folder can be ignored because of Package Restore
**/[Pp]ackages/*
# except build/, which is used as an MSBuild target.
!**/[Pp]ackages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/[Pp]ackages/repositories.config
# NuGet v3's project.json files produces more ignorable files
*.nuget.props
*.nuget.targets
# Microsoft Azure Build Output
csx/
*.build.csdef
# Microsoft Azure Emulator
ecf/
rcf/
# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
*.appx
*.appxbundle
*.appxupload
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!?*.[Cc]ache/
# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.jfm
*.pfx
*.publishsettings
orleans.codegen.cs
# Including strong name files can present a security risk
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
#*.snk
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
ServiceFabricBackup/
*.rptproj.bak
# SQL Server files
*.mdf
*.ldf
*.ndf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
*.rptproj.rsuser
*- [Bb]ackup.rdl
*- [Bb]ackup ([0-9]).rdl
*- [Bb]ackup ([0-9][0-9]).rdl
# Microsoft Fakes
FakesAssemblies/
# GhostDoc plugin setting file
*.GhostDoc.xml
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
node_modules/
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw
# Visual Studio 6 auto-generated project file (contains which files were open etc.)
*.vbp
# Visual Studio 6 workspace and project file (working project files containing files to include in project)
*.dsw
*.dsp
# Visual Studio 6 technical files
*.ncb
*.aps
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# Paket dependency manager
.paket/paket.exe
paket-files/
# FAKE - F# Make
.fake/
# CodeRush personal settings
.cr/personal
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
# Cake - Uncomment if you are using it
# tools/**
# !tools/packages.config
# Tabs Studio
*.tss
# Telerik's JustMock configuration file
*.jmconfig
# BizTalk build output
*.btp.cs
*.btm.cs
*.odx.cs
*.xsd.cs
# OpenCover UI analysis results
OpenCover/
# Azure Stream Analytics local run output
ASALocalRun/
# MSBuild Binary and Structured Log
*.binlog
# NVidia Nsight GPU debugger configuration file
*.nvuser
# MFractors (Xamarin productivity tool) working folder
.mfractor/
# Local History for Visual Studio
.localhistory/
# Visual Studio History (VSHistory) files
.vshistory/
# BeatPulse healthcheck temp database
healthchecksdb
# Backup folder for Package Reference Convert tool in Visual Studio 2017
MigrationBackup/
# Ionide (cross platform F# VS Code tools) working folder
.ionide/
# Fody - auto-generated XML schema
FodyWeavers.xsd
# VS Code files for those working on multiple tools
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
*.code-workspace
# Local History for Visual Studio Code
.history/
# Windows Installer files from build outputs
*.cab
*.msi
*.msix
*.msm
*.msp
# JetBrains Rider
*.sln.iml
##
## Visual studio for Mac
##
# globs
Makefile.in
*.userprefs
*.usertasks
config.make
config.status
aclocal.m4
install-sh
autom4te.cache/
*.tar.gz
tarballs/
test-results/
# Mac bundle stuff
*.dmg
*.app
# content below from: https://github.com/github/gitignore/blob/master/Global/macOS.gitignore
# General
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
# content below from: https://github.com/github/gitignore/blob/master/Global/Windows.gitignore
# Windows thumbnail cache files
Thumbs.db
ehthumbs.db
ehthumbs_vista.db
# Dump file
*.stackdump
# Folder config file
[Dd]esktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp
# Windows shortcuts
*.lnk

View File

@@ -0,0 +1,85 @@
# Отчёт по лабораторной работе №3
Выполнила: студентка группы ИСЭбд-41 Горбылева Антонина Игоревна
Используемые сущности: Автомобили - Car, марка автомобиля - Marka, модель - model, номер - number
## REST API, Gateway и синхронный обмен между микросервисами
## Создание микросервисов
Команда `dotnet new web -n worker-1` создает в терминале микросервис worker-1.
Команда `dotnet new sln`для создания решения для проекта.
Команда `dotnet sln worker-1.sln add worker-1.csproj`связывает созданное решение с проектом.
Аналогично, создаем второй микросервис и добавляем оба проекта в единое решение.
Команда `dotnet run` для запуска проекта.
Скриншоты API приложений:
![](picture/sworker-1.png)
![](picture/sworker-2.png)
## Реализация синхронного обмена
Реализован механизм синхронного обмена сообщениями между микросервисами.
```cs
app.MapGet("/Company/", async () =>
{
var httpClient = new HttpClient();
var secondWorkerResponse = await httpClient.GetStringAsync("http://worker-1:8080/");
return secondWorkerResponse.ToArray();
})
.WithName("GetRequests")
.WithOpenApi();
```
## Реализация gateway при помощи nginx
Шлюз на основе прозрачного прокси-сервера nginx
```conf
server {
listen 8080;
listen [::]:8080;
server_name localhost;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
}
location /worker-1/ {
proxy_pass http://worker-1:8080/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Prefix /worker-1;
}
location /worker-2/ {
proxy_pass http://worker-2:8080/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Prefix /worker-2;
}
}
```
Результаты, после вызова команды `docker-compose up`:
Docker Desktop:
![](picture/docker.png)
index.html на gateway-1:
![](picture/test.png)
worker-1:
![](picture/lworker-1.png)
worker-2:
![](picture/lworker-2.png)

View File

@@ -0,0 +1,15 @@
version: "3.1"
services:
worker-1:
build: ./worker-1
worker-2:
build: ./worker-2
depends_on:
- worker-1
gateway:
image: nginx:latest
ports:
- 8080:8080
volumes:
- ./static:/usr/share/nginx/html:ro
- ./nginx.conf:/etc/nginx/conf.d/default.conf:ro

View File

@@ -0,0 +1,14 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View File

@@ -0,0 +1,26 @@
server {
listen 8080;
listen [::]:8080;
server_name localhost;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
}
location /worker-1/ {
proxy_pass http://worker-1:8080/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Prefix /worker-1;
}
location /worker-2/ {
proxy_pass http://worker-2:8080/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Prefix /worker-2;
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

View File

@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Лабараторная работа №3</title>
</head>
<body>
<p>Горбылева Антонина студентка ИСЭбд-41</p>
<p><a href="/worker-1/">Запрос к "worker-1"</a></p>
<p><a href="/worker-2/">Запрос к "worker-2"</a></p>
</body>
</html>

View File

@@ -0,0 +1,11 @@
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env
WORKDIR /app
COPY . ./
RUN dotnet restore
RUN dotnet publish -c Release -o out
FROM mcr.microsoft.com/dotnet/aspnet:8.0
WORKDIR /app
COPY --from=build-env /app/out .
ENTRYPOINT ["dotnet", "worker-1.dll"]

View File

@@ -0,0 +1,118 @@
List<Cars > Cars = new()
{
new Cars () { Uuid= Guid.Parse("6a1b4a72-5669-41fe-8d5b-106dc86f58bd"), Model = "Programming Basics", GosNumber = "Programming" },
new Cars () { Uuid= Guid.Parse("464bbdb8-39c0-4644-b9c0-3df1c484ea7e"), Model = "Advanced Algorithms", GosNumber = "Programming" },
new Cars () { Uuid= Guid.Parse("f8692bea-b7e6-4164-b564-a921f16c35c9"), Model = "Romantic Journey", GosNumber = "Romance" },
};
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();
var app = builder.Build();
if (app.Environment.IsDevelopment())
{
app.UseSwagger();
app.UseSwaggerUI();
}
app.UseHttpsRedirection();
app.MapGet("/", () =>
{
return Cars.Select(r => new CarEntityDto()
{
Uuid = r.Uuid,
Model = r.Model,
GosNumber = r.GosNumber,
});
})
.WithMarka("GetCars")
.WithOpenApi();
app.MapGet("/{uuid}", (Guid uuid) =>
{
var Car = Cars.FirstOrDefault(r => r.Uuid == uuid);
if (Car == null)
return Results.NotFound();
return Results.Json(new CarEntityDto()
{
Uuid = Car.Uuid,
Model = Car.Model,
GosNumber = Car.GosNumber,
});
})
.WithMarka("GetCarByGUID")
.WithOpenApi();
app.MapPost("/{Model}/{GosNumber}", (string Model, string GosNumber) =>
{
Guid NewGuid = Guid.NewGuid();
Cars.Add(new Cars() { Uuid = NewGuid, Model = (string)Model, GosNumber = (string)GosNumber});
var Car = Cars.FirstOrDefault(r => r.Uuid == NewGuid);
if (Car == null)
return Results.NotFound();
return Results.Json(new CarEntityDto()
{
Uuid = Car.Uuid,
Model = Car.Model,
GosNumber = Car.GosNumber,
});
})
.WithMarka("PostCar")
.WithOpenApi();
app.MapPatch("/{uuid}/{Model}/{GosNumber}", (Guid uuid, string ?Model, string ?GosNumber) =>
{
var Car = Cars.FirstOrDefault(r => r.Uuid == uuid);
if (Car == null)
return Results.NotFound();
if (Model != null) Car.Model = Model;
if (GosNumber != ",") Car.GosNumber = GosNumber;
return Results.Json(new CarEntityDto()
{
Uuid = Car.Uuid,
Model = Car.Model,
GosNumber = Car.GosNumber,
});
})
.WithMarka("UpdateCar")
.WithOpenApi();
app.MapDelete("/{uuid}", (Guid uuid) =>
{
var Car = Cars.FirstOrDefault(r => r.Uuid == uuid);
if (Car == null)
return Results.NotFound();
Cars.Remove(Car);
return Results.Json(new CarEntityDto()
{
Uuid = Car.Uuid,
Model = Car.Model,
GosNumber = Car.GosNumber,
});
})
.WithMarka("DeleteCarByGUID")
.WithOpenApi();
app.Run();
public class Cars
{
public Guid Uuid { get; set; }
public string Model { get; set; } = string.Empty;
public string GosNumber { get; set; } = string.Empty;
}
public class CarEntityDto : Cars { }

View File

@@ -0,0 +1,37 @@
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:28800",
"sslPort": 44397
}
},
"profiles": {
"http": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"applicationUrl": "http://localhost:5108",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"https": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"applicationUrl": "https://localhost:7126;http://localhost:5108",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}

View File

@@ -0,0 +1,8 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
}
}

View File

@@ -0,0 +1,9 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*"
}

View File

@@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<RootNamespace>worker_1</RootNamespace>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1,22 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "worker-1", "worker-1.csproj", "{AEF383BD-8E80-4FF5-A579-1B601B7D1464}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{AEF383BD-8E80-4FF5-A579-1B601B7D1464}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AEF383BD-8E80-4FF5-A579-1B601B7D1464}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AEF383BD-8E80-4FF5-A579-1B601B7D1464}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AEF383BD-8E80-4FF5-A579-1B601B7D1464}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal

View File

@@ -0,0 +1,11 @@
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env
WORKDIR /app
COPY . ./
RUN dotnet restore
RUN dotnet publish -c Release -o out
FROM mcr.microsoft.com/dotnet/aspnet:8.0
WORKDIR /app
COPY --from=build-env /app/out .
ENTRYPOINT ["dotnet", "worker-2.dll"]

View File

@@ -0,0 +1,139 @@
List<Authors> authors = new()
{
new Authors() { Uuid= Guid.NewGuid(), Number = "1", Name = "Programming Basics", IdBook = Guid.Parse("6a1b4a72-5669-41fe-8d5b-106dc86f58bd") },
new Authors() { Uuid= Guid.NewGuid(), Number = "2", Name = "Advanced Algorithms", IdBook = Guid.Parse("f8692bea-b7e6-4164-b564-a921f16c35c9") },
new Authors() { Uuid= Guid.NewGuid(), Number = "3", Name = "Romantic Journey", IdBook = Guid.Parse("464bbdb8-39c0-4644-b9c0-3df1c484ea7e") },
new Authors() { Uuid= Guid.NewGuid(), Number = "3А", Name = "Mystery Island", IdBook = Guid.Parse("464bbdb8-39c0-4644-b9c0-3df1c484ea7e") },
};
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();
var app = builder.Build();
if (app.Environment.IsDevelopment())
{
app.UseSwagger();
app.UseSwaggerUI();
}
app.UseHttpsRedirection();
app.MapGet("/", () =>
{
return authors.Select(r => new AuthorEntityDto()
{
Uuid = r.Uuid,
Number = r.Number,
Name = r.Name,
IdBook = r.IdBook,
});
})
.WithName("GetAuthors")
.WithOpenApi();
app.MapGet("/{uuid}", (Guid uuid) =>
{
var author = authors.FirstOrDefault(r => r.Uuid == uuid);
if (author == null)
return Results.NotFound();
return Results.Json(new AuthorEntityDto()
{
Uuid = author.Uuid,
Number = author.Number,
Name = author.Name,
IdBook = author.IdBook,
});
})
.WithName("GetAuthorByGUID")
.WithOpenApi();
app.MapPost("/{number}/{name}/{IdBook}", (string? Number, string Name, Guid IdBook) =>
{
Guid NewGuid = Guid.NewGuid();
authors.Add(new Authors() { Uuid = NewGuid, Number = (string)Number, Name = (string)Name, IdBook = (Guid)IdBook });
var author = authors.FirstOrDefault(r => r.Uuid == NewGuid);
if (author == null)
return Results.NotFound();
return Results.Json(new AuthorEntityDto()
{
Uuid = author.Uuid,
Number = author.Number,
Name = author.Name,
IdBook = author.IdBook,
});
})
.WithName("PostAuthor")
.WithOpenApi();
app.MapPatch("/{uuid}/{number}/{name}/{IdBook}", (Guid uuid, string ?number, string name, Guid IdBook) =>
{
var author = authors.FirstOrDefault(r => r.Uuid == uuid);
if (author == null)
return Results.NotFound();
if (number != ",") author.Number = number;
if (name != author.Name) author.Name = name;
if (IdBook != author.IdBook) author.IdBook = IdBook;
return Results.Json(new AuthorEntityDto()
{
Uuid = author.Uuid,
Number = author.Number,
Name = author.Name,
IdBook = author.IdBook,
});
})
.WithName("UpdateAuthor")
.WithOpenApi();
app.MapDelete("/{uuid}", (Guid uuid) =>
{
var author = authors.FirstOrDefault(r => r.Uuid == uuid);
if (author == null)
return Results.NotFound();
authors.Remove(author);
return Results.Json(new AuthorEntityDto()
{
Uuid = author.Uuid,
Number = author.Number,
Name = author.Name,
IdBook = author.IdBook,
});
})
.WithName("DeleteAuthor")
.WithOpenApi();
app.MapGet("/Authors/", async () =>
{
var httpClient = new HttpClient();
var secondWorkerResponse = await httpClient.GetStringAsync("http://worker-1:8080/");
return secondWorkerResponse.ToArray();
})
.WithName("GetBooks")
.WithOpenApi();
app.Run();
public class Authors
{
public Guid Uuid { get; set; }
public string Number { get; set; } = string.Empty;
public string Name { get; set; } = string.Empty;
public Guid IdBook { get; set; }
}
public class AuthorEntityDto : Authors { }
public class Books
{
public Guid Uuid { get; set; }
public string Title { get; set; } = string.Empty;
public string Genre { get; set; } = string.Empty;
}
public class BookEntityDto : Books { }

View File

@@ -0,0 +1,37 @@
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:24157",
"sslPort": 44320
}
},
"profiles": {
"http": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"applicationUrl": "http://localhost:5082",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"https": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"applicationUrl": "https://localhost:7130;http://localhost:5082",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}

View File

@@ -0,0 +1,83 @@
# Отчёт по лабораторной работе №3
Выполнила: студентка гр. ИСЭбд-41 Никифорова Татьяна Сергеевна.
## REST API, Gateway и синхронный обмен между микросервисами
## Создание микросервисов
Использовала команду `dotnet new web -n worker-1` в терминале для создания моего первого микросервиса.
Далее, с помощью команды `dotnet new sln`, создала решение для проекта. Затем использовала команду `dotnet sln worker-1.sln add worker-1.csproj`, чтобы связать созданное решение с проектом.
Повторила те же действия для второго микросервиса, добавила оба проекта в единое решение.
Добавил библиотеку Swagger и OpenAi в проекты и запустил с помощью команды `dotnet run`".
Скриншоты API приложений:
![](picture/sworker-1.png)
![](picture/sworker-2.png)
## Реализация синхронного обмена
Реализовала механизм синхронного обмена сообщениями между микросервисами.
```cs
app.MapGet("/Authors/", async () =>
{
var httpClient = new HttpClient();
var secondWorkerResponse = await httpClient.GetStringAsync("http://worker-1:8080/");
return secondWorkerResponse.ToArray();
})
.WithName("GetRequests")
.WithOpenApi();
```
## Реализация gateway при помощи nginx
Реализовала шлюз на основе прозрачного прокси-сервера nginx.
```conf
server {
listen 8080;
listen [::]:8080;
server_name localhost;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
}
location /worker-1/ {
proxy_pass http://worker-1:8080/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Prefix /worker-1;
}
location /worker-2/ {
proxy_pass http://worker-2:8080/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Prefix /worker-2;
}
}
```
Результаты, после вызова команды `docker-compose up`:
Docker Desktop:
![](picture/docker.png)
index.html на gateway-1:
![](picture/test.png)
worker-1:
![](picture/lworker-1.png)
worker-2:
![](picture/lworker-2.png)

View File

@@ -0,0 +1,8 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
}
}

View File

@@ -0,0 +1,9 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*"
}

View File

@@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<RootNamespace>worker_2</RootNamespace>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1,22 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "worker-2", "worker-2.csproj", "{46EE043B-ED4D-44D1-82AF-3A180AD32532}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{46EE043B-ED4D-44D1-82AF-3A180AD32532}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{46EE043B-ED4D-44D1-82AF-3A180AD32532}.Debug|Any CPU.Build.0 = Debug|Any CPU
{46EE043B-ED4D-44D1-82AF-3A180AD32532}.Release|Any CPU.ActiveCfg = Release|Any CPU
{46EE043B-ED4D-44D1-82AF-3A180AD32532}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal

454
tasks/khalitova-am/lab_5/App/.gitignore vendored Normal file
View File

@@ -0,0 +1,454 @@
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
# User-specific files
*.rsuser
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Mono auto generated files
mono_crash.*
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
[Ww][Ii][Nn]32/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
[Ll]ogs/
# Visual Studio 2015/2017 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# Visual Studio 2017 auto generated files
Generated\ Files/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUnit
*.VisualState.xml
TestResult.xml
nunit-*.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# Benchmark Results
BenchmarkDotNet.Artifacts/
# .NET
project.lock.json
project.fragment.lock.json
artifacts/
# Tye
.tye/
# ASP.NET Scaffolding
ScaffoldingReadMe.txt
# StyleCop
StyleCopReport.xml
# Files built by Visual Studio
*_i.c
*_p.c
*_h.h
*.ilk
*.meta
*.obj
*.iobj
*.pch
*.pdb
*.ipdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*_wpftmp.csproj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb
# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap
# Visual Studio Trace Files
*.e2e
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# AxoCover is a Code Coverage Tool
.axoCover/*
!.axoCover/settings.json
# Coverlet is a free, cross platform Code Coverage Tool
coverage*.json
coverage*.xml
coverage*.info
# Visual Studio code coverage results
*.coverage
*.coveragexml
# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# Note: Comment the next line if you want to checkin your web deploy settings,
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/
# NuGet Packages
*.nupkg
# NuGet Symbol Packages
*.snupkg
# The packages folder can be ignored because of Package Restore
**/[Pp]ackages/*
# except build/, which is used as an MSBuild target.
!**/[Pp]ackages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/[Pp]ackages/repositories.config
# NuGet v3's project.json files produces more ignorable files
*.nuget.props
*.nuget.targets
# Microsoft Azure Build Output
csx/
*.build.csdef
# Microsoft Azure Emulator
ecf/
rcf/
# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
*.appx
*.appxbundle
*.appxupload
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!?*.[Cc]ache/
# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.jfm
*.pfx
*.publishsettings
orleans.codegen.cs
# Including strong name files can present a security risk
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
#*.snk
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
ServiceFabricBackup/
*.rptproj.bak
# SQL Server files
*.mdf
*.ldf
*.ndf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
*.rptproj.rsuser
*- [Bb]ackup.rdl
*- [Bb]ackup ([0-9]).rdl
*- [Bb]ackup ([0-9][0-9]).rdl
# Microsoft Fakes
FakesAssemblies/
# GhostDoc plugin setting file
*.GhostDoc.xml
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
node_modules/
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# Paket dependency manager
.paket/paket.exe
paket-files/
# FAKE - F# Make
.fake/
# CodeRush personal settings
.cr/personal
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
# Cake - Uncomment if you are using it
# tools/**
# !tools/packages.config
# Tabs Studio
*.tss
# Telerik's JustMock configuration file
*.jmconfig
# BizTalk build output
*.btp.cs
*.btm.cs
*.odx.cs
*.xsd.cs
# OpenCover UI analysis results
OpenCover/
# Azure Stream Analytics local run output
ASALocalRun/
# MSBuild Binary and Structured Log
*.binlog
# NVidia Nsight GPU debugger configuration file
*.nvuser
# MFractors (Xamarin productivity tool) working folder
.mfractor/
# Local History for Visual Studio
.localhistory/
# BeatPulse healthcheck temp database
healthchecksdb
# Backup folder for Package Reference Convert tool in Visual Studio 2017
MigrationBackup/
# Ionide (cross platform F# VS Code tools) working folder
.ionide/
# Fody - auto-generated XML schema
FodyWeavers.xsd
##
## Visual studio for Mac
##
# globs
Makefile.in
*.userprefs
*.usertasks
config.make
config.status
aclocal.m4
install-sh
autom4te.cache/
*.tar.gz
tarballs/
test-results/
# Mac bundle stuff
*.dmg
*.app
# content below from: https://github.com/github/gitignore/blob/master/Global/macOS.gitignore
# General
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
# content below from: https://github.com/github/gitignore/blob/master/Global/Windows.gitignore
# Windows thumbnail cache files
Thumbs.db
ehthumbs.db
ehthumbs_vista.db
# Dump file
*.stackdump
# Folder config file
[Dd]esktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp
# Windows shortcuts
*.lnk
# JetBrains Rider
.idea/
*.sln.iml
##
## Visual Studio Code
##
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

View File

@@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.13.11" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,173 @@
using System;
using System.Diagnostics;
using System.Threading.Tasks;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;
public class MatrixMultiplication
{
public static int[][] MultiplySequential(int[][] matrixA, int[][] matrixB)
{
int rowsA = matrixA.Length;
int colsA = matrixA[0].Length;
int colsB = matrixB[0].Length;
int[][] result = new int[rowsA][];
for (int i = 0; i < rowsA; i++)
{
result[i] = new int[colsB];
for (int j = 0; j < colsB; j++)
{
for (int k = 0; k < colsA; k++)
{
result[i][j] += matrixA[i][k] * matrixB[k][j];
}
}
}
return result;
}
public static int[][] MultiplyParallel(int[][] matrixA, int[][] matrixB, int numThreads)
{
int rowsA = matrixA.Length;
int colsA = matrixA[0].Length;
int colsB = matrixB[0].Length;
int[][] result = new int[rowsA][];
Parallel.For(0, rowsA, new ParallelOptions { MaxDegreeOfParallelism = numThreads }, i =>
{
result[i] = new int[colsB];
for (int j = 0; j < colsB; j++)
{
for (int k = 0; k < colsA; k++)
{
result[i][j] += matrixA[i][k] * matrixB[k][j];
}
}
});
return result;
}
[Benchmark]
public void MultiplySequential_100x100()
{
int[][] matrixA = GenerateRandomMatrix(100, 100);
int[][] matrixB = GenerateRandomMatrix(100, 100);
MultiplySequential(matrixA, matrixB);
}
[Benchmark]
public void MultiplyParallel_100x100_4TH()
{
int[][] matrixA = GenerateRandomMatrix(100, 100);
int[][] matrixB = GenerateRandomMatrix(100, 100);
MultiplyParallel(matrixA, matrixB, 4);
}
[Benchmark]
public void MultiplyParallel_100x100_8TH()
{
int[][] matrixA = GenerateRandomMatrix(100, 100);
int[][] matrixB = GenerateRandomMatrix(100, 100);
MultiplyParallel(matrixA, matrixB, 8);
}
[Benchmark]
public void MultiplyParallel_100x100_16TH()
{
int[][] matrixA = GenerateRandomMatrix(100, 100);
int[][] matrixB = GenerateRandomMatrix(100, 100);
MultiplyParallel(matrixA, matrixB, 16);
}
[Benchmark]
public void MultiplySequential_300x300()
{
int[][] matrixA = GenerateRandomMatrix(300, 300);
int[][] matrixB = GenerateRandomMatrix(300, 300);
MultiplySequential(matrixA, matrixB);
}
[Benchmark]
public void MultiplyParallel_300x300_4TH()
{
int[][] matrixA = GenerateRandomMatrix(300, 300);
int[][] matrixB = GenerateRandomMatrix(300, 300);
MultiplyParallel(matrixA, matrixB, 4);
}
[Benchmark]
public void MultiplyParallel_300x300_8TH()
{
int[][] matrixA = GenerateRandomMatrix(300, 300);
int[][] matrixB = GenerateRandomMatrix(300, 300);
MultiplyParallel(matrixA, matrixB, 8);
}
[Benchmark]
public void MultiplyParallel_300x300_16TH()
{
int[][] matrixA = GenerateRandomMatrix(300, 300);
int[][] matrixB = GenerateRandomMatrix(300, 300);
MultiplyParallel(matrixA, matrixB, 16);
}
[Benchmark]
public void MultiplySequential_500x500()
{
int[][] matrixA = GenerateRandomMatrix(500, 500);
int[][] matrixB = GenerateRandomMatrix(500, 500);
MultiplySequential(matrixA, matrixB);
}
[Benchmark]
public void MultiplyParallel_500x500_4TH()
{
int[][] matrixA = GenerateRandomMatrix(500, 500);
int[][] matrixB = GenerateRandomMatrix(500, 500);
MultiplyParallel(matrixA, matrixB, 4);
}
[Benchmark]
public void MultiplyParallel_500x500_8TH()
{
int[][] matrixA = GenerateRandomMatrix(500, 500);
int[][] matrixB = GenerateRandomMatrix(500, 500);
MultiplyParallel(matrixA, matrixB, 8);
}
[Benchmark]
public void MultiplyParallel_500x500_16TH()
{
int[][] matrixA = GenerateRandomMatrix(500, 500);
int[][] matrixB = GenerateRandomMatrix(500, 500);
MultiplyParallel(matrixA, matrixB, 16);
}
private static int[][] GenerateRandomMatrix(int rows, int cols)
{
int[][] matrix = new int[rows][];
Random rand = new Random();
for (int i = 0; i < rows; i++)
{
matrix[i] = new int[cols];
for (int j = 0; j < cols; j++)
{
matrix[i][j] = rand.Next(1, 10);
}
}
return matrix;
}
}
class Program
{
static void Main(string[] args)
{
var summary = BenchmarkRunner.Run<MatrixMultiplication>();
Console.ReadLine();
}
}

View File

@@ -0,0 +1,191 @@
# Отчёт по лабораторной работе №5
Выполнила: студентка гр. ИСЭбд-41 Халитова А.М.
## Создание приложения
В приложении были созданы следующие методы:
- Заполнение матрицы рандомными значениями:
```
private static int[][] GenerateRandomMatrix(int rows, int cols)
{
int[][] matrix = new int[rows][];
Random rand = new Random();
for (int i = 0; i < rows; i++)
{
matrix[i] = new int[cols];
for (int j = 0; j < cols; j++)
{
matrix[i][j] = rand.Next(1, 10);
}
}
return matrix;
}
```
- Перемножение матриц обычным алгоритмом:
```
public static int[][] MultiplySequential(int[][] matrixA, int[][] matrixB)
{
int rowsA = matrixA.Length;
int colsA = matrixA[0].Length;
int colsB = matrixB[0].Length;
int[][] result = new int[rowsA][];
for (int i = 0; i < rowsA; i++)
{
result[i] = new int[colsB];
for (int j = 0; j < colsB; j++)
{
for (int k = 0; k < colsA; k++)
{
result[i][j] += matrixA[i][k] * matrixB[k][j];
}
}
}
return result;
}
```
- Перемножение матриц параллельным алгоритмом:
```
public static int[][] MultiplyParallel(int[][] matrixA, int[][] matrixB, int numThreads)
{
int rowsA = matrixA.Length;
int colsA = matrixA[0].Length;
int colsB = matrixB[0].Length;
int[][] result = new int[rowsA][];
Parallel.For(0, rowsA, new ParallelOptions { MaxDegreeOfParallelism = numThreads }, i =>
{
result[i] = new int[colsB];
for (int j = 0; j < colsB; j++)
{
for (int k = 0; k < colsA; k++)
{
result[i][j] += matrixA[i][k] * matrixB[k][j];
}
}
});
return result;
}
```
- Создание матриц различных размеров и с различным количеством потоков для параллельного алгоритма:
```
[Benchmark]
public void MultiplySequential_100x100()
{
int[][] matrixA = GenerateRandomMatrix(100, 100);
int[][] matrixB = GenerateRandomMatrix(100, 100);
MultiplySequential(matrixA, matrixB);
}
[Benchmark]
public void MultiplyParallel_100x100_4TH()
{
int[][] matrixA = GenerateRandomMatrix(100, 100);
int[][] matrixB = GenerateRandomMatrix(100, 100);
MultiplyParallel(matrixA, matrixB, 4);
}
[Benchmark]
public void MultiplyParallel_100x100_8TH()
{
int[][] matrixA = GenerateRandomMatrix(100, 100);
int[][] matrixB = GenerateRandomMatrix(100, 100);
MultiplyParallel(matrixA, matrixB, 8);
}
[Benchmark]
public void MultiplyParallel_100x100_16TH()
{
int[][] matrixA = GenerateRandomMatrix(100, 100);
int[][] matrixB = GenerateRandomMatrix(100, 100);
MultiplyParallel(matrixA, matrixB, 16);
}
[Benchmark]
public void MultiplySequential_300x300()
{
int[][] matrixA = GenerateRandomMatrix(300, 300);
int[][] matrixB = GenerateRandomMatrix(300, 300);
MultiplySequential(matrixA, matrixB);
}
[Benchmark]
public void MultiplyParallel_300x300_4TH()
{
int[][] matrixA = GenerateRandomMatrix(300, 300);
int[][] matrixB = GenerateRandomMatrix(300, 300);
MultiplyParallel(matrixA, matrixB, 4);
}
[Benchmark]
public void MultiplyParallel_300x300_8TH()
{
int[][] matrixA = GenerateRandomMatrix(300, 300);
int[][] matrixB = GenerateRandomMatrix(300, 300);
MultiplyParallel(matrixA, matrixB, 8);
}
[Benchmark]
public void MultiplyParallel_300x300_16TH()
{
int[][] matrixA = GenerateRandomMatrix(300, 300);
int[][] matrixB = GenerateRandomMatrix(300, 300);
MultiplyParallel(matrixA, matrixB, 16);
}
[Benchmark]
public void MultiplySequential_500x500()
{
int[][] matrixA = GenerateRandomMatrix(500, 500);
int[][] matrixB = GenerateRandomMatrix(500, 500);
MultiplySequential(matrixA, matrixB);
}
[Benchmark]
public void MultiplyParallel_500x500_4TH()
{
int[][] matrixA = GenerateRandomMatrix(500, 500);
int[][] matrixB = GenerateRandomMatrix(500, 500);
MultiplyParallel(matrixA, matrixB, 4);
}
[Benchmark]
public void MultiplyParallel_500x500_8TH()
{
int[][] matrixA = GenerateRandomMatrix(500, 500);
int[][] matrixB = GenerateRandomMatrix(500, 500);
MultiplyParallel(matrixA, matrixB, 8);
}
[Benchmark]
public void MultiplyParallel_500x500_16TH()
{
int[][] matrixA = GenerateRandomMatrix(500, 500);
int[][] matrixB = GenerateRandomMatrix(500, 500);
MultiplyParallel(matrixA, matrixB, 16);
}
```
- Запуск приложения:
```
static void Main(string[] args)
{
var summary = BenchmarkRunner.Run<MatrixMultiplication>();
Console.ReadLine();
}
```
## Результаты работы приложения
![](shot1.PNG)
По результатам работы: для матриц небольших размеров большое количество потоков не ускоряет (а в некоторых случаях замедляет) работу алгоритма, за счет излишнего переключения процессора. Для больших матриц увеличение количества потоков увеличивает скорость работы алгоритма. В сравнении с однопоточным алгоритмом, работа параллельного в несколько раз быстрее.

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

View File

@@ -0,0 +1,158 @@
# Отчёт по лабораторной работе №1
Выполнил: студент гр. ИСЭБД-41 Клементьева Жанна.
## Разворачивание сервера Wordpress
Содержимое файла `docker-compose.yml`:
```yaml
version: '3'
services: # Описание контейнеров
db: # База данных
image: mysql:5.7 # Образ базы данных и версия
volumes: # Тома для хранения данных, для контейнеров
- db_data:/var/lib/mysql
restart: always # Параметр перезапуска БД
environment: # Переменные среды для контейнера
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: wordpress
MYSQL_USER: wordpress
MYSQL_PASSWORD: wordpress
networks: # Параметры сети
- wpsite
wordpress: # Контейнер с Wordpress
depends_on: # Параметр зависимости от работы базы данных (в данном случае)
- db
image: wordpress:latest # Образ Wordpress (последняя версия)
ports: # Порт, проложенный из контейнера в хост
- '8000:80'
restart: always # Параметр перезапуска
volumes: ['./:/var/www/html'] # Тома для хранения данных, для контейнеров
environment: # Переменные среды для контейнера
WORDPRESS_DB_HOST: db:3306
WORDPRESS_DB_USER: wordpress
WORDPRESS_DB_PASSWORD: wordpress
networks: # Параметры сети
- wpsite
networks:
wpsite:
volumes:
db_data:
```
Разворачивается командой `docker-compose up`.
Убеждаемся, что всё работает, прописываем в браузере "localhost:8000", так как docker-compose.yaml мы указали порт 8000:
![port8000](port8000.png)
![localhost:8000](localhost8000.png)
Открывается стартовое окно Wordpress, где мы можем выбрать язык и приступить к работе, если это потребуется:
![WPLanguage](WPLanguage.png)
![WPSettings](WPSettings.png)
Удаляется всё командой `docker-compose down` или `docker-compose down -v`.
## Разворачивание сервера Gitea
Содержимое файла `docker-compose.yml`:
```yaml
version: "3"
networks:
gitea:
external: false
services: # Описание служб (контейнеров).
server: # Сервер
image: gitea/gitea:1.20.4 # Образ базы данных и версия
container_name: gitea # Наименование контейнера
environment: # Переменные среды для контейнера
- USER_UID=1000
- USER_GID=1000
- GITEA__database__DB_TYPE=mysql
- GITEA__database__HOST=db:3306
- GITEA__database__NAME=gitea
- GITEA__database__USER=gitea
- GITEA__database__PASSWD=gitea
restart: always # Параметр перезапуска
networks: # Параметры сети
- gitea
volumes: # Тома для хранения данных, для контейнеров
- ./gitea:/data
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
ports: # Порты, проложенные из контейнера в хост
- "3000:80"
- "222:22"
depends_on: # Параметр зависимости от работы базы данных (в данном случае)
- db
db: # База данных
image: mysql:8 # Образ базы данных и версия
restart: always # Параметр перезапуска БД
environment: # Переменные среды для контейнера
- MYSQL_ROOT_PASSWORD=gitea
- MYSQL_USER=gitea
- MYSQL_PASSWORD=gitea
- MYSQL_DATABASE=gitea
networks: # Параметры сети
- gitea
volumes: # Тома для хранения данных, для контейнеров
- ./mysql:/var/lib/mysql
```
Разворачивается командой `docker-compose up`.
Убеждаемся, что всё работает, прописываем в браузере "localhost:3000", так как docker-compose.yaml мы указали порт 3000. Открывается стартовое окно Gitea, где мы можем настроить систему и приступить к работе, если это потребуется:
![localhost:3000](localhost3000.png)
Удаляется всё командой `docker-compose down` или `docker-compose down -v`.
## Разворачивание сервера Mediawiki
Содержимое файла `docker-compose.yml`:
```yaml
version: '3.2'
services: # Описание контейнеров
web: # Контейнер с Mediawiki
image: mediawiki:lts # Образ Mediawiki
ports: # Порт, проложенный из контейнера в хост
- 9999:80
links: # Ссылка на контейнер "database"
- database
restart: unless-stopped # Параметр перезапуска
volumes: # Тома для хранения данных, для контейнеров
- ./images:/var/www/html/images
database: # База данных
image: mariadb # Образ базы данных
environment: # Переменные среды для контейнера
MYSQL_DATABASE: 'wiki'
MYSQL_USER: 'wikiuser234234'
MYSQL_PASSWORD: 'YOUR_SECURE_PASSWORD'
MYSQL_RANDOM_ROOT_PASSWORD: 'yes'
volumes: # Тома для хранения данных, для контейнеров
- ./database:/var/lib/mysql
restart: unless-stopped # Параметр перезапуска
```
Разворачивается командой `docker-compose up`.
Убеждаемся, что всё работает, прописываем в браузере "localhost:9999", так как docker-compose.yaml мы указали порт 9999. Открывается стартовое окно Mediawiki, где мы можем настроить систему и приступить к работе, если это потребуется:
![Mediawiki](Mediawiki.png)
Удаляется всё командой `docker-compose down` или `docker-compose down -v`.

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

477
tasks/klementeva-ja/lab_2/.gitignore vendored Normal file
View File

@@ -0,0 +1,477 @@
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore
# User-specific files
*.rsuser
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Mono auto generated files
mono_crash.*
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
[Ww][Ii][Nn]32/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
[Ll]ogs/
# Visual Studio 2015/2017 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# Visual Studio 2017 auto generated files
Generated\ Files/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUnit
*.VisualState.xml
TestResult.xml
nunit-*.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# Benchmark Results
BenchmarkDotNet.Artifacts/
# .NET
project.lock.json
project.fragment.lock.json
artifacts/
# Tye
.tye/
# ASP.NET Scaffolding
ScaffoldingReadMe.txt
# StyleCop
StyleCopReport.xml
# Files built by Visual Studio
*_i.c
*_p.c
*_h.h
*.ilk
*.meta
*.obj
*.iobj
*.pch
*.pdb
*.ipdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*_wpftmp.csproj
*.log
*.tlog
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb
# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap
# Visual Studio Trace Files
*.e2e
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# AxoCover is a Code Coverage Tool
.axoCover/*
!.axoCover/settings.json
# Coverlet is a free, cross platform Code Coverage Tool
coverage*.json
coverage*.xml
coverage*.info
# Visual Studio code coverage results
*.coverage
*.coveragexml
# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# Note: Comment the next line if you want to checkin your web deploy settings,
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/
# NuGet Packages
*.nupkg
# NuGet Symbol Packages
*.snupkg
# The packages folder can be ignored because of Package Restore
**/[Pp]ackages/*
# except build/, which is used as an MSBuild target.
!**/[Pp]ackages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/[Pp]ackages/repositories.config
# NuGet v3's project.json files produces more ignorable files
*.nuget.props
*.nuget.targets
# Microsoft Azure Build Output
csx/
*.build.csdef
# Microsoft Azure Emulator
ecf/
rcf/
# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
*.appx
*.appxbundle
*.appxupload
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!?*.[Cc]ache/
# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.jfm
*.pfx
*.publishsettings
orleans.codegen.cs
# Including strong name files can present a security risk
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
#*.snk
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
ServiceFabricBackup/
*.rptproj.bak
# SQL Server files
*.mdf
*.ldf
*.ndf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
*.rptproj.rsuser
*- [Bb]ackup.rdl
*- [Bb]ackup ([0-9]).rdl
*- [Bb]ackup ([0-9][0-9]).rdl
# Microsoft Fakes
FakesAssemblies/
# GhostDoc plugin setting file
*.GhostDoc.xml
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
node_modules/
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw
# Visual Studio 6 auto-generated project file (contains which files were open etc.)
*.vbp
# Visual Studio 6 workspace and project file (working project files containing files to include in project)
*.dsw
*.dsp
# Visual Studio 6 technical files
*.ncb
*.aps
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# Paket dependency manager
.paket/paket.exe
paket-files/
# FAKE - F# Make
.fake/
# CodeRush personal settings
.cr/personal
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
# Cake - Uncomment if you are using it
# tools/**
# !tools/packages.config
# Tabs Studio
*.tss
# Telerik's JustMock configuration file
*.jmconfig
# BizTalk build output
*.btp.cs
*.btm.cs
*.odx.cs
*.xsd.cs
# OpenCover UI analysis results
OpenCover/
# Azure Stream Analytics local run output
ASALocalRun/
# MSBuild Binary and Structured Log
*.binlog
# NVidia Nsight GPU debugger configuration file
*.nvuser
# MFractors (Xamarin productivity tool) working folder
.mfractor/
# Local History for Visual Studio
.localhistory/
# Visual Studio History (VSHistory) files
.vshistory/
# BeatPulse healthcheck temp database
healthchecksdb
# Backup folder for Package Reference Convert tool in Visual Studio 2017
MigrationBackup/
# Ionide (cross platform F# VS Code tools) working folder
.ionide/
# Fody - auto-generated XML schema
FodyWeavers.xsd
# VS Code files for those working on multiple tools
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
*.code-workspace
# Local History for Visual Studio Code
.history/
# Windows Installer files from build outputs
*.cab
*.msi
*.msix
*.msm
*.msp
# JetBrains Rider
*.sln.iml
##
## Visual studio for Mac
##
# globs
Makefile.in
*.userprefs
*.usertasks
config.make
config.status
aclocal.m4
install-sh
autom4te.cache/
*.tar.gz
tarballs/
test-results/
# Mac bundle stuff
*.dmg
*.app
# content below from: https://github.com/github/gitignore/blob/master/Global/macOS.gitignore
# General
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
# content below from: https://github.com/github/gitignore/blob/master/Global/Windows.gitignore
# Windows thumbnail cache files
Thumbs.db
ehthumbs.db
ehthumbs_vista.db
# Dump file
*.stackdump
# Folder config file
[Dd]esktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp
# Windows shortcuts
*.lnk

View File

@@ -0,0 +1,75 @@
# Отчёт по лабораторной работе №2
Выполнил: студентка гр. ИСЭбд-41 Клементьева Жанна.
Вариант программы 1: Ищет в каталоге `/var/data` файл с наибольшим количеством строк и перекладывает его в `/var/result/data.txt`.
Вариант программы 2: Ищет наименьшее число из файла `/var/data/data.txt` и сохраняет количество таких чисел из последовательности в `/var/result/result.txt`.
## Создание приложений
Создадим 2 приложения.
Был выбран язык C# и технология .NET 6, потому что потому.
Для создания обычных консольных приложений воспользуемся командами:
```sh
dotnet new console -o worker-1
dotnet new console -o worker-2
```
Согласно варианту программа 1 ищет в каталоге `/var/data` файл с наибольшим количеством строк и перекладывает его в `/var/result/data.txt`.
[Исходный текст программы worker-1](worker-1/Program.cs)
Согласно варианту программа 2 ищет наименьшее число из файла `/var/data/data.txt` и сохраняет количество таких чисел из последовательности в `/var/result/result.txt`.
[Исходный текст программы worker-2](worker-2/Program.cs)
Дополнительно создан файл [.gitignore](.gitignore) для того, чтобы не закоммитить в git ничего лишнего.
## Настройка окружения
Для связи двух приложений воспользуемся следующей схемой:
1. Каталог `./data` должен быть примонтирован в каталог `/var/data` для программы 1.
Оттуда будут браться исходные данные.
2. Каталог `./result-1` должен быть примонтирован в каталог `/var/result` для программы 2.
Туда будут складываться промежуточные данные.
3. Каталог `./result-1` также должен быть примонтирован в каталог `/var/data` для программы 2.
Оттуда будут браться промежуточные результаты.
4. Каталог `./result` должен быть примонтирован в каталог `/var/result` для программы 2.
Туда будут складывать результаты финальной обработки.
Для каждой программы были созданы файлы Dockerfile ([программа 1](worker-1/Dockerfile.yml), [программа 2](worker-1/Dockerfile.yml)) с подробным описанием процесса сборки.
Был создан файл [docker-compose.yml](docker-compose.yml), в котором указан манифест для запуска распределённого приложения.
Дополнительно был создан файл [.gitignore](.gitignore), чтобы исключить для сборки и коммита всё лишнее.
## Сборка и запуск
В каталог `./data` помещены 2 файла.
В первом файле были числа 1 2 3, во втором 1 1 7 5 3 1.
Для запуска приложения необходимо ввести команду `docker compose up ---build`.
Результат запуска после сборки:
```
[+] Running 2/0
- Container lab_2-worker-1-1 Created
- Container lab_2-worker-2-1 Created
Attaching to lab_2-worker-1-1, lab_2-worker-2-1
lab_2-worker-1-1 | Начало обработки файла /var/data/another data.txt
lab_2-worker-1-1 | Начало обработки файла /var/data/data.txt
lab_2-worker-1-1 exited with code 0
lab_2-worker-2-1 | Чисел для обработки: 8
lab_2-worker-2-1 exited with code 0
```
В результате в каталоге `./result` создался файл `result.txt` с содержимым `3`, что соответствует входным данным.
Изменение значений в файлах из каталога `./data` также изменяет содержимое в файлах из каталогов `./result-1` и `./result`.
![resultat](resultat.png)

View File

@@ -0,0 +1,16 @@
version: "3.1"
services:
worker-1:
build: ./worker-1
volumes:
#монтируем локальную папку в запущенный образ контейнера
- ./data:/var/data
- ./result-1:/var/result
worker-2:
build: ./worker-2
volumes:
- ./result-1:/var/data
- ./result:/var/result
#добавляется зависимость, так как по условию второе приложение зависит от первого
depends_on:
- worker-1

View File

@@ -0,0 +1,72 @@
{
"version": 3,
"targets": {
"net6.0": {}
},
"libraries": {},
"projectFileDependencyGroups": {
"net6.0": []
},
"packageFolders": {
"C:\\Users\\Angelina\\.nuget\\packages\\": {},
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages": {}
},
"project": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "C:\\Users\\Angelina\\source\\repos\\rvip_j2\\rvip_j2.csproj",
"projectName": "rvip_j2",
"projectPath": "C:\\Users\\Angelina\\source\\repos\\rvip_j2\\rvip_j2.csproj",
"packagesPath": "C:\\Users\\Angelina\\.nuget\\packages\\",
"outputPath": "C:\\Users\\Angelina\\source\\repos\\rvip_j2\\obj\\",
"projectStyle": "PackageReference",
"fallbackFolders": [
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages"
],
"configFilePaths": [
"C:\\Users\\Angelina\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
],
"originalTargetFrameworks": [
"net6.0"
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"net6.0": {
"targetAlias": "net6.0",
"projectReferences": {}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
}
},
"frameworks": {
"net6.0": {
"targetAlias": "net6.0",
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48"
],
"assetTargetFallback": true,
"warn": true,
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\6.0.302\\RuntimeIdentifierGraph.json"
}
}
}
}

View File

@@ -0,0 +1,8 @@
{
"version": 2,
"dgSpecHash": "hiebTXlxthjXc1QJSKY3S0IQRu5qUGAH0gSd/Nco/5iDafnuAWzESuqJHEv4balZJHuPkpIs5zlfPwaMVwwrWw==",
"success": true,
"projectFilePath": "C:\\Users\\Angelina\\source\\repos\\rvip_j2\\rvip_j2.csproj",
"expectedPackageFiles": [],
"logs": []
}

View File

@@ -0,0 +1,66 @@
{
"format": 1,
"restore": {
"C:\\Users\\Angelina\\source\\repos\\rvip_j2\\rvip_j2.csproj": {}
},
"projects": {
"C:\\Users\\Angelina\\source\\repos\\rvip_j2\\rvip_j2.csproj": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "C:\\Users\\Angelina\\source\\repos\\rvip_j2\\rvip_j2.csproj",
"projectName": "rvip_j2",
"projectPath": "C:\\Users\\Angelina\\source\\repos\\rvip_j2\\rvip_j2.csproj",
"packagesPath": "C:\\Users\\Angelina\\.nuget\\packages\\",
"outputPath": "C:\\Users\\Angelina\\source\\repos\\rvip_j2\\obj\\",
"projectStyle": "PackageReference",
"fallbackFolders": [
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages"
],
"configFilePaths": [
"C:\\Users\\Angelina\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
],
"originalTargetFrameworks": [
"net6.0"
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"net6.0": {
"targetAlias": "net6.0",
"projectReferences": {}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
}
},
"frameworks": {
"net6.0": {
"targetAlias": "net6.0",
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48"
],
"assetTargetFallback": true,
"warn": true,
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\6.0.302\\RuntimeIdentifierGraph.json"
}
}
}
}
}

View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\Angelina\.nuget\packages\;C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages</NuGetPackageFolders>
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.2.1</NuGetToolVersion>
</PropertyGroup>
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<SourceRoot Include="C:\Users\Angelina\.nuget\packages\" />
<SourceRoot Include="C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages\" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" />

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

View File

@@ -0,0 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.5.002.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "worker-1", "worker-1\worker-1.csproj", "{F6B29C3F-FC5C-4B48-A594-4B9316A21F56}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "worker-2", "worker-2\worker-2.csproj", "{B18DF6BB-6783-4F53-A5EE-140D07BF447C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{F6B29C3F-FC5C-4B48-A594-4B9316A21F56}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F6B29C3F-FC5C-4B48-A594-4B9316A21F56}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F6B29C3F-FC5C-4B48-A594-4B9316A21F56}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F6B29C3F-FC5C-4B48-A594-4B9316A21F56}.Release|Any CPU.Build.0 = Release|Any CPU
{B18DF6BB-6783-4F53-A5EE-140D07BF447C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B18DF6BB-6783-4F53-A5EE-140D07BF447C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B18DF6BB-6783-4F53-A5EE-140D07BF447C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B18DF6BB-6783-4F53-A5EE-140D07BF447C}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {D0BD68D2-E574-457E-B29C-4A1167DE76D6}
EndGlobalSection
EndGlobal

View File

@@ -0,0 +1,3 @@
1
2
3

View File

@@ -0,0 +1,6 @@
1
1
7
5
3
1

View File

@@ -0,0 +1,5 @@
1
2
3
4
5

View File

@@ -0,0 +1 @@
3147483647

View File

@@ -0,0 +1,15 @@
#указываем образ из которого будем брать все слои
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build-env
#папка, с которой мы будем работать
WORKDIR /App
#копируем файл в рабочую дерикторию
COPY . ./
#запускаем команду
RUN dotnet restore
RUN dotnet publish -c Release -o out
FROM mcr.microsoft.com/dotnet/aspnet:6.0
WORKDIR /App
#копирует не из файловой системы хоста, а из того, что собрали на прерыдущей стадии
COPY --from=build-env /App/out .
ENTRYPOINT ["dotnet", "worker-1.dll"]

View File

@@ -0,0 +1,13 @@
var files = Directory.GetFiles("/var/data");
int maxCount = 0;
string lagrestFile = "";
foreach(var file in files){
var lines = File.ReadAllLines(file);
if(lines.Count() > maxCount){
maxCount = lines.Count();
lagrestFile = file;
}
}
if(File.Exists("/var/result/data.txt"))
File.Delete("/var/result/data.txt");
File.Move(lagrestFile, "/var/result/data.txt");

View File

@@ -0,0 +1,23 @@
{
"runtimeTarget": {
"name": ".NETCoreApp,Version=v6.0",
"signature": ""
},
"compilationOptions": {},
"targets": {
".NETCoreApp,Version=v6.0": {
"worker-1/1.0.0": {
"runtime": {
"worker-1.dll": {}
}
}
}
},
"libraries": {
"worker-1/1.0.0": {
"type": "project",
"serviceable": false,
"sha512": ""
}
}
}

View File

@@ -0,0 +1,9 @@
{
"runtimeOptions": {
"tfm": "net6.0",
"framework": {
"name": "Microsoft.NETCore.App",
"version": "6.0.0"
}
}
}

View File

@@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v6.0", FrameworkDisplayName = "")]

View File

@@ -0,0 +1,22 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("worker-1")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")]
[assembly: System.Reflection.AssemblyProductAttribute("worker-1")]
[assembly: System.Reflection.AssemblyTitleAttribute("worker-1")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
// Создано классом WriteCodeFragment MSBuild.

View File

@@ -0,0 +1 @@
9b423a53481895e7341de7e28fe8c945c03908af

View File

@@ -0,0 +1,10 @@
is_global = true
build_property.TargetFramework = net6.0
build_property.TargetPlatformMinVersion =
build_property.UsingMicrosoftNETSdkWeb =
build_property.ProjectTypeGuids =
build_property.InvariantGlobalization =
build_property.PlatformNeutralAssembly =
build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = worker_1
build_property.ProjectDir = C:\Users\Angelina\source\repos\rvip_j2\worker-1\

View File

@@ -0,0 +1,8 @@
// <auto-generated/>
global using global::System;
global using global::System.Collections.Generic;
global using global::System.IO;
global using global::System.Linq;
global using global::System.Net.Http;
global using global::System.Threading;
global using global::System.Threading.Tasks;

View File

@@ -0,0 +1 @@
2ce983111ab3dfd18d5a764821ca2badebb59785

View File

@@ -0,0 +1,15 @@
C:\Users\Angelina\source\repos\rvip_j2\worker-1\bin\Debug\net6.0\worker-1.exe
C:\Users\Angelina\source\repos\rvip_j2\worker-1\bin\Debug\net6.0\worker-1.deps.json
C:\Users\Angelina\source\repos\rvip_j2\worker-1\bin\Debug\net6.0\worker-1.runtimeconfig.json
C:\Users\Angelina\source\repos\rvip_j2\worker-1\bin\Debug\net6.0\worker-1.dll
C:\Users\Angelina\source\repos\rvip_j2\worker-1\bin\Debug\net6.0\worker-1.pdb
C:\Users\Angelina\source\repos\rvip_j2\worker-1\obj\Debug\net6.0\worker-1.csproj.AssemblyReference.cache
C:\Users\Angelina\source\repos\rvip_j2\worker-1\obj\Debug\net6.0\worker-1.GeneratedMSBuildEditorConfig.editorconfig
C:\Users\Angelina\source\repos\rvip_j2\worker-1\obj\Debug\net6.0\worker-1.AssemblyInfoInputs.cache
C:\Users\Angelina\source\repos\rvip_j2\worker-1\obj\Debug\net6.0\worker-1.AssemblyInfo.cs
C:\Users\Angelina\source\repos\rvip_j2\worker-1\obj\Debug\net6.0\worker-1.csproj.CoreCompileInputs.cache
C:\Users\Angelina\source\repos\rvip_j2\worker-1\obj\Debug\net6.0\worker-1.dll
C:\Users\Angelina\source\repos\rvip_j2\worker-1\obj\Debug\net6.0\refint\worker-1.dll
C:\Users\Angelina\source\repos\rvip_j2\worker-1\obj\Debug\net6.0\worker-1.pdb
C:\Users\Angelina\source\repos\rvip_j2\worker-1\obj\Debug\net6.0\worker-1.genruntimeconfig.cache
C:\Users\Angelina\source\repos\rvip_j2\worker-1\obj\Debug\net6.0\ref\worker-1.dll

View File

@@ -0,0 +1 @@
09fd2cb6c9c353226ef9a0fc0e4386552dffb164

View File

@@ -0,0 +1,72 @@
{
"version": 3,
"targets": {
"net6.0": {}
},
"libraries": {},
"projectFileDependencyGroups": {
"net6.0": []
},
"packageFolders": {
"C:\\Users\\Angelina\\.nuget\\packages\\": {},
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages": {}
},
"project": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "C:\\Users\\Angelina\\source\\repos\\rvip_j2\\worker-1\\worker-1.csproj",
"projectName": "worker-1",
"projectPath": "C:\\Users\\Angelina\\source\\repos\\rvip_j2\\worker-1\\worker-1.csproj",
"packagesPath": "C:\\Users\\Angelina\\.nuget\\packages\\",
"outputPath": "C:\\Users\\Angelina\\source\\repos\\rvip_j2\\worker-1\\obj\\",
"projectStyle": "PackageReference",
"fallbackFolders": [
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages"
],
"configFilePaths": [
"C:\\Users\\Angelina\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
],
"originalTargetFrameworks": [
"net6.0"
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"net6.0": {
"targetAlias": "net6.0",
"projectReferences": {}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
}
},
"frameworks": {
"net6.0": {
"targetAlias": "net6.0",
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48"
],
"assetTargetFallback": true,
"warn": true,
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\6.0.302\\RuntimeIdentifierGraph.json"
}
}
}
}

View File

@@ -0,0 +1,8 @@
{
"version": 2,
"dgSpecHash": "C2anyFjtRK0Epm22JYF/qjf/rPQav2nfpkocjB7jwVD+lUPaShv6REMOWux8v/WiQkOsZJDmvzWFBToAD24j9g==",
"success": true,
"projectFilePath": "C:\\Users\\Angelina\\source\\repos\\rvip_j2\\worker-1\\worker-1.csproj",
"expectedPackageFiles": [],
"logs": []
}

View File

@@ -0,0 +1,66 @@
{
"format": 1,
"restore": {
"C:\\Users\\Angelina\\source\\repos\\rvip_j2\\worker-1\\worker-1.csproj": {}
},
"projects": {
"C:\\Users\\Angelina\\source\\repos\\rvip_j2\\worker-1\\worker-1.csproj": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "C:\\Users\\Angelina\\source\\repos\\rvip_j2\\worker-1\\worker-1.csproj",
"projectName": "worker-1",
"projectPath": "C:\\Users\\Angelina\\source\\repos\\rvip_j2\\worker-1\\worker-1.csproj",
"packagesPath": "C:\\Users\\Angelina\\.nuget\\packages\\",
"outputPath": "C:\\Users\\Angelina\\source\\repos\\rvip_j2\\worker-1\\obj\\",
"projectStyle": "PackageReference",
"fallbackFolders": [
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages"
],
"configFilePaths": [
"C:\\Users\\Angelina\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
],
"originalTargetFrameworks": [
"net6.0"
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"net6.0": {
"targetAlias": "net6.0",
"projectReferences": {}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
}
},
"frameworks": {
"net6.0": {
"targetAlias": "net6.0",
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48"
],
"assetTargetFallback": true,
"warn": true,
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\6.0.302\\RuntimeIdentifierGraph.json"
}
}
}
}
}

View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\Angelina\.nuget\packages\;C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages</NuGetPackageFolders>
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.2.1</NuGetToolVersion>
</PropertyGroup>
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<SourceRoot Include="C:\Users\Angelina\.nuget\packages\" />
<SourceRoot Include="C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages\" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" />

View File

@@ -0,0 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>worker_1</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1,15 @@
#указываем образ из которого будем брать все слои
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build-env
#папка, с которой мы будем работать
WORKDIR /App
#копируем файл в рабочую дерикторию
COPY . ./
#запускаем команду
RUN dotnet restore
RUN dotnet publish -c Release -o out
FROM mcr.microsoft.com/dotnet/aspnet:6.0
WORKDIR /App
#копирует не из файловой системы хоста, а из того, что собрали на прерыдущей стадии
COPY --from=build-env /App/out .
ENTRYPOINT ["dotnet", "worker-2.dll"]

View File

@@ -0,0 +1,23 @@
using System.Text;
int[] numbers = File.ReadAllLines("/var/data/data.txt").Select(x=> int.Parse(x)).ToArray();
int minNumber = int.MaxValue;
int minNumberCount = 0;
foreach(var number in numbers){
if(number > minNumber){
continue;
}
if(number == minNumber){
minNumberCount++;
continue;
}
if(number < minNumber){
minNumber = number;
minNumberCount = 1;
}
}
using(FileStream fstream = new FileStream("/var/result/result.txt", FileMode.OpenOrCreate)){
byte[] buffer = Encoding.Default.GetBytes(minNumberCount.ToString());
await fstream.WriteAsync(buffer, 0, buffer.Length);
}
Console.WriteLine(minNumberCount);

View File

@@ -0,0 +1,23 @@
{
"runtimeTarget": {
"name": ".NETCoreApp,Version=v6.0",
"signature": ""
},
"compilationOptions": {},
"targets": {
".NETCoreApp,Version=v6.0": {
"worker-2/1.0.0": {
"runtime": {
"worker-2.dll": {}
}
}
}
},
"libraries": {
"worker-2/1.0.0": {
"type": "project",
"serviceable": false,
"sha512": ""
}
}
}

View File

@@ -0,0 +1,9 @@
{
"runtimeOptions": {
"tfm": "net6.0",
"framework": {
"name": "Microsoft.NETCore.App",
"version": "6.0.0"
}
}
}

View File

@@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v6.0", FrameworkDisplayName = "")]

Some files were not shown because too many files have changed in this diff Show More