Skip to content
Open
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
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ IMG ?= ghcr.io/converged-computing/state-machine-operator:latest
ARMIMG ?= ghcr.io/converged-computing/state-machine-operator:arm
DEVIMG ?= ghcr.io/converged-computing/state-machine-operator:test
MANAGER_IMG ?= ghcr.io/converged-computing/state-machine-operator:manager
INSTANCE_SELECT_IMG ?= ghcr.io/converged-computing/state-machine-operator:instance-select

# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
ENVTEST_K8S_VERSION = 1.30.0
Expand Down Expand Up @@ -146,6 +147,10 @@ docker-push: ## Push docker image with the manager.
manager:
$(CONTAINER_TOOL) build -f docker/manager/Dockerfile -t ${MANAGER_IMG} .

.PHONY: instance-select
instance-select:
$(CONTAINER_TOOL) build -f docker/instance-select/Dockerfile -t ${INSTANCE_SELECT_IMG} .

.PHONY: kind
kind: manager ## Build docker image with the manager and load into kind
kind load docker-image ${MANAGER_IMG}
Expand Down
4 changes: 4 additions & 0 deletions python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@
"river",
"kubernetes",
],
extras_require={
'instance-select': ['pandas', 'requests', "grpcio", "grpcio-tools"],
},
tests_require=["pytest", "pytest-cov"],
classifiers=[
"Intended Audience :: Science/Research",
Expand All @@ -55,6 +58,7 @@
entry_points={
"console_scripts": [
"state-machine-manager=state_machine_operator.manager:main",
"instance-select-server=state_machine_operator.instances.server:main",
]
},
)
13 changes: 10 additions & 3 deletions python/state_machine_operator/analysis/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,14 @@ def generate_colors(self, items):
colors[item] = hexcolors.pop(0)
return colors

def to_gantt(self, outfile, title="Node Uptimes for Static vs Autoscaling", colors=None):
def to_gantt(
self,
outfile,
title="Node Uptimes for Static vs Autoscaling",
colors=None,
width=8,
height=20,
):
"""
Make a gantt chart of nodes over time
"""
Expand Down Expand Up @@ -83,7 +90,7 @@ def to_gantt(self, outfile, title="Node Uptimes for Static vs Autoscaling", colo
patches.append(matplotlib.patches.Patch(color=color))

# Each needs its own plot
fig, axs = plt.subplots(number_plots, figsize=(8, 20))
fig, axs = plt.subplots(number_plots, figsize=(width, height))
idx = 0
for experiment in self.df.experiment.unique():
exp_subset = self.df[self.df.experiment == experiment]
Expand All @@ -105,7 +112,7 @@ def to_gantt(self, outfile, title="Node Uptimes for Static vs Autoscaling", colo
idx += 1

plt.subplots_adjust(top=0.95)
fig.suptitle(title, fontsize=11)
fig.suptitle(title, fontsize=11, x=0.025, y=0.98, ha="left")
fig.legend(handles=patches, labels=colors.keys(), fontsize=11)
plt.savefig(outfile)

Expand Down
5 changes: 5 additions & 0 deletions python/state_machine_operator/defaults.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
scheduler = "kubernetes"
registry = "registry-0.state-machine.default.svc.cluster.local:5000"
service_account_file = "/var/run/secrets/kubernetes.io/serviceaccount/namespace"

# Insance select server
workers = 8
port = 8080

# Operator label for the jobid
operator_label = "jobid"
Expand Down
7 changes: 3 additions & 4 deletions python/state_machine_operator/tracker/kubernetes/utils.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import os

from kubernetes import client

import state_machine_operator.default as defaults

def get_namespace():
"""
Get the current namespace the workflow manager is running in.
"""
ns_path = "/var/run/secrets/kubernetes.io/serviceaccount/namespace"
if os.path.exists(ns_path):
with open(ns_path) as f:
if os.path.exists(defaults.service_account_file):
with open(defaults.service_account_file) as f:
return f.read().strip()


Expand Down
Loading