From 3b1c97cda77d50b1ff11b711ce597ed4efd0218a Mon Sep 17 00:00:00 2001 From: Rudolf Date: Fri, 20 Dec 2024 10:50:39 +0100 Subject: [PATCH] =?UTF-8?q?Deployment=20konfigurovateln=C3=BD=20na=20Docke?= =?UTF-8?q?r=20a=20norm=C3=A1ln=C3=AD=20instlaci.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Jenkinsfile | 2 +- ci/deploy.yaml | 363 ++++++++++++++-------------- ci/group_vars/all/main.yaml | 2 + ci/group_vars/prod/main.yaml | 18 ++ ci/group_vars/test/collecton.yaml | 7 + ci/group_vars/test/main.yaml | 3 + ci/prod | 17 ++ ci/templates/docker-compose.yaml.j2 | 8 +- ci/templates/nginx.conf.j2 | 37 +++ docs/Pywb/navrhy.md | 152 ++++++++++++ 10 files changed, 426 insertions(+), 183 deletions(-) create mode 100644 ci/group_vars/prod/main.yaml create mode 100644 ci/prod create mode 100644 ci/templates/nginx.conf.j2 create mode 100644 docs/Pywb/navrhy.md diff --git a/Jenkinsfile b/Jenkinsfile index 2dc5edd..389a45e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -54,7 +54,7 @@ pipeline { set -o pipefail # catch non-zero exit code in pipes # set -o xtrace # uncomment for bug hunting - # ssh -o "StrictHostKeyChecking=no" -i ${SSH_CREDS} ${SSH_CREDS_USR}@10.3.0.21 sudo /home/ansible/pywb/run-test.sh + ssh -o "StrictHostKeyChecking=no" -i ${SSH_CREDS} ${SSH_CREDS_USR}@10.3.0.21 sudo /home/pywb-test/run.sh # Následující vymřelo na nenalezení dockercopose # ssh -o "StrictHostKeyChecking=no" -i ${SSH_CREDS} ${SSH_CREDS_USR}@10.3.0.21 sudo /opt/pywb/run-test.sh ''' diff --git a/ci/deploy.yaml b/ci/deploy.yaml index 08a8630..ddcfe33 100644 --- a/ci/deploy.yaml +++ b/ci/deploy.yaml @@ -2,182 +2,187 @@ - name: PyWb Deployment hosts: all tasks: - - name: Ensure ACL installed to resolve permission issues - become: "{{ sudo | default(true) }}" - ansible.builtin.apt: - name: acl,nginx - state: present - - - name: Install virtualenv via pip - become: "{{ sudo | default(true) }}" - pip: - name: virtualenv - executable: pip3 - - - name: User running pywb - become: "{{ sudo | default(true) }}" - ansible.builtin.user: - name: "{{ owner }}" - comment: Web archive replay system - shell: /bin/bash - create_home: yes - - - name: "Prepare pywb operation directory" - become: "{{ sudo | default(true) }}" - file: - owner: "{{ owner | default(omit) }}" - group: "{{ group | default(omit) }}" - dest: "{{ item }}" - state: directory - loop: - - "{{ pywb_dir }}/venv" - - "{{ pywb_dir }}/uwsgi" - - - name: Install pywb - become: "{{ sudo | default(true) }}" - become_user: "{{ owner | default(omit) }}" - ansible.builtin.pip: - name: pywb, uwsgi - virtualenv: "{{ pywb_dir }}/venv" - - # - name: deploy nginx configuration for pywb-test - # become: "{{ sudo | default(true) }}" - # copy: - # dest: /etc/nginx/sites-available/pywb-test - # content: | - # server { - # listen 80; - # server_name pywb-test; - # location / { - # proxy_pass http://127.0.0.1:8080; - # } - # } - - - name: deploy nginx configuration for pywb-test - become: "{{ sudo | default(true) }}" - copy: - dest: /etc/nginx/sites-available/pywb-test - content: | - server { - listen 80; - - location /static { - alias {{ pywb_dir }}/venv/lib/python3.10/site-packages/pywb/static/; - } - - location / { - uwsgi_pass localhost:8081; - - include uwsgi_params; - uwsgi_param UWSGI_SCHEME $scheme; - } - } - - - name: deploy uwsgi configuration for pywb-test - become: "{{ sudo | default(true) }}" - copy: - dest: "{{ pywb_dir }}/uwsgi/uwsgi.ini" - content: | - [uwsgi] - if-not-env = PORT - http-socket = :8080 - socket = :8081 - endif = - - master = true - buffer-size = 65536 - die-on-term = true - - if-env = VIRTUAL_ENV - venv = $(VIRTUAL_ENV) - endif = - - gevent = 100 - - #Not available until uwsgi 2.1 - #monkey-patching manually in pywb.apps.wayback - #gevent-early-monkey-patch = - # for uwsgi<2.1, set env when using gevent - env = GEVENT_MONKEY_PATCH=1 - - # specify config file here - env = PYWB_CONFIG_FILE=config.yaml - #wsgi = pywb.apps.wayback - - # config to run pywb from a prefix - mount = /wayback={{ pywb_dir }}/venv/lib/python3.10/site-packages/pywb/apps/wayback.py - manage-script-name = true - - - name: set nginx configuration to pywb-test - become: "{{ sudo | default(true) }}" - file: - state: link - src: /etc/nginx/sites-available/pywb-test - dest: /etc/nginx/sites-enabled/default - - - name: reload nginx - become: "{{ sudo | default(true) }}" - service: - name: nginx - state: reloaded - - - name: "Deployment scripts & configurations" - become: "{{ sudo | default(true) }}" - template: - owner: "{{ owner | default(omit) }}" - group: "{{ group | default(omit) }}" - src: "{{ item.src }}" - dest: "{{ item.dest }}" - mode: u+x - loop: - - src: venv.sh - dest: "{{ pywb_dir }}/venv.sh" - - src: config.yaml - dest: "{{ pywb_dir }}/config.yaml" - - # - name: "Prepare configuration for static web." - # copy: - # dest: /home/ansible/seeder/static-nginx.conf - # content: | - # server { - # location /static/ { - # root /seeder; - # } - # location /media/ { - # root /seeder; - # } - - # # Increase max upload size to ~50MB - # client_max_body_size 53M; - - # listen 0.0.0.0:80; - # } - - # - name: "Deploy Docker Compose" - # template: - # src: "{{ item.src }}" - # dest: "{{ pywb_dir }}/{{ item.dest }}" - # loop: - # - src: docker-compose.yaml.j2 - # dest: docker-compose-{{ env }}.yaml - # - src: config.yaml - # dest: config.yaml - - # - name: "Deployment scripts" - # template: - # src: "{{ item.src }}" - # dest: "{{ item.dest }}" - # mode: u+x - # loop: - # - src: run.sh - # dest: "{{ pywb_dir }}/run-{{ env }}.sh" - # - src: stop.sh - # dest: "{{ pywb_dir }}/stop-{{ env }}.sh" - # - src: logs.sh - # dest: "{{ pywb_dir }}/logs-{{ env }}.sh" - # - src: exec.sh - # dest: "{{ pywb_dir }}/exec-{{ env }}.sh" - # - src: docker.sh - # dest: "{{ pywb_dir }}/docker-{{ env }}.sh" - # - src: wb-manager.sh - # dest: "{{ pywb_dir }}/wb-manager-{{ env }}.sh" + - name: Run pywb as Docker Image + when: pywb_deployment == 'docker' + block: + - name: "Deploy Docker Compose" + template: + src: "{{ item.src }}" + dest: "{{ pywb_dir }}/{{ item.dest }}" + loop: + - src: docker-compose.yaml.j2 + dest: docker-compose.yaml + - src: config.yaml + dest: config.yaml + - name: "Deployment scripts" + template: + src: "{{ item.src }}" + dest: "{{ item.dest }}" + mode: u+x + loop: + - src: run.sh + dest: "{{ pywb_dir }}/run.sh" + - src: stop.sh + dest: "{{ pywb_dir }}/stop.sh" + - src: logs.sh + dest: "{{ pywb_dir }}/logs.sh" + - src: exec.sh + dest: "{{ pywb_dir }}/exec.sh" + - src: docker.sh + dest: "{{ pywb_dir }}/docker.sh" + - src: wb-manager.sh + dest: "{{ pywb_dir }}/wb-manager.sh" + + - name: Install pywb locally (without Docker) + when: pywb_deployment == 'normal' + block: + - name: Ensure ACL installed to resolve permission issues + become: "{{ sudo | default(true) }}" + ansible.builtin.apt: + name: acl,nginx + state: present + + - name: Install virtualenv via pip + become: "{{ sudo | default(true) }}" + pip: + name: virtualenv + executable: pip3 + + - name: User running pywb + become: "{{ sudo | default(true) }}" + ansible.builtin.user: + name: "{{ owner }}" + comment: Web archive replay system + shell: /bin/bash + create_home: yes + + - name: "Prepare pywb operation directory" + become: "{{ sudo | default(true) }}" + file: + owner: "{{ owner | default(omit) }}" + group: "{{ group | default(omit) }}" + dest: "{{ item }}" + state: directory + loop: + - "{{ pywb_dir }}/venv" + - "{{ pywb_dir }}/uwsgi" + + - name: Install pywb + become: "{{ sudo | default(true) }}" + become_user: "{{ owner | default(omit) }}" + ansible.builtin.pip: + name: pywb, uwsgi + virtualenv: "{{ pywb_dir }}/venv" + + # - name: deploy nginx configuration for pywb-test + # become: "{{ sudo | default(true) }}" + # copy: + # dest: /etc/nginx/sites-available/pywb-test + # content: | + # server { + # listen 80; + # server_name pywb-test; + # location / { + # proxy_pass http://127.0.0.1:8080; + # } + # } + + - name: deploy nginx configuration for pywb-test + become: "{{ sudo | default(true) }}" + copy: + dest: /etc/nginx/sites-available/pywb-test + content: | + server { + listen 80; + + location /static { + alias {{ pywb_dir }}/venv/lib/python3.10/site-packages/pywb/static/; + } + + location / { + uwsgi_pass localhost:8081; + + include uwsgi_params; + uwsgi_param UWSGI_SCHEME $scheme; + } + } + + - name: deploy uwsgi configuration for pywb-test + become: "{{ sudo | default(true) }}" + copy: + dest: "{{ pywb_dir }}/uwsgi/uwsgi.ini" + content: | + [uwsgi] + if-not-env = PORT + http-socket = :8080 + socket = :8081 + endif = + + master = true + buffer-size = 65536 + die-on-term = true + + if-env = VIRTUAL_ENV + venv = $(VIRTUAL_ENV) + endif = + + gevent = 100 + + #Not available until uwsgi 2.1 + #monkey-patching manually in pywb.apps.wayback + #gevent-early-monkey-patch = + # for uwsgi<2.1, set env when using gevent + env = GEVENT_MONKEY_PATCH=1 + + # specify config file here + env = PYWB_CONFIG_FILE=config.yaml + #wsgi = pywb.apps.wayback + + # config to run pywb from a prefix + mount = /wayback={{ pywb_dir }}/venv/lib/python3.10/site-packages/pywb/apps/wayback.py + manage-script-name = true + + - name: set nginx configuration to pywb-test + become: "{{ sudo | default(true) }}" + file: + state: link + src: /etc/nginx/sites-available/pywb-test + dest: /etc/nginx/sites-enabled/default + + - name: reload nginx + become: "{{ sudo | default(true) }}" + service: + name: nginx + state: reloaded + + - name: "Deployment scripts & configurations" + become: "{{ sudo | default(true) }}" + template: + owner: "{{ owner | default(omit) }}" + group: "{{ group | default(omit) }}" + src: "{{ item.src }}" + dest: "{{ item.dest }}" + mode: u+x + loop: + - src: venv.sh + dest: "{{ pywb_dir }}/venv.sh" + - src: config.yaml + dest: "{{ pywb_dir }}/config.yaml" + + # - name: "Prepare configuration for static web." + # copy: + # dest: /home/ansible/seeder/static-nginx.conf + # content: | + # server { + # location /static/ { + # root /seeder; + # } + # location /media/ { + # root /seeder; + # } + + # # Increase max upload size to ~50MB + # client_max_body_size 53M; + + # listen 0.0.0.0:80; + # } diff --git a/ci/group_vars/all/main.yaml b/ci/group_vars/all/main.yaml index e69de29..b5f608e 100644 --- a/ci/group_vars/all/main.yaml +++ b/ci/group_vars/all/main.yaml @@ -0,0 +1,2 @@ +# Choose Docker or Normal pywb deployment. Normal is not finished. +pywb_deployment: docker diff --git a/ci/group_vars/prod/main.yaml b/ci/group_vars/prod/main.yaml new file mode 100644 index 0000000..2e6ff4c --- /dev/null +++ b/ci/group_vars/prod/main.yaml @@ -0,0 +1,18 @@ +# Environment - is it production, test or local development? +env: test + +treafik_host_routing: pywb.webarchiv.cz + +# Directory where pywb is installed +# pywb_dir: /home/ansible/pywb + +# Who owns directories & files +# owner: ansible +# group: ansible + +# Directory where pywb is installed +pywb_dir: /home/pywb-prod + +# Who owns directories & files +owner: pywb-prod +group: pywb-prod diff --git a/ci/group_vars/test/collecton.yaml b/ci/group_vars/test/collecton.yaml index 322a500..d34f07e 100644 --- a/ci/group_vars/test/collecton.yaml +++ b/ci/group_vars/test/collecton.yaml @@ -1,6 +1,13 @@ collection: # Collection provides archive to collection mapping - /mnt/index/collections:/webarchive/collections + # - /mnt/archive/24/topics/Topics-2024-04-T-CUNI-MagistratHlMPrahy-NarArchiv-BedrichSmetana-VolbyDoEU2024:/webarchive/collections/archive/Topics-2024-06-VolbyDoEU/Topics-2024-04-T-CUNI-MagistratHlMPrahy-NarArchiv-BedrichSmetana-VolbyDoEU2024 + # - /mnt/archive/24/topics/Topics-2024-04-T-CUNI-MagistratHlMPrahy-NarArchiv-BedrichSmetana-VolbyDoEU2024-2:/webarchive/collections/archive/Topics-2024-06-VolbyDoEU/Topics-2024-04-T-CUNI-MagistratHlMPrahy-NarArchiv-BedrichSmetana-VolbyDoEU2024-2 + # - /mnt/archive/24/topics/Topics-2024-04-T-CUNI-MagistratHlMPrahy-NarArchiv-BedrichSmetana-VolbyDoEU2024-3:/webarchive/collections/archive/Topics-2024-06-VolbyDoEU/Topics-2024-04-T-CUNI-MagistratHlMPrahy-NarArchiv-BedrichSmetana-VolbyDoEU2024-3 + # - /mnt/archive/24/topics/Topics-2024-06-VolbyDoEU2:/webarchive/collections/archive/Topics-2024-06-VolbyDoEU/Topics-2024-06-VolbyDoEU2 + # - /mnt/archive/24/topics/Topics-2024-06-VolbyDoEU3:/webarchive/collections/archive/Topics-2024-06-VolbyDoEU/Topics-2024-06-VolbyDoEU3 + # - /mnt/archive/24/topics/Topics-2024-06-VolbyDoEU-MistrovstviSvetaVHokeji:/webarchive/collections/archive/Topics-2024-06-VolbyDoEU/Topics-2024-06-VolbyDoEU-MistrovstviSvetaVHokeji + # always mount the archive directory as read-only - /mnt/archive:/mnt/archive:ro # pywb configuration diff --git a/ci/group_vars/test/main.yaml b/ci/group_vars/test/main.yaml index 935138f..2aaa1e5 100644 --- a/ci/group_vars/test/main.yaml +++ b/ci/group_vars/test/main.yaml @@ -1,5 +1,8 @@ # Environment - is it production, test or local development? env: test + +treafik_host_routing: test.pywb.webarchiv.cz + # Directory where pywb is installed # pywb_dir: /home/ansible/pywb diff --git a/ci/prod b/ci/prod new file mode 100644 index 0000000..a96dd71 --- /dev/null +++ b/ci/prod @@ -0,0 +1,17 @@ +--- +test: + hosts: + wa-pywb-prod: + ansible_host: 10.3.0.21 + vars: + # seeder_docker_tag: develop + # seeder_db_host: seeder_db + # seeder_db_name: seeder + # seeder_db_user: seeder + # seeder_db_pass: "{{ seeder_db_pass_vault }}" + # seeder_django_allowed_hosts: app.webarchiv.cz + # seeder_django_debug: "False" + # treafik_seeder_rule: "Host(`app.webarchiv.cz`)" + # treafik_seeder_static_rule: "Host(`app.webarchiv.cz`) && (PathPrefix(`/static`) || PathPrefix(`/media`))" + # treafik_seeder_vyvoj_rule: "Host(`app.webarchiv.cz`) && PathPrefix(`/vyvoj`)" + # treafik_api_rule: "Host(`wa-dev-docker00`) || Host(`10.3.0.110`)" diff --git a/ci/templates/docker-compose.yaml.j2 b/ci/templates/docker-compose.yaml.j2 index ea77a08..6f4b04d 100644 --- a/ci/templates/docker-compose.yaml.j2 +++ b/ci/templates/docker-compose.yaml.j2 @@ -1,3 +1,5 @@ +version: '3.0' + services: reverse-proxy: # The official v2 Traefik docker image @@ -6,9 +8,9 @@ services: command: --api.insecure=true --providers.docker ports: # The HTTP port - - "443:80" + - "80:80" # The Web UI (enabled by --api.insecure=true) - - "80:8080" + - "443:8080" volumes: # So that Traefik can listen to the Docker events - /var/run/docker.sock:/var/run/docker.sock @@ -20,7 +22,7 @@ services: - "{{ path }}" {% endfor %} labels: - - "traefik.http.routers.pywb.rule=Host(`whoami.docker.localhost`) || Host(`10.3.0.21`) || Host(`localhost`)" + - "traefik.http.routers.pywb.rule=Host(`whoami.docker.localhost`) || Host(`10.3.0.21`) || Host(`localhost`) || Host(`{{ treafik_host_routing }}`) " # whoami: # # A container that exposes an API to show its IP address # image: traefik/whoami diff --git a/ci/templates/nginx.conf.j2 b/ci/templates/nginx.conf.j2 new file mode 100644 index 0000000..375c789 --- /dev/null +++ b/ci/templates/nginx.conf.j2 @@ -0,0 +1,37 @@ +# nginx config for running under /wayback/ prefix + +# set acl_user, defaulting to empty (any public user) +geo $acl_user { + # ensure user is set to empty by default + default ""; + + # optional: add IP ranges to allow privileged access + 127.0.0.1 "staff"; + 192.168.0.0/24 "staff"; +} + + + +server { + listen 80; + + # optinal: optimization to have nginx serve static assets + location /wayback/static { + alias /pywb/pywb/static; + } + + # required: pywb with prefix + location /wayback/ { + resolver 127.0.0.1; + + uwsgi_pass pywb:8081; + uwsgi_buffer_size 8k; + + + include uwsgi_params; + uwsgi_param UWSGI_SCHEME $scheme; + + # pass acl_user (which should be empty by default) + uwsgi_param HTTP_X_PYWB_ACL_USER $acl_user; + } +} diff --git a/docs/Pywb/navrhy.md b/docs/Pywb/navrhy.md new file mode 100644 index 0000000..4d01f73 --- /dev/null +++ b/docs/Pywb/navrhy.md @@ -0,0 +1,152 @@ +# Změnové návrhy pro rok 2025 + +## Nová abstrakce pro tématické kolekci + +Tématická sklizeň je sada sklizní, která vytváří jednu kolekci. + +### Současný stav + +``` +- /mnt/archive + - /topics + # Tématická sklizeň 2024-CUNI + - /mnt/archive/24/topics/Topics-2024-01-T-CUNI-MagistratHlMPrahy-NarArchiv-MilanKundera-UtokNaFilozofickeFakulteUK + - /mnt/archive/24/topics/Topics-2024-02-T-CUNI-MagistratHlMPrahy-NarArchiv-UtokNaFilozofickeFakulteUK-DezinfoWeby-10WebuProVecnost + - /mnt/archive/24/topics/Topics-2024-03-T-CUNI-MagistratHlMPrahy-NarArchiv + - /mnt/archive/24/topics/Topics-2024-04-T-CUNI-MagistratHlMPrahy-NarArchiv-BedrichSmetana-VolbyDoEU2024 + - /mnt/archive/24/topics/Topics-2024-04-T-CUNI-MagistratHlMPrahy-NarArchiv-BedrichSmetana-VolbyDoEU2024-2 + - /mnt/archive/24/topics/Topics-2024-04-T-CUNI-MagistratHlMPrahy-NarArchiv-BedrichSmetana-VolbyDoEU2024-3 + - /mnt/archive/24/topics/Topics-2024-05-CUNI-MagistratHlMPrahy-NarArchiv-ErotAPorno-Rajce-SlevyLetaky + - /mnt/archive/24/topics/Topics-2024-05-CUNI-MagistratHlMPrahy-NarArchiv-ErotAPorno-Rajce-SlevyLetaky-2 + - /mnt/archive/24/topics/Topics-2024-06-CUNI-MagistratHlMPrahy-NarArchiv-Webzdarma-RizikoveWeby + - /mnt/archive/24/topics/Topics-2024-06-CUNI-MagistratHlMPrahy-NarArchiv-Webzdarma-RizikoveWeby-2 + + # Tématická sklizeň 2024-WikiSources + - /mnt/archive/24/topics/Topics-2024-01-T-WikiSources + - /mnt/archive/24/topics/Topics-2024-01-T-WikiSources-- 2 + + # Tématická sklizeň Covid19-ValkaNaUkrajine + - /mnt/archive/24/topics/Topics-2024-02-T-Covid19-ValkaNaUkrajine + - /mnt/archive/24/topics/Topics-2024-03-T-Covid19-ValkaNaUkrajine + - /mnt/archive/24/topics/Topics-2024-04-T-Covid19-ValkaNaUkrajine + - /mnt/archive/24/topics/Topics-2024-05-T-Covid19-ValkaNaUkrajine + - /mnt/archive/24/topics/Topics-2024-06-T-Covid19-ValkaNaUkrajine + +``` + +### Navrhovaný stav A + +#### Souborý Systém +```yaml +/mnt/index/collections: + - "2024-06-VolbyDoEU" + - "archive/archive-paths.txt" + - "index/index.cdxj" + - 2024-Covid19-ValkaNaUkrajine + - "archive/archive-paths.txt" + - "index/index.cdxj" + - 2024-CUNI + - "archive/archive-paths.txt" + - "index/index.cdxj" + - 2024-WikiSources + - "archive/archive-paths.txt" + - "index/index.cdxj" +``` +#### Docker-compose +```yaml +volumes: + - /mnt/index/collections:/webarchive/collections + - /mnt/archive:/mnt/archive:ro +``` +#### Pohled z kontejneru +```yaml +/webarchive/collections: + - "2024-06-VolbyDoEU" + - "archive/archive-paths.txt" + - "index/index.cdxj" + - 2024-Covid19-ValkaNaUkrajine + - "archive/archive-paths.txt" + - "index/index.cdxj" + - 2024-CUNI + - "archive/archive-paths.txt" + - "index/index.cdxj" + - 2024-WikiSources + - "archive/archive-paths.txt" + - "index/index.cdxj" + +/mnt/archive: + - "05" + - "06" + - "07" + - "..." + - "24" + +``` + +#### Obsah archive-paths.txt +```yaml +``` + +### Navrhovaný stav B + +``` +- /mnt/archive + - /topics + - /CUNI + - /mnt/archive/24/topics/Topics-2024-01-T-CUNI-MagistratHlMPrahy-NarArchiv-MilanKundera-UtokNaFilozofickeFakulteUK + - /mnt/archive/24/topics/Topics-2024-02-T-CUNI-MagistratHlMPrahy-NarArchiv-UtokNaFilozofickeFakulteUK-DezinfoWeby-10WebuProVecnost + - /mnt/archive/24/topics/Topics-2024-03-T-CUNI-MagistratHlMPrahy-NarArchiv + - /mnt/archive/24/topics/Topics-2024-04-T-CUNI-MagistratHlMPrahy-NarArchiv-BedrichSmetana-VolbyDoEU2024 + - /mnt/archive/24/topics/Topics-2024-04-T-CUNI-MagistratHlMPrahy-NarArchiv-BedrichSmetana-VolbyDoEU2024-2 + - /mnt/archive/24/topics/Topics-2024-04-T-CUNI-MagistratHlMPrahy-NarArchiv-BedrichSmetana-VolbyDoEU2024-3 + - /mnt/archive/24/topics/Topics-2024-05-CUNI-MagistratHlMPrahy-NarArchiv-ErotAPorno-Rajce-SlevyLetaky + - /mnt/archive/24/topics/Topics-2024-05-CUNI-MagistratHlMPrahy-NarArchiv-ErotAPorno-Rajce-SlevyLetaky-2 + - /mnt/archive/24/topics/Topics-2024-06-CUNI-MagistratHlMPrahy-NarArchiv-Webzdarma-RizikoveWeby + - /mnt/archive/24/topics/Topics-2024-06-CUNI-MagistratHlMPrahy-NarArchiv-Webzdarma-RizikoveWeby-2 + - /WikiSources + - /mnt/archive/24/topics/Topics-2024-01-T-WikiSources + - /mnt/archive/24/topics/Topics-2024-01-T-WikiSources-- 2 + + - /Covid19-ValkaNaUkrajine + - /mnt/archive/24/topics/Topics-2024-02-T-Covid19-ValkaNaUkrajine + - /mnt/archive/24/topics/Topics-2024-03-T-Covid19-ValkaNaUkrajine + - /mnt/archive/24/topics/Topics-2024-04-T-Covid19-ValkaNaUkrajine + - /mnt/archive/24/topics/Topics-2024-05-T-Covid19-ValkaNaUkrajine + - /mnt/archive/24/topics/Topics-2024-06-T-Covid19-ValkaNaUkrajine + +``` + +### Odůvodnění 2 + +V současném nastavení je potřeba mapovat tématické sklizně takto: + +``` +volume_to_collection_mapping: + # Collections of Topics + ## 2024-WikiSources + ### Index + - /mnt/index/topics/2024-WikiSources/:/webarchive/collections/2024-WikiSources/indexes/ + ### Archives + - /mnt/archive/24/topics/Topics-2024-01-T-WikiSources:/webarchive/collections/2024-WikiSources/archive/Topics-2024-01-T-WikiSources + - /mnt/archive/24/topics/Topics-2024-01-T-WikiSources-2:/webarchive/collections/2024-WikiSources/archive/Topics-2024-01-T-WikiSources-2 + - /mnt/archive/23/topics/Topics-2023-12-T-WikiSources:/webarchive/collections/2023-WikiSources/archive/Topics-2023-12-T-WikiSources // tuhle sklizeň jsme si vymyslel pro ilustraci kolekce napříč roky +``` + +Po změně bude možné mapovat tématické sklizně takto: + +``` +volume_to_collection_mapping: + # Collections of Topics + ## WikiSources + ### Index + - /mnt/index/topics/2024-WikiSources/:/webarchive/collections/2024-WikiSources/indexes/ + ### Archives + - /mnt/archive/24/topics/WikiSources:/webarchive/collections/WikiSources/archive/ + - /mnt/archive/23/topics/WikiSources:/webarchive/collections/WikiSources/archive/ // tuhle sklizeň jsme si vymyslel pro ilustraci kolekce napříč roky + +``` + +Výhody: + +- Vše co co je přidáno do existující kolekce, může být reindexováno bez akutalizace kolekce v kódu +- Snadnější a čitelnější mapování kolekcí v Docker-compose