Compare commits
114 Commits
borschevsk
...
main
Author | SHA1 | Date | |
---|---|---|---|
85b809333b | |||
5e3c9c0d5b | |||
daf24d364d | |||
6c13deb231 | |||
543d41d9c3 | |||
153684c403 | |||
0708b01560 | |||
8a6932ff20 | |||
35cf16824d | |||
ac3dc2e566 | |||
2f46c05849 | |||
84cb26162c | |||
129b991712 | |||
ffecef8fa3 | |||
1289d67a62 | |||
b09f3ea844 | |||
2f368ffb07 | |||
ead06782ad | |||
b2ac5eba9a | |||
0c0a47549a | |||
|
84e8cac198 | ||
bde242318f | |||
761cc83ebd | |||
4699fda797 | |||
940cc6757f | |||
1e9bdf2806 | |||
|
9bd14a60b4 | ||
5aa2cae670 | |||
281d30a89e | |||
f2093f376c | |||
80c666d6b0 | |||
a589994db5 | |||
38ce2bb347 | |||
f25af86d9c | |||
45eb2b72c5 | |||
77bdc1d8e9 | |||
da6593c4d0 | |||
|
eeac04be49 | ||
0a73e2d5d4 | |||
1565e49462 | |||
858ea65e71 | |||
0f898b968d | |||
8b96102dbd | |||
82ecad71f4 | |||
8a96320fd5 | |||
bd25930973 | |||
|
8efc2422cf | ||
c3537b5abe | |||
a0ef65e0f9 | |||
6815b2e560 | |||
48b7fbd900 | |||
080625d270 | |||
37996c249a | |||
9456d4fe01 | |||
c14e105db5 | |||
4d1e900721 | |||
7184d6d728 | |||
|
6e7055efa4 | ||
|
9e40adc53c | ||
|
4a36528cc7 | ||
ad3988e5fc | |||
780b4b2924 | |||
d9f5f75f5e | |||
7d9c9ec4d0 | |||
5047b16cde | |||
2b87427299 | |||
|
21cdd4971d | ||
6b55b7b0fc | |||
47193155d9 | |||
bc8c4c887e | |||
4a2adcc35a | |||
d7cb666a0d | |||
6c642384c1 | |||
bdb5cc07ed | |||
e761e33201 | |||
|
ceee500b95 | ||
2be2c71b69 | |||
|
aa8180ba49 | ||
c509e74465 | |||
314751f25c | |||
48f7f3a215 | |||
f112d2a44b | |||
477afb824d | |||
6ce78e60ad | |||
b13182c80e | |||
e7b9938278 | |||
822467bd99 | |||
|
ba7480cb4f | ||
d7faf2a1b7 | |||
d98803227e | |||
6f12270c73 | |||
6e6266c228 | |||
06d1d8cdd4 | |||
4c76a9dea6 | |||
e5d0aa0b3d | |||
d326e64f24 | |||
1a118ae71f | |||
e9b06b1f27 | |||
|
1adaac9281 | ||
|
5e9e2600f3 | ||
b6e311755e | |||
8eedde24a1 | |||
57970b3333 | |||
1c77ba3272 | |||
ce9527b1c9 | |||
a1419f21ec | |||
aac01e9f48 | |||
221f3e248b | |||
3d98388a13 | |||
4922e9075e | |||
891eae4211 | |||
121e4bbcd2 | |||
0590f7b532 | |||
0eec58a347 |
9
.gitignore
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
|
||||
/dozorova_alena_lab_2/.vs
|
||||
/dozorova_alena_lab_2/ConsoleApp1/.vs
|
||||
/dozorova_alena_lab_2/ConsoleApp1/bin
|
||||
/dozorova_alena_lab_2/ConsoleApp1/obj
|
||||
/dozorova_alena_lab_2/ConsoleApp1/Properties/PublishProfiles
|
||||
/dozorova_alena_lab_2/ConsoleApp2/.vs
|
||||
/dozorova_alena_lab_2/ConsoleApp2/bin
|
||||
/dozorova_alena_lab_2/ConsoleApp2/obj
|
59
balakhonov_danila_lab_1/README.md
Normal file
@ -0,0 +1,59 @@
|
||||
# Лабораторная работа номер 1
|
||||
|
||||
> Здравствуйте меня зовут Балахонов Данила группа ПИбд-42
|
||||
>
|
||||
> *— Балахонов Данила ПИбд-42*
|
||||
|
||||
Видео лабораторной работы номер 1 доступно по этой [ссылке](https://drive.google.com/file/d/1Up_JzDcK_TjYLixpfYXN7PhJmOeg_Uck/view?usp=sharing).
|
||||
|
||||
## Как запустить лабораторную работу номер 1?
|
||||
### Необходимые компоненты для запуска лабораторной работы номер 1
|
||||
> Здесь рассказана установка необходимых компонентов для запуска лабораторной работы номер 1 под дистрибутив GNU/Linux **Ubuntu**.
|
||||
|
||||
Для запуска лабораторной работы номер 1 необходимы такие компоненты:
|
||||
- Git
|
||||
- Docker
|
||||
- Docker compose
|
||||
|
||||
Чтобы установить **Git**, необходимо ввести данные команды в командную строку:
|
||||
``` bash
|
||||
sudo apt-get update
|
||||
sudo apt-get install git
|
||||
```
|
||||
|
||||
Чтобы установить **Docker** и **Docker compose**, стоит ввести такие команды:
|
||||
``` bash
|
||||
# Настройка репозитория Docker
|
||||
sudo apt-get update
|
||||
sudo apt-get install ca-certificates curl
|
||||
sudo install -m 0755 -d /etc/apt/keyrings
|
||||
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
|
||||
sudo chmod a+r /etc/apt/keyrings/docker.asc
|
||||
|
||||
echo \
|
||||
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
|
||||
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
|
||||
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
|
||||
sudo apt-get update
|
||||
|
||||
# Установка Docker и его компонентов
|
||||
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
|
||||
```
|
||||
### Запуск лабораторной работы номер 1
|
||||
Для запуска лабораторной работы номер 1 необходимо **склонировать** репозиторий в любую папку и **перейти на ветку** balakhonov_danila_lab_1.
|
||||
Далее в папке с `docker-compose.yaml` нужно вызвать такую команду:
|
||||
``` bash
|
||||
sudo docker-compose up -d
|
||||
```
|
||||
Таким образом будут запущены контейнеры в фоновом режиме.
|
||||
## Какие технологии были использованы?
|
||||
Для выполнения лабораторной работы номер 1 использовались такие технологии, как: *git*, *docker*, *docker compose*.
|
||||
|
||||
Сервисы, выбранные для запуска в docker-compose файле:
|
||||
- *Gitea* - удобный сервис отслеживания версий разрабатываемого ПО
|
||||
- *MediaWiki* - сервис создания и ведения электронной энциклопедии
|
||||
- *PostgreSQL* - база данных, используемая сервисами выше
|
||||
|
||||
Системой, на которую были установлены указанные технологии, является Ubuntu 22.
|
||||
## Что делает лабораторная работа номер 1?
|
||||
Лабораторная работа номер 1 заключается в написании docker-compose файла для удобного запуска и администрирования сразу нескольких сервисов в docker-контейнерах.
|
58
balakhonov_danila_lab_1/docker-compose.yaml
Normal file
@ -0,0 +1,58 @@
|
||||
services:
|
||||
# PostgreSQL
|
||||
db:
|
||||
# Образ контейнера PostgreSQL последней версии
|
||||
image: postgres
|
||||
# Название контейнера
|
||||
container_name: db
|
||||
# Переменные окружения для настройки базы данных
|
||||
environment:
|
||||
- POSTGRES_USER=gitea
|
||||
- POSTGRES_PASSWORD=gitea
|
||||
- POSTGRES_DB=gitea
|
||||
# Настройка корневого каталога, где хранятся данные
|
||||
# Слева указан каталог компьютера, справа - каталог контейнера
|
||||
# Нужно для сохранения данных на сервере после отключения контейнера
|
||||
volumes:
|
||||
- ./postgres:/var/lib/postgresql/data
|
||||
# Порт, через который можно будет подключиться к базе данных
|
||||
ports:
|
||||
- 5432:5432
|
||||
# После перезапуска докера всегда запускать этот контейнер
|
||||
restart: always
|
||||
# Gitea
|
||||
gitea:
|
||||
# Используется Gitea последней версии
|
||||
image: gitea/gitea
|
||||
container_name: gitea
|
||||
# После перезапуска докера всегда запускать этот контейнер
|
||||
restart: always
|
||||
volumes:
|
||||
- ./data:/var/lib/gitea
|
||||
- ./config:/etc/gitea
|
||||
- /etc/timezone:/etc/timezone:ro
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
ports:
|
||||
- 3000:3000
|
||||
- 2222:2222
|
||||
environment:
|
||||
- GITEA__database__DB_TYPE=postgres
|
||||
- GITEA__database__HOST=db:5432
|
||||
- GITEA__database__NAME=gitea
|
||||
- GITEA__database__USER=gitea
|
||||
- GITEA__database__PASSWD=gitea
|
||||
# Указывается, что этот контейнер запускается только после запуска контейнера db
|
||||
depends_on:
|
||||
- db
|
||||
# MediaWiki
|
||||
mediawiki:
|
||||
# Образ контейнера MediaWiki последней версии
|
||||
image: mediawiki
|
||||
container_name: mediawiki
|
||||
restart: always
|
||||
ports:
|
||||
- 8080:80
|
||||
links:
|
||||
- db
|
||||
volumes:
|
||||
- ./images:/var/www/html/images
|
64
balakhonov_danila_lab_2/README.md
Normal file
@ -0,0 +1,64 @@
|
||||
# Лабораторная работа номер 2
|
||||
|
||||
> Здравствуйте меня зовут Балахонов Данила группа ПИбд-42
|
||||
>
|
||||
> *— Балахонов Данила ПИбд-42*
|
||||
|
||||
Видео лабораторной работы номер 2 доступно по этой [ссылке](https://drive.google.com/file/d/1N4NgWsFLlHY5lGOO3Ps7DPvdJbHNxaqz/view?usp=sharing).
|
||||
|
||||
## Как запустить лабораторную работу номер 2?
|
||||
### Необходимые компоненты для запуска лабораторной работы номер 2
|
||||
> Здесь рассказана установка необходимых компонентов для запуска лабораторной работы номер 2 под дистрибутив GNU/Linux **Ubuntu**.
|
||||
|
||||
Для запуска лабораторной работы номер 2 необходимы такие компоненты:
|
||||
- Git
|
||||
- Docker
|
||||
- Docker compose
|
||||
|
||||
Чтобы установить **Git**, необходимо ввести данные команды в командную строку:
|
||||
``` bash
|
||||
sudo apt-get update
|
||||
sudo apt-get install git
|
||||
```
|
||||
|
||||
Чтобы установить **Docker** и **Docker compose**, стоит ввести такие команды:
|
||||
``` bash
|
||||
# Настройка репозитория Docker
|
||||
sudo apt-get update
|
||||
sudo apt-get install ca-certificates curl
|
||||
sudo install -m 0755 -d /etc/apt/keyrings
|
||||
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
|
||||
sudo chmod a+r /etc/apt/keyrings/docker.asc
|
||||
|
||||
echo \
|
||||
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
|
||||
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
|
||||
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
|
||||
sudo apt-get update
|
||||
|
||||
# Установка Docker и его компонентов
|
||||
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
|
||||
```
|
||||
### Запуск лабораторной работы номер 2
|
||||
Для запуска лабораторной работы номер 2 необходимо **склонировать** репозиторий в любую папку и **перейти на ветку** balakhonov_danila_lab_2.
|
||||
Далее в папке с `docker-compose.yaml` нужно вызвать такую команду:
|
||||
``` bash
|
||||
sudo docker-compose up --build
|
||||
```
|
||||
Таким образом контейнеры будут подготовлены и запущены. Результат выполнения будет находится внутри директории докера. Расположение файлов data.txt и result.txt: `/var/lib/docker/volumes/balakhonov_danila_lab_2_result/_data/`
|
||||
|
||||
## Какие технологии были использованы?
|
||||
Для выполнения лабораторной работы номер 2 были применены такие технологии, как:
|
||||
- Dockerfile
|
||||
- Docker compose
|
||||
- Git
|
||||
- .NET SDK и F# в частности
|
||||
|
||||
Сервисы были написаны с использованием .NET SDK на языке F#.
|
||||
## Что делает лабораторная работа номер 2?
|
||||
Лабораторная работа номер 2 запускает два сервиса:
|
||||
|
||||
1. Сервис, который берёт из каталога `/var/data` случайный файл и перекладывает его в `/var/result/data.txt`
|
||||
2. Сервис, который ищет наибольшее число из файла `/var/result/data.txt` и сохраняет количество таких чисел из последовательности в `/var/result/result.txt`
|
||||
|
||||
Благодаря лабораторной работе номер 2 были получены навыки создания Dockerfile для развертывания проектов в контейнерах, а также их связки с помощью docker-compose.yaml.
|
22
balakhonov_danila_lab_2/docker-compose.yaml
Normal file
@ -0,0 +1,22 @@
|
||||
services:
|
||||
app1:
|
||||
build: ./sigma_app_1/
|
||||
volumes:
|
||||
# Создание папки /var/data внутри контейнера
|
||||
# И копирование файлов из ./files в эту папку
|
||||
- ./files:/var/data
|
||||
# Создание папки /var/result внутри контейнера
|
||||
# А также папки result внутри директории докера
|
||||
- result:/var/result
|
||||
app2:
|
||||
build: ./skibidi_app_2/
|
||||
# Указано, что пока не запуститься app1, app2 не запустится
|
||||
# Он ЗАВИСИТ от app1 (depends on (с англ.) - зависит от)
|
||||
depends_on:
|
||||
- app1
|
||||
volumes:
|
||||
- result:/var/result
|
||||
volumes:
|
||||
# Указывается, что будет создана папка result
|
||||
# внутри директории докера
|
||||
result:
|
323
balakhonov_danila_lab_2/files/1.txt
Normal file
@ -0,0 +1,323 @@
|
||||
245
|
||||
678
|
||||
12
|
||||
987
|
||||
456
|
||||
234
|
||||
789
|
||||
345
|
||||
678
|
||||
123
|
||||
456
|
||||
789
|
||||
234
|
||||
567
|
||||
890
|
||||
12
|
||||
34
|
||||
56
|
||||
78
|
||||
90
|
||||
123
|
||||
456
|
||||
789
|
||||
321
|
||||
654
|
||||
987
|
||||
432
|
||||
876
|
||||
543
|
||||
210
|
||||
987
|
||||
654
|
||||
321
|
||||
456
|
||||
789
|
||||
12
|
||||
34
|
||||
56
|
||||
78
|
||||
90
|
||||
123
|
||||
456
|
||||
789
|
||||
234
|
||||
567
|
||||
890
|
||||
123
|
||||
456
|
||||
789
|
||||
987
|
||||
654
|
||||
321
|
||||
432
|
||||
876
|
||||
543
|
||||
210
|
||||
678
|
||||
345
|
||||
678
|
||||
123
|
||||
456
|
||||
789
|
||||
234
|
||||
567
|
||||
890
|
||||
12
|
||||
34
|
||||
56
|
||||
78
|
||||
90
|
||||
123
|
||||
456
|
||||
789
|
||||
321
|
||||
654
|
||||
987
|
||||
432
|
||||
876
|
||||
543
|
||||
210
|
||||
678
|
||||
345
|
||||
678
|
||||
123
|
||||
456
|
||||
789
|
||||
234
|
||||
567
|
||||
890
|
||||
12
|
||||
34
|
||||
56
|
||||
78
|
||||
90
|
||||
123
|
||||
456
|
||||
789
|
||||
321
|
||||
654
|
||||
987
|
||||
432
|
||||
876
|
||||
543
|
||||
210
|
||||
678
|
||||
345
|
||||
678
|
||||
123
|
||||
456
|
||||
789
|
||||
234
|
||||
567
|
||||
890
|
||||
12
|
||||
34
|
||||
56
|
||||
78
|
||||
90
|
||||
123
|
||||
456
|
||||
789
|
||||
321
|
||||
654
|
||||
987
|
||||
432
|
||||
876
|
||||
543
|
||||
210
|
||||
678
|
||||
345
|
||||
678
|
||||
123
|
||||
456
|
||||
789
|
||||
234
|
||||
567
|
||||
890
|
||||
12
|
||||
34
|
||||
56
|
||||
78
|
||||
90
|
||||
123
|
||||
456
|
||||
789
|
||||
321
|
||||
654
|
||||
987
|
||||
432
|
||||
876
|
||||
543
|
||||
210
|
||||
678
|
||||
345
|
||||
678
|
||||
123
|
||||
456
|
||||
789
|
||||
234
|
||||
567
|
||||
890
|
||||
12
|
||||
34
|
||||
56
|
||||
78
|
||||
90
|
||||
123
|
||||
456
|
||||
789
|
||||
321
|
||||
654
|
||||
987
|
||||
432
|
||||
876
|
||||
543
|
||||
210
|
||||
678
|
||||
345
|
||||
678
|
||||
123
|
||||
456
|
||||
789
|
||||
234
|
||||
567
|
||||
890
|
||||
12
|
||||
34
|
||||
56
|
||||
78
|
||||
90
|
||||
123
|
||||
456
|
||||
789
|
||||
321
|
||||
654
|
||||
987
|
||||
432
|
||||
876
|
||||
543
|
||||
210
|
||||
678
|
||||
345
|
||||
678
|
||||
123
|
||||
456
|
||||
789
|
||||
234
|
||||
567
|
||||
890
|
||||
12
|
||||
34
|
||||
56
|
||||
78
|
||||
90
|
||||
123
|
||||
456
|
||||
789
|
||||
321
|
||||
654
|
||||
987
|
||||
432
|
||||
876
|
||||
543
|
||||
210
|
||||
678
|
||||
345
|
||||
678
|
||||
123
|
||||
456
|
||||
789
|
||||
234
|
||||
567
|
||||
890
|
||||
12
|
||||
34
|
||||
56
|
||||
78
|
||||
90
|
||||
123
|
||||
456
|
||||
789
|
||||
321
|
||||
654
|
||||
987
|
||||
432
|
||||
876
|
||||
543
|
||||
210
|
||||
678
|
||||
345
|
||||
678
|
||||
123
|
||||
456
|
||||
789
|
||||
234
|
||||
567
|
||||
890
|
||||
12
|
||||
34
|
||||
56
|
||||
78
|
||||
90
|
||||
123
|
||||
456
|
||||
789
|
||||
321
|
||||
654
|
||||
987
|
||||
432
|
||||
876
|
||||
543
|
||||
210
|
||||
678
|
||||
345
|
||||
678
|
||||
123
|
||||
456
|
||||
789
|
||||
234
|
||||
567
|
||||
890
|
||||
12
|
||||
34
|
||||
56
|
||||
78
|
||||
90
|
||||
123
|
||||
456
|
||||
789
|
||||
321
|
||||
654
|
||||
987
|
||||
432
|
||||
876
|
||||
543
|
||||
210
|
||||
678
|
||||
345
|
||||
678
|
||||
123
|
||||
456
|
||||
789
|
||||
234
|
||||
567
|
||||
890
|
||||
12
|
||||
34
|
||||
56
|
||||
78
|
||||
90
|
||||
123
|
||||
456
|
||||
789
|
||||
321
|
||||
654
|
||||
987
|
||||
432
|
||||
876
|
||||
543
|
||||
210
|
||||
678
|
||||
345
|
||||
678
|
642
balakhonov_danila_lab_2/files/2.txt
Normal file
@ -0,0 +1,642 @@
|
||||
873
|
||||
62
|
||||
455
|
||||
879
|
||||
235
|
||||
941
|
||||
267
|
||||
811
|
||||
174
|
||||
517
|
||||
382
|
||||
399
|
||||
460
|
||||
221
|
||||
640
|
||||
915
|
||||
384
|
||||
622
|
||||
897
|
||||
212
|
||||
798
|
||||
109
|
||||
477
|
||||
546
|
||||
29
|
||||
995
|
||||
678
|
||||
342
|
||||
135
|
||||
804
|
||||
890
|
||||
453
|
||||
726
|
||||
891
|
||||
664
|
||||
290
|
||||
872
|
||||
190
|
||||
526
|
||||
304
|
||||
12
|
||||
587
|
||||
234
|
||||
753
|
||||
980
|
||||
197
|
||||
824
|
||||
579
|
||||
458
|
||||
15
|
||||
999
|
||||
614
|
||||
704
|
||||
205
|
||||
860
|
||||
537
|
||||
842
|
||||
491
|
||||
668
|
||||
210
|
||||
920
|
||||
477
|
||||
811
|
||||
350
|
||||
731
|
||||
95
|
||||
639
|
||||
287
|
||||
127
|
||||
423
|
||||
1000
|
||||
394
|
||||
521
|
||||
8
|
||||
267
|
||||
154
|
||||
431
|
||||
715
|
||||
266
|
||||
834
|
||||
173
|
||||
268
|
||||
947
|
||||
582
|
||||
157
|
||||
367
|
||||
882
|
||||
737
|
||||
305
|
||||
472
|
||||
481
|
||||
651
|
||||
960
|
||||
843
|
||||
701
|
||||
122
|
||||
514
|
||||
92
|
||||
658
|
||||
884
|
||||
371
|
||||
458
|
||||
637
|
||||
620
|
||||
793
|
||||
285
|
||||
611
|
||||
785
|
||||
495
|
||||
822
|
||||
849
|
||||
708
|
||||
592
|
||||
465
|
||||
469
|
||||
78
|
||||
734
|
||||
667
|
||||
606
|
||||
241
|
||||
666
|
||||
474
|
||||
569
|
||||
543
|
||||
918
|
||||
68
|
||||
906
|
||||
123
|
||||
501
|
||||
330
|
||||
947
|
||||
111
|
||||
365
|
||||
734
|
||||
249
|
||||
429
|
||||
296
|
||||
16
|
||||
511
|
||||
974
|
||||
317
|
||||
764
|
||||
230
|
||||
542
|
||||
920
|
||||
821
|
||||
718
|
||||
281
|
||||
556
|
||||
575
|
||||
900
|
||||
632
|
||||
720
|
||||
462
|
||||
88
|
||||
275
|
||||
403
|
||||
100
|
||||
418
|
||||
684
|
||||
600
|
||||
119
|
||||
863
|
||||
781
|
||||
225
|
||||
971
|
||||
670
|
||||
80
|
||||
643
|
||||
220
|
||||
176
|
||||
588
|
||||
58
|
||||
202
|
||||
850
|
||||
537
|
||||
934
|
||||
748
|
||||
378
|
||||
817
|
||||
505
|
||||
696
|
||||
21
|
||||
630
|
||||
324
|
||||
117
|
||||
420
|
||||
257
|
||||
493
|
||||
826
|
||||
688
|
||||
305
|
||||
772
|
||||
654
|
||||
927
|
||||
208
|
||||
525
|
||||
511
|
||||
256
|
||||
650
|
||||
447
|
||||
163
|
||||
99
|
||||
74
|
||||
99
|
||||
487
|
||||
306
|
||||
754
|
||||
510
|
||||
132
|
||||
201
|
||||
392
|
||||
785
|
||||
778
|
||||
512
|
||||
258
|
||||
904
|
||||
932
|
||||
589
|
||||
694
|
||||
204
|
||||
884
|
||||
110
|
||||
673
|
||||
152
|
||||
649
|
||||
295
|
||||
387
|
||||
758
|
||||
927
|
||||
538
|
||||
619
|
||||
904
|
||||
651
|
||||
174
|
||||
712
|
||||
104
|
||||
641
|
||||
474
|
||||
198
|
||||
322
|
||||
764
|
||||
204
|
||||
407
|
||||
550
|
||||
42
|
||||
879
|
||||
716
|
||||
368
|
||||
316
|
||||
43
|
||||
600
|
||||
893
|
||||
370
|
||||
137
|
||||
631
|
||||
244
|
||||
571
|
||||
663
|
||||
551
|
||||
907
|
||||
211
|
||||
166
|
||||
746
|
||||
583
|
||||
708
|
||||
771
|
||||
215
|
||||
90
|
||||
829
|
||||
653
|
||||
494
|
||||
563
|
||||
334
|
||||
794
|
||||
745
|
||||
936
|
||||
718
|
||||
126
|
||||
923
|
||||
451
|
||||
668
|
||||
966
|
||||
532
|
||||
935
|
||||
886
|
||||
646
|
||||
75
|
||||
858
|
||||
693
|
||||
859
|
||||
284
|
||||
315
|
||||
679
|
||||
133
|
||||
878
|
||||
292
|
||||
340
|
||||
716
|
||||
128
|
||||
250
|
||||
554
|
||||
482
|
||||
789
|
||||
677
|
||||
308
|
||||
494
|
||||
931
|
||||
144
|
||||
337
|
||||
982
|
||||
713
|
||||
535
|
||||
893
|
||||
939
|
||||
932
|
||||
905
|
||||
805
|
||||
236
|
||||
991
|
||||
781
|
||||
686
|
||||
572
|
||||
951
|
||||
335
|
||||
58
|
||||
303
|
||||
335
|
||||
145
|
||||
608
|
||||
794
|
||||
862
|
||||
792
|
||||
619
|
||||
54
|
||||
292
|
||||
878
|
||||
585
|
||||
293
|
||||
959
|
||||
379
|
||||
20
|
||||
484
|
||||
144
|
||||
678
|
||||
67
|
||||
363
|
||||
946
|
||||
566
|
||||
106
|
||||
442
|
||||
820
|
||||
562
|
||||
109
|
||||
201
|
||||
759
|
||||
481
|
||||
289
|
||||
698
|
||||
25
|
||||
847
|
||||
648
|
||||
733
|
||||
613
|
||||
776
|
||||
989
|
||||
257
|
||||
864
|
||||
32
|
||||
703
|
||||
989
|
||||
465
|
||||
103
|
||||
963
|
||||
515
|
||||
829
|
||||
30
|
||||
303
|
||||
926
|
||||
159
|
||||
586
|
||||
268
|
||||
852
|
||||
953
|
||||
321
|
||||
306
|
||||
978
|
||||
909
|
||||
177
|
||||
835
|
||||
458
|
||||
994
|
||||
885
|
||||
213
|
||||
775
|
||||
385
|
||||
598
|
||||
267
|
||||
754
|
||||
448
|
||||
1000
|
||||
555
|
||||
354
|
||||
657
|
||||
231
|
||||
979
|
||||
265
|
||||
374
|
||||
68
|
||||
197
|
||||
953
|
||||
648
|
||||
153
|
||||
523
|
||||
761
|
||||
827
|
||||
819
|
||||
63
|
||||
782
|
||||
766
|
||||
882
|
||||
404
|
||||
258
|
||||
672
|
||||
883
|
||||
80
|
||||
111
|
||||
212
|
||||
681
|
||||
812
|
||||
911
|
||||
837
|
||||
194
|
||||
161
|
||||
143
|
||||
427
|
||||
981
|
||||
132
|
||||
357
|
||||
605
|
||||
810
|
||||
414
|
||||
20
|
||||
210
|
||||
772
|
||||
882
|
||||
313
|
||||
186
|
||||
578
|
||||
154
|
||||
523
|
||||
339
|
||||
383
|
||||
903
|
||||
29
|
||||
172
|
||||
62
|
||||
314
|
||||
491
|
||||
289
|
||||
550
|
||||
521
|
||||
327
|
||||
794
|
||||
299
|
||||
678
|
||||
769
|
||||
415
|
||||
266
|
||||
77
|
||||
33
|
||||
438
|
||||
233
|
||||
160
|
||||
11
|
||||
523
|
||||
623
|
||||
254
|
||||
29
|
||||
327
|
||||
924
|
||||
938
|
||||
588
|
||||
444
|
||||
976
|
||||
547
|
||||
775
|
||||
638
|
||||
35
|
||||
23
|
||||
203
|
||||
203
|
||||
927
|
||||
149
|
||||
198
|
||||
150
|
||||
370
|
||||
728
|
||||
775
|
||||
818
|
||||
768
|
||||
99
|
||||
40
|
||||
969
|
||||
435
|
||||
49
|
||||
276
|
||||
360
|
||||
964
|
||||
277
|
||||
283
|
||||
825
|
||||
479
|
||||
331
|
||||
471
|
||||
381
|
||||
652
|
||||
264
|
||||
564
|
||||
891
|
||||
638
|
||||
470
|
||||
291
|
||||
101
|
||||
143
|
||||
93
|
||||
663
|
||||
328
|
||||
841
|
||||
881
|
||||
94
|
||||
327
|
||||
2
|
||||
628
|
||||
474
|
||||
905
|
||||
545
|
||||
421
|
||||
453
|
||||
282
|
||||
276
|
||||
24
|
||||
655
|
||||
295
|
||||
48
|
||||
102
|
||||
49
|
||||
676
|
||||
187
|
||||
773
|
||||
169
|
||||
170
|
||||
165
|
||||
405
|
||||
348
|
||||
4
|
||||
654
|
||||
276
|
||||
343
|
||||
153
|
||||
381
|
||||
756
|
||||
753
|
||||
816
|
||||
474
|
||||
186
|
||||
652
|
||||
67
|
||||
689
|
||||
69
|
||||
920
|
||||
880
|
||||
363
|
||||
637
|
||||
524
|
||||
171
|
||||
753
|
||||
12
|
||||
634
|
||||
648
|
||||
668
|
||||
220
|
||||
408
|
||||
348
|
||||
887
|
||||
341
|
||||
738
|
||||
681
|
||||
408
|
||||
377
|
||||
693
|
||||
234
|
||||
83
|
||||
982
|
||||
417
|
||||
222
|
||||
322
|
||||
253
|
||||
494
|
||||
868
|
||||
951
|
||||
344
|
||||
60
|
||||
23
|
||||
41
|
||||
99
|
||||
944
|
||||
723
|
||||
156
|
||||
813
|
||||
5
|
||||
44
|
||||
62
|
||||
899
|
||||
835
|
||||
482
|
||||
469
|
||||
157
|
||||
637
|
||||
295
|
||||
929
|
||||
992
|
||||
234
|
||||
66
|
||||
31
|
||||
170
|
||||
333
|
||||
92
|
||||
185
|
||||
117
|
||||
627
|
||||
82
|
||||
292
|
||||
796
|
||||
840
|
||||
768
|
||||
532
|
||||
981
|
||||
300
|
||||
125
|
||||
958
|
||||
4
|
489
balakhonov_danila_lab_2/files/3.txt
Normal file
@ -0,0 +1,489 @@
|
||||
522
|
||||
173
|
||||
815
|
||||
671
|
||||
284
|
||||
903
|
||||
477
|
||||
639
|
||||
732
|
||||
143
|
||||
928
|
||||
564
|
||||
812
|
||||
109
|
||||
397
|
||||
249
|
||||
868
|
||||
301
|
||||
848
|
||||
376
|
||||
794
|
||||
99
|
||||
506
|
||||
217
|
||||
645
|
||||
12
|
||||
187
|
||||
930
|
||||
811
|
||||
583
|
||||
684
|
||||
455
|
||||
94
|
||||
499
|
||||
118
|
||||
722
|
||||
603
|
||||
267
|
||||
772
|
||||
947
|
||||
845
|
||||
210
|
||||
495
|
||||
632
|
||||
372
|
||||
930
|
||||
908
|
||||
546
|
||||
327
|
||||
685
|
||||
883
|
||||
235
|
||||
613
|
||||
579
|
||||
762
|
||||
491
|
||||
328
|
||||
672
|
||||
156
|
||||
739
|
||||
1000
|
||||
421
|
||||
731
|
||||
215
|
||||
867
|
||||
610
|
||||
847
|
||||
732
|
||||
204
|
||||
411
|
||||
515
|
||||
150
|
||||
438
|
||||
651
|
||||
174
|
||||
590
|
||||
725
|
||||
963
|
||||
530
|
||||
889
|
||||
577
|
||||
694
|
||||
417
|
||||
261
|
||||
767
|
||||
480
|
||||
934
|
||||
125
|
||||
558
|
||||
282
|
||||
899
|
||||
96
|
||||
653
|
||||
908
|
||||
303
|
||||
774
|
||||
617
|
||||
407
|
||||
482
|
||||
538
|
||||
239
|
||||
472
|
||||
766
|
||||
118
|
||||
920
|
||||
206
|
||||
797
|
||||
420
|
||||
853
|
||||
205
|
||||
340
|
||||
123
|
||||
387
|
||||
497
|
||||
640
|
||||
24
|
||||
999
|
||||
476
|
||||
77
|
||||
920
|
||||
382
|
||||
405
|
||||
55
|
||||
834
|
||||
371
|
||||
167
|
||||
290
|
||||
300
|
||||
611
|
||||
53
|
||||
470
|
||||
81
|
||||
232
|
||||
14
|
||||
451
|
||||
678
|
||||
623
|
||||
564
|
||||
787
|
||||
99
|
||||
648
|
||||
873
|
||||
803
|
||||
888
|
||||
504
|
||||
186
|
||||
256
|
||||
405
|
||||
102
|
||||
999
|
||||
673
|
||||
721
|
||||
434
|
||||
814
|
||||
305
|
||||
582
|
||||
436
|
||||
90
|
||||
774
|
||||
216
|
||||
706
|
||||
855
|
||||
702
|
||||
307
|
||||
59
|
||||
835
|
||||
812
|
||||
234
|
||||
736
|
||||
168
|
||||
523
|
||||
219
|
||||
868
|
||||
365
|
||||
294
|
||||
500
|
||||
207
|
||||
927
|
||||
450
|
||||
521
|
||||
851
|
||||
703
|
||||
992
|
||||
327
|
||||
916
|
||||
554
|
||||
846
|
||||
658
|
||||
88
|
||||
659
|
||||
628
|
||||
764
|
||||
84
|
||||
45
|
||||
10
|
||||
870
|
||||
779
|
||||
320
|
||||
882
|
||||
942
|
||||
93
|
||||
792
|
||||
836
|
||||
137
|
||||
489
|
||||
862
|
||||
391
|
||||
337
|
||||
887
|
||||
114
|
||||
237
|
||||
178
|
||||
874
|
||||
569
|
||||
135
|
||||
919
|
||||
931
|
||||
231
|
||||
50
|
||||
995
|
||||
215
|
||||
658
|
||||
139
|
||||
484
|
||||
292
|
||||
903
|
||||
113
|
||||
755
|
||||
333
|
||||
829
|
||||
942
|
||||
360
|
||||
172
|
||||
689
|
||||
42
|
||||
127
|
||||
799
|
||||
191
|
||||
455
|
||||
533
|
||||
234
|
||||
15
|
||||
404
|
||||
636
|
||||
373
|
||||
884
|
||||
921
|
||||
977
|
||||
113
|
||||
227
|
||||
703
|
||||
173
|
||||
297
|
||||
440
|
||||
604
|
||||
575
|
||||
971
|
||||
855
|
||||
82
|
||||
252
|
||||
589
|
||||
276
|
||||
826
|
||||
206
|
||||
166
|
||||
482
|
||||
375
|
||||
174
|
||||
612
|
||||
818
|
||||
854
|
||||
832
|
||||
809
|
||||
569
|
||||
306
|
||||
993
|
||||
931
|
||||
289
|
||||
148
|
||||
943
|
||||
421
|
||||
784
|
||||
441
|
||||
536
|
||||
426
|
||||
548
|
||||
49
|
||||
687
|
||||
415
|
||||
505
|
||||
951
|
||||
583
|
||||
368
|
||||
172
|
||||
974
|
||||
47
|
||||
173
|
||||
570
|
||||
264
|
||||
754
|
||||
701
|
||||
693
|
||||
796
|
||||
914
|
||||
809
|
||||
310
|
||||
512
|
||||
725
|
||||
963
|
||||
829
|
||||
614
|
||||
220
|
||||
410
|
||||
631
|
||||
860
|
||||
270
|
||||
158
|
||||
168
|
||||
595
|
||||
62
|
||||
715
|
||||
913
|
||||
517
|
||||
157
|
||||
5
|
||||
660
|
||||
274
|
||||
414
|
||||
139
|
||||
300
|
||||
698
|
||||
675
|
||||
263
|
||||
872
|
||||
292
|
||||
142
|
||||
375
|
||||
696
|
||||
895
|
||||
302
|
||||
75
|
||||
576
|
||||
899
|
||||
524
|
||||
362
|
||||
721
|
||||
916
|
||||
883
|
||||
347
|
||||
980
|
||||
29
|
||||
392
|
||||
839
|
||||
971
|
||||
593
|
||||
708
|
||||
804
|
||||
678
|
||||
234
|
||||
719
|
||||
659
|
||||
418
|
||||
914
|
||||
437
|
||||
550
|
||||
418
|
||||
576
|
||||
776
|
||||
293
|
||||
737
|
||||
348
|
||||
292
|
||||
48
|
||||
975
|
||||
547
|
||||
205
|
||||
831
|
||||
783
|
||||
587
|
||||
657
|
||||
132
|
||||
733
|
||||
53
|
||||
700
|
||||
785
|
||||
292
|
||||
332
|
||||
771
|
||||
849
|
||||
994
|
||||
905
|
||||
460
|
||||
420
|
||||
923
|
||||
663
|
||||
134
|
||||
658
|
||||
673
|
||||
618
|
||||
779
|
||||
951
|
||||
244
|
||||
425
|
||||
312
|
||||
436
|
||||
878
|
||||
538
|
||||
236
|
||||
805
|
||||
457
|
||||
897
|
||||
799
|
||||
134
|
||||
469
|
||||
56
|
||||
724
|
||||
370
|
||||
521
|
||||
654
|
||||
20
|
||||
260
|
||||
315
|
||||
525
|
||||
501
|
||||
433
|
||||
90
|
||||
368
|
||||
192
|
||||
162
|
||||
198
|
||||
65
|
||||
652
|
||||
613
|
||||
222
|
||||
160
|
||||
76
|
||||
755
|
||||
541
|
||||
305
|
||||
257
|
||||
669
|
||||
179
|
||||
849
|
||||
878
|
||||
249
|
||||
224
|
||||
4
|
||||
1
|
||||
860
|
||||
967
|
||||
738
|
||||
712
|
||||
281
|
||||
834
|
||||
908
|
||||
774
|
||||
964
|
||||
880
|
||||
902
|
||||
234
|
||||
635
|
||||
138
|
||||
305
|
||||
532
|
||||
585
|
||||
956
|
||||
68
|
||||
21
|
||||
278
|
||||
639
|
||||
622
|
||||
473
|
||||
769
|
||||
161
|
||||
580
|
||||
285
|
||||
204
|
||||
410
|
||||
115
|
||||
430
|
||||
953
|
||||
968
|
||||
593
|
||||
703
|
||||
704
|
||||
469
|
||||
835
|
||||
623
|
||||
991
|
4
balakhonov_danila_lab_2/sigma_app_1/.dockerignore
Normal file
@ -0,0 +1,4 @@
|
||||
bin/
|
||||
obj/
|
||||
Dockerfile
|
||||
README.md
|
484
balakhonov_danila_lab_2/sigma_app_1/.gitignore
vendored
Normal file
@ -0,0 +1,484 @@
|
||||
## Ignore Visual Studio temporary files, build results, and
|
||||
## files generated by popular Visual Studio add-ons.
|
||||
##
|
||||
## Get latest from `dotnet new gitignore`
|
||||
|
||||
# dotenv files
|
||||
.env
|
||||
|
||||
# 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
|
||||
.idea
|
||||
|
||||
##
|
||||
## 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
|
||||
|
||||
# Vim temporary swap files
|
||||
*.swp
|
14
balakhonov_danila_lab_2/sigma_app_1/Dockerfile
Normal file
@ -0,0 +1,14 @@
|
||||
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
|
||||
WORKDIR /App
|
||||
|
||||
# Copy everything
|
||||
COPY . ./
|
||||
# Restore as distinct layers
|
||||
RUN dotnet restore
|
||||
# Build and publish a release
|
||||
RUN dotnet publish -c Release -o out
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/runtime:8.0 AS runtime
|
||||
WORKDIR /App
|
||||
COPY --from=build /App/out .
|
||||
ENTRYPOINT ["dotnet", "sigma_app_1.dll"]
|
14
balakhonov_danila_lab_2/sigma_app_1/Program.fs
Normal file
@ -0,0 +1,14 @@
|
||||
let PATH = @"/var/data/"
|
||||
let RESULT_PATH = @"/var/result/data.txt"
|
||||
|
||||
let getFiles(path: string): seq<string> =
|
||||
System.IO.Directory.EnumerateFiles(path)
|
||||
|
||||
let getRandFile(files: seq<string>) =
|
||||
let rand = System.Random()
|
||||
let index = rand.Next(Seq.length files)
|
||||
Seq.item index files
|
||||
|
||||
let files = getFiles(PATH)
|
||||
let randFile = getRandFile(files)
|
||||
System.IO.File.Copy(randFile, RESULT_PATH)
|
4
balakhonov_danila_lab_2/sigma_app_1/README.md
Normal file
@ -0,0 +1,4 @@
|
||||
# Первая программа лабораторной работы номер 2
|
||||
> Вариант 6
|
||||
>
|
||||
> Берёт из каталога `/var/data` случайный файл и перекладывает его в `/var/result/data.txt`
|
12
balakhonov_danila_lab_2/sigma_app_1/sigma_app_1.fsproj
Normal file
@ -0,0 +1,12 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Include="Program.fs" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
4
balakhonov_danila_lab_2/skibidi_app_2/.dockerignore
Normal file
@ -0,0 +1,4 @@
|
||||
bin/
|
||||
obj/
|
||||
Dockerfile
|
||||
README.md
|
484
balakhonov_danila_lab_2/skibidi_app_2/.gitignore
vendored
Normal file
@ -0,0 +1,484 @@
|
||||
## Ignore Visual Studio temporary files, build results, and
|
||||
## files generated by popular Visual Studio add-ons.
|
||||
##
|
||||
## Get latest from `dotnet new gitignore`
|
||||
|
||||
# dotenv files
|
||||
.env
|
||||
|
||||
# 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
|
||||
.idea
|
||||
|
||||
##
|
||||
## 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
|
||||
|
||||
# Vim temporary swap files
|
||||
*.swp
|
14
balakhonov_danila_lab_2/skibidi_app_2/Dockerfile
Normal file
@ -0,0 +1,14 @@
|
||||
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
|
||||
WORKDIR /App
|
||||
|
||||
# Copy everything
|
||||
COPY . ./
|
||||
# Restore as distinct layers
|
||||
RUN dotnet restore
|
||||
# Build and publish a release
|
||||
RUN dotnet publish -c Release -o out
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/runtime:8.0 AS runtime
|
||||
WORKDIR /App
|
||||
COPY --from=build /App/out .
|
||||
ENTRYPOINT ["dotnet", "skibidi_app_2.dll"]
|
16
balakhonov_danila_lab_2/skibidi_app_2/Program.fs
Normal file
@ -0,0 +1,16 @@
|
||||
let INPUT_FILE = @"/var/result/data.txt"
|
||||
let OUTPUT_FILE = @"/var/result/result.txt"
|
||||
|
||||
let getNumbersFromFile(path: string): seq<int> =
|
||||
System.IO.File.ReadLines(path)
|
||||
|> Seq.map int
|
||||
|
||||
let getCountOfMaxNumber(numbers: seq<int>): int =
|
||||
numbers
|
||||
|> Seq.max
|
||||
|> fun maxNum -> Seq.filter ((=) maxNum) numbers
|
||||
|> Seq.length
|
||||
|
||||
let numbers = getNumbersFromFile(INPUT_FILE)
|
||||
let count = getCountOfMaxNumber(numbers)
|
||||
System.IO.File.WriteAllText(OUTPUT_FILE, string count)
|
4
balakhonov_danila_lab_2/skibidi_app_2/README.md
Normal file
@ -0,0 +1,4 @@
|
||||
# Вторая программа лабораторной работы номер 2
|
||||
> Вариант 3
|
||||
>
|
||||
> Ищет набольшее число из файла `/var/result/data.txt` и сохраняет количество таких чисел из последовательности в `/var/result/result.txt`
|
12
balakhonov_danila_lab_2/skibidi_app_2/skibidi_app_2.fsproj
Normal file
@ -0,0 +1,12 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Include="Program.fs" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
2
bazunov_andrew_lab_1/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
ollama
|
||||
./ollama
|
33
bazunov_andrew_lab_1/README.md
Normal file
@ -0,0 +1,33 @@
|
||||
# Распределенные вычисления и приложения Л1
|
||||
## _Автор Базунов Андрей Игревич ПИбд-42_
|
||||
|
||||
В качестве сервисов были выбраны:
|
||||
- 1.Ollama (_Сервис для использования LLMs моделей_)
|
||||
- 2.Open Web Ui (_Сервис для удобного общения с моделью из сервиса Ollama_)
|
||||
- 3.Gitea (_Гит сервис_)
|
||||
|
||||
# Docker
|
||||
|
||||
>Перед исполнением вполняем установку docker и проверяем версию
|
||||
|
||||
```sh
|
||||
docker-compose --version
|
||||
```
|
||||
|
||||
>Далее производим настройку файла docker-compose.yaml и запускаем контейнер
|
||||
|
||||
```sh
|
||||
docker-compose up -d
|
||||
```
|
||||
|
||||
>Для завершения работы контейнера используем команду
|
||||
```sh
|
||||
docker-compose down
|
||||
```
|
||||
---
|
||||
> Замечание: после запуска контейнера, необходимо перейти в контейнер **ollamа** и выполнить установку модели [gemma2](https://ollama.com/library/gemma2:2b)
|
||||
> ```sh
|
||||
> docker-compose exec ollama ollama run ollama run gemma2:2b
|
||||
> ```
|
||||
---
|
||||
Далее можно использовать веб сервис Open Web Ui по адресу **localhost:8080** для общения с моделью и Gitea по адресу **localhost:3000** - [демонстрация работы](https://vk.com/video/@viltskaa?z=video236673313_456239574%2Fpl_236673313_-2)
|
61
bazunov_andrew_lab_1/docker-compose.yml
Normal file
@ -0,0 +1,61 @@
|
||||
services:
|
||||
gitea: # Имя сервиса
|
||||
image: gitea/gitea:latest # Имя образа
|
||||
container_name: gitea # Имя контейнера, может быть произовольным
|
||||
ports:
|
||||
- "3000:3000" # Проброс порта Gitea на хост
|
||||
volumes: # хранилище
|
||||
- data:/data
|
||||
environment: # переменные окружения
|
||||
USER_UID: 1000
|
||||
USER_GID: 1000
|
||||
|
||||
ollama:
|
||||
image: ollama/ollama:latest
|
||||
container_name: ollama
|
||||
restart: always
|
||||
ports:
|
||||
- 7869:11434
|
||||
pull_policy: always
|
||||
tty: true
|
||||
volumes:
|
||||
- .:/code
|
||||
- ./ollama/ollama:/root/.ollama # Директория для данных Ollama
|
||||
environment:
|
||||
- OLLAMA_KEEP_ALIVE=24h
|
||||
- OLLAMA_HOST=0.0.0.0 # Указываем хост для API Ollama
|
||||
networks:
|
||||
- ollama-docker
|
||||
command: ["serve"] # Запускаем Ollama в режиме сервера
|
||||
|
||||
ollama-webui:
|
||||
image: ghcr.io/open-webui/open-webui:main # Образ Open Web UI
|
||||
container_name: ollama-webui
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- ./ollama/ollama-webui:/app/backend/data
|
||||
ports:
|
||||
- 8080:8080 # Порт для веб-интерфейса
|
||||
environment: # https://docs.openwebui.com/getting-started/env-configuration#default_models
|
||||
- OLLAMA_BASE_URLS=http://host.docker.internal:7869
|
||||
- ENV=dev
|
||||
- WEBUI_AUTH=False
|
||||
- WEBUI_NAME=Viltskaa AI
|
||||
- WEBUI_URL=http://localhost:8080
|
||||
- WEBUI_SECRET_KEY=t0p-s3cr3t
|
||||
depends_on:
|
||||
- ollama
|
||||
extra_hosts:
|
||||
- host.docker.internal:host-gateway
|
||||
networks:
|
||||
- ollama-docker
|
||||
|
||||
networks:
|
||||
ollama-docker:
|
||||
external: false
|
||||
|
||||
volumes:
|
||||
ollama:
|
||||
driver: local
|
||||
data:
|
||||
driver: local
|
14
bazunov_andrew_lab_2/FileCreator/Dockerfile
Normal file
@ -0,0 +1,14 @@
|
||||
# Используем официальный образ Go в качестве базового
|
||||
FROM golang:1.23
|
||||
|
||||
# Устанавливаем рабочую директорию
|
||||
WORKDIR /app
|
||||
|
||||
# Копируем файлы модуля
|
||||
COPY . .
|
||||
|
||||
# Сборка модуля
|
||||
RUN go build -o /bin/FileCreator
|
||||
|
||||
# Запуск модуля
|
||||
CMD ["/bin/FileCreator"]
|
1
bazunov_andrew_lab_2/FileCreator/go.mod
Normal file
@ -0,0 +1 @@
|
||||
module FileCreator
|
92
bazunov_andrew_lab_2/FileCreator/main.go
Normal file
@ -0,0 +1,92 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"crypto/md5"
|
||||
"encoding/hex"
|
||||
"fmt"
|
||||
"math/rand"
|
||||
"os"
|
||||
"path/filepath"
|
||||
)
|
||||
|
||||
const DIR = "/var/data"
|
||||
|
||||
func Exists(name string) (bool, error) {
|
||||
_, err := os.Stat(name)
|
||||
if os.IsNotExist(err) {
|
||||
return false, nil
|
||||
}
|
||||
return err != nil, err
|
||||
}
|
||||
|
||||
func CreateDirectory(dirs string) error {
|
||||
if _, err := os.Stat(dirs); os.IsNotExist(err) {
|
||||
err := os.MkdirAll(dirs, 0664)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func CreateFileOrOpenIfExist(name string) (*os.File, error) {
|
||||
err := CreateDirectory(filepath.Dir(name))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
exists, err := Exists(name)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if exists {
|
||||
return os.OpenFile(name, os.O_WRONLY|os.O_CREATE, 0664)
|
||||
}
|
||||
return os.Create(name)
|
||||
}
|
||||
|
||||
func CreateFileAndWriteData(filename string) error {
|
||||
file, err := CreateFileOrOpenIfExist(filename)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
lines := rand.Intn(1000) + 100
|
||||
|
||||
for i := 0; i < lines; i++ {
|
||||
randomValueForLine := rand.Intn(1_000_000)
|
||||
_, err = fmt.Fprintf(file, "%d\r\n", randomValueForLine)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
err = file.Close()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func GetMD5Hash(text string) string {
|
||||
hash := md5.Sum([]byte(text))
|
||||
return hex.EncodeToString(hash[:])
|
||||
}
|
||||
|
||||
func main() {
|
||||
for i := 0; i < 10; i++ {
|
||||
filename := fmt.Sprintf("%s/%s.txt", DIR, GetMD5Hash(fmt.Sprintf("%d", i)))
|
||||
err := CreateFileAndWriteData(filename)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
} else {
|
||||
fmt.Printf("Created file %s\n", filename)
|
||||
}
|
||||
}
|
||||
|
||||
err := CreateFileAndWriteData(DIR + "/data.txt")
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
} else {
|
||||
fmt.Printf("Created file %s\n", DIR+"/data.txt")
|
||||
}
|
||||
}
|
14
bazunov_andrew_lab_2/FirstService/Dockerfile
Normal file
@ -0,0 +1,14 @@
|
||||
# Используем официальный образ Go в качестве базового
|
||||
FROM golang:1.23
|
||||
|
||||
# Устанавливаем рабочую директорию
|
||||
WORKDIR /app
|
||||
|
||||
# Копируем файлы модуля
|
||||
COPY . .
|
||||
|
||||
# Сборка модуля
|
||||
RUN go build -o /bin/FirstService
|
||||
|
||||
# Запуск модуля
|
||||
CMD ["/bin/FirstService"]
|
1
bazunov_andrew_lab_2/FirstService/go.mod
Normal file
@ -0,0 +1 @@
|
||||
module RVIP2
|
94
bazunov_andrew_lab_2/FirstService/main.go
Normal file
@ -0,0 +1,94 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
)
|
||||
|
||||
// Формирует файл /var/result/data.txt так,
|
||||
// что каждая строка файла - количество символов в именах файлов из каталога /var/data.
|
||||
|
||||
const INPUT = "/var/data"
|
||||
const OUTPUT = "/data/result"
|
||||
|
||||
func GetListFilesInDirectory(directory string) ([]string, error) {
|
||||
f, err := os.Open(directory)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
return nil, err
|
||||
}
|
||||
files, err := f.Readdir(0)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var fileNames []string
|
||||
for _, file := range files {
|
||||
fileName := file.Name()
|
||||
fileNames = append(fileNames, fileName)
|
||||
}
|
||||
return fileNames, nil
|
||||
}
|
||||
|
||||
func Exists(name string) (bool, error) {
|
||||
_, err := os.Stat(name)
|
||||
if os.IsNotExist(err) {
|
||||
return false, nil
|
||||
}
|
||||
return err != nil, err
|
||||
}
|
||||
|
||||
func CreateFileOrOpenIfExist(name string) (*os.File, error) {
|
||||
exists, err := Exists(name)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if exists {
|
||||
return os.OpenFile(name, os.O_WRONLY|os.O_CREATE, 0664)
|
||||
}
|
||||
return os.Create(name)
|
||||
}
|
||||
|
||||
func CreateFileAndWriteData(filename string, lines []string) error {
|
||||
file, err := CreateFileOrOpenIfExist(filename)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
for _, line := range lines {
|
||||
_, err = fmt.Fprintf(file, line)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
err = file.Close()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func main() {
|
||||
filenames, err := GetListFilesInDirectory(INPUT)
|
||||
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
return
|
||||
}
|
||||
|
||||
var lenghtOfFilenames []string
|
||||
for _, filename := range filenames {
|
||||
fmt.Println(filename)
|
||||
lenghtOfFilenames = append(lenghtOfFilenames, fmt.Sprintf("%d", len(filename)))
|
||||
}
|
||||
|
||||
err = CreateFileAndWriteData(OUTPUT+"/data.txt", filenames)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
fmt.Println("First Service is end.")
|
||||
}
|
30
bazunov_andrew_lab_2/README.md
Normal file
@ -0,0 +1,30 @@
|
||||
# Распределенные вычисления и приложения Л2
|
||||
## _Автор Базунов Андрей Игревич ПИбд-42_
|
||||
|
||||
Сервисы ( _порядок исполнения сервисов соблюден_ ):
|
||||
- 1.FileCreator - (_Создание тестовых данных_)
|
||||
- 2.FirstService - (_Выполнение 1.4 варианта задания_)
|
||||
- 3.SecondService - (_Выполнение 2.2 варианта задания_)
|
||||
|
||||
В качестве основного языка был выбран GoLang. Для каждого сервиса был создан DOCKERFILE где были прописаны условия и действия для сборки каждого из модулей
|
||||
|
||||
# Docker
|
||||
|
||||
>Перед исполнением вполняем установку docker и проверяем версию
|
||||
|
||||
```sh
|
||||
docker-compose --version
|
||||
```
|
||||
|
||||
>Далее производим настройку файла docker-compose.yaml и запускаем контейнер с сборкой образов
|
||||
|
||||
```sh
|
||||
docker-compose up -d --build
|
||||
```
|
||||
|
||||
>Для завершения работы контейнера используем команду
|
||||
```sh
|
||||
docker-compose down
|
||||
```
|
||||
|
||||
[Демонстрация работы](https://vk.com/video236673313_456239575)
|
14
bazunov_andrew_lab_2/SecondService/Dockerfile
Normal file
@ -0,0 +1,14 @@
|
||||
# Используем официальный образ Go в качестве базового
|
||||
FROM golang:1.23
|
||||
|
||||
# Устанавливаем рабочую директорию
|
||||
WORKDIR /app
|
||||
|
||||
# Копируем файлы модуля
|
||||
COPY . .
|
||||
|
||||
# Сборка модуля
|
||||
RUN go build -o /bin/SecondService
|
||||
|
||||
# Запуск модуля
|
||||
CMD ["/bin/SecondService"]
|
1
bazunov_andrew_lab_2/SecondService/go.mod
Normal file
@ -0,0 +1 @@
|
||||
module SecondService
|
79
bazunov_andrew_lab_2/SecondService/main.go
Normal file
@ -0,0 +1,79 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"fmt"
|
||||
"os"
|
||||
)
|
||||
|
||||
//Ищет наименьшее число из файла /var/data/data.txt и сохраняет его третью степень в /var/result/result.txt.
|
||||
|
||||
const INPUT = "/var/data/data.txt"
|
||||
const OUTPUT = "/var/result/result.txt"
|
||||
|
||||
func ReadlinesFromFile(filename string) ([]string, error) {
|
||||
file, err := os.Open(filename)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var output []string
|
||||
scanner := bufio.NewScanner(file)
|
||||
for scanner.Scan() {
|
||||
output = append(output, scanner.Text())
|
||||
}
|
||||
|
||||
err = file.Close()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return output, nil
|
||||
}
|
||||
|
||||
func WriteIntToFile(filename string, i int) error {
|
||||
file, err := os.Create(filename)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
defer func(file *os.File) {
|
||||
err := file.Close()
|
||||
if err != nil {
|
||||
|
||||
}
|
||||
}(file)
|
||||
|
||||
_, err = file.WriteString(fmt.Sprintf("%d\n", i))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func main() {
|
||||
lines, err := ReadlinesFromFile(INPUT)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
}
|
||||
|
||||
minValue := 0
|
||||
|
||||
for _, line := range lines {
|
||||
if intValue, err := fmt.Sscanf(line, "%d", &minValue); err != nil {
|
||||
fmt.Println(err)
|
||||
} else {
|
||||
if minValue >= intValue {
|
||||
minValue = intValue
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if err = WriteIntToFile(OUTPUT, minValue); err != nil {
|
||||
return
|
||||
} else {
|
||||
fmt.Printf("Write %d to %s\n", minValue, OUTPUT)
|
||||
}
|
||||
|
||||
fmt.Println("Second Service is end.")
|
||||
}
|
27
bazunov_andrew_lab_2/docker-compose.yaml
Normal file
@ -0,0 +1,27 @@
|
||||
services:
|
||||
file_generate:
|
||||
build:
|
||||
context: ./FileCreator
|
||||
dockerfile: Dockerfile
|
||||
volumes:
|
||||
- ./data:/var/data # Монтирование локальной папки data в /var/data в контейнере
|
||||
|
||||
first_service:
|
||||
build:
|
||||
context: ./FirstService
|
||||
dockerfile: Dockerfile
|
||||
volumes:
|
||||
- ./data:/var/data
|
||||
- ./data:/var/result
|
||||
depends_on:
|
||||
- file_generate
|
||||
|
||||
second_service:
|
||||
build:
|
||||
context: ./SecondService
|
||||
dockerfile: Dockerfile
|
||||
volumes:
|
||||
- ./data:/var/data
|
||||
- ./data:/var/result
|
||||
depends_on:
|
||||
- first_service
|
35
bogdanov_dmitry_lab_1/README.md
Normal file
@ -0,0 +1,35 @@
|
||||
# Лабораторная работа №1
|
||||
|
||||
## Богданов Дмитрий ПИбд-42
|
||||
|
||||
### Для выполнения были развернуты следующие сервисы:
|
||||
|
||||
* PostgreSQL - база данных
|
||||
* Mediawiki - движок вики
|
||||
* Gitea - движок гита
|
||||
|
||||
### С использованием следующих технологий:
|
||||
|
||||
* git
|
||||
* docker
|
||||
* docker-compose
|
||||
|
||||
|
||||
### Запуск лабораторной:
|
||||
Необходимо перейти в папку с файлом docker-compose.yaml и ввести следующую команду:
|
||||
```
|
||||
docker-compose up -d
|
||||
```
|
||||
|
||||
## Результат запуска:
|
||||
```
|
||||
[+] Running 4/4
|
||||
✔ Network bogdanov_dmitry_lab_1_default Created 0.0s
|
||||
✔ Container bogdanov_dmitry_lab_1-mediawiki-1 Started 0.7s
|
||||
✔ Container bogdanov_dmitry_lab_1-git-1 Started 0.8s
|
||||
✔ Container bogdanov_dmitry_lab_1-db-1 Started 0.7s
|
||||
```
|
||||
|
||||
## Видео с результатом запуска:
|
||||
|
||||
Видео можно посмотреть по данной [ссылке](https://drive.google.com/file/d/1TES58HIeCnnKbtwWgED2oig4N7plBmol/view).
|
40
bogdanov_dmitry_lab_1/docker-compose.yaml
Normal file
@ -0,0 +1,40 @@
|
||||
services:
|
||||
# PostgreSQL
|
||||
db:
|
||||
# Образ контейнера
|
||||
image: postgres
|
||||
# Перезапуск при падении
|
||||
restart: always
|
||||
# Порт для подключения
|
||||
ports:
|
||||
- 5432:5432
|
||||
# Каталог с данными. Каталог компьютера:каталог контейнера
|
||||
volumes:
|
||||
- ./volumes/postgres:/var/lib/postgresql/data
|
||||
# Переменные среды для определения хотя бы одного пользователя при запуске
|
||||
environment:
|
||||
- POSTGRES_USER=admin
|
||||
- POSTGRES_PASSWORD=admin
|
||||
# Mediawiki
|
||||
mediawiki:
|
||||
# Образ
|
||||
image: mediawiki
|
||||
# Перезапуск при падении
|
||||
restart: always
|
||||
# Порт для подключения
|
||||
ports:
|
||||
- 8080:80
|
||||
# Каталоги
|
||||
volumes:
|
||||
- ./volumes/mediawiki:/var/www/html/images
|
||||
# Gitea
|
||||
git:
|
||||
image: gitea/gitea:latest
|
||||
restart: always
|
||||
ports:
|
||||
- "3000:3000"
|
||||
- "222:22"
|
||||
volumes:
|
||||
- ./volumes/gitea:/data
|
||||
- ./volumes/timezone:/etc/timezone:ro
|
||||
- ./volumes/localtime:/etc/localtime:ro
|
@ -1,50 +0,0 @@
|
||||
# Отчет. Лабораторная работа 4
|
||||
|
||||
## Описание
|
||||
В ходе лабораторной работы были изучены главы туториала о работе с RabbitMQ. Результат выполнения заданий каждой главы
|
||||
отражен на скриншотах в папке /images:
|
||||
- Tutorial-Task1.png
|
||||
![Tutorial-Task1](images/Tutorial-Task1.png)
|
||||
- Tutorial-Task2.png
|
||||
![Tutorial-Task2](images/Tutorial-Task2.png)
|
||||
- Tutorial-Task3.png
|
||||
![Tutorial-Task3](images/Tutorial-Task3.png)
|
||||
|
||||
Задание из 3-ей главы туториала было расширено условиями, которые были поставлены в задании к данной лабораторной работе.
|
||||
Для демонстрации работы сервисов посредством ассинхронного общения через брокер сообщений RabbitMQ была выбрана
|
||||
предметная область "Обработка заказов".
|
||||
|
||||
Сервис-издатель "Publisher" публикует в очередь сообщений событие поступления заказа с некоторым номером.
|
||||
|
||||
Сервисы-подписчики обрабатывают сообщения о заказах, при этом подписчики обрабатывают сообщение по-разному. Один вид
|
||||
подписчика обрабатывает с задержкой в несколько секунд, другой - "мгновенно", они получают одни и те жа сообщения,
|
||||
но соединены с разными очередями.
|
||||
В качестве эксперимента изначально были запущены по одному экземпляру каждого вида.
|
||||
На изображении Consumer2.png представлена работа мгновенно обрабатывающего подписчика. Он справляется с нагрузкой,
|
||||
так как размер очереди не растет.
|
||||
![Consumer 2](images/Consumer2.png)
|
||||
На изображении Consumer1.png представлена работа подписчика, обрабатывающего сообщения с задержкой. Как мы видим,
|
||||
в очереди накапливаются сообщения в состоянии 'Ready' - эти сообщения готовы для того, чтобы быть доставленными подписчикам.
|
||||
Сервис не справляется с нагрузкой, так как отправляются сообщения быстрее, чем обрабатываются.
|
||||
![Consumer 1](images/Consumer1.png)
|
||||
Для того, чтобы обеспечить равную скорость отправки и обработки, увеличиваем количество экземпляров-подписчиков данного типа до трех.
|
||||
На изображении видно, что теперь длина очереди не растет и система справляется с поступающими сообщениями. Также скорость "publish" и
|
||||
"consumer ack" стали равны.
|
||||
![Consumer 1](images/Consumer1-scaling.png)
|
||||
## Как запустить
|
||||
Для того, чтобы запустить сервисы, необходимо выполнить следующие действия:
|
||||
1. Установить и запустить Docker Engine или Docker Desktop
|
||||
2. Через консоль перейти в папку, в которой расположен файл docker-compose.yml
|
||||
3. Выполнить команду для запуска брокера сообщений rabbitmq:
|
||||
```
|
||||
docker compose up rabbit -d
|
||||
```
|
||||
4. Выполнить команду для запуска остальных контейнеров:
|
||||
```
|
||||
docker compose up -d
|
||||
```
|
||||
Такой порядок запуска важен для того, чтобы брокер сообщений успел полностью запуститься
|
||||
и произвести действия для того, чтобы быть готовым принимать соединения от сервисов. Потому что указания depends_on не хватает
|
||||
для отслеживания завершения всех необходимых подготовительных процессов брокера.
|
||||
## Видео-отчет
|
||||
Работоспособность лабораторной работы можно оценить в следующем [видео](https://disk.yandex.ru/i/G0vsfp7vwazYHw).
|
@ -1,23 +0,0 @@
|
||||
# Используем образ Maven для сборки
|
||||
FROM maven:3.8-eclipse-temurin-21-alpine AS build
|
||||
|
||||
# Устанавливаем рабочую директорию
|
||||
WORKDIR /app
|
||||
|
||||
# Копируем остальные исходные файлы
|
||||
COPY pom.xml .
|
||||
COPY src src
|
||||
|
||||
# Собираем весь проект
|
||||
RUN mvn clean package -DskipTests
|
||||
RUN mvn dependency:copy-dependencies
|
||||
|
||||
# Используем официальный образ JDK для запуска собранного jar-файла
|
||||
FROM eclipse-temurin:21-jdk-alpine
|
||||
|
||||
# Копируем jar-файл из предыдущего этапа
|
||||
COPY --from=build /app/target/*.jar /app.jar
|
||||
COPY --from=build /app/target/dependency /
|
||||
|
||||
# Указываем команду для запуска приложения
|
||||
CMD ["java", "-jar", "app.jar"]
|
@ -1,50 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>ru.somecompany</groupId>
|
||||
<artifactId>consumer-app</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>3.2.3</version>
|
||||
<relativePath/>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>21</maven.compiler.source>
|
||||
<maven.compiler.target>21</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.rabbitmq</groupId>
|
||||
<artifactId>amqp-client</artifactId>
|
||||
<version>5.22.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>1.18.30</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
@ -1,15 +0,0 @@
|
||||
package ru.somecompany;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.context.properties.ConfigurationPropertiesScan;
|
||||
import ru.somecompany.config.property.RabbitProperties;
|
||||
|
||||
@SpringBootApplication
|
||||
@ConfigurationPropertiesScan(basePackageClasses = RabbitProperties.class)
|
||||
public class Main {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(Main.class, args);
|
||||
}
|
||||
}
|
@ -1,45 +0,0 @@
|
||||
package ru.somecompany.config;
|
||||
|
||||
import com.rabbitmq.client.BuiltinExchangeType;
|
||||
import com.rabbitmq.client.Channel;
|
||||
import com.rabbitmq.client.Connection;
|
||||
import com.rabbitmq.client.ConnectionFactory;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import ru.somecompany.config.property.RabbitProperties;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.concurrent.TimeoutException;
|
||||
|
||||
@Configuration
|
||||
@RequiredArgsConstructor
|
||||
public class ConnectionFactoryConfig {
|
||||
|
||||
private final RabbitProperties rabbitProperties;
|
||||
|
||||
@Bean
|
||||
public ConnectionFactory connectionFactory() {
|
||||
ConnectionFactory factory = new ConnectionFactory();
|
||||
factory.setHost(rabbitProperties.getHost());
|
||||
factory.setPort(rabbitProperties.getPort());
|
||||
return factory;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public Connection connection(ConnectionFactory connectionFactory) throws IOException, TimeoutException {
|
||||
return connectionFactory.newConnection();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public Channel channel(Connection connection) throws IOException {
|
||||
var exchange = rabbitProperties.getExchange();
|
||||
var queue = rabbitProperties.getQueue();
|
||||
var channel = connection.createChannel();
|
||||
|
||||
channel.exchangeDeclare(exchange, BuiltinExchangeType.FANOUT);
|
||||
channel.queueDeclare(queue, true, false, true, null);
|
||||
channel.queueBind(queue, exchange, "");
|
||||
return channel;
|
||||
}
|
||||
}
|
@ -1,19 +0,0 @@
|
||||
package ru.somecompany.config.property;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
|
||||
@Data
|
||||
@ConfigurationProperties(prefix = "app.rabbit-properties")
|
||||
public class RabbitProperties {
|
||||
|
||||
private String host;
|
||||
|
||||
private Integer port;
|
||||
|
||||
private Integer delay;
|
||||
|
||||
private String queue;
|
||||
|
||||
private String exchange;
|
||||
}
|
@ -1,76 +0,0 @@
|
||||
package ru.somecompany.consumer;
|
||||
|
||||
import com.rabbitmq.client.AMQP;
|
||||
import com.rabbitmq.client.Channel;
|
||||
import com.rabbitmq.client.Connection;
|
||||
import com.rabbitmq.client.DefaultConsumer;
|
||||
import com.rabbitmq.client.Envelope;
|
||||
import jakarta.annotation.PostConstruct;
|
||||
import jakarta.annotation.PreDestroy;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
import ru.somecompany.config.property.RabbitProperties;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class Consumer {
|
||||
|
||||
private final RabbitProperties rabbitProperties;
|
||||
|
||||
private final Connection connection;
|
||||
private final Channel channel;
|
||||
|
||||
@PostConstruct
|
||||
public void consume() {
|
||||
try {
|
||||
channel.basicQos(1);
|
||||
channel.basicConsume(rabbitProperties.getQueue(), false, new DefaultConsumer(channel) {
|
||||
@Override
|
||||
public void handleDelivery(String consumerTag,
|
||||
Envelope envelope,
|
||||
AMQP.BasicProperties properties,
|
||||
byte[] body) throws IOException {
|
||||
long deliveryTag = envelope.getDeliveryTag();
|
||||
|
||||
String message = new String(body, StandardCharsets.UTF_8);
|
||||
System.out.println(" [x] Received '" + message + "'");
|
||||
|
||||
var delay = rabbitProperties.getDelay();
|
||||
try {
|
||||
doWork(delay);
|
||||
} finally {
|
||||
System.out.println(" [x] Processed '" + message + "'");
|
||||
channel.basicAck(deliveryTag, false);
|
||||
}
|
||||
}
|
||||
});
|
||||
} catch (Exception exception) {
|
||||
log.error("Error while set up connection with rabbit", exception);
|
||||
}
|
||||
}
|
||||
|
||||
private static void doWork(Integer delay) {
|
||||
if (delay > 0) {
|
||||
try {
|
||||
Thread.sleep(delay);
|
||||
} catch (InterruptedException _ignored) {
|
||||
Thread.currentThread().interrupt();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@PreDestroy
|
||||
public void cleanUp() throws Exception {
|
||||
if (channel != null) {
|
||||
channel.close();
|
||||
}
|
||||
if (connection != null) {
|
||||
connection.close();
|
||||
}
|
||||
}
|
||||
}
|
@ -1,10 +0,0 @@
|
||||
server:
|
||||
port: ${SERVER_PORT:8081}
|
||||
|
||||
app:
|
||||
rabbit-properties:
|
||||
host: ${RABBIT_HOST:localhost}
|
||||
port: ${RABBIT_PORT:5672}
|
||||
delay: ${PROCESS_DELAY:0}
|
||||
queue: ${QUEUE_NAME:queue-1}
|
||||
exchange: ${EXCHANGE_NAME:order-events}
|
@ -1,79 +0,0 @@
|
||||
services:
|
||||
rabbit:
|
||||
container_name: rabbit
|
||||
image: rabbitmq:3-management
|
||||
ports:
|
||||
- "15672:15672"
|
||||
- "5672:5672"
|
||||
- "5671:5671"
|
||||
networks:
|
||||
- local
|
||||
publisher:
|
||||
build: ./publisher-app
|
||||
container_name: publisher
|
||||
depends_on:
|
||||
- rabbit
|
||||
environment:
|
||||
RABBIT_HOST: rabbit
|
||||
RABBIT_PORT: 5672
|
||||
networks:
|
||||
- local
|
||||
consumer-1:
|
||||
build: ./consumer-app
|
||||
container_name: consumer-1
|
||||
depends_on:
|
||||
- rabbit
|
||||
- publisher
|
||||
environment:
|
||||
RABBIT_HOST: rabbit
|
||||
RABBIT_PORT: 5672
|
||||
PROCESS_DELAY: 3000
|
||||
QUEUE_NAME: queue1
|
||||
EXCHANGE_NAME: order-events
|
||||
networks:
|
||||
- local
|
||||
consumer-2:
|
||||
build: ./consumer-app
|
||||
container_name: consumer-2
|
||||
depends_on:
|
||||
- rabbit
|
||||
- publisher
|
||||
environment:
|
||||
RABBIT_HOST: rabbit
|
||||
RABBIT_PORT: 5672
|
||||
PROCESS_DELAY: 0
|
||||
QUEUE_NAME: queue2
|
||||
EXCHANGE_NAME: order-events
|
||||
networks:
|
||||
- local
|
||||
consumer-12:
|
||||
build: ./consumer-app
|
||||
container_name: consumer-12
|
||||
depends_on:
|
||||
- rabbit
|
||||
- publisher
|
||||
environment:
|
||||
RABBIT_HOST: rabbit
|
||||
RABBIT_PORT: 5672
|
||||
PROCESS_DELAY: 3000
|
||||
QUEUE_NAME: queue1
|
||||
EXCHANGE_NAME: order-events
|
||||
networks:
|
||||
- local
|
||||
consumer-13:
|
||||
build: ./consumer-app
|
||||
container_name: consumer-13
|
||||
depends_on:
|
||||
- rabbit
|
||||
- publisher
|
||||
environment:
|
||||
RABBIT_HOST: rabbit
|
||||
RABBIT_PORT: 5672
|
||||
PROCESS_DELAY: 3000
|
||||
QUEUE_NAME: queue1
|
||||
EXCHANGE_NAME: order-events
|
||||
networks:
|
||||
- local
|
||||
|
||||
networks:
|
||||
local:
|
@ -1,34 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>ru.somecompany</groupId>
|
||||
<artifactId>helloworld-tutorial</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>21</maven.compiler.source>
|
||||
<maven.compiler.target>21</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.rabbitmq</groupId>
|
||||
<artifactId>amqp-client</artifactId>
|
||||
<version>5.22.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-api</artifactId>
|
||||
<version>1.7.5</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-log4j12</artifactId>
|
||||
<version>1.7.5</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
@ -1,28 +0,0 @@
|
||||
package ru.somecompany;
|
||||
|
||||
import com.rabbitmq.client.Channel;
|
||||
import com.rabbitmq.client.Connection;
|
||||
import com.rabbitmq.client.ConnectionFactory;
|
||||
import com.rabbitmq.client.DeliverCallback;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.concurrent.TimeoutException;
|
||||
|
||||
public class Main {
|
||||
|
||||
private static final String QUEUE_NAME = "hello-world";
|
||||
|
||||
public static void main(String[] args) {
|
||||
ConnectionFactory factory = new ConnectionFactory();
|
||||
factory.setHost("localhost");
|
||||
try(Connection connection = factory.newConnection();
|
||||
Channel channel = connection.createChannel();) {
|
||||
var sender = new Sender(channel);
|
||||
var receiver = new Receiver(channel);
|
||||
|
||||
} catch (Exception e) {
|
||||
System.out.println(" [*] Error in Hello-World");
|
||||
}
|
||||
}
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
package ru.somecompany;
|
||||
|
||||
import com.rabbitmq.client.Channel;
|
||||
import com.rabbitmq.client.DeliverCallback;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class Receiver {
|
||||
|
||||
private static final String QUEUE_NAME = "hello-world";
|
||||
|
||||
public Receiver(Channel channel) throws IOException {
|
||||
channel.queueDeclare(QUEUE_NAME, false, false, false, null);
|
||||
DeliverCallback deliverCallback = (consumerTag, delivery) -> {
|
||||
String message = new String(delivery.getBody(), "UTF-8");
|
||||
System.out.println(" [x] Received '" + message + "'");
|
||||
};
|
||||
channel.basicConsume(QUEUE_NAME, true, deliverCallback, consumerTag -> { });
|
||||
}
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
package ru.somecompany;
|
||||
|
||||
import com.rabbitmq.client.Channel;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
public class Sender {
|
||||
|
||||
private static final String QUEUE_NAME = "hello-world";
|
||||
|
||||
public Sender(Channel channel) throws IOException {
|
||||
channel.queueDeclare(QUEUE_NAME, false, false, false, null);
|
||||
String message = "Hello World!";
|
||||
channel.basicPublish("", QUEUE_NAME, null, message.getBytes(StandardCharsets.UTF_8));
|
||||
System.out.println(" [x] Sent '" + message + "'");
|
||||
}
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
# Root logger option
|
||||
log4j.rootLogger=INFO, stdout
|
||||
|
||||
# Direct log messages to stdout
|
||||
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
|
||||
log4j.appender.stdout.Target=System.out
|
||||
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
|
||||
log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n
|
Before Width: | Height: | Size: 31 KiB |
Before Width: | Height: | Size: 39 KiB |
Before Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 101 KiB |
Before Width: | Height: | Size: 128 KiB |
Before Width: | Height: | Size: 848 KiB |
@ -1,38 +0,0 @@
|
||||
target/
|
||||
!.mvn/wrapper/maven-wrapper.jar
|
||||
!**/src/main/**/target/
|
||||
!**/src/test/**/target/
|
||||
|
||||
### IntelliJ IDEA ###
|
||||
.idea/modules.xml
|
||||
.idea/jarRepositories.xml
|
||||
.idea/compiler.xml
|
||||
.idea/libraries/
|
||||
*.iws
|
||||
*.iml
|
||||
*.ipr
|
||||
|
||||
### Eclipse ###
|
||||
.apt_generated
|
||||
.classpath
|
||||
.factorypath
|
||||
.project
|
||||
.settings
|
||||
.springBeans
|
||||
.sts4-cache
|
||||
|
||||
### NetBeans ###
|
||||
/nbproject/private/
|
||||
/nbbuild/
|
||||
/dist/
|
||||
/nbdist/
|
||||
/.nb-gradle/
|
||||
build/
|
||||
!**/src/main/**/build/
|
||||
!**/src/test/**/build/
|
||||
|
||||
### VS Code ###
|
||||
.vscode/
|
||||
|
||||
### Mac OS ###
|
||||
.DS_Store
|
@ -1,21 +0,0 @@
|
||||
# Используем образ Maven для сборки
|
||||
FROM maven:3.8-eclipse-temurin-21-alpine AS build
|
||||
|
||||
# Устанавливаем рабочую директорию
|
||||
WORKDIR /app
|
||||
|
||||
# Копируем остальные исходные файлы
|
||||
COPY pom.xml .
|
||||
COPY src src
|
||||
|
||||
# Собираем весь проект
|
||||
RUN mvn clean package -DskipTests
|
||||
|
||||
# Используем официальный образ JDK для запуска собранного jar-файла
|
||||
FROM eclipse-temurin:21-jdk-alpine
|
||||
|
||||
# Копируем jar-файл из предыдущего этапа
|
||||
COPY --from=build /app/target/*.jar /app.jar
|
||||
|
||||
# Указываем команду для запуска приложения
|
||||
CMD ["java", "-jar", "app.jar"]
|
@ -1,49 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>ru.somecompany</groupId>
|
||||
<artifactId>publisher-app</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>3.2.3</version>
|
||||
<relativePath/>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>21</maven.compiler.source>
|
||||
<maven.compiler.target>21</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>1.18.30</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.rabbitmq</groupId>
|
||||
<artifactId>amqp-client</artifactId>
|
||||
<version>5.22.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
@ -1,17 +0,0 @@
|
||||
package ru.somecompany;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.context.properties.ConfigurationPropertiesScan;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
import ru.somecompany.config.property.RabbitProperties;
|
||||
|
||||
@EnableScheduling
|
||||
@SpringBootApplication
|
||||
@ConfigurationPropertiesScan(basePackageClasses = RabbitProperties.class)
|
||||
public class Main {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(Main.class, args);
|
||||
}
|
||||
}
|
@ -1,40 +0,0 @@
|
||||
package ru.somecompany.config;
|
||||
|
||||
import com.rabbitmq.client.BuiltinExchangeType;
|
||||
import com.rabbitmq.client.Channel;
|
||||
import com.rabbitmq.client.Connection;
|
||||
import com.rabbitmq.client.ConnectionFactory;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import ru.somecompany.config.property.RabbitProperties;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.concurrent.TimeoutException;
|
||||
|
||||
@Configuration
|
||||
@RequiredArgsConstructor
|
||||
public class ConnectionFactoryConfig {
|
||||
|
||||
private final RabbitProperties rabbitProperties;
|
||||
|
||||
@Bean
|
||||
public ConnectionFactory connectionFactory() {
|
||||
ConnectionFactory factory = new ConnectionFactory();
|
||||
factory.setHost(rabbitProperties.getHost());
|
||||
factory.setPort(rabbitProperties.getPort());
|
||||
return factory;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public Connection connection(ConnectionFactory connectionFactory) throws IOException, TimeoutException {
|
||||
return connectionFactory.newConnection();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public Channel channel(Connection connection) throws IOException {
|
||||
var channel = connection.createChannel();
|
||||
channel.exchangeDeclare(rabbitProperties.getExchange(), BuiltinExchangeType.FANOUT);
|
||||
return channel;
|
||||
}
|
||||
}
|
@ -1,15 +0,0 @@
|
||||
package ru.somecompany.config.property;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
|
||||
@Data
|
||||
@ConfigurationProperties(prefix = "app.rabbit-properties")
|
||||
public class RabbitProperties {
|
||||
|
||||
private String host;
|
||||
|
||||
private Integer port;
|
||||
|
||||
private String exchange;
|
||||
}
|
@ -1,41 +0,0 @@
|
||||
package ru.somecompany.scheduler;
|
||||
|
||||
import com.rabbitmq.client.BuiltinExchangeType;
|
||||
import com.rabbitmq.client.Channel;
|
||||
import com.rabbitmq.client.Connection;
|
||||
import com.rabbitmq.client.ConnectionFactory;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.concurrent.TimeoutException;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class SenderScheduler {
|
||||
|
||||
private static final String EXCHANGE_NAME = "order-events";
|
||||
private static final String MESSAGE = "Поступил заказ №%d";
|
||||
private Integer index = 0;
|
||||
|
||||
private final ConnectionFactory connectionFactory;
|
||||
private final Connection connection;
|
||||
private final Channel channel;
|
||||
|
||||
@Scheduled(cron = "*/1 * * * * *")
|
||||
public void sendMessage() {
|
||||
try {
|
||||
var message = String.format(MESSAGE, index);
|
||||
|
||||
channel.basicPublish(EXCHANGE_NAME, "", null, message.getBytes(StandardCharsets.UTF_8));
|
||||
index++;
|
||||
System.out.println(" [x] Sent '" + message + "'");
|
||||
} catch (IOException e) {
|
||||
System.out.println(" [x] Error while send message");
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
server:
|
||||
port: ${SERVER_PORT:8080}
|
||||
|
||||
app:
|
||||
rabbit-properties:
|
||||
host: ${RABBIT_HOST:localhost}
|
||||
port: ${RABBIT_PORT:5672}
|
||||
exchange: ${EXCHANGE_NAME:order-events}
|
@ -1,30 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>ru.somecompany</groupId>
|
||||
<artifactId>workqueue-tutorial</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>21</maven.compiler.source>
|
||||
<maven.compiler.target>21</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.rabbitmq</groupId>
|
||||
<artifactId>amqp-client</artifactId>
|
||||
<version>5.22.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-log4j12</artifactId>
|
||||
<version>1.7.5</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
@ -1,23 +0,0 @@
|
||||
package ru.somecompany;
|
||||
|
||||
import com.rabbitmq.client.Channel;
|
||||
import com.rabbitmq.client.Connection;
|
||||
import com.rabbitmq.client.ConnectionFactory;
|
||||
|
||||
public class Main {
|
||||
|
||||
public static final String QUEUE_NAME = "task_queue";
|
||||
|
||||
public static void main(String[] args) {
|
||||
ConnectionFactory factory = new ConnectionFactory();
|
||||
factory.setHost("localhost");
|
||||
try(Connection connection = factory.newConnection();
|
||||
Channel channel = connection.createChannel();) {
|
||||
var sender = new Sender(channel);
|
||||
sender.send("Work Queue message");
|
||||
var receiver = new Receiver(channel);
|
||||
} catch (Exception e) {
|
||||
System.out.println(" [*] Error in Work-Queue: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
@ -1,44 +0,0 @@
|
||||
package ru.somecompany;
|
||||
|
||||
import com.rabbitmq.client.Channel;
|
||||
import com.rabbitmq.client.DeliverCallback;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
import static ru.somecompany.Main.QUEUE_NAME;
|
||||
|
||||
public class Receiver {
|
||||
|
||||
public Receiver(Channel channel) throws IOException {
|
||||
channel.queueDeclare(QUEUE_NAME, true, false, false, null);
|
||||
System.out.println(" [*] Waiting for messages. To exit press CTRL+C");
|
||||
|
||||
channel.basicQos(1);
|
||||
|
||||
DeliverCallback deliverCallback = (consumerTag, delivery) -> {
|
||||
String message = new String(delivery.getBody(), StandardCharsets.UTF_8);
|
||||
|
||||
System.out.println(" [x] Received '" + message + "'");
|
||||
try {
|
||||
doWork(message);
|
||||
} finally {
|
||||
System.out.println(" [x] Done");
|
||||
channel.basicAck(delivery.getEnvelope().getDeliveryTag(), false);
|
||||
}
|
||||
};
|
||||
channel.basicConsume(QUEUE_NAME, false, deliverCallback, consumerTag -> { });
|
||||
}
|
||||
|
||||
private static void doWork(String task) {
|
||||
for (char ch : task.toCharArray()) {
|
||||
if (ch == '.') {
|
||||
try {
|
||||
Thread.sleep(1000);
|
||||
} catch (InterruptedException _ignored) {
|
||||
Thread.currentThread().interrupt();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,29 +0,0 @@
|
||||
package ru.somecompany;
|
||||
|
||||
import com.rabbitmq.client.Channel;
|
||||
import com.rabbitmq.client.MessageProperties;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
import static ru.somecompany.Main.QUEUE_NAME;
|
||||
|
||||
public class Sender {
|
||||
|
||||
private Channel channel;
|
||||
|
||||
public Sender(Channel channel) throws IOException {
|
||||
channel.queueDeclare(QUEUE_NAME, true, false, false, null);
|
||||
this.channel = channel;
|
||||
}
|
||||
|
||||
public void send(String msg) throws IOException {
|
||||
String message = String.join(" ", msg);
|
||||
|
||||
channel.basicPublish("", QUEUE_NAME,
|
||||
MessageProperties.PERSISTENT_TEXT_PLAIN,
|
||||
message.getBytes("UTF-8"));
|
||||
System.out.println(" [x] Sent '" + message + "'");
|
||||
}
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
# Root logger option
|
||||
log4j.rootLogger=INFO, stdout
|
||||
|
||||
# Direct log messages to stdout
|
||||
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
|
||||
log4j.appender.stdout.Target=System.out
|
||||
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
|
||||
log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n
|
4
dolgov_dmitriy_lab_1/.gitignore
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
data/
|
||||
log/
|
||||
wordpress/
|
||||
custom/
|
34
dolgov_dmitriy_lab_1/README.md
Normal file
@ -0,0 +1,34 @@
|
||||
# Лабораторная работа №1
|
||||
|
||||
## Выполнил: Долгов Дмитрий, группа ПИбд-42
|
||||
|
||||
### Были развёрнуты следующие сервисы:
|
||||
|
||||
* mediawiki (движок вики)
|
||||
* wordpress (популярная система управления контентом)
|
||||
* gitea (сервис для хранения репозиториев git)
|
||||
* mariaDB
|
||||
### Были использованы следующие технологии:
|
||||
|
||||
* git
|
||||
* docker
|
||||
* docker-compose
|
||||
|
||||
|
||||
### Для запуска лабораторной работы необходимо ввести в консоль следующую команду:
|
||||
```
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
## Результат запуска:
|
||||
```
|
||||
[+] Running 4/4
|
||||
✔ Container dolgov_dmitriy_lab_1-wordpress-1 Running 0.0s
|
||||
✔ Container dolgov_dmitriy_lab_1-database-1 Running 0.0s
|
||||
✔ Container dolgov_dmitriy_lab_1-mediawiki-1 Running 0.0s
|
||||
✔ Container gitea Running
|
||||
```
|
||||
|
||||
## Видео с результатом запуска:
|
||||
|
||||
Видео можно посмотреть по данной [ссылке](https://drive.google.com/file/d/1hC6HhNvYBRuYVClobXyDMReA4ngwxhwc/view?usp=drive_link).
|
73
dolgov_dmitriy_lab_1/docker-compose.yml
Normal file
@ -0,0 +1,73 @@
|
||||
# Сервисы по заданию
|
||||
services:
|
||||
# Сервис MediaWiki
|
||||
mediawiki:
|
||||
# Образ MediaWiki
|
||||
image: mediawiki
|
||||
# Автоматический перезапуск при сбое
|
||||
restart: always
|
||||
# проброс порта 80 из контейнера на порт 8080 хоста
|
||||
ports:
|
||||
- "8080:80"
|
||||
# связь с сервисом database
|
||||
links:
|
||||
- database
|
||||
# монтирование volume для хранения данных
|
||||
volumes:
|
||||
- images:/var/www/html/images
|
||||
|
||||
# Сервис WordPress
|
||||
wordpress:
|
||||
# Образ WordPress
|
||||
image: wordpress:latest
|
||||
# Автоматический перезапуск при сбое
|
||||
ports:
|
||||
- "8082:80"
|
||||
restart: always
|
||||
volumes:
|
||||
- ./wordpress:/var/www/html
|
||||
|
||||
# Сервис Gitea
|
||||
server:
|
||||
image: gitea/gitea:latest
|
||||
container_name: gitea
|
||||
restart: always
|
||||
environment:
|
||||
- USER_UID=1000
|
||||
- USER_GID=1000
|
||||
volumes:
|
||||
- ./data:/data
|
||||
- ./custom:/app/gitea/custom
|
||||
- ./log:/app/gitea/log
|
||||
ports:
|
||||
- "8081:3000"
|
||||
links:
|
||||
- database
|
||||
depends_on:
|
||||
- database
|
||||
|
||||
# Сервис MariaDB
|
||||
database:
|
||||
# Образ MariaDB
|
||||
image: mariadb
|
||||
# Автоматический перезапуск при сбое
|
||||
restart: always
|
||||
# переменные окружения для настройки базы данных
|
||||
environment:
|
||||
# имя базы данных
|
||||
MYSQL_DATABASE: my_wiki
|
||||
# имя пользователя
|
||||
MYSQL_USER: user
|
||||
# пароль пользователя
|
||||
MYSQL_PASSWORD: user
|
||||
# случайный пароль для пользователя root
|
||||
MYSQL_RANDOM_ROOT_PASSWORD: 'yes'
|
||||
# монтирование volume для хранения данных
|
||||
volumes:
|
||||
- db:/var/lib/mysql
|
||||
|
||||
# тома для хранения данных
|
||||
volumes:
|
||||
images:
|
||||
db:
|
||||
|
BIN
dolgov_dmitriy_lab_1/screenshots/image.png
Normal file
After Width: | Height: | Size: 275 KiB |
2
dolgov_dmitriy_lab_2/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
data
|
||||
result
|
36
dolgov_dmitriy_lab_2/README.md
Normal file
@ -0,0 +1,36 @@
|
||||
# Лабораторная работа №2
|
||||
|
||||
## Выполнил: Долгов Дмитрий, группа ПИбд-42
|
||||
|
||||
### Были выбраны следующие варианты программ:
|
||||
|
||||
* _Вариант первого приложения: 6._ Берёт из каталога /var/data случайный файл и перекладывает его в /var/result/data.txt.
|
||||
* _Вариант второго приложения: 1._ Ищет набольшее число из файла /var/data/data.txt и сохраняет его вторую степень в /var/result/result.txt.
|
||||
|
||||
Кроме того, для генерации файлов был реализован сервис file_generator
|
||||
|
||||
### Были использованы следующие технологии:
|
||||
|
||||
* git
|
||||
* docker
|
||||
* docker-compose
|
||||
* язык программирования Python
|
||||
|
||||
### Для запуска лабораторной работы, находясь в папке `dolgov_dmitriy_lab_2`, необходимо выполнить следующую команду:
|
||||
|
||||
```
|
||||
docker-compose up --build
|
||||
```
|
||||
Таким образом, запустятся все сервисы, необходимые для выполнения лабораторной работы.
|
||||
|
||||
## Результат запуска:
|
||||
```
|
||||
app2-1 | Наибольшее числовое значение: 29.0
|
||||
app2-1 | Результат: 841.0
|
||||
app1-1 | Файл file_3.txt успешно перемещен в /var/result/data.txt
|
||||
app2-1 exited with code 0
|
||||
app1-1 exited with code 0
|
||||
```
|
||||
## Видео с результатом запуска:
|
||||
|
||||
Видео можно посмотреть по данной [ссылке](https://drive.google.com/file/d/1Iw6BR0lRvh4382QsIEfr5E68-09aKX9C/view?usp=drive_link).
|
8
dolgov_dmitriy_lab_2/app1/Dockerfile
Normal file
@ -0,0 +1,8 @@
|
||||
# Стандартный образ Python
|
||||
FROM python:3.9
|
||||
# Указываем рабочую директорию
|
||||
WORKDIR /app
|
||||
# Копируем в ней файл app1.py
|
||||
COPY app1.py .
|
||||
# Команда для запуска при старте контейнера
|
||||
CMD ["python", "app1.py"]
|
27
dolgov_dmitriy_lab_2/app1/app1.py
Normal file
@ -0,0 +1,27 @@
|
||||
import os
|
||||
import random
|
||||
import shutil
|
||||
|
||||
def move_random_file():
|
||||
src_dir = "/var/data"
|
||||
dst_file = "/var/result/data.txt"
|
||||
|
||||
# Получаем список всех файлов в src_dir
|
||||
files = os.listdir(src_dir)
|
||||
|
||||
if files:
|
||||
# Выбираем случайный файл
|
||||
random_file = random.choice(files)
|
||||
|
||||
# Проверяем, что файл существует
|
||||
if os.path.exists(os.path.join(src_dir, random_file)):
|
||||
# Перемещаем файл в целевое место
|
||||
shutil.move(os.path.join(src_dir, random_file), dst_file)
|
||||
print(f"Файл {random_file} успешно перемещен в {dst_file}")
|
||||
else:
|
||||
print(f"Ошибка: Файл {random_file} не найден в {src_dir}")
|
||||
else:
|
||||
print("Папка пуста")
|
||||
|
||||
if __name__ == "__main__":
|
||||
move_random_file()
|
8
dolgov_dmitriy_lab_2/app2/Dockerfile
Normal file
@ -0,0 +1,8 @@
|
||||
# Стандартный образ Python
|
||||
FROM python:3.9
|
||||
# Указываем рабочую директорию
|
||||
WORKDIR /app
|
||||
# Копируем содержимое текущей директории в рабочую директорию
|
||||
COPY app2.py .
|
||||
# Запускаем приложение
|
||||
CMD ["python", "app2.py"]
|
26
dolgov_dmitriy_lab_2/app2/app2.py
Normal file
@ -0,0 +1,26 @@
|
||||
import os
|
||||
from math import sqrt
|
||||
|
||||
def find_largest_number_and_square():
|
||||
input_file = "/var/data/data.txt"
|
||||
output_file = "/var/result/result.txt"
|
||||
|
||||
try:
|
||||
with open(input_file, 'r') as f:
|
||||
numbers = [float(num.strip()) for num in f]
|
||||
|
||||
largest_num = max(numbers)
|
||||
squared_num = largest_num ** 2
|
||||
|
||||
with open(output_file, 'w') as f:
|
||||
f.write(str(squared_num))
|
||||
|
||||
print(f"Наибольшее числовое значение: {largest_num}")
|
||||
print(f"Результат: {squared_num}")
|
||||
except FileNotFoundError:
|
||||
print(f"Ошибка: Файл {input_file} не найден")
|
||||
except ValueError:
|
||||
print("Ошибка: В файле содержатся некорректные данные")
|
||||
|
||||
if __name__ == "__main__":
|
||||
find_largest_number_and_square()
|
42
dolgov_dmitriy_lab_2/docker-compose.yml
Normal file
@ -0,0 +1,42 @@
|
||||
# Сервисы, которые будут запускаться
|
||||
services:
|
||||
# Сервис генерации файлов
|
||||
file_generator:
|
||||
build:
|
||||
# Директория с Dockerfile и скриптом генератора
|
||||
context: ./file_generator
|
||||
dockerfile: Dockerfile
|
||||
# Монтирование локальной папки data в /var/data в контейнере
|
||||
volumes:
|
||||
- ./data:/var/data
|
||||
- ./result:/var/result
|
||||
# Запуск команды, которая генерирует файл в папке /var/data
|
||||
command: ["python", "file_generator.py"]
|
||||
|
||||
# Первая программа, которая перемещает рандомный файл из одной папки в другую
|
||||
app1:
|
||||
build:
|
||||
# Директория с Dockerfile для первого приложения
|
||||
context: ./app1
|
||||
dockerfile: Dockerfile
|
||||
# Монтирование локальной папки result в /var/result в контейнере
|
||||
volumes:
|
||||
- ./result:/var/result
|
||||
- ./data:/var/data
|
||||
# Указывает, что первый сервис зависит от завершения работы генератора
|
||||
depends_on:
|
||||
- file_generator
|
||||
# Запуск скрипта
|
||||
command: ["python", "app1.py"]
|
||||
|
||||
# Вторая программа, которая считает квадрат максимального числа в файле (пояснения аналогичны первой)
|
||||
app2:
|
||||
build:
|
||||
context: ./app2
|
||||
dockerfile: Dockerfile
|
||||
volumes:
|
||||
- ./result:/var/result
|
||||
- ./data:/var/data
|
||||
depends_on:
|
||||
- file_generator
|
||||
command: ["python", "app2.py"]
|
7
dolgov_dmitriy_lab_2/file_generator/Dockerfile
Normal file
@ -0,0 +1,7 @@
|
||||
FROM python:3.9
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY file_generator.py .
|
||||
|
||||
CMD [ "python", "file_generator.py" ]
|
33
dolgov_dmitriy_lab_2/file_generator/file_generator.py
Normal file
@ -0,0 +1,33 @@
|
||||
import os
|
||||
import random
|
||||
|
||||
def generate_files(count):
|
||||
directory = "/var/data/"
|
||||
if not os.path.exists(directory):
|
||||
os.makedirs(directory)
|
||||
|
||||
for _ in range(count):
|
||||
file_name = f"{directory}file_{random.randint(1, 10)}.txt"
|
||||
|
||||
with open(file_name, 'w') as f:
|
||||
for _ in range(random.randint(1, 100)):
|
||||
f.write(f"{random.randint(1, 100)}\n")
|
||||
|
||||
print(f"Сгенерирован файл {file_name}")
|
||||
|
||||
|
||||
def generate_data():
|
||||
|
||||
file_name = "/var/data/data.txt"
|
||||
|
||||
with open(file_name, 'w') as f:
|
||||
for _ in range(random.randint(10, 100)):
|
||||
f.write(f"{random.randint(1, 30)}\n")
|
||||
print(f"Сгенерирован файл {file_name}")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
generate_files(10)
|
||||
generate_data()
|
||||
|
||||
|
30
dozorova_alena_lab_2/ConsoleApp1/.dockerignore
Normal file
@ -0,0 +1,30 @@
|
||||
**/.classpath
|
||||
**/.dockerignore
|
||||
**/.env
|
||||
**/.git
|
||||
**/.gitignore
|
||||
**/.project
|
||||
**/.settings
|
||||
**/.toolstarget
|
||||
**/.vs
|
||||
**/.vscode
|
||||
**/*.*proj.user
|
||||
**/*.dbmdl
|
||||
**/*.jfm
|
||||
**/azds.yaml
|
||||
**/bin
|
||||
**/charts
|
||||
**/docker-compose*
|
||||
**/Dockerfile*
|
||||
**/node_modules
|
||||
**/npm-debug.log
|
||||
**/obj
|
||||
**/secrets.dev.yaml
|
||||
**/values.dev.yaml
|
||||
LICENSE
|
||||
README.md
|
||||
!**/.gitignore
|
||||
!.git/HEAD
|
||||
!.git/config
|
||||
!.git/packed-refs
|
||||
!.git/refs/heads/**
|
13
dozorova_alena_lab_2/ConsoleApp1/ConsoleApp1.csproj
Normal file
@ -0,0 +1,13 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk;Microsoft.NET.Sdk.Publish">
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
|
||||
<DockerfileContext>.</DockerfileContext>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.20.1" />
|
||||
</ItemGroup>
|
||||
</Project>
|
7
dozorova_alena_lab_2/ConsoleApp1/ConsoleApp1.csproj.user
Normal file
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<ActiveDebugProfile>Container (Dockerfile)</ActiveDebugProfile>
|
||||
<_LastSelectedProfileId>C:\Users\Alena\WorkFolder\Study\politech\7\РВиП\DAS_2024_1\dozorova_alena_lab_2\ConsoleApp1\Properties\PublishProfiles\registry.hub.docker.com_alenadozorova.pubxml</_LastSelectedProfileId>
|
||||
</PropertyGroup>
|
||||
</Project>
|
25
dozorova_alena_lab_2/ConsoleApp1/ConsoleApp1.sln
Normal file
@ -0,0 +1,25 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.10.35004.147
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleApp1", "ConsoleApp1.csproj", "{093B5FCB-33F6-4F14-B150-87DA092D2BFA}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{093B5FCB-33F6-4F14-B150-87DA092D2BFA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{093B5FCB-33F6-4F14-B150-87DA092D2BFA}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{093B5FCB-33F6-4F14-B150-87DA092D2BFA}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{093B5FCB-33F6-4F14-B150-87DA092D2BFA}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {CDC30087-C732-4ED0-97FB-E43A9F219F67}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
22
dozorova_alena_lab_2/ConsoleApp1/Dockerfile
Normal file
@ -0,0 +1,22 @@
|
||||
#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging.
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/runtime:6.0 AS base
|
||||
WORKDIR /app
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
|
||||
ARG BUILD_CONFIGURATION=Release
|
||||
WORKDIR /src
|
||||
COPY ["ConsoleApp1.csproj", "."]
|
||||
RUN dotnet restore "./ConsoleApp1.csproj"
|
||||
COPY . .
|
||||
WORKDIR "/src/."
|
||||
RUN dotnet build "./ConsoleApp1.csproj" -c $BUILD_CONFIGURATION -o /app/build
|
||||
|
||||
FROM build AS publish
|
||||
ARG BUILD_CONFIGURATION=Release
|
||||
RUN dotnet publish "./ConsoleApp1.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
|
||||
|
||||
FROM base AS final
|
||||
WORKDIR /app
|
||||
COPY --from=publish /app/publish .
|
||||
ENTRYPOINT ["dotnet", "ConsoleApp1.dll"]
|
32
dozorova_alena_lab_2/ConsoleApp1/Program.cs
Normal file
@ -0,0 +1,32 @@
|
||||
// Ищет в каталоге /var/data файл с самым коротким названием и перекладывает
|
||||
// его в /var/result/data.txt.
|
||||
|
||||
Console.WriteLine("Start first service");
|
||||
var files = Directory.GetFiles("/var/data/");
|
||||
|
||||
if(files == null || files.Length == 0)
|
||||
{
|
||||
File.Create("./var/data/data.txt");
|
||||
}
|
||||
|
||||
string res = files[0];
|
||||
|
||||
files.ToList().ForEach(f =>
|
||||
{
|
||||
if(res.Length > f.Length)
|
||||
{
|
||||
res = f;
|
||||
}
|
||||
});
|
||||
|
||||
Console.WriteLine("Find file " + res);
|
||||
|
||||
if(!Directory.Exists("/var/result"))
|
||||
{
|
||||
Directory.CreateDirectory("/var/result");
|
||||
}
|
||||
|
||||
File.Copy(res, "/var/result/data.txt");
|
||||
|
||||
Console.WriteLine("Copy to /var/result/data.txt");
|
||||
|
@ -0,0 +1,10 @@
|
||||
{
|
||||
"profiles": {
|
||||
"ConsoleApp1": {
|
||||
"commandName": "Project"
|
||||
},
|
||||
"Container (Dockerfile)": {
|
||||
"commandName": "Docker"
|
||||
}
|
||||
}
|
||||
}
|
30
dozorova_alena_lab_2/ConsoleApp2/.dockerignore
Normal file
@ -0,0 +1,30 @@
|
||||
**/.classpath
|
||||
**/.dockerignore
|
||||
**/.env
|
||||
**/.git
|
||||
**/.gitignore
|
||||
**/.project
|
||||
**/.settings
|
||||
**/.toolstarget
|
||||
**/.vs
|
||||
**/.vscode
|
||||
**/*.*proj.user
|
||||
**/*.dbmdl
|
||||
**/*.jfm
|
||||
**/azds.yaml
|
||||
**/bin
|
||||
**/charts
|
||||
**/docker-compose*
|
||||
**/Dockerfile*
|
||||
**/node_modules
|
||||
**/npm-debug.log
|
||||
**/obj
|
||||
**/secrets.dev.yaml
|
||||
**/values.dev.yaml
|
||||
LICENSE
|
||||
README.md
|
||||
!**/.gitignore
|
||||
!.git/HEAD
|
||||
!.git/config
|
||||
!.git/packed-refs
|
||||
!.git/refs/heads/**
|
16
dozorova_alena_lab_2/ConsoleApp2/ConsoleApp2.csproj
Normal file
@ -0,0 +1,16 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
|
||||
<DockerfileContext>.</DockerfileContext>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.20.1" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
6
dozorova_alena_lab_2/ConsoleApp2/ConsoleApp2.csproj.user
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<ActiveDebugProfile>Container (Dockerfile)</ActiveDebugProfile>
|
||||
</PropertyGroup>
|
||||
</Project>
|
25
dozorova_alena_lab_2/ConsoleApp2/ConsoleApp2.sln
Normal file
@ -0,0 +1,25 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.10.35004.147
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleApp2", "ConsoleApp2.csproj", "{364FF6E2-3AED-4C3A-B2DD-D20CA9214BB8}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{364FF6E2-3AED-4C3A-B2DD-D20CA9214BB8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{364FF6E2-3AED-4C3A-B2DD-D20CA9214BB8}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{364FF6E2-3AED-4C3A-B2DD-D20CA9214BB8}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{364FF6E2-3AED-4C3A-B2DD-D20CA9214BB8}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {E5B491A6-064F-48E0-ACBD-E1B4FE3D0898}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
22
dozorova_alena_lab_2/ConsoleApp2/Dockerfile
Normal file
@ -0,0 +1,22 @@
|
||||
#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging.
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/runtime:6.0 AS base
|
||||
WORKDIR /app
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
|
||||
ARG BUILD_CONFIGURATION=Release
|
||||
WORKDIR /src
|
||||
COPY ["ConsoleApp2.csproj", "."]
|
||||
RUN dotnet restore "./ConsoleApp2.csproj"
|
||||
COPY . .
|
||||
WORKDIR "/src/."
|
||||
RUN dotnet build "./ConsoleApp2.csproj" -c $BUILD_CONFIGURATION -o /app/build
|
||||
|
||||
FROM build AS publish
|
||||
ARG BUILD_CONFIGURATION=Release
|
||||
RUN dotnet publish "./ConsoleApp2.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
|
||||
|
||||
FROM base AS final
|
||||
WORKDIR /app
|
||||
COPY --from=publish /app/publish .
|
||||
ENTRYPOINT ["dotnet", "ConsoleApp2.dll"]
|
16
dozorova_alena_lab_2/ConsoleApp2/Program.cs
Normal file
@ -0,0 +1,16 @@
|
||||
// Ищет набольшее число из файла /var/data/data.txt и сохраняет
|
||||
// его вторую степень в /var/result/result.txt.
|
||||
Console.WriteLine("Start second service");
|
||||
var data = File.ReadAllText("/var/data/data.txt").Split(" ").ToList();
|
||||
|
||||
var max = data.Select(x => Int32.TryParse(x, out int value) ? value : 0).Max();
|
||||
|
||||
Console.WriteLine("Find max value: "+max);
|
||||
if(!Directory.Exists("/var/result/"))
|
||||
{
|
||||
Directory.CreateDirectory("/var/result/");
|
||||
}
|
||||
|
||||
File.WriteAllText("/var/result/result.txt", Math.Pow(max, 2).ToString());
|
||||
|
||||
Console.WriteLine("Save to /var/result/result.txt");
|
@ -0,0 +1,10 @@
|
||||
{
|
||||
"profiles": {
|
||||
"ConsoleApp2": {
|
||||
"commandName": "Project"
|
||||
},
|
||||
"Container (Dockerfile)": {
|
||||
"commandName": "Docker"
|
||||
}
|
||||
}
|
||||
}
|
1
dozorova_alena_lab_2/FilesInput/First/0.txt
Normal file
@ -0,0 +1 @@
|
||||
52 32 22 57 23 30 63 22 27 32 10 0 58 40 83 86 21 87 84 27 44 31 59 35 37 57 21 97 87 7 23 89 27 35 55 9 14 35 59
|
1
dozorova_alena_lab_2/FilesInput/First/1.txt
Normal file
@ -0,0 +1 @@
|
||||
93 95 67 2 81 16 46 47 40 43 93 71 16 63 6 86 94 8 55 32 59 28 71 43 39 29 60 23 43 75 67 70 73 50 75 65 10 99 41
|
1
dozorova_alena_lab_2/FilesInput/First/10.txt
Normal file
@ -0,0 +1 @@
|
||||
48 88 38 25 7 96 34 30 92 34 97 0 81 41 94 85 4 82 77 23 41 8 78 93 38 12 27 55 97 46 20 52 88 54 35 72 62 28 43
|
1
dozorova_alena_lab_2/FilesInput/First/11.txt
Normal file
@ -0,0 +1 @@
|
||||
14 3 92 80 29 21 88 21 98 41 64 10 73 57 31 27 92 84 53 37 35 27 60 52 54 90 89 4 90 95 26 79 55 31 34 17 26 90 49
|