Skip to content

Commit

Permalink
feat: add autoscaling values for ralph and superset
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian2012 committed Nov 5, 2024
1 parent c3434ee commit d364839
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 0 deletions.
8 changes: 8 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,14 @@ At this point you should have a working Tutor / Aspects environment, but with no

You should now have data to look at in Superset! Log in to https://superset.local.overhang.io/ with your admin account and you should see charts with your data.

Aspects Autoscaling
-------------------

Aspects adds default autoscaling values for `Ralph`, `Superset` and the `Superset Worker` deployments via
`tutor-contrib-pod-autoscaling <https://github.com/eduNEXT/tutor-contrib-pod-autoscaling>`_. To apply the
autoscaling settings make sure to install the plugin and enable it. To modify the autoscaling values
see the `Configuration <https://github.com/eduNEXT/tutor-contrib-pod-autoscaling?tab=readme-ov-file#configuration>`_ section.

Superset Assets
---------------

Expand Down
46 changes: 46 additions & 0 deletions tutoraspects/filters.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
from tutorpod_autoscaling.hooks import AUTOSCALING_CONFIG


@AUTOSCALING_CONFIG.add()
def add_aspects_autoscaling(autoscaling_config):
autoscaling_config.update(
{
"ralph": {
"enable_hpa": True,
"memory_request": "300Mi",
"cpu_request": 0.25,
"memory_limit": "600Mi",
"cpu_limit": 1,
"min_replicas": 1,
"max_replicas": 10,
"avg_cpu": 80,
"avg_memory": "",
"enable_vpa": False,
},
"superset": {
"enable_hpa": True,
"memory_request": "500Mi",
"cpu_request": 0.25,
"memory_limit": "1000Mi",
"cpu_limit": 1,
"min_replicas": 1,
"max_replicas": 10,
"avg_cpu": 80,
"avg_memory": "",
"enable_vpa": False,
},
"superset-worker": {
"enable_hpa": True,
"memory_request": "600Mi",
"cpu_request": 0.25,
"memory_limit": "1500Mi",
"cpu_limit": 1,
"min_replicas": 1,
"max_replicas": 10,
"avg_cpu": 80,
"avg_memory": "",
"enable_vpa": False,
},
}
)
return autoscaling_config
6 changes: 6 additions & 0 deletions tutoraspects/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -636,3 +636,9 @@ def _aspects_public_hosts(
# file for now.
for f in TUTOR_V1_COMMANDS:
hooks.Filters.CLI_COMMANDS.add_item(f)

# Autoscaling
try:
from tutoraspects.filters import add_aspects_autoscaling
except ImportError:
pass

0 comments on commit d364839

Please sign in to comment.