diff --git a/README.md b/README.md index 4e65c3b1..2bc1f880 100644 --- a/README.md +++ b/README.md @@ -19,8 +19,27 @@ As a last step texts can be loaded into an information retrieval system to query ## Configuration and startup 1. **Create Docker swarm:** + +The following part is for **users** and not the development team. The development team uses a script which sets up a local development swarm. + The generated computational workload is handled by a [Docker](https://docs.docker.com/) swarm. A swarm is a group of machines that are running Docker and joined into a cluster. It consists out of two different kinds of members, managers and workers. Currently it is not possible to specify a dedicated Docker host, instead Opaque expects the executing system to be a swarm manager of a cluster with at least one dedicated worker machine. The swarm setup process is described best in the [Docker documentation](https://docs.docker.com/engine/swarm/swarm-tutorial/). + +The dev team can use dind_swarm_setup.sh. If the workers cannot join the manager node. Try opening the following ports using the ubuntu firewall ufw: +```bash +sudo ufw allow 2376/tcp \ +&& sudo ufw allow 7946/udp \ +&& sudo ufw allow 7946/tcp \ +&& sudo ufw allow 80/tcp \ +&& sudo ufw allow 2377/tcp \ +&& sudo ufw allow 4789/udp + +sudo ufw reload && sudo ufw enable +sudo systemctl restart docker +``` + 2. **Create a network storage:** +The dind_swarm_setup.sh script handles this step for the dev team aswell. + A shared network space is necessary so that all swarm members have access to all the data. To achieve this a [Samba](https://www.samba.org/) can be used. ``` bash # Example: Create a Samba share via Docker @@ -55,7 +74,7 @@ $ nopaque.env # Fill out the empty variables within this file. ``` bash # Execute the following 3 steps only on first startup $ docker-compose run web flask db upgrade -$ docker-compose run web flask db insert-initial-database-entries +$ docker-compose run web flask insert-initial-database-entries $ docker-compose down $ docker-compose up diff --git a/app/static/css/nopaque.css b/app/static/css/nopaque.css index e291c03b..c1c999ad 100644 --- a/app/static/css/nopaque.css +++ b/app/static/css/nopaque.css @@ -101,9 +101,6 @@ indicator will show up how the column is sorted right now.; */ .service[data-service]:before { content: "help"; } -.service[data-service="corpus"]:before { - content: "book"; -} .service[data-service="setup_files"]:before { content: "burst_mode"; } diff --git a/app/static/js/nopaque.lists.js b/app/static/js/nopaque.lists.js index ba61b8d4..683f36e1 100644 --- a/app/static/js/nopaque.lists.js +++ b/app/static/js/nopaque.lists.js @@ -1,7 +1,13 @@ class RessourceList extends List { - constructor(idOrElement, subscriberList, dataMapper=null, options={}) { - super(idOrElement, {...RessourceList.options, ...options}); - this.dataMapper = dataMapper; + constructor(idOrElement, subscriberList, type, options={}) { + if (!['corpus', 'job'].includes(type)) { + console.error("Unknown Type!"); + return; + } + super(idOrElement, {...RessourceList.options['common'], + ...RessourceList.options[type], + ...options}); + this.type = type; subscriberList.push(this); } @@ -43,19 +49,15 @@ class RessourceList extends List { addRessources(ressources) { - if (this.dataMapper) { - this.add(ressources.map(x => this.dataMapper(x))); - } else { - this.add(ressources); - } + this.add(ressources.map(x => RessourceList.dataMapper[this.type](x))); } } RessourceList.dataMapper = { corpus: corpus => ({creation_date: corpus.creation_date, description: corpus.description, id: corpus.id, - link: `/corpora/${corpus.id}`, - service: "corpus", + "analyse-link": `/corpora/${corpus.id}/analyse`, + "edit-link": `/corpora/${corpus.id}`, status: corpus.status, title: corpus.title}), job: job => ({creation_date: job.creation_date, @@ -67,32 +69,53 @@ RessourceList.dataMapper = { title: job.title}) }; RessourceList.options = { - item: ` - - - - - - -
- - - - - - - Viewsend - - `, - page: 4, - pagination: {innerWindow: 8, outerWindow: 1}, - valueNames: ["creation_date", - "description", - "title", - {data: ["id"]}, - {name: "link", attr: "href"}, - {name: "service", attr: "data-service"}, - {name: "status", attr: "data-status"}]}; + common: {page: 4, pagination: {innerWindow: 8, outerWindow: 1}}, + corpus: {item: ` + + + book + + + +
+ + + + + + + edit + Analysesearch + + `, + valueNames: ["creation_date", "description", "title", + {data: ["id"]}, + {name: "analyse-link", attr: "href"}, + {name: "edit-link", attr: "href"}, + {name: "status", attr: "data-status"}]}, + job: {item: ` + + + + + + +
+ + + + + + + Viewsend + + `, + valueNames: ["creation_date", "description", "title", + {data: ["id"]}, + {name: "link", attr: "href"}, + {name: "service", attr: "data-service"}, + {name: "status", attr: "data-status"}]} +}; class ResultList extends List { diff --git a/app/templates/admin/user.html.j2 b/app/templates/admin/user.html.j2 index d50bf843..e4e24b6f 100644 --- a/app/templates/admin/user.html.j2 +++ b/app/templates/admin/user.html.j2 @@ -103,8 +103,9 @@ {% endblock %} diff --git a/app/templates/corpora/corpus.html.j2 b/app/templates/corpora/corpus.html.j2 index b1156a6c..b6058be5 100644 --- a/app/templates/corpora/corpus.html.j2 +++ b/app/templates/corpora/corpus.html.j2 @@ -7,7 +7,20 @@

{{ corpus.title }}

{{ corpus.description }}

- +
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -150,8 +163,12 @@ } setStatus(status) { - let analyseBtn, statusElement; + let analyseBtn, progressIndicator, statusElement; + if (status != "preparable" && status != "preparing") { + progressIndicator = document.getElementById("progress-indicator"); + progressIndicator.classList.add("hide"); + } statusElement = document.getElementById("status"); statusElement.dataset.status = status; analyseBtn = document.getElementById('analyse'); diff --git a/app/templates/jobs/job.html.j2 b/app/templates/jobs/job.html.j2 index ed01f3eb..77ea9a5d 100644 --- a/app/templates/jobs/job.html.j2 +++ b/app/templates/jobs/job.html.j2 @@ -2,156 +2,131 @@ {% set full_width = False %} {% set roadmap = False %} +{% set title_override = 'Job'.format(service=job.service) %} {% block page_content %}

{{ job.title }}

{{ job.description }}

- +
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
- Chronometrics -
-
-
- - +
-
- -
-

Input and result files

-
- -
-
-
- Filewise - - - - - - - - - {% for input in job.inputs %} - - - - - {% endfor %} - -
FilenameDownload
{{ input.filename }} - - file_download - -
-
-
-
- -
-
-
- Bundled - - - - - - - - -
BundlenameDownload
-
-
-
- - -
-
-
- Files - - - - - - - - - {% for input in job.inputs %} - - - - - - {% endfor %} - -
FilenameDownload
{{ input.filename }} - - file_download - -
-
-
+ +
@@ -159,7 +134,7 @@