From 32dc57f58e246f2f84b8b56b526481ef0e46a9f3 Mon Sep 17 00:00:00 2001 From: Arnold Kochari Date: Wed, 6 Nov 2024 17:00:13 +0100 Subject: [PATCH] Bugfixes before release 2.2.0 (#252) Co-authored-by: Hamza --- apps/forms/dash.py | 2 +- apps/forms/gradio.py | 2 +- apps/forms/shiny.py | 2 +- apps/forms/streamlit.py | 2 +- apps/tasks.py | 6 ++++-- cypress/e2e/ui-tests/test-public-webpages.cy.js | 2 +- cypress/e2e/ui-tests/test-signup.cy.js | 3 +-- fixtures/apps_fixtures.json | 2 +- templates/apps/logs.html | 4 ++-- 9 files changed, 13 insertions(+), 12 deletions(-) diff --git a/apps/forms/dash.py b/apps/forms/dash.py index 19b1cd58..e552e158 100644 --- a/apps/forms/dash.py +++ b/apps/forms/dash.py @@ -35,7 +35,7 @@ def _setup_form_helper(self): ), SRVCommonDivField("source_code_url", placeholder="Provide a link to the public source code"), SRVCommonDivField("port", placeholder="8000"), - SRVCommonDivField("image", placeholder="registry/repository/image:tag"), + SRVCommonDivField("image", placeholder="e.g. docker.io/username/image-name:image-tag"), css_class="card-body", ) diff --git a/apps/forms/gradio.py b/apps/forms/gradio.py index 42a8f5b6..d88a83ee 100644 --- a/apps/forms/gradio.py +++ b/apps/forms/gradio.py @@ -39,7 +39,7 @@ def _setup_form_helper(self): placeholder="Describe why you want to make the app accessible only via a link", ), SRVCommonDivField("port", placeholder="7860"), - SRVCommonDivField("image"), + SRVCommonDivField("image", placeholder="e.g. docker.io/username/image-name:image-tag"), css_class="card-body", ) self.helper.layout = Layout(body, self.footer) diff --git a/apps/forms/shiny.py b/apps/forms/shiny.py index 7274ecea..b855711b 100644 --- a/apps/forms/shiny.py +++ b/apps/forms/shiny.py @@ -53,7 +53,7 @@ def _setup_form_helper(self): ), SRVCommonDivField("source_code_url", placeholder="Provide a link to the public source code"), SRVCommonDivField("port", placeholder="3838"), - SRVCommonDivField("image", placeholder="registry/repository/image:tag"), + SRVCommonDivField("image", placeholder="e.g. docker.io/username/image-name:image-tag"), Accordion( AccordionGroup( "Advanced settings", diff --git a/apps/forms/streamlit.py b/apps/forms/streamlit.py index 828d1802..2ef1c38a 100644 --- a/apps/forms/streamlit.py +++ b/apps/forms/streamlit.py @@ -39,7 +39,7 @@ def _setup_form_helper(self): placeholder="Describe why you want to make the app accessible only via a link", ), SRVCommonDivField("port", placeholder="8501"), - SRVCommonDivField("image"), + SRVCommonDivField("image", placeholder="e.g. docker.io/username/image-name:image-tag"), css_class="card-body", ) self.helper.layout = Layout(body, self.footer) diff --git a/apps/tasks.py b/apps/tasks.py index cda77034..12756368 100644 --- a/apps/tasks.py +++ b/apps/tasks.py @@ -32,7 +32,9 @@ def get_threshold(threshold): # Handle deletion of apps in the "Develop" category for orm_model in APP_REGISTRY.iter_orm_models(): - old_develop_apps = orm_model.objects.filter(created_on__lt=get_threshold(7), app__category__name="Develop") + old_develop_apps = orm_model.objects.filter( + created_on__lt=get_threshold(7), app__category__name="Develop" + ).exclude(app_status__status="Deleted") for app_ in old_develop_apps: delete_resource.delay(app_.serialize()) @@ -40,7 +42,7 @@ def get_threshold(threshold): # Handle deletion of non persistent file managers old_file_managers = FilemanagerInstance.objects.filter( created_on__lt=timezone.now() - timezone.timedelta(days=1), persistent=False - ) + ).exclude(app_status__status="Deleted") for app_ in old_file_managers: delete_resource.delay(app_.serialize()) diff --git a/cypress/e2e/ui-tests/test-public-webpages.cy.js b/cypress/e2e/ui-tests/test-public-webpages.cy.js index b19c5ced..4181a0be 100644 --- a/cypress/e2e/ui-tests/test-public-webpages.cy.js +++ b/cypress/e2e/ui-tests/test-public-webpages.cy.js @@ -12,7 +12,7 @@ describe("Tests of the public pages of the website", () => { }) it("should open the Apps and models page on link click", () => { - cy.get("li.nav-item a").contains("Apps and models").click() + cy.get("li.nav-item a").contains("Apps & Models").click() cy.url().should("include", "/apps") cy.get('h3').should('contain', 'Public applications and models') cy.get("title").should("have.text", "Apps and models | SciLifeLab Serve (beta)") diff --git a/cypress/e2e/ui-tests/test-signup.cy.js b/cypress/e2e/ui-tests/test-signup.cy.js index d0bb31bc..bd42b938 100644 --- a/cypress/e2e/ui-tests/test-signup.cy.js +++ b/cypress/e2e/ui-tests/test-signup.cy.js @@ -47,8 +47,7 @@ describe("Test sign up", () => { cy.url().should("include", "accounts/login"); cy.get('.alert-success').should( 'contain', - 'Please check your email for a verification link.' + - ' If you don’t see it, please contact us at serve@scilifelab.se' + 'Please check your email for a verification link.' ); // TO-DO: add steps to check that email was sent, get token from email, go to email verification page, submit token there, then log in with new account diff --git a/fixtures/apps_fixtures.json b/fixtures/apps_fixtures.json index 9aff9b82..d9ffa376 100644 --- a/fixtures/apps_fixtures.json +++ b/fixtures/apps_fixtures.json @@ -383,7 +383,7 @@ { "fields": { "category": "serve", - "chart": "ghcr.io/scilifelabdatacentre/serve-charts/shinyproxy:1.4.1", + "chart": "ghcr.io/scilifelabdatacentre/serve-charts/shinyproxy:1.4.2", "created_on": "2023-08-25T21:34:37.815Z", "description": "", "logo": "shinyapp-logo.svg", diff --git a/templates/apps/logs.html b/templates/apps/logs.html index ee959fea..b8e7929b 100644 --- a/templates/apps/logs.html +++ b/templates/apps/logs.html @@ -11,14 +11,14 @@

{{ instance.name }} Logs

{{ instance.status.latest.status_type }}
-

Note: Logs appear a few minutes after an app has been launched. The Status on the top right is an indication of the state of the app. {% if instance.app.slug == 'customapp' and instance.volume %} If the app is not running (due to an error) and you have a volume attached to the app, then you can switch between to the tabs below to see logs for the data copy process. The data copy tab will be shown in red in this case. If the data copy succeeds, then the data copy tab is disabled and can't be accessed. This can give you hints if data copy failed.{% endif %}

+

Note: Logs appear a few minutes after an app has been launched. The Status on the top right is an indication of the state of the app. {% if instance.app.slug in 'customapp,gradio,streamlit' and instance.volume %} If the app is not running (due to an error) and you have a volume attached to the app, then you can switch between to the tabs below to see logs for the data copy process. The data copy tab will be shown in red in this case. If the data copy succeeds, then the data copy tab is disabled and can't be accessed. This can give you hints if data copy failed.{% endif %}