Skip to content

Commit

Permalink
creating pods added to the system
Browse files Browse the repository at this point in the history
  • Loading branch information
saeid93 committed Mar 27, 2023
1 parent af53b30 commit 49e246f
Show file tree
Hide file tree
Showing 107 changed files with 1,352 additions and 788 deletions.
58 changes: 29 additions & 29 deletions Dockerfiles/service/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def index():

try:

logging.info("received new configuration from utilization-server: {}".format(
logging.info("received new configuration from sdghafouri/utilization-server-smart-scheduler: {}".format(
request.form
))

Expand All @@ -50,34 +50,34 @@ def index():
# get hostname of current machine
hostname = socket.gethostname()
command = None

logging.info('trying to connect to the utilization-server')
while True:
try:
# register into controller and setup the stress
controller = requests.get('http://utilization-server.consolidation.svc/metrics/{}/'.format(hostname))

if controller.status_code == 404:
logging.info(controller.content)
time.sleep(1)
continue

content = controller.json()
logging.info("got resources: {}".format(content))

# running stress
command = COMMAND_TEMPLATE.format(
content.get('ram'),
content.get('cpu'),
)
break

except Exception as e:
logging.error(e)
exit(-1)

logging.info('running stress-ng: "{}"'.format(command))
os.system(command)
logging.info('starting service ...')
# logging.info('trying to connect to the sdghafouri/utilization-server-smart-scheduler')
# while True:
# try:
# # register into controller and setup the stress
# controller = requests.get('http://sdghafouri/utilization-server-smart-scheduler.consolidation.svc/metrics/{}/'.format(hostname))

# if controller.status_code == 404:
# logging.info(controller.content)
# time.sleep(1)
# continue

# content = controller.json()
# logging.info("got resources: {}".format(content))

# # running stress
# command = COMMAND_TEMPLATE.format(
# content.get('ram'),
# content.get('cpu'),
# )
# break

# except Exception as e:
# logging.error(e)
# exit(-1)

# logging.info('running stress-ng: "{}"'.format(command))
# os.system(command)

logging.info("serving 'app' on port {}".format(PORT))
app.run(host="0.0.0.0", port=PORT, debug=True, use_reloader=False)
1 change: 1 addition & 0 deletions Dockerfiles/service/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
docker build --tag=service:latest . && docker tag service:latest sdghafouri/service-smart-scheduler && docker push sdghafouri/service-smart-scheduler
2 changes: 1 addition & 1 deletion Dockerfiles/utilization-server/build.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
docker build --tag=utilization-server:latest . && docker tag utilization-server:latest sdghafouri/utilization-server && docker push sdghafouri/utilization-server
docker build --tag=sdghafouri/utilization-server-smart-scheduler-smart-scheduler:latest . && docker tag sdghafouri/utilization-server-smart-scheduler:latest sdghafouri/utilization-server-smart-scheduler-smart-scheduler && docker push sdghafouri/utilization-server-smart-scheduler-smart-scheduler
4 changes: 2 additions & 2 deletions data/configs/check/check_env.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@
},
"kube":{
"admin_config": "~/.kube/config",
"service_image": "sdghafouri/service",
"service_image": "sdghafouri/service-smart-scheduler",
"namespace": "consolidation",
"clean_after_exit": true,
"utilization_image": "sdghafouri/utilization-server"
"utilization_image": "sdghafouri/utilization-server-smart-scheduler"
}
}
}
4 changes: 2 additions & 2 deletions data/configs/check/check_env_17.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@
},
"kube":{
"admin_config": "~/.kube/config",
"service_image": "sdghafouri/service",
"service_image": "sdghafouri/service-smart-scheduler",
"namespace": "consolidation",
"clean_after_exit": true,
"utilization_image": "sdghafouri/utilization-server"
"utilization_image": "sdghafouri/utilization-server-smart-scheduler"
}
}
}
4 changes: 2 additions & 2 deletions data/configs/check/check_env_18.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@
},
"kube":{
"admin_config": "~/.kube/config",
"service_image": "sdghafouri/service",
"service_image": "sdghafouri/service-smart-scheduler",
"namespace": "consolidation",
"clean_after_exit": true,
"utilization_image": "sdghafouri/utilization-server"
"utilization_image": "sdghafouri/utilization-server-smart-scheduler"
}
}
}
4 changes: 2 additions & 2 deletions data/configs/check/check_env_19.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@
},
"kube":{
"admin_config": "~/.kube/config",
"service_image": "sdghafouri/service",
"service_image": "sdghafouri/service-smart-scheduler",
"namespace": "consolidation",
"clean_after_exit": true,
"utilization_image": "sdghafouri/utilization-server"
"utilization_image": "sdghafouri/utilization-server-smart-scheduler"
}
}
}
4 changes: 2 additions & 2 deletions data/configs/check/check_env_20.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@
},
"kube":{
"admin_config": "~/.kube/config",
"service_image": "sdghafouri/service",
"service_image": "sdghafouri/service-smart-scheduler",
"namespace": "consolidation",
"clean_after_exit": true,
"utilization_image": "sdghafouri/utilization-server"
"utilization_image": "sdghafouri/utilization-server-smart-scheduler"
}
}
}
4 changes: 2 additions & 2 deletions data/configs/check/check_env_21.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@
},
"kube":{
"admin_config": "~/.kube/config",
"service_image": "sdghafouri/service",
"service_image": "sdghafouri/service-smart-scheduler",
"namespace": "consolidation",
"clean_after_exit": true,
"utilization_image": "sdghafouri/utilization-server"
"utilization_image": "sdghafouri/utilization-server-smart-scheduler"
}
}
}
4 changes: 2 additions & 2 deletions data/configs/check/check_env_22.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@
},
"kube":{
"admin_config": "~/.kube/config",
"service_image": "sdghafouri/service",
"service_image": "sdghafouri/service-smart-scheduler",
"namespace": "consolidation",
"clean_after_exit": true,
"utilization_image": "sdghafouri/utilization-server"
"utilization_image": "sdghafouri/utilization-server-smart-scheduler"
}
}
}
124 changes: 13 additions & 111 deletions data/configs/generation-configs/cluster.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"notes":"16 node clsuter same as cluster 17",
"notes":"2 node clsuter for testing the kubernetes implementation",
"fixed_size_cluster": true,
"nums": {
"nodes": 10,
"services": 1200,
"nodes": 2,
"services": 10,
"resources": 2,
"services_types": 8,
"services_types_map": [150, 150, 150, 150, 150, 150, 150, 150]
"services_types": 1,
"services_types_map": [10]
},
"metrics": {
"ram":"mb",
Expand All @@ -18,131 +18,33 @@
},
"nodes_cap_rng": {
"ram": {
"min": 8000,
"max": 8000,
"min": 2500,
"max": 2500,
"step": 1
},
"cpu": {
"min": 8,
"max": 8,
"min": 1,
"max": 1,
"step": 1
}
},
"services_request_rng": {
"0":
{
"num": 150,
"num": 10,
"ram": {
"min": 250,
"max": 250,
"step": 1
},
"cpu": {
"min": 0.250,
"max": 0.250,
"step": 1
}
},
"1":
{
"num": 150,
"ram": {
"min": 500,
"max": 500,
"step": 1
},
"cpu": {
"min": 0.5,
"max": 0.5,
"step": 1
}
},
"2":
{
"num": 150,
"ram": {
"min": 1000,
"max": 1000,
"step": 1
},
"cpu": {
"min": 1,
"max": 1,
"step": 1
}
},
"3":
{
"num": 150,
"ram": {
"min": 2000,
"max": 2000,
"step": 1
},
"cpu": {
"min": 2,
"max": 2,
"step": 1
}
},
"4":
{
"num": 150,
"ram": {
"min": 3000,
"max": 3000,
"step": 1
},
"cpu": {
"min": 3,
"max": 3,
"step": 1
}
},
"5":
{
"num": 150,
"ram": {
"min": 4000,
"max": 4000,
"step": 1
},
"cpu": {
"min": 4,
"max": 4,
"step": 1
}
},
"6":
{
"num": 150,
"ram": {
"min": 5000,
"max": 5000,
"step": 1
},
"cpu": {
"min": 5,
"max": 5,
"step": 1
}
},
"7":
{
"num": 150,
"ram": {
"min": 6000,
"max": 6000,
"step": 1
},
"cpu": {
"min": 6,
"max": 6,
"min": 0.125,
"max": 0.125,
"step": 1
}
}
},
"start_workload":[[0.5, 0.5], [0.5, 0.5], [0.5, 0.5], [0.5, 0.5], [0.5, 0.5], [0.5, 0.5], [0.5, 0.5], [0.5, 0.5]],
"start_workload":[[0.5, 0.5]],
"cluster_start_time": 0,
"cluster_end_time": 5000,
"seed": 42
Expand Down
8 changes: 4 additions & 4 deletions data/configs/generation-configs/workload_random.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"workload_type": "random",
"notes": "resoure usage",
"cluster_id": 22,
"cluster_id": 23,
"timesteps": 300,
"services_types": 8,
"services_types": 1,
"workloads_var" : {
"steps_unit":[[0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0]],
"max_steps":[[1, 1], [1, 1], [1, 1], [1, 1], [1, 1], [1, 1], [1, 1], [1, 1]]
"steps_unit":[[0, 0]],
"max_steps":[[1, 1]]
},
"plot_smoothing":301,
"seed":42
Expand Down
4 changes: 2 additions & 2 deletions data/configs/train/DQN-balance-axtra.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@
},
"kube":{
"admin_config": "~/.kube/config",
"service_image": "sdghafouri/service",
"service_image": "sdghafouri/service-smart-scheduler",
"namespace": "consolidation",
"clean_after_exit": true,
"utilization_image": "sdghafouri/utilization-server"
"utilization_image": "sdghafouri/utilization-server-smart-scheduler"
}
},
"run_or_experiment": "DQN",
Expand Down
4 changes: 2 additions & 2 deletions data/configs/train/DQN-balance-big.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@
},
"kube":{
"admin_config": "~/.kube/config",
"service_image": "sdghafouri/service",
"service_image": "sdghafouri/service-smart-scheduler",
"namespace": "consolidation",
"clean_after_exit": true,
"utilization_image": "sdghafouri/utilization-server"
"utilization_image": "sdghafouri/utilization-server-smart-scheduler"
}
},
"run_or_experiment": "DQN",
Expand Down
4 changes: 2 additions & 2 deletions data/configs/train/DQN-balance-medium.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@
},
"kube":{
"admin_config": "~/.kube/config",
"service_image": "sdghafouri/service",
"service_image": "sdghafouri/service-smart-scheduler",
"namespace": "consolidation",
"clean_after_exit": true,
"utilization_image": "sdghafouri/utilization-server"
"utilization_image": "sdghafouri/utilization-server-smart-scheduler"
}
},
"run_or_experiment": "DQN",
Expand Down
4 changes: 2 additions & 2 deletions data/configs/train/DQN-balance-six.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@
},
"kube":{
"admin_config": "~/.kube/config",
"service_image": "sdghafouri/service",
"service_image": "sdghafouri/service-smart-scheduler",
"namespace": "consolidation",
"clean_after_exit": true,
"utilization_image": "sdghafouri/utilization-server"
"utilization_image": "sdghafouri/utilization-server-smart-scheduler"
}
},
"run_or_experiment": "DQN",
Expand Down
Loading

0 comments on commit 49e246f

Please sign in to comment.