Commit c81dca43 by Chif Gergő

Virtual CPU core max value now configurable

Add new environment variable (MAX_NODE_CPU_RAM) in settings/base.py. Using this variable in dashboard/forms.py as maximal value of cpu cores.
parent aa92a44d
Pipeline #657 passed with stage
in 0 seconds
......@@ -574,6 +574,7 @@ SESSION_COOKIE_NAME = "csessid%x" % (((getnode() // 139) ^
(getnode() % 983)) & 0xffff)
MAX_NODE_RAM = get_env_variable("MAX_NODE_RAM", 1024)
MAX_NODE_CPU_CORE = get_env_variable("MAX_NODE_CPU_CORE", 10)
# Url to download the client: (e.g. http://circlecloud.org/client/download/)
CLIENT_DOWNLOAD_URL = get_env_variable('CLIENT_DOWNLOAD_URL', 'http://circlecloud.org/client/download/')
......
......@@ -59,7 +59,7 @@ from storage.models import DataStore, Disk
from django.contrib.admin.widgets import FilteredSelectMultiple
from django.contrib.auth.models import Permission
from .models import Profile, GroupProfile, Message
from circle.settings.base import LANGUAGES, MAX_NODE_RAM
from circle.settings.base import LANGUAGES, MAX_NODE_RAM, MAX_NODE_CPU_CORE
from django.utils.translation import string_concat
from .validators import domain_validator
......@@ -118,10 +118,10 @@ class VmCustomizeForm(forms.Form):
cpu_count = forms.IntegerField(widget=forms.NumberInput(attrs={
'class': "form-control input-tags cpu-count-input",
'min': 1,
'max': 10,
'max': MAX_NODE_CPU_CORE,
'required': "",
}),
min_value=1, max_value=10,
min_value=1, max_value=MAX_NODE_CPU_CORE,
)
ram_size = forms.IntegerField(widget=forms.TextInput(attrs={
......@@ -466,10 +466,10 @@ class TemplateForm(forms.ModelForm):
num_cores = forms.IntegerField(widget=forms.NumberInput(attrs={
'class': "form-control input-tags cpu-count-input",
'min': 1,
'max': 10,
'max': MAX_NODE_CPU_CORE,
'required': "",
}),
min_value=1, max_value=10,
min_value=1, max_value=MAX_NODE_CPU_CORE,
)
ram_size = forms.IntegerField(widget=forms.NumberInput(attrs={
......@@ -1508,10 +1508,10 @@ class VmResourcesForm(forms.ModelForm):
num_cores = forms.IntegerField(widget=forms.NumberInput(attrs={
'class': "form-control input-tags cpu-count-input",
'min': 1,
'max': 10,
'max': MAX_NODE_CPU_CORE,
'required': "",
}),
min_value=1, max_value=10,
min_value=1, max_value=MAX_NODE_CPU_CORE,
)
ram_size = forms.IntegerField(widget=forms.NumberInput(attrs={
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment