Skip to content

Commit f32342f

Browse files
authored
Merge pull request #114 from fabric-testbed/doc-tag-log
Issues identified during network tests
2 parents 2f7b274 + 9d15f6b commit f32342f

22 files changed

+105
-311
lines changed

Dockerfile-auth

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
11
FROM python:3.9.0
22
MAINTAINER Komal Thareja<[email protected]>
33

4+
HANDLERS_VER=1.0rc2
5+
46
RUN mkdir -p /usr/src/app
57
WORKDIR /usr/src/app
68
VOLUME ["/usr/src/app"]
79

810
EXPOSE 11000
911

10-
COPY . /usr/src/app/
12+
COPY requirements.txt /usr/src/app/
13+
COPY fabric_cf /usr/src/app/fabric_cf
1114
RUN pip3 install --no-cache-dir -r requirements.txt
1215
RUN mkdir -p "/etc/fabric/message_bus/schema"
1316
RUN mkdir -p "/etc/fabric/actor/config"
1417
RUN mkdir -p "/var/log/actor"
1518
RUN cp /usr/local/lib/python3.9/site-packages/fabric_mb/message_bus/schema/*.avsc /etc/fabric/message_bus/schema
16-
RUN pip3 install fabric-am-handlers==1.0rc1
19+
RUN pip3 install fabric-am-handlers==HANDLERS_VER
1720

1821
ENTRYPOINT ["python3"]
1922
CMD ["-m", "fabric_cf.authority"]

Dockerfile-broker

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ VOLUME ["/usr/src/app"]
77

88
EXPOSE 11000
99

10-
COPY . /usr/src/app/
10+
COPY requirements.txt /usr/src/app/
11+
COPY fabric_cf /usr/src/app/fabric_cf
1112
RUN pip3 install --no-cache-dir -r requirements.txt
1213
RUN mkdir -p "/etc/fabric/message_bus/schema"
1314
RUN mkdir -p "/etc/fabric/actor/config"

Dockerfile-cf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ VOLUME ["/usr/src/app"]
77

88
EXPOSE 11000
99

10-
COPY . /usr/src/app/
10+
COPY requirements.txt /usr/src/app/
11+
COPY fabric_cf /usr/src/app/fabric_cf
1112
RUN pip3 install --no-cache-dir -r requirements.txt
1213
RUN mkdir -p "/etc/fabric/message_bus/schema"
1314
RUN mkdir -p "/etc/fabric/actor/config"

Dockerfile-orchestrator

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ VOLUME ["/usr/src/app"]
88
EXPOSE 11000
99
EXPOSE 8700
1010

11-
COPY . /usr/src/app/
11+
COPY requirements.txt /usr/src/app/
12+
COPY fabric_cf /usr/src/app/fabric_cf
1213
RUN pip3 install --no-cache-dir -r requirements.txt
1314
RUN mkdir -p "/etc/fabric/message_bus/schema"
1415
RUN mkdir -p "/etc/fabric/actor/config"

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,14 @@ Broker is an agent of CF that collects resource availability information from mu
1818
AM is a CF agent responsible for managing aggregate resources. Is under the control of the owner of the aggregate. Provides promises of resources to brokers and controllers/ orchestrators. More details can be found [here](fabric_cf/authority/Readme.md)
1919

2020
## Orchestrator
21-
Orchestrator is an agent of CF that makes allocation decisions (embedding) of user requests into available resources. Communicates with user to collect slice requests, communicates with broker or aggregate managers to collect resource promises, communicates with aggregate managers to provision promised resources. Creates slices, configures resources, maintains their state, modifies slices and slivers. More details can be found [here](fabric_cf/orchestrator/Readme.md)
21+
Orchestrator is an agent of CF that makes allocation decisions (embedding) of user requests into available resources. Communicates with user to collect slice requests, communicates with broker or aggregate managers to collect resource promises, communicates with aggregate managers to provision promised resources. Creates slices, configures resources, maintains their state, modifies slices and slivers. More details can be found [here](fabric_cf/orchestrator/README.md)
22+
23+
## Architecture
24+
The following diagram depicts an overall architecture for the Control Framework.
25+
![Architecture](./images/cf.png)
2226

2327
## Requirements
24-
Python 3.7+
28+
Python 3.9+
2529

2630
## Build Docker Images
2731

fabric_cf/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__VERSION__ = "1.0rc2"
1+
__VERSION__ = "1.0rc3"

fabric_cf/actor/boot/configuration.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,12 @@ def get_global_config(self) -> GlobalConfig:
398398
"""
399399
return self.global_config
400400

401+
def get_log_config(self) -> dict:
402+
"""
403+
Return Log config
404+
"""
405+
return self.global_config.get_logging()
406+
401407
def get_runtime_config(self) -> dict:
402408
"""
403409
Return Runtime Config

fabric_cf/actor/core/common/constants.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,3 +274,5 @@ class Constants:
274274
DEFAULT_VLAN_OFFSET = 10
275275
VLAN_START = 1
276276
VLAN_END = 4096
277+
278+
CONFIG_PROPERTIES_FILE = "config.properties.file"

fabric_cf/actor/core/container/globals.py

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,22 +69,21 @@ def __init__(self):
6969
self.lock = threading.Lock()
7070
self.jwt_validator = None
7171

72-
def make_logger(self):
72+
def make_logger(self, *, log_config: dict = None):
7373
"""
7474
Detects the path and level for the log file from the actor config and sets
7575
up a logger. Instead of detecting the path and/or level from the
7676
config, a custom path and/or level for the log file can be passed as
7777
optional arguments.
7878
79-
:param log_path: Path to custom log file
80-
:param log_level: Custom log level
79+
:param log_config: Log config
8180
:return: logging.Logger object
8281
"""
82+
if log_config is None:
83+
if self.config is None:
84+
raise RuntimeError('No config information available')
8385

84-
# Get the log path
85-
if self.config is None:
86-
raise RuntimeError('No config information available')
87-
log_config = self.config.get_global_config().get_logging()
86+
log_config = self.config.get_global_config().get_logging()
8887
if log_config is None:
8988
raise RuntimeError('No logging config information available')
9089

@@ -198,6 +197,13 @@ def get_config(self) -> Configuration:
198197
raise InitializationException(Constants.UNINITIALIZED_STATE)
199198
return self.config
200199

200+
def get_log_config(self) -> dict:
201+
"""
202+
Get the Log configuration
203+
@return dict
204+
"""
205+
return self.get_config().get_log_config()
206+
201207
def get_kafka_config_admin_client(self) -> dict:
202208
"""
203209
Get Kafka Config Admin Client

fabric_cf/actor/core/plugins/handlers/ansible_handler_processor.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ def __init__(self):
4848
self.thread = None
4949
self.future_lock = threading.Condition()
5050
self.stopped = False
51+
from fabric_cf.actor.core.container.globals import GlobalsSingleton
52+
self.log_config = GlobalsSingleton.get().get_log_config()
5153

5254
def __getstate__(self):
5355
state = self.__dict__.copy()
@@ -136,7 +138,7 @@ def invoke_handler(self, unit: ConfigToken, operation: str):
136138

137139
handler_class = ReflectionUtils.create_instance_with_params(module_name=handler.get_module_name(),
138140
class_name=handler.get_class_name())
139-
handler_obj = handler_class(self.logger, handler.get_properties())
141+
handler_obj = handler_class(self.log_config, handler.get_properties())
140142

141143
future = None
142144
if operation == Constants.TARGET_CREATE:

0 commit comments

Comments
 (0)