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

Slider #184

Merged
merged 2 commits into from
Dec 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
34 changes: 34 additions & 0 deletions docs/region-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ A quota follows the kubernetes model which is composed of:
| `tolerations` | NA | This node selector can be injected in a service to force it to run on nodes with this taint |
| `startupProbe` | NA | This startup probe can be injected in a service. It can help you in environment with slow network to specify a long duration before killing a container |
| `kafka` | | See [Kafka](####kafka) |
| `sliders` | | See [sliders](####sliders) |
| `Resources` | | See [Resources](####resources) |

#### kafka

Expand All @@ -141,6 +143,38 @@ kafka can be used to get some events in users chart like hive metastore.
| `URL` | N.A | brokerURL |
| `topicName` | N.A | topic name for those events |

#### sliders

Sliders specify some slider parameters that may overwrite some defaults.

| Key | Default | Description |
| --------------------- | ------- | ------------------------------------------------------------------ |
| `cpu` | N.A | cpu slider parameters |
| `memory` | N.A | memory slider parameters |
| `gpu` | N.A | gpu slider parameters |
| `disk` | N.A | disk slider parameters |


| Key | Default | Description |
| --------------------- | ------- | ------------------------------------------------------------------ |
| `sliderMin` | N.A | sliderMin |
| `sliderMax` | N.A | sliderMax |
| `sliderStep` | N.A | sliderStep |
| `sliderUnit` | N.A | sliderUnit |

#### resources

Resources specify some values that may overwrite some defaults.

| Key | Default | Description |
| --------------------- | ------- | ------------------------------------------------------------------ |
| `cpuRequest` | N.A | overwrite default cpu request if asked by helm-charts |
| `cpuLimit` | N.A | overwrite default cpu limit if asked by helm-charts |
| `memoryRequest` | N.A | overwrite default memory request if asked by helm-charts |
| `memoryLimit` | N.A | overwrite default memory limit if asked by helm-charts |
| `disk` | N.A | overwrite default disk size if asked by helm-charts |
| `gpu` | N.A | overwrite default gpu if asked by helm-charts |


## Data properties

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@ public static class XOnyxia {
boolean hidden = false;
boolean readonly = false;
String overwriteDefaultWith;
String overwriteSliderWith;

public boolean isHidden() {
return hidden;
Expand All @@ -370,6 +371,14 @@ public String getOverwriteDefaultWith() {
public void setOverwriteDefaultWith(String overwriteDefaultWith) {
this.overwriteDefaultWith = overwriteDefaultWith;
}

public String getOverwriteSliderWith() {
return overwriteSliderWith;
}

public void setOverwriteSliderWith(String overwriteSliderWith) {
this.overwriteSliderWith = overwriteSliderWith;
}
}

@JsonIgnoreProperties(ignoreUnknown = true)
Expand Down
155 changes: 155 additions & 0 deletions onyxia-model/src/main/java/fr/insee/onyxia/model/region/Region.java
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,8 @@ public static class DefaultConfiguration {
private Object nodeSelector;
private Object startupProbe;
private Kafka kafka = new Kafka();
private Sliders sliders = new Sliders();
private Resources resources = new Resources();

public void setIPProtection(boolean IPProtection) {
this.IPProtection = IPProtection;
Expand Down Expand Up @@ -265,6 +267,22 @@ public void setKafka(Kafka kafka) {
this.kafka = kafka;
}

public Sliders getSliders() {
return sliders;
}

public void setSliders(Sliders sliders) {
this.sliders = sliders;
}

public Resources getResources() {
return resources;
}

public void setResources(Resources resources) {
this.resources = resources;
}

public static class Kafka {
@JsonProperty("URL")
private String url;
Expand All @@ -287,6 +305,143 @@ public void setTopicName(String topicName) {
this.topicName = topicName;
}
}

public static class Sliders {

Slider cpu;
Slider memory;
Slider gpu;
Slider disk;

public Slider getCpu() {
return cpu;
}

public void setCpu(Slider cpu) {
this.cpu = cpu;
}

public Slider getMemory() {
return memory;
}

public void setMemory(Slider memory) {
this.memory = memory;
}

public Slider getGpu() {
return gpu;
}

public void setGpu(Slider gpu) {
this.gpu = gpu;
}

public Slider getDisk() {
return disk;
}

public void setDisk(Slider disk) {
this.disk = disk;
}

public static class Slider {

Integer sliderMin;
Integer sliderMax;
Integer sliderStep;
String sliderUnit;

public Integer getSliderMin() {
return sliderMin;
}

public void setSliderMin(Integer sliderMin) {
this.sliderMin = sliderMin;
}

public Integer getSliderMax() {
return sliderMax;
}

public void setSliderMax(Integer sliderMax) {
this.sliderMax = sliderMax;
}

public Integer getSliderStep() {
return sliderStep;
}

public void setSliderStep(Integer sliderStep) {
this.sliderStep = sliderStep;
}

public String getSliderUnit() {
return sliderUnit;
}

public void setSliderUnit(String sliderUnit) {
this.sliderUnit = sliderUnit;
}
}
}

public static class Resources {
private String cpuRequest;
private String cpuLimit;
private String memoryRequest;
private String memoryLimit;
private String disk;
private String gpu;

public String getCpuRequest() {
return cpuRequest;
}

public void setCpuRequest(String cpuRequest) {
this.cpuRequest = cpuRequest;
}

public String getCpuLimit() {
return cpuLimit;
}

public void setCpuLimit(String cpuLimit) {
this.cpuLimit = cpuLimit;
}

public String getMemoryRequest() {
return memoryRequest;
}

public void setMemoryRequest(String memoryRequest) {
this.memoryRequest = memoryRequest;
}

public String getMemoryLimit() {
return memoryLimit;
}

public void setMemoryLimit(String memoryLimit) {
this.memoryLimit = memoryLimit;
}

public String getDisk() {
return disk;
}

public void setDisk(String disk) {
this.disk = disk;
}

public String getGpu() {
return gpu;
}

public void setGpu(String gpu) {
this.gpu = gpu;
}
}
}

public static class Quotas {
Expand Down