Skip to content

Commit

Permalink
Project limit change + a few other small changes (#204)
Browse files Browse the repository at this point in the history
  • Loading branch information
akochari authored Jul 2, 2024
1 parent 2f32526 commit e30d792
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 16 deletions.
6 changes: 3 additions & 3 deletions cypress/e2e/ui-tests/test-project-as-contributor.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,8 @@ describe("Test project contributor user functionality", () => {
// Names of projects to create
const project_name = "e2e-create-proj-test"

// Create 5 projects (current limit)
Cypress._.times(5, () => {
// Create 10 projects (current limit)
Cypress._.times(10, () => {
cy.visit("/projects/")
cy.get("a").contains('New project').click()
cy.get("a").contains('Create').first().click()
Expand All @@ -276,7 +276,7 @@ describe("Test project contributor user functionality", () => {
cy.request({url: "/projects/templates/", failOnStatusCode: false}).its('status').should('equal', 403)

// Now delete all created projects
Cypress._.times(5, () => {
Cypress._.times(10, () => {
cy.visit("/projects/")
cy.contains('.card-title', project_name).parents('.card-body').siblings('.card-footer').find('.confirm-delete').click()
.then((href) => {
Expand Down
8 changes: 4 additions & 4 deletions cypress/e2e/ui-tests/test-superuser-functionality.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,8 @@ describe("Test superuser access", () => {
// Names of projects to create
const project_name = "e2e-superuser-proj-limits-test"

cy.log("Create 5 projects (current limit for regular users)")
Cypress._.times(5, () => {
cy.log("Create 10 projects (current limit for regular users)")
Cypress._.times(10, () => {
// better to write this out rather than use the createBlankProject command because then we can do a 5000 ms pause only once
cy.visit("/projects/")
cy.get("a").contains('New project').click()
Expand All @@ -308,10 +308,10 @@ describe("Test superuser access", () => {
cy.log("Create one more project to check it is possible to bypass the limit")
cy.createBlankProject(project_name)
cy.visit("/projects/")
cy.get('h5:contains("' + project_name + '")').its('length').should('eq', 6) // check that the superuser now bypassed the limit for regular users
cy.get('h5:contains("' + project_name + '")').its('length').should('eq', 11) // check that the superuser now bypassed the limit for regular users

cy.log("Now delete all created projects")
Cypress._.times(6, () => {
Cypress._.times(11, () => {
cy.visit("/projects/")
cy.contains('.card-title', project_name).parents('.card-body').siblings('.card-footer').find('.confirm-delete').click()
.then((href) => {
Expand Down
6 changes: 3 additions & 3 deletions fixtures/projects_templates.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[
{
"fields": {
"description": "Use this template if you intend to only deploy apps or use integrated development environments (IDEs).",
"description": "Use this template if you intend to deploy apps or ML models packaged into containers, or if you intend to use web-based notebooks.",
"name": "Default project",
"slug": "blank",
"available_apps": [8, 9, 19, 21, 22, 23, 24, 28],
Expand Down Expand Up @@ -61,8 +61,8 @@
},
{
"fields": {
"description": "Use this template if you intend to deploy machine learning models using the serving functionality.",
"name": "Project with ML serving",
"description": "This project type allows to deploy machine learning models using the specialized model serving frameworks.",
"name": "Project with specialized ML serving",
"slug": "default",
"template": {
"apps": {
Expand Down
2 changes: 1 addition & 1 deletion studio/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@
"filemanager": 1,
}

PROJECTS_PER_USER_LIMIT = 5
PROJECTS_PER_USER_LIMIT = 10

STUDIO_ACCESSMODE = os.environ.get("STUDIO_ACCESSMODE", "")
ENABLE_PROJECT_EXTRA_SETTINGS = False
Expand Down
2 changes: 1 addition & 1 deletion templates/apps/create_view.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
{% elif app_slug in 'shinyapp,shinyproxyapp' %}
<p>This form allows you to start hosting a Shiny app at SciLifeLab Serve. Please read our <a href="/docs/application-hosting/shiny/">documentation page on Shiny apps</a> for step-by-step instructions.</p>
{% elif app_slug == 'tissuumaps' %}
<p>This form allows you to start hosting your own TissUUmaps instance at SciLifeLab Serve. After your app has been created you will need to upload the data to your project. We suggest that you create the app with Permissions initially set to <i>private</i>, upload the data, and then edit the app settings to change the Permissions to <i>public</i>. Please read our <a href="/docs/application-hosting/tissuumaps/" target="_blank">documentation page on TissUUmaps apps</a> for step-by-step instructions.</p>
<p>This form allows you to start hosting your own TissUUmaps instance at SciLifeLab Serve. After your app has been created you will need to upload the data to your project. We suggest that you create the app with Permissions initially set to <i>Private</i>, upload the data, and then edit the app settings to change the Permissions to <i>Public</i>. Please read our <a href="/docs/application-hosting/tissuumaps/" target="_blank">documentation page on TissUUmaps apps</a> for step-by-step instructions.</p>
{% endif %}
{% if app_slug in 'jupyter-lab,rstudio,vscode' %}
<p>Note that <b>after 7 days the created {{ form.model_name }} instance will be deleted</b>, only the files saved in 'project-vol' will stay available.</p>
Expand Down
2 changes: 1 addition & 1 deletion templates/breadcrumbs/breadcrumb_base.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<ol class="breadcrumb">
{% if project %}
<li class="breadcrumb-item"><a href="{% url 'projects:index' %}">My projects</a></li>
<li class="breadcrumb-item" aria-current="page">{{ project.name }}</li>
<li class="breadcrumb-item" aria-current="page"><a href="{% url 'projects:details' project.slug %}">{{ project.name }}</a></li>
{% endif %}
{% block breadcrumb_content%}
{% endblock %}
Expand Down
11 changes: 8 additions & 3 deletions templates/projects/project_templates.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ <h3>New project</h3>
<div class="card shadow border-0 h-100">
<div class="card-body d-flex flex-column">

<div class="row">
<div class="row {% if template.name == 'Project with specialized ML serving' %}text-muted{% endif %}">
<div class="col-8">
<div class="row">
<div class="col">
Expand Down Expand Up @@ -57,9 +57,14 @@ <h3 class="card-title">

<div class="card-footer d-flex justify-content-end">

{% if template.name == 'Project with specialized ML serving' %}
<button class="btn btn-secondary" style="cursor: default;" data-bs-toggle="tooltip" data-bs-placement="top" data-bs-title="This project type is temporarily disabled while we are rebuilding support for specialized model serving frameworks. You can still serve your ML model in other ways, get in touch with us at [email protected], and we will help you.">
Create
</button>
{% else %}
<a class="btn btn-primary align-self-end"
href="{% url 'projects:create' %}?template={{ template.name | urlencode }}">Create</a>

href="{% url 'projects:create' %}?template={{ template.name | urlencode }}">Create</a>
{% endif %}
</div>
</div>
</div>
Expand Down

0 comments on commit e30d792

Please sign in to comment.