From 0c43673e4ba64e1dff038a2336aa4cbfc2a07aad Mon Sep 17 00:00:00 2001 From: Tim Date: Mon, 29 Jul 2024 13:07:21 +0200 Subject: [PATCH 01/39] removed webpack dependency and background_jobs endpoint --- application/requirements.txt | 18 ++++--- application/src/django_admin/settings.py | 9 ---- application/src/tira/endpoints/admin_api.py | 1 + application/src/tira/endpoints/vm_api.py | 1 + .../tira/templates/tira/background_jobs.html | 48 ------------------- application/src/tira/urls.py | 2 - application/src/tira/views.py | 12 ----- application/test/api_access_matrix.py | 22 --------- application/test/settings_test.py | 9 ---- 9 files changed, 10 insertions(+), 112 deletions(-) delete mode 100644 application/src/tira/templates/tira/background_jobs.html diff --git a/application/requirements.txt b/application/requirements.txt index ab27b754a..739649bb6 100644 --- a/application/requirements.txt +++ b/application/requirements.txt @@ -1,30 +1,28 @@ grpcio>=1.53.2 # grpcio-tools==1.36.1 # still needed? protobuf<4.0dev -pyuwsgi Django pyyaml requests randomname tqdm -mysql mysqlclient -django-webpack-loader==0.6.0 python-gitlab GitPython python-slugify -git+https://github.com/allenai/ir_datasets +# git+https://github.com/allenai/ir_datasets git+https://github.com/mam10eks/diffir pandas markdown PyGithub==1.59.1 -ghapi -parameterized -mockito -approvaltests==7.3.0 django-extensions -coverage -coverage-badge discourse-client-in-disraptor==0.0.8 tira>=0.0.97 huggingface-hub + +# Test & Dev dependencies: +approvaltests==7.3.0 +parameterized +mockito +coverage +coverage-badge \ No newline at end of file diff --git a/application/src/django_admin/settings.py b/application/src/django_admin/settings.py index 4abc92728..b6b8a5439 100644 --- a/application/src/django_admin/settings.py +++ b/application/src/django_admin/settings.py @@ -73,7 +73,6 @@ 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', - 'webpack_loader', ] MIDDLEWARE = [ @@ -332,14 +331,6 @@ def logger_config(log_dir: Path): STATIC_ROOT = "/var/www/public" -WEBPACK_LOADER = { - 'DEFAULT': { - 'CACHE': DEBUG, - 'BUNDLE_DIR_NAME': '/bundles/', - 'STATS_FILE': BASE_DIR / 'tira' / 'frontend' / 'webpack-stats.json' - } -} - DISCOURSE_API_URL = 'https://www.tira.io' PUBLIC_TRAINING_DATA = set(['jena-topics-20231026-test', 'leipzig-topics-20231025-test']) diff --git a/application/src/tira/endpoints/admin_api.py b/application/src/tira/endpoints/admin_api.py index 7e217d61d..b541ec855 100644 --- a/application/src/tira/endpoints/admin_api.py +++ b/application/src/tira/endpoints/admin_api.py @@ -376,6 +376,7 @@ def admin_import_ir_dataset(request, task_id): model.add_evaluator(master_vm_id, task_id, ds['dataset_id'], evaluator_command, working_directory, not measures, is_git_runner, git_runner_image, git_runner_command, git_repository_id) + # TODO: what is the up-to-date href for background_jobs? try: process_id = run_irds_command(ds['task'], ds['dataset_id'], ds['irds_docker_image'], ds['irds_import_command'], dataset_path, ds['irds_import_truth_command'], dataset_truth_path) return JsonResponse({'status': 0, 'context': ds, 'message': 'Imported dataset successfull.', diff --git a/application/src/tira/endpoints/vm_api.py b/application/src/tira/endpoints/vm_api.py index f7cc22da6..07d3ccc91 100644 --- a/application/src/tira/endpoints/vm_api.py +++ b/application/src/tira/endpoints/vm_api.py @@ -900,6 +900,7 @@ def run_execute_docker_software(request, task_id, vm_id, dataset_id, docker_soft visit_job_message = 'Failed to start job.' + # TODO: what is a new URL for that? if background_process: visit_job_message = f'Please visit https://tira.io/background_jobs/{task_id}/{background_process} ' + \ ' to view the progress of the job that creates the rerank output.' diff --git a/application/src/tira/templates/tira/background_jobs.html b/application/src/tira/templates/tira/background_jobs.html deleted file mode 100644 index b894ac7e5..000000000 --- a/application/src/tira/templates/tira/background_jobs.html +++ /dev/null @@ -1,48 +0,0 @@ -{% extends 'tira/base.html' %} -{% load render_bundle from webpack_loader %} -{% block title %}TIRA{% endblock %} -{% block navbar %}{% include "tira/navbar.html" with nav_active='tasks' %}{% endblock %} - -{% block content %} -{% csrf_token %} - -{% if include_navigation %} - - - -{% endif %} - - - - - -
- -
- -
-
-

