Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SS-606, SS-534 - adjust default flavor, make two project templates #77

Merged
merged 54 commits into from
Oct 11, 2023
Merged
Show file tree
Hide file tree
Changes from 53 commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
888d28c
SS-308 added security context, resource limits and added default valu…
sandstromviktor Sep 28, 2023
ea9d5dc
update w volume to allow rendering
sandstromviktor Sep 28, 2023
e46d4f5
Fixed dash with security context and resources
sandstromviktor Sep 28, 2023
176f55f
Removed security context from init container
sandstromviktor Sep 28, 2023
3ea1fdd
fixed shiny app chart
sandstromviktor Sep 28, 2023
a90c62b
fixed Rstudio
sandstromviktor Sep 28, 2023
06c6e0a
SS-308 Fixed VSCODE with security context and resource limits
sandstromviktor Sep 28, 2023
3501098
Removed docker-registry
sandstromviktor Sep 28, 2023
e42c490
removed registry from views and settings
sandstromviktor Sep 28, 2023
b176c06
Merge branch 'develop' of github.com:ScilifelabDataCentre/stackn into…
sandstromviktor Sep 28, 2023
06554ac
Removed unused flavor from dash, shiny and custom app
sandstromviktor Sep 28, 2023
206a01b
Cleaned up JupyterLab and fixed the chart with securitycontext
sandstromviktor Sep 28, 2023
8e1bbc0
Fixed flavor serialize to simplify adding flavors to charts
sandstromviktor Sep 28, 2023
348f394
updated custom, dash, jlab, rstudio,shiny and vscode with flavor
sandstromviktor Sep 28, 2023
f4b7e51
fixed pytorch with security context and flavor
sandstromviktor Sep 28, 2023
897b2f4
Fixed tensorflow serving with security context and flavor
sandstromviktor Sep 28, 2023
fe1b12e
Fixed mlflow with security context and flavor
sandstromviktor Sep 28, 2023
86f8175
added flavor to mlflow
sandstromviktor Sep 28, 2023
cf5a532
Added security context and resources to Mlflow-serve
sandstromviktor Sep 28, 2023
44116e0
Removed pull-secret
sandstromviktor Sep 29, 2023
e964366
Updated project template with larger ephemeral storage
sandstromviktor Sep 29, 2023
36c8044
Merge branch 'develop' into SS-308-add-security-contexts-to-all-charts
sandstromviktor Sep 29, 2023
0250813
Merge branch 'develop' into SS-308-add-security-contexts-to-all-charts
sandstromviktor Sep 29, 2023
254b4c3
Fixed namespace issue
sandstromviktor Oct 2, 2023
4b2746d
Merge branch 'SS-308-add-security-contexts-to-all-charts' of github.c…
sandstromviktor Oct 2, 2023
c9cb881
add display of flash messages to the project overview template
akochari Oct 2, 2023
3616dd9
add breadcrumbs to model creation template
akochari Oct 2, 2023
21775fd
fixed whitespace error
sandstromviktor Oct 2, 2023
be272d3
Merge branch 'SS-308-add-security-contexts-to-all-charts' of github.c…
sandstromviktor Oct 2, 2023
35eac8d
improve display of flavors and project in django admin panel
akochari Oct 4, 2023
3308a94
only show the image option if there is more than one to choose from
akochari Oct 4, 2023
4d71e97
new project templates
akochari Oct 4, 2023
4893d65
Merge branch 'develop' into SS-606-flavor
akochari Oct 4, 2023
fdd313b
call flavors hardware
akochari Oct 4, 2023
8444d45
add placeholder for documentation link in app creation forms
akochari Oct 4, 2023
51a94af
move out my projects from Profile dropdown
akochari Oct 5, 2023
b67e003
logged in users redirected to projects when calling /
akochari Oct 5, 2023
d4f7046
correct homepage url in footer
akochari Oct 5, 2023
97ed33b
better urls to make use of django appending slashes
akochari Oct 5, 2023
34ebd69
adjust tests to new UI
akochari Oct 5, 2023
87203b0
Merge branch 'develop' into SS-606-flavor
akochari Oct 5, 2023
57a5a89
set default limit for shinyproxy
akochari Oct 5, 2023
dc8e485
revamp categories of apps
akochari Oct 5, 2023
efb5652
disallow creation of admin only apps through the app limit setting
akochari Oct 5, 2023
7baff7b
replace regular shiny with shinyproxy as default
akochari Oct 5, 2023
713d478
clarify which user in navbar
akochari Oct 5, 2023
e23ea05
simple way to hide extra options when project template is not for ML
akochari Oct 5, 2023
5911308
use django way of commenting code in templates
akochari Oct 5, 2023
562ab1f
Merge branch 'SS-606-flavor' of https://github.com/ScilifelabDataCent…
akochari Oct 5, 2023
245adcc
separate tests for two project templates
akochari Oct 5, 2023
a0813ae
add waiting time for project creation step
akochari Oct 5, 2023
ee1dedc
Merge branch 'develop' into SS-606-flavor
akochari Oct 10, 2023
6b638cc
Changed order of volume and minio
sandstromviktor Oct 11, 2023
4638366
Merge branch 'develop' into SS-606-flavor
sandstromviktor Oct 11, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cypress/e2e/ui-tests/test-homepage.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ describe("Test of the home page", () => {

it("should open the home page on link click", () => {
cy.get("li.nav-item a").contains("Home").click()
cy.url().should("include", "")
cy.url().should("include", "/home")
})

it("should open the Apps page on link click", () => {
Expand Down
82 changes: 74 additions & 8 deletions cypress/e2e/ui-tests/test-project-as-contributor.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ describe("Test project contributor user functionality", () => {
it("can run the test setup", () => {
})

it("can create a new blank project, open settings, delete from settings", () => {
it("can create a new project with default template, open settings, delete from settings", () => {

// Names of objects to create
const project_name = "e2e-create-proj-test"
Expand All @@ -54,12 +54,83 @@ describe("Test project contributor user functionality", () => {
cy.get('input[name=name]').type(project_name)
cy.get('textarea[name=description]').type("A test project created by an e2e test.")
cy.get("input[name=save]").contains('Create project').click()
cy.wait(5000) // sometimes it takes a while to create a project
.then((href) => {
cy.log(href)
//cy.url().should("include", "/project-e2e-blank");
cy.get("title").should("have.text", project_title_name)
cy.get('h3').should('contain', project_name)

// Check that the correct deployment options are available
cy.get('.card-header').find('h5').should('contain', 'Develop')
cy.get('.card-header').find('h5').should('contain', 'Serve')
cy.get('.card-header').find('h5').should('not.contain', 'Models')
cy.get('.card-header').find('h5').should('not.contain', 'Additional options [admins only]')

// Check that project settings are available
cy.get('[data-cy="settings"]').click()
cy.url().should("include", "settings")
cy.get('h3').should('contain', 'Project settings')

// Check that the correct project settings are visible (i.e. no extra settings)
cy.get('.list-group').find('a').should('contain', 'Access')
cy.get('.list-group').find('a').should('not.contain', 'S3 storage')
cy.get('.list-group').find('a').should('not.contain', 'MLFlow')
cy.get('.list-group').find('a').should('not.contain', 'Flavors')
cy.get('.list-group').find('a').should('not.contain', 'Environments')

// Delete the project from the settings menu
cy.get('a').contains("Delete").click()
.then((href) => {
cy.get('div#delete').should('have.css', 'display', 'block')
cy.get('#id_delete_button').parent().parent().find('button').contains('Delete').click()
.then((href) => {
cy.get('div#deleteModal').should('have.css', 'display', 'block')
cy.get('div#deleteModal').find('button').contains('Confirm').click()
})
cy.contains(project_name).should('not.exist')

})
})
})

it("can create a new project with ML serving template, open settings, delete from settings", () => {

// Names of objects to create
const project_name = "e2e-create-proj-test"
const volume_name = "e2e-project-vol"
const project_title_name = project_name + " | SciLifeLab Serve"

cy.visit("/projects/")
cy.get("title").should("have.text", "My projects | SciLifeLab Serve")

// Click button for UI to create a new project
cy.get("a").contains('New project').click()
cy.url().should("include", "projects/templates")
cy.get('h3').should('contain', 'New project')

// Next click button to create a new blank project
cy.get(".card-body").last().contains("Create").click()
cy.url().should("include", "projects/create?template=")
cy.get('h3').should('contain', 'New project')

// Fill in the options for creating a new blank project
cy.get('input[name=name]').type(project_name)
cy.get('textarea[name=description]').type("A test project created by an e2e test.")
cy.get("input[name=save]").contains('Create project').click()
cy.wait(5000) // sometimes it takes a while to create a project
.then((href) => {
cy.log(href)
//cy.url().should("include", "/project-e2e-blank");
cy.get("title").should("have.text", project_title_name)
cy.get('h3').should('contain', project_name)

// Check that the correct deployment options are available
cy.get('.card-header').find('h5').should('contain', 'Develop')
cy.get('.card-header').find('h5').should('contain', 'Serve')
cy.get('.card-header').find('h5').should('contain', 'Models')
cy.get('.card-header').find('h5').should('not.contain', 'Additional options [admins only]')

// Section Models - Machine Learning Models
// Navigate to the create models view and cancel back again
cy.get("div#models").first("h5").should("contain", "Machine Learning Models")
Expand All @@ -73,13 +144,6 @@ describe("Test project contributor user functionality", () => {
})
})

// Check that the correct deployment options are available
cy.get('.card-header').find('h5').should('contain', 'Develop')
cy.get('.card-header').find('h5').should('contain', 'Serve')
cy.get('.card-header').find('h5').should('contain', 'Models')
cy.get('.card-header').find('h5').should('not.contain', 'Network')
cy.get('.card-header').find('h5').should('not.contain', 'Store')

// Check that project settings are available
cy.get('[data-cy="settings"]').click()
cy.url().should("include", "settings")
Expand Down Expand Up @@ -148,6 +212,7 @@ describe("Test project contributor user functionality", () => {
cy.get("a").contains('Create').first().click()
cy.get('input[name=name]').type(project_name)
cy.get("input[name=save]").contains('Create project').click()
cy.wait(5000) // sometimes it takes a while to create a project
.then((href) => {
cy.log(href)
// Check that the app limits work using Jupyter Lab as example
Expand Down Expand Up @@ -191,6 +256,7 @@ describe("Test project contributor user functionality", () => {
cy.get('input[name=name]').type(project_name)
cy.get("input[name=save]").contains('Create project').click()
});
cy.wait(5000) // sometimes it takes a while to create a project but just waiting once at the end should be enough

// Now check that it is not possible to create another project
// not possible to click the button to create a new project
Expand Down
25 changes: 23 additions & 2 deletions cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,5 +98,26 @@ Cypress.Commands.add('createBlankProject', (project_name) => {
cy.get('input[name=name]').type(project_name)
cy.get('textarea[name=description]').type("A test project created by an e2e test.")
cy.get("input[name=save]").contains('Create project').click()

})
cy.wait(5000) // need to wait a bit for the project to be created on some machines, otherwise won't find the new project under /projects/

})

Cypress.Commands.add('deleteBlankProject', (project_name) => {

cy.visit("/projects/")

cy.get('h5.card-title').contains(project_name).siblings('div').find('a.confirm-delete').click()
.then((href) => {
cy.get('div#modalConfirmDelete').should('have.css', 'display', 'block')

cy.get("h1#modalConfirmDeleteLabel").then(function($elem) {
cy.log($elem.text())

cy.get('div#modalConfirmDeleteFooter').find('button').contains('Delete').click()

// Assert that the project has been deleted
cy.contains(project_name).should('not.exist')
})
})

})
Comment on lines +101 to +123
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this. We should do more functions like this and reuse throughout tests.

46 changes: 16 additions & 30 deletions fixtures/appcats_fixtures.json
Original file line number Diff line number Diff line change
@@ -1,37 +1,23 @@
[
{
"fields": {
"name": "Develop"
},
"model": "apps.appcategories",
"pk": "network",
"pk": "develop"
},
{
"fields": {
"name": "Network"
}
"name": "Serve"
},
"model": "apps.appcategories",
"pk": "serve"
},
{
"model": "apps.appcategories",
"pk": "compute",
"fields": {
"name": "Notebooks"
}
},
{
"model": "apps.appcategories",
"pk": "develop",
"fields": {
"name": "Develop"
}
},
{
"model": "apps.appcategories",
"pk": "serve",
"fields": {
"name": "Serve"
}
},
{
"model": "apps.appcategories",
"pk": "store",
"fields": {
"name": "Store"
{
"fields": {
"name": "Additional options [admins only]"
},
"model": "apps.appcategories",
"pk": "admin-apps"
}
}
]
Loading