UI is using API to request scripts with full content

Bug #1916317 reported by Lee Trager
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Fix Released
Undecided
Unassigned
2.9
Won't Fix
Undecided
Unassigned
maas-ui
Fix Released
Unknown

Bug Description

While looking through the MAAS logs I noticed that the UI is repeatedly requesting

/MAAS/api/2.0/scripts/?include_script=true

This uses the API to return all scripts including their content. The API returns historic data so not only does this include script content but the content for every version of a script. The API also includes other data which the UI is not currently using.

On a fresh MAAS install with no script history the returned size is as follows:

/MAAS/api/2.0/scripts/ - 36K
/MAAS/api/2.0/scripts/?include_script=true - 258K

This causes a lot of unnecessary load on the region and alot of unnecessary data over the network which can effect slow connections. This also seems to happening repeatedly so content is not cached.

1. MAAS has a websocket to return script data. It does not currently have a way to return content but that can be easily added.
2. Script content should be loaded as needed. IMHO its better to wait a second for each script to load when viewing content then to load it all at once. I discovered this while on the nodes-listing page where you can't view script content.

Tags: ui

Related branches

Revision history for this message
Lee Trager (ltrager) wrote :

This should be back ported if its effecting earlier versions of MAAS.

Changed in maas-ui:
importance: Undecided → Unknown
Changed in maas-ui:
status: New → Fix Released
Revision history for this message
Lee Trager (ltrager) wrote :

The attached branch adds websocket functions so the UI can view script content and delete scripts. It does not solve this bug.

Changed in maas:
milestone: none → 2.10-beta1
status: New → Fix Committed
Changed in maas:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.