Skip to content

Commit 4cd49c4

Browse files
authored
Merge pull request #362 from fabric-testbed/infrastructure-slices
allow infrastructure slices
2 parents 76f72b3 + c02f828 commit 4cd49c4

File tree

8 files changed

+18
-8
lines changed

8 files changed

+18
-8
lines changed

fabric_cf/actor/core/common/constants.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ class Constants:
197197
CONFIGURATION_FILE = "/etc/fabric/actor/config/config.yaml"
198198
STATE_FILE_LOCATION = '/tmp/fabric_actor.tmp'
199199
MAINT_PROJECT_ID = 'maint.project.id'
200+
INFRASTRUCTURE_PROJECT_ID = "infrastructure.project.id"
200201

201202
ELASTIC_TIME = "request.elasticTime"
202203
ELASTIC_SIZE = "request.elasticSize"

fabric_cf/actor/core/policy/authority_calendar_policy.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -596,6 +596,9 @@ def get_network_service_from_graph(self, *, node_id: str) -> NetworkServiceSlive
596596
if self.aggregate_resource_model is None:
597597
return None
598598
return self.aggregate_resource_model.build_deep_ns_sliver(node_id=node_id)
599+
except Exception as e:
600+
self.logger.error(f"Unable to get network service: {e}")
601+
self.logger.error(traceback.format_exc())
599602
finally:
600603
self.lock.release()
601604

fabric_cf/actor/core/policy/network_service_inventory.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ def allocate_ifs(self, *, requested_ns: NetworkServiceSliver, requested_ifs: Int
153153

154154
if vlan_range is not None and requested_vlan not in vlan_range:
155155
raise BrokerException(error_code=ExceptionErrorCode.FAILURE,
156-
msg=f"Vlan for L2 service {requested_vlan} is outside the available vlans "
156+
msg=f"Vlan for L2 service {requested_vlan} is outside the available range "
157157
f"{vlan_range}")
158158

159159
# Validate the VLANs

fabric_cf/authority/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ services:
5252
network: host
5353
context: ../../../
5454
dockerfile: Dockerfile-auth
55-
image: authority:1.6.0
55+
image: authority:1.6.1
5656
container_name: site1-am
5757
restart: always
5858
depends_on:

fabric_cf/broker/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ services:
5454
build:
5555
context: ../../../
5656
dockerfile: Dockerfile-broker
57-
image: broker:1.6.0
57+
image: broker:1.6.1
5858
container_name: broker
5959
restart: always
6060
networks:

fabric_cf/orchestrator/config.orchestrator.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ runtime:
4848
kafka.request.timeout.ms: 120000
4949
rpc.request.timeout.seconds: 1200
5050
maint.project.id: 990d8a8b-7e50-4d13-a3be-0f133ffa8653
51+
infrastructure.project.id: 4604cab7-41ff-4c1a-a935-0ca6f20cceeb
5152
message.max.bytes: 1048588
5253
rpc.retries: 5
5354
commit.batch.size: 1

fabric_cf/orchestrator/core/orchestrator_handler.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ def __init__(self):
6464
self.logger = self.globals.get_logger()
6565
self.jwks_url = self.globals.get_config().get_oauth_config().get(Constants.PROPERTY_CONF_O_AUTH_JWKS_URL, None)
6666
self.pdp_config = self.globals.get_config().get_global_config().get_pdp_config()
67+
self.infrastructure_project_id = self.globals.get_config().get_runtime_config().get(Constants.INFRASTRUCTURE_PROJECT_ID, None)
6768

6869
def get_logger(self):
6970
"""
@@ -218,7 +219,8 @@ def create_slice(self, *, token: str, slice_name: str, slice_graph: str, ssh_key
218219
fabric_token = AccessChecker.validate_and_decode_token(token=token)
219220
project, tags, project_name = fabric_token.first_project
220221
allow_long_lived = True if Constants.SLICE_NO_LIMIT_LIFETIME in tags else False
221-
end_time = self.__validate_lease_end_time(lease_end_time=lease_end_time, allow_long_lived=allow_long_lived)
222+
end_time = self.__validate_lease_end_time(lease_end_time=lease_end_time, allow_long_lived=allow_long_lived,
223+
project_id=project)
222224

223225
controller = self.controller_state.get_management_actor()
224226
self.logger.debug(f"create_slice invoked for Controller: {controller}")
@@ -701,7 +703,8 @@ def renew_slice(self, *, token: str, slice_id: str, new_lease_end_time: str):
701703
project, tags, project_name = fabric_token.first_project
702704
allow_long_lived = True if Constants.SLICE_NO_LIMIT_LIFETIME in tags else False
703705
new_end_time = self.__validate_lease_end_time(lease_end_time=new_lease_end_time,
704-
allow_long_lived=allow_long_lived)
706+
allow_long_lived=allow_long_lived,
707+
project_id=project)
705708

706709
reservations = controller.get_reservations(slice_id=slice_id)
707710
if reservations is None or len(reservations) < 1:
@@ -748,11 +751,13 @@ def renew_slice(self, *, token: str, slice_id: str, new_lease_end_time: str):
748751
self.logger.error(f"Exception occurred processing renew e: {e}")
749752
raise e
750753

751-
def __validate_lease_end_time(self, lease_end_time: str, allow_long_lived: bool = False) -> datetime:
754+
def __validate_lease_end_time(self, lease_end_time: str, allow_long_lived: bool = False,
755+
project_id: str = None) -> datetime:
752756
"""
753757
Validate Lease End Time
754758
:param lease_end_time: New End Time
755759
:param allow_long_lived: Allow long lived tokens
760+
:param project_id: Project Id
756761
:return End Time
757762
:raises Exception if new end time is in past
758763
"""
@@ -774,7 +779,7 @@ def __validate_lease_end_time(self, lease_end_time: str, allow_long_lived: bool
774779
default_long_lived_duration = Constants.LONG_LIVED_SLICE_TIME_WEEKS
775780
else:
776781
default_long_lived_duration = Constants.DEFAULT_MAX_DURATION
777-
if (new_end_time - now) > default_long_lived_duration:
782+
if project_id not in self.infrastructure_project_id and (new_end_time - now) > default_long_lived_duration:
778783
self.logger.info(f"New term end time {new_end_time} exceeds system default "
779784
f"{default_long_lived_duration}, setting to system default: ")
780785

fabric_cf/orchestrator/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ services:
6868
build:
6969
context: ../../../
7070
dockerfile: Dockerfile-orchestrator
71-
image: orchestrator:1.6.0
71+
image: orchestrator:1.6.1
7272
container_name: orchestrator
7373
restart: always
7474
depends_on:

0 commit comments

Comments
 (0)