mirror of
https://github.com/gryf/coach.git
synced 2025-12-18 03:30:19 +01:00
Add RedisDataStore (#295)
* GraphManager.set_session also sets self.sess * make sure that GraphManager.fetch_from_worker uses training phase * remove unnecessary phase setting in training worker * reorganize rollout worker * provide default name to GlobalVariableSaver.__init__ since it isn't really used anyway * allow dividing TrainingSteps and EnvironmentSteps * add timestamps to the log * added redis data store * conflict merge fix
This commit is contained in:
committed by
shadiendrawis
parent
34e1c04f29
commit
7b0fccb041
@@ -78,11 +78,18 @@ class RedisPubSubBackend(MemoryBackend):
|
||||
"""
|
||||
if 'namespace' not in self.params.orchestrator_params:
|
||||
self.params.orchestrator_params['namespace'] = "default"
|
||||
from kubernetes import client
|
||||
from kubernetes import client, config
|
||||
|
||||
container = client.V1Container(
|
||||
name=self.redis_server_name,
|
||||
image='redis:4-alpine',
|
||||
resources=client.V1ResourceRequirements(
|
||||
limits={
|
||||
"cpu": "8",
|
||||
"memory": "4Gi"
|
||||
# "nvidia.com/gpu": "0",
|
||||
}
|
||||
),
|
||||
)
|
||||
template = client.V1PodTemplateSpec(
|
||||
metadata=client.V1ObjectMeta(labels={'app': self.redis_server_name}),
|
||||
@@ -105,8 +112,10 @@ class RedisPubSubBackend(MemoryBackend):
|
||||
spec=deployment_spec
|
||||
)
|
||||
|
||||
config.load_kube_config()
|
||||
api_client = client.AppsV1Api()
|
||||
try:
|
||||
print(self.params.orchestrator_params)
|
||||
api_client.create_namespaced_deployment(self.params.orchestrator_params['namespace'], deployment)
|
||||
except client.rest.ApiException as e:
|
||||
print("Got exception: %s\n while creating redis-server", e)
|
||||
|
||||
Reference in New Issue
Block a user