Skip to content
This repository has been archived by the owner on Oct 16, 2024. It is now read-only.

Commit

Permalink
Merge branch 'master' into u/msingh/CLUSTERMAN-812-cache-kubernetes-c…
Browse files Browse the repository at this point in the history
…lient-creation
  • Loading branch information
gmdfalk authored Oct 19, 2023
2 parents a0d0419 + 55d0831 commit edbd14d
Show file tree
Hide file tree
Showing 12 changed files with 4 additions and 864 deletions.
11 changes: 0 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,21 +59,10 @@ test-external: clean-cache
tox -e external -- --tags=-yelp

.PHONY: itest
itest: export EXTRA_VOLUME_MOUNTS=/nail/etc/services/services.yaml:/nail/etc/services/services.yaml:ro
itest: cook-image
COMPOSE_PROJECT_NAME=clusterman_jammy tox -e acceptance
./service-itest-runner clusterman.batch.spot_price_collector "--aws-region=us-west-1 "
./service-itest-runner clusterman.batch.cluster_metrics_collector "--cluster=local-dev"
./service-itest-runner clusterman.batch.autoscaler_bootstrap "" clusterman.batch.autoscaler
make -C acceptance local-cluster-clean && make -C acceptance acceptance-internal

.PHONY: itest-external
itest-external: cook-image-external
COMPOSE_PROJECT_NAME=clusterman_jammy tox -e acceptance
./service-itest-runner examples.batch.spot_price_collector "--aws-region=us-west-1 --env-config-path=acceptance/srv-configs/clusterman-external.yaml"
./service-itest-runner examples.batch.cluster_metrics_collector "--cluster=local-dev --env-config-path=acceptance/srv-configs/clusterman-external.yaml"
./service-itest-runner examples.batch.autoscaler_bootstrap "--env-config-path=acceptance/srv-configs/clusterman-external.yaml" examples.batch.autoscaler
make -C acceptance local-cluster-clean && make -C acceptance acceptance-external

.PHONY: cook-image
cook-image:
Expand Down
4 changes: 2 additions & 2 deletions clusterman/kubernetes/kubernetes_cluster_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
import colorlog
import kubernetes
import staticconf
from kubernetes.client import V1beta1Eviction
from kubernetes.client import V1DeleteOptions
from kubernetes.client import V1Eviction
from kubernetes.client import V1ObjectMeta
from kubernetes.client.models.v1_node import V1Node as KubernetesNode
from kubernetes.client.models.v1_pod import V1Pod as KubernetesPod
Expand Down Expand Up @@ -356,7 +356,7 @@ def _evict_pod(self, pod: KubernetesPod):
self._core_api.create_namespaced_pod_eviction(
name=pod.metadata.name,
namespace=pod.metadata.namespace,
body=V1Eviction(
body=V1beta1Eviction(
metadata=V1ObjectMeta(
name=pod.metadata.name,
namespace=pod.metadata.namespace,
Expand Down
2 changes: 0 additions & 2 deletions clusterman/kubernetes/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
from kubernetes.client.models.v1_node_selector_requirement import V1NodeSelectorRequirement
from kubernetes.client.models.v1_node_selector_term import V1NodeSelectorTerm
from kubernetes.client.models.v1_pod import V1Pod as KubernetesPod
from kubernetes.config.config_exception import ConfigException

from clusterman.util import ClustermanResources

Expand Down Expand Up @@ -63,7 +62,6 @@ def __init__(self, kubeconfig_path: str, client_class: Type) -> None:
:param str kubeconfig_path: k8s configuration path
:param Type client_class: k8s client class to initialize
"""

# By making client a class variable we are avoiding re-creating kubernetes
# client object multiple times ( due to call to reload_state which calls reload_client in return)
if self._client is None:
Expand Down
7 changes: 0 additions & 7 deletions package/itest/ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,6 @@ python3.8 /itest/run_instance.py \
# Run the critical clusterman CLI commands
if [ ! "${EXAMPLE}" ]; then
highlight_exec /usr/bin/clusterman --version
highlight_exec /usr/bin/clusterman status --cluster local-dev -v
highlight_exec /usr/bin/clusterman manage --cluster local-dev --target-capacity 10 --dry-run
highlight_exec /usr/bin/clusterman disable --cluster local-dev --until tomorrow
highlight_exec /usr/bin/clusterman enable --cluster local-dev
highlight_exec /usr/bin/clusterman simulate --cluster local-dev --start-time 2017-12-01T08:00:00Z --end-time 2017-12-01T09:00:00Z --metrics-data-files /itest/metrics.json.gz
highlight_exec /usr/bin/clusterman --log-level debug simulate --cluster local-dev --scheduler mesos --autoscaler-config /itest/autoscaler_config.yaml --start-time 2017-12-01T08:00:00Z --end-time 2017-12-01T08:05:00Z --metrics-data-files /itest/metrics.json.gz

highlight "$0:" 'success!'
else
/bin/bash
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ idna==2.8
jmespath==0.9.4
jsonpickle==1.4.2
kiwisolver==1.1.0
kubernetes==24.2.0
kubernetes==10.0.1
matplotlib==3.4.2
mypy-extensions==0.4.3
numpy==1.21.6
Expand Down
Loading

0 comments on commit edbd14d

Please sign in to comment.