TIRA — Background Job: {{job.title}}

- - If your job is finished (i.e., you see the output that you expect and there is an success exit code of 0), please go back to your task /task/{{task}}. - Please refresh the page to see updates. - -

Metadata

-
    -
  • Last Contact to the Job: {{job.last_contact}}
  • -
  • Exit code: {{job.exit_code}}
  • -
- -

Stdout/Stderr of the job

-
-        {{job.stdout}}
-        
-
- -
- -{% endblock %} - - - diff --git a/application/src/tira/urls.py b/application/src/tira/urls.py index 4ec2c7e48..3f3faecb1 100644 --- a/application/src/tira/urls.py +++ b/application/src/tira/urls.py @@ -4,8 +4,6 @@ from .endpoints import organizer_api, admin_api, vm_api, data_api, diffir_api, serp_api urlpatterns = [ - path('background_jobs//', views.background_jobs, name='background_jobs'), - path('task//user//dataset//download/.zip', views.download_rundir, name='download_rundir'), path('data-download/git-repo-template//.zip', views.download_repo_template, name='download_repo_template'), path('data-download///.zip', views.download_datadir, name='download_datadir'), diff --git a/application/src/tira/views.py b/application/src/tira/views.py index d2b00d10f..928197289 100644 --- a/application/src/tira/views.py +++ b/application/src/tira/views.py @@ -1,4 +1,3 @@ -from django.shortcuts import render, redirect from django.template.loader import render_to_string from django.http import JsonResponse, FileResponse from django.conf import settings @@ -8,12 +7,10 @@ import logging import tira.tira_model as model -from .tira_data import get_run_runtime, get_run_file_list, get_stderr, get_stdout, get_tira_log from .authentication import auth from .checks import check_permissions, check_resources_exist, check_conditional_permissions from .forms import * from pathlib import Path -from datetime import datetime as dt import os import zipfile import json @@ -45,15 +42,6 @@ def func_wrapper(request, *args, **kwargs): return func_wrapper -@check_permissions -@add_context -def background_jobs(request, context, task_id, job_id): - context['task'] = task_id - context['job'] = model.get_job_details(task_id, None, job_id) - - return render(request, 'tira/background_jobs.html', context) - - def _add_task_to_context(context, task_id, dataset_id): datasets = model.get_datasets_by_task(task_id) diff --git a/application/test/api_access_matrix.py b/application/test/api_access_matrix.py index d28cd31fa..e10f50dab 100644 --- a/application/test/api_access_matrix.py +++ b/application/test/api_access_matrix.py @@ -425,28 +425,6 @@ ORGANIZER_WRONG_TASK: 405, }, ), - route_to_test( - url_pattern='background_jobs//', - params={'task_id': 'does-not-exist', 'job_id': -1}, - group_to_expected_status_code={ - ADMIN: 200, - GUEST: 405, - PARTICIPANT: 405, - ORGANIZER: 405, - ORGANIZER_WRONG_TASK: 405, - }, - ), - route_to_test( - url_pattern='background_jobs//', - params={'task_id': 'task-of-organizer-1', 'job_id': -1}, - group_to_expected_status_code={ - ADMIN: 200, - GUEST: 405, - PARTICIPANT: 405, - ORGANIZER: 200, - ORGANIZER_WRONG_TASK: 405, - }, - ), route_to_test( url_pattern='task//vm//add_software/vm', params={'task_id': 'shared-task-1', 'vm_id': 'example_participant'}, diff --git a/application/test/settings_test.py b/application/test/settings_test.py index c80a69946..a32255db5 100644 --- a/application/test/settings_test.py +++ b/application/test/settings_test.py @@ -67,7 +67,6 @@ 'django.contrib.messages', 'django.contrib.staticfiles', 'django_extensions', - 'webpack_loader', ] MIDDLEWARE = [ @@ -309,14 +308,6 @@ def logger_config(log_dir: Path): STATIC_ROOT = "/var/www/public" -WEBPACK_LOADER = { - 'DEFAULT': { - 'CACHE': DEBUG, - 'BUNDLE_DIR_NAME': '/bundles/', - 'STATS_FILE': BASE_DIR / "src" / 'tira' / 'frontend' / 'webpack-stats.json' - } -} - TIREX_COMPONENTS = yaml.load(open(BASE_DIR / 'src' / 'tirex-components.yml').read(), Loader=yaml.FullLoader) GIT_CI_AVAILABLE_RESOURCES = { From 297c54fb549111a6916cbc87fc15563af74ba10f Mon Sep 17 00:00:00 2001 From: Tim Date: Mon, 29 Jul 2024 13:20:38 +0200 Subject: [PATCH 02/39] removed legacy deployment stuff and began work on new production dockerfile --- application/.devcontainer.json | 8 ---- application/.dockerignore | 7 ++- application/.gitignore | 1 - application/Dockerfile.application | 13 ----- application/Dockerfile.prod | 77 ++++++++++++++++++++++++++++++ application/README.md | 14 ------ application/requirements.txt | 2 +- application/setup.sh | 15 ------ 8 files changed, 84 insertions(+), 53 deletions(-) delete mode 100644 application/.devcontainer.json create mode 100644 application/Dockerfile.prod delete mode 100755 application/setup.sh diff --git a/application/.devcontainer.json b/application/.devcontainer.json deleted file mode 100644 index 99ded8ed7..000000000 --- a/application/.devcontainer.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "image": "webis/tira-application:basis-0.0.96", - "customizations": { - "vscode": { - "extensions": ["ms-python.python", "ms-python.vscode-pylance", "ms-toolsai.jupyter"] - } - } -} diff --git a/application/.dockerignore b/application/.dockerignore index f83a4abb6..048f0304b 100644 --- a/application/.dockerignore +++ b/application/.dockerignore @@ -1,2 +1,7 @@ venv/ -**/node_modules/ +.gitignore +Dockerfile.* +Makefile +README.md +mock-data +config/*.dev.yml \ No newline at end of file diff --git a/application/.gitignore b/application/.gitignore index ef5a5d0ce..347232bbe 100644 --- a/application/.gitignore +++ b/application/.gitignore @@ -9,7 +9,6 @@ test/test-database src/tira/frontend/node_modules/ src/tira/static/tira/dist/* package-lock.json -src/tira/frontend/webpack-stats.json test/tira-root/ **/*.received.txt diff --git a/application/Dockerfile.application b/application/Dockerfile.application index bea1a11e5..d0140e093 100644 --- a/application/Dockerfile.application +++ b/application/Dockerfile.application @@ -1,13 +1,3 @@ -#Build Vuetify in first stage: Only change in case of new / updated dependencies -FROM webis/tira-application:basis-0.0.97 - -COPY frontend /src/tira/frontend-vuetify - -RUN cd /src/tira/frontend-vuetify \ - && ln -s /usr/local/lib/node_modules node_modules \ - && yarn build - - # Only change in case of new / updated dependencies FROM webis/tira-application:basis-0.0.96 @@ -27,9 +17,6 @@ RUN cd /tira/application/src && \ chmod +x /tira/application/src/tira/endpoints/aha && \ cp /tira/application/src/tira/management/commands/irds_cli.sh /irds_cli.sh && \ rm -f ./config/settings.yml ./config/config.yml ./config/tira-application-config.dev.yml && \ - rm -Rf tira/static/tira/frontend-vuetify/ && rm -Rf /tira/application/src/tira/static/tira/frontend-vuetify/ - -COPY --from=0 /src/tira/static/tira/frontend-vuetify/ /tira/application/src/tira/static/tira/frontend-vuetify/ RUN cd /tira/application/ && \ ./test/run_all_tests.sh diff --git a/application/Dockerfile.prod b/application/Dockerfile.prod new file mode 100644 index 000000000..09f006f33 --- /dev/null +++ b/application/Dockerfile.prod @@ -0,0 +1,77 @@ +# TODO: this dockerfile is the latest and greatest out of the large quantity found in this folder +# At some point, Dockerfile.application* and Dockerfile.basis should be obsolete and can be deleted. If you read this in +# the future and that is the case, then "Hello Future Person" and also please delete these dockerfiles. + +######################################################################################################################## +# Production Container # +######################################################################################################################## +FROM debian:stable-slim + +ENV TZ=Europe/Berlin +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone + +RUN apt-get update && apt-get install -y locales +RUN echo "en_US.UTF-8 UTF-8" | tee -a /etc/locale.gen && locale-gen + +######################################################################################################################## +# Create User # +######################################################################################################################## +RUN useradd -ms /bin/bash tira + + +######################################################################################################################## +# Copy all neccessary files over # +######################################################################################################################## +USER tira +WORKDIR /tira/ +COPY --chown=tira:tira . ./ + + +######################################################################################################################## +# Install Python and Dependencies # +######################################################################################################################## +USER root +ENV PIP_BREAK_SYSTEM_PACKAGES 1 +# For faster build of GRPCIO +ENV GRPC_PYTHON_BUILD_EXT_COMPILER_JOBS 16 + +RUN <.zip django-db-dump.zip If there are problems with the precompiled protobuf parser, you can recompile them from the `tira/protocol` repository and copy them to `tira/application/src/tira/proto`. If you run into `django.db.utils.OperationalError: (1050, "Table already exists")`, skip migrations using `./venv/bin/python3 src/manage.py migrate --fake` . - -Windows users using WSL: If you run into `setup.sh: line 3: $'\r'`: command not found' when executing make setup: - 1. run `sudo apt-get install dos2unix` - 2. run `dos2unix setup.sh` - 3. run `cd tests && dos2unix setup.sh` - 4. Now make setup should work - - Error running vite-dev: `00h00m00s 0/0: : ERROR: [Errno 2] No such file or directory: 'install'`: - run `apt remove cmdtest - sudo apt remove yarn - curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - - echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list - sudo apt-get update - sudo apt-get install yarn -y` diff --git a/application/requirements.txt b/application/requirements.txt index 739649bb6..06db2ea7a 100644 --- a/application/requirements.txt +++ b/application/requirements.txt @@ -10,7 +10,7 @@ mysqlclient python-gitlab GitPython python-slugify -# git+https://github.com/allenai/ir_datasets +ir-datasets git+https://github.com/mam10eks/diffir pandas markdown diff --git a/application/setup.sh b/application/setup.sh deleted file mode 100755 index c26eaba97..000000000 --- a/application/setup.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash -# setup.sh does steps in the tira setup. - -exit_with () { - echo $1 - echo "Exiting setup.sh; Please install the required software."; - exit 1 -} - -which mysql_config > '\dev\null' || exit_with "Please install the sql driver before the tira-application setup: - sudo apt install libmysqlclient-dev - sudo apk add mariadb-dev" - -which npm > '\dev\null' || exit_with "Please install npm to build the vue frontend - https://nodejs.org/en/download/" From 08c5a251f4435012865339df5dc8cfbdf7770b3e Mon Sep 17 00:00:00 2001 From: Tim Date: Wed, 31 Jul 2024 09:07:40 +0200 Subject: [PATCH 03/39] added building the application to the publish workflow --- .github/workflows/publish.yml | 23 ++++++++++++++++++++--- application/Dockerfile.prod | 9 --------- 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 10e139f26..fe9dd7a88 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -3,6 +3,9 @@ name: Publish Docker images on: release: types: [published] + # TODO: workflow_dispatch should be removed (or commented out) in the future. It is here only for testing purposes + # while the deployment is WiP + workflow_dispatch: {} env: REGISTRY: ghcr.io @@ -24,7 +27,7 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Extract metadata (tags, labels) for Docker - id: meta + id: meta-frontend uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 with: images: ${{ env.REGISTRY }}/tira-io/tira-frontend @@ -34,5 +37,19 @@ jobs: context: ${{ github.workspace }}/frontend file: ${{ github.workspace }}/frontend/Dockerfile.prod push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file + tags: ${{ steps.meta-frontend.outputs.tags }} + labels: ${{ steps.meta-frontend.outputs.labels }} + + - name: Extract metadata (tags, labels) for Docker + id: meta-backend + uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 + with: + images: ${{ env.REGISTRY }}/tira-io/tira-backend + - name: Publish tira-backend image + uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 + with: + context: ${{ github.workspace }}/application + file: ${{ github.workspace }}/application/Dockerfile.prod + push: true + tags: ${{ steps.meta-backend.outputs.tags }} + labels: ${{ steps.meta-backend.outputs.labels }} \ No newline at end of file diff --git a/application/Dockerfile.prod b/application/Dockerfile.prod index 09f006f33..82514118d 100644 --- a/application/Dockerfile.prod +++ b/application/Dockerfile.prod @@ -40,17 +40,8 @@ apt-get update # Tools apt-get install -y python3 python3-pip git pkg-config # Dependencies (stuff needed by at least one python package) -# Needed by grpcio (TODO: can be removed when GRPC is removed) -#apt-get install -y g++ linux-headers python3-devel build-base -#apt-get install -y gcc linux-headers make musl-dev python3-dev build-base libxml2 libxslt libxml2-dev libxslt-dev pcre-dev -#apt-get install -y zip py3-virtualenv mariadb-dev npm git openssh-client libc6-compat pandas # For MariaDB apt-get install -y default-libmysqlclient-dev -#apk add --no-cache mariadb-connector-c-dev -# For Scipy -#apk add --no-cache gfortran cmake openblas-dev -# For Pytrec Eval -#apk add libffi-dev python3 -m pip install -r requirements.txt EOF From 363db8f2789e41a92c4ae41b8548b3aa5ac7c1a5 Mon Sep 17 00:00:00 2001 From: Tim Date: Wed, 31 Jul 2024 09:22:07 +0200 Subject: [PATCH 04/39] updated publish workflow to run on push for now --- .github/workflows/publish.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index fe9dd7a88..10ae719ad 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -3,9 +3,11 @@ name: Publish Docker images on: release: types: [published] - # TODO: workflow_dispatch should be removed (or commented out) in the future. It is here only for testing purposes + # TODO: The run on push should be removed (or commented out) in the future. It is here only for testing purposes # while the deployment is WiP - workflow_dispatch: {} + push: + branches: + - updated_backend_deployment env: REGISTRY: ghcr.io From 30643b5e91aae8825134c21fc40892acdd010849 Mon Sep 17 00:00:00 2001 From: Tim Date: Wed, 31 Jul 2024 11:15:42 +0200 Subject: [PATCH 05/39] made index.html paths relative --- frontend/index.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/index.html b/frontend/index.html index bfffae889..c42f9135d 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -3,14 +3,14 @@ - + TIRA Reproducible Experiments
- + - + \ No newline at end of file From 2039d85a440cf3179f3df6e70d857e9e11b0b488 Mon Sep 17 00:00:00 2001 From: Tim Date: Wed, 31 Jul 2024 11:31:36 +0200 Subject: [PATCH 06/39] appended tira-frontend to all resource paths in the compiled frontend --- frontend/vite.config.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts index 77ab062f8..d30ce4871 100644 --- a/frontend/vite.config.ts +++ b/frontend/vite.config.ts @@ -9,9 +9,9 @@ import { fileURLToPath, URL } from 'node:url' // https://vitejs.dev/config/ export default defineConfig({ plugins: [ - vue({template: { transformAssetUrls }}), + vue({ template: { transformAssetUrls } }), // https://github.com/vuetifyjs/vuetify-loader/tree/next/packages/vite-plugin - vuetify({autoImport: true}), + vuetify({ autoImport: true }), ], define: { 'process.env': {} }, resolve: { @@ -28,9 +28,10 @@ export default defineConfig({ rollupOptions: { output: { // TODO: We would usually like to use assets/ here, but we first have to fix this disraptor problem: https://github.com/disraptor/disraptor/issues/33 - assetFileNames: 'assets-public/[name].[ext]', - chunkFileNames: 'chunks/[name].js', - entryFileNames: 'entries/[name].js', + // TODO: Documentation + assetFileNames: 'tira-frontend/assets-public/[name].[ext]', + chunkFileNames: 'tira-frontend/chunks/[name].js', + entryFileNames: 'tira-frontend/entries/[name].js', }, }, outDir: 'static/', From 5f9714b4210c07a11cd4dd711deb90d6ed8db17f Mon Sep 17 00:00:00 2001 From: Tim Date: Wed, 31 Jul 2024 12:00:46 +0200 Subject: [PATCH 07/39] set base path explicitly --- frontend/vite.config.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts index d30ce4871..7b2d7c395 100644 --- a/frontend/vite.config.ts +++ b/frontend/vite.config.ts @@ -8,6 +8,7 @@ import { fileURLToPath, URL } from 'node:url' // https://vitejs.dev/config/ export default defineConfig({ + base: "", plugins: [ vue({ template: { transformAssetUrls } }), // https://github.com/vuetifyjs/vuetify-loader/tree/next/packages/vite-plugin @@ -28,10 +29,9 @@ export default defineConfig({ rollupOptions: { output: { // TODO: We would usually like to use assets/ here, but we first have to fix this disraptor problem: https://github.com/disraptor/disraptor/issues/33 - // TODO: Documentation - assetFileNames: 'tira-frontend/assets-public/[name].[ext]', - chunkFileNames: 'tira-frontend/chunks/[name].js', - entryFileNames: 'tira-frontend/entries/[name].js', + assetFileNames: 'assets-public/[name].[ext]', + chunkFileNames: 'chunks/[name].js', + entryFileNames: 'entries/[name].js', }, }, outDir: 'static/', From 87185feda7fc334d2446389bc660c075ec17fff4 Mon Sep 17 00:00:00 2001 From: Tim Date: Wed, 31 Jul 2024 12:28:22 +0200 Subject: [PATCH 08/39] added tfr-static prefix --- frontend/vite.config.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts index 7b2d7c395..3b397c010 100644 --- a/frontend/vite.config.ts +++ b/frontend/vite.config.ts @@ -8,7 +8,7 @@ import { fileURLToPath, URL } from 'node:url' // https://vitejs.dev/config/ export default defineConfig({ - base: "", + base: "/", plugins: [ vue({ template: { transformAssetUrls } }), // https://github.com/vuetifyjs/vuetify-loader/tree/next/packages/vite-plugin @@ -29,17 +29,17 @@ export default defineConfig({ rollupOptions: { output: { // TODO: We would usually like to use assets/ here, but we first have to fix this disraptor problem: https://github.com/disraptor/disraptor/issues/33 - assetFileNames: 'assets-public/[name].[ext]', - chunkFileNames: 'chunks/[name].js', - entryFileNames: 'entries/[name].js', + assetFileNames: 'tfr-static/assets-public/[name].[ext]', + chunkFileNames: 'tfr-static/chunks/[name].js', + entryFileNames: 'tfr-static/entries/[name].js', }, }, outDir: 'static/', }, - experimental: { + /*experimental: { renderBuiltUrl(filename: string, { hostType }: { hostType: 'js' | 'css' | 'html' }) { // TIRA expects resourecs/assets at this location return '/' + filename } - } + }*/ }) From c40e599ad24625b1a64891f9ba606fa5bde0b6bd Mon Sep 17 00:00:00 2001 From: Tim Date: Wed, 31 Jul 2024 13:07:29 +0200 Subject: [PATCH 09/39] added workaround for disraptor --- frontend/index.html | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/frontend/index.html b/frontend/index.html index c42f9135d..0d23224b8 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -11,6 +11,16 @@
+ + + \ No newline at end of file From 96430b4fe6a6659243aea0a911af4d1ab2d9e461 Mon Sep 17 00:00:00 2001 From: Tim Date: Wed, 31 Jul 2024 13:18:42 +0200 Subject: [PATCH 10/39] test --- frontend/index.html | 3 +++ 1 file changed, 3 insertions(+) diff --git a/frontend/index.html b/frontend/index.html index 0d23224b8..a8fd739fb 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -14,6 +14,9 @@ diff --git a/frontend/src/__tests__/user-metadata-extraction-test.ts b/frontend/src/__tests__/user-metadata-extraction-test.ts index 58bf31719..8534d2f7e 100644 --- a/frontend/src/__tests__/user-metadata-extraction-test.ts +++ b/frontend/src/__tests__/user-metadata-extraction-test.ts @@ -1,40 +1,10 @@ -import { extractRole, extractCsrf } from '../utils' +import { extractCsrf } from '../utils' function doc(html: string) { return new DOMParser().parseFromString(html, 'text/html') } -test('Guest is the default role if a non-existing role is specified.', () => { - let d = doc('') - - expect(extractRole(d)).toBe('guest') -}); - -test('Guest is the default role if the json can not be parsed.', () => { - let d = doc('') - - expect(extractRole(d)).toBe('guest') -}); - -test('Guest is the default role if a valid json is in a different tag.', () => { - let d = doc('') - - expect(extractRole(d)).toBe('guest') -}); - -test('Extract admin if admin is specified.', () => { - let d = doc('') - - expect(extractRole(d)).toBe('admin') -}); - -test('Extract participant if participant is specified.', () => { - let d = doc('') - - expect(extractRole(d)).toBe('participant') -}); - test('Csrf Token can be extracted.', () => { let d = doc('
') diff --git a/frontend/src/components/EditTask.vue b/frontend/src/components/EditTask.vue index 8cae92145..01f397f09 100644 --- a/frontend/src/components/EditTask.vue +++ b/frontend/src/components/EditTask.vue @@ -1,121 +1,167 @@ - + diff --git a/frontend/src/components/RunActions.vue b/frontend/src/components/RunActions.vue index 9591e6e3e..ab806f070 100644 --- a/frontend/src/components/RunActions.vue +++ b/frontend/src/components/RunActions.vue @@ -1,106 +1,141 @@ diff --git a/frontend/src/components/RunList.vue b/frontend/src/components/RunList.vue index 234df27a0..ebc5f02df 100644 --- a/frontend/src/components/RunList.vue +++ b/frontend/src/components/RunList.vue @@ -1,50 +1,54 @@