Skip to content

Commit 3c7dd04

Browse files
authored
Merge pull request #177 from fabric-testbed/rel1.2
Rel1.2 - Mega merge for all the 1.2 features
2 parents 07f8c6c + e3a3af8 commit 3c7dd04

File tree

155 files changed

+3897
-5389
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

155 files changed

+3897
-5389
lines changed

Dockerfile-auth

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
FROM python:3.9.0
22
MAINTAINER Komal Thareja<[email protected]>
33

4-
ARG HANDLERS_VER=1.1.1
4+
ARG HANDLERS_VER=1.2rc6
55

66
RUN mkdir -p /usr/src/app
77
WORKDIR /usr/src/app

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
include README.md
22
include LICENSE
3+
include requirements.txt
34
include fabric_cf/orchestrator/swagger_server/swagger/swagger.yaml
45
include fabric_cf/actor/security/data/*.json
56
include fabric_cf/authority/config.site.am.yaml

docker-compose-test.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,3 +257,13 @@ services:
257257
- ./secrets/snakeoil-ca-1.crt:/etc/fabric/message_bus/ssl/cacert.pem
258258
- ./secrets/kafkacat1.client.key:/etc/fabric/message_bus/ssl/client.key
259259
- ./secrets/kafkacat1-ca1-signed.pem:/etc/fabric/message_bus/ssl/client.pem
260+
pdp:
261+
image: fabrictestbed/authzforce-pdp:3.1.0
262+
container_name: pdp
263+
restart: always
264+
user: ${PDP_UID:-1000}:${PDP_GID:-1000}
265+
ports:
266+
- 8080:8080
267+
volumes:
268+
- ${PDP_NEW_CONF_PATH_HOST:-./newconf}:/conf
269+
- ${PDP_NEW_POLICIES_PATH_HOST:-./newpolicies}:/policies

fabricNo.AnyActorNoPolicy.xml

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

fabric_cf/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__VERSION__ = "1.1.2"
1+
__VERSION__ = "1.2rc4"

fabric_cf/actor/core/apis/abc_actor_mixin.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
from fabric_cf.actor.core.kernel.resource_set import ResourceSet
5353
from fabric_cf.actor.core.time.term import Term
5454

55+
5556
class ActorType(Enum):
5657
"""
5758
Enum for Actor Type
@@ -286,8 +287,7 @@ def queue_event(self, *, incoming: ABCActorEvent):
286287

287288
@abstractmethod
288289
def query(self, *, query: dict = None, caller: AuthToken = None,
289-
actor_proxy: ABCActorProxy = None, handler: ABCQueryResponseHandler = None,
290-
id_token: str = None):
290+
actor_proxy: ABCActorProxy = None, handler: ABCQueryResponseHandler = None):
291291
"""
292292
Processes a query request from the specified caller.
293293
@@ -296,7 +296,6 @@ def query(self, *, query: dict = None, caller: AuthToken = None,
296296
caller: caller
297297
actor_proxy: actor proxy
298298
handler: handler
299-
id_token: id_token
300299
301300
Returns:
302301
query response

fabric_cf/actor/core/apis/abc_actor_proxy.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,12 @@ class ABCActorProxy(ABCProxy):
4040
IActorProxy represents the proxy interface to a generic actor
4141
"""
4242
@abstractmethod
43-
def prepare_query(self, *, callback: ABCCallbackProxy, query: dict, caller: AuthToken, id_token: str):
43+
def prepare_query(self, *, callback: ABCCallbackProxy, query: dict, caller: AuthToken):
4444
"""
4545
Prepares the query
4646
4747
Args:
4848
callback: proxy call back which handles the query
4949
query: query
5050
caller: caller of the query
51-
id_token: id token
5251
"""

fabric_cf/actor/core/apis/abc_authority.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,25 +54,29 @@ def eject(self, *, resources: ResourceSet):
5454
"""
5555

5656
@abstractmethod
57-
def extend_lease(self, *, reservation: ABCAuthorityReservation, caller: AuthToken = None):
57+
def extend_lease(self, *, reservation: ABCAuthorityReservation, caller: AuthToken = None,
58+
callback: ABCControllerCallbackProxy = None,):
5859
"""
5960
Processes an extend lease request for the reservation.
6061
6162
@param reservation reservation representing a request for a lease
6263
extension
6364
@param caller : caller
65+
@param callback : callback
6466
6567
@raises Exception in case of error
6668
"""
6769

6870
@abstractmethod
69-
def modify_lease(self, *, reservation: ABCAuthorityReservation, caller: AuthToken):
71+
def modify_lease(self, *, reservation: ABCAuthorityReservation, caller: AuthToken,
72+
callback: ABCControllerCallbackProxy = None,):
7073
"""
7174
Processes an modify lease request for the reservation.
7275
7376
@param reservation : reservation representing a request for a lease
7477
modification
7578
@param caller : caller
79+
@param callback : callback
7680
7781
@raises Exception in case of error
7882
"""
@@ -90,7 +94,8 @@ def freed(self, *, resources: ResourceSet):
9094
"""
9195

9296
@abstractmethod
93-
def redeem(self, *, reservation: ABCReservationMixin, callback: ABCControllerCallbackProxy = None, caller: AuthToken = None):
97+
def redeem(self, *, reservation: ABCReservationMixin, callback: ABCControllerCallbackProxy = None,
98+
caller: AuthToken = None):
9499
"""
95100
Processes a redeem request for the reservation.
96101

fabric_cf/actor/core/apis/abc_authority_reservation.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,4 +72,22 @@ def set_broker_callback(self, *, broker_callback: ABCCallbackProxy):
7272
def get_broker_callback(self) -> ABCCallbackProxy:
7373
"""
7474
Get the Broker Callback Proxy
75-
"""
75+
"""
76+
77+
@abstractmethod
78+
def prepare_extend_lease(self):
79+
"""
80+
Prepare for an incoming extend request on this existing
81+
reservation. Note: unlocked
82+
83+
@throws Exception thrown if request is rejected (e.g., ticket not valid)
84+
"""
85+
86+
@abstractmethod
87+
def prepare_modify_lease(self):
88+
"""
89+
Prepare for an incoming modify request on this existing
90+
reservation. Note: unlocked
91+
92+
@throws Exception thrown if request is rejected (e.g., ticket not valid)
93+
"""

fabric_cf/actor/core/apis/abc_base_plugin.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,17 +117,18 @@ def restart_configuration_actions(self, *, reservation: ABCReservationMixin):
117117
"""
118118

119119
@abstractmethod
120-
def create_slice(self, *, slice_id: ID, name: str):
120+
def create_slice(self, *, slice_id: ID, name: str, project_id: str):
121121
"""
122122
Creates a new slice.
123123
124124
Args:
125125
slice_id: guid for the slice
126126
name: slice name
127+
project_id: project id
127128
Returns:
128-
a slice object
129+
slice object
129130
Raises:
130-
Exception in case of error
131+
Exception if creation fails
131132
"""
132133

133134
@abstractmethod

fabric_cf/actor/core/apis/abc_broker_proxy.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def prepare_relinquish(self, *, reservation: ABCReservationMixin, callback: ABCC
7575

7676
@abstractmethod
7777
def prepare_claim_delegation(self, *, delegation: ABCDelegation, callback: ABCClientCallbackProxy,
78-
caller: AuthToken, id_token: str = None) -> ABCRPCRequestState:
78+
caller: AuthToken) -> ABCRPCRequestState:
7979
"""
8080
Prepare a claim delegation
8181
@params delegation: delegation
@@ -85,7 +85,7 @@ def prepare_claim_delegation(self, *, delegation: ABCDelegation, callback: ABCCl
8585

8686
@abstractmethod
8787
def prepare_reclaim_delegation(self, *, delegation: ABCDelegation, callback: ABCClientCallbackProxy,
88-
caller: AuthToken, id_token: str = None) -> ABCRPCRequestState:
88+
caller: AuthToken) -> ABCRPCRequestState:
8989
"""
9090
Prepare a reclaim delegation
9191
@params delegation: delegation

fabric_cf/actor/core/apis/abc_broker_reservation.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,3 +82,17 @@ def set_source(self, *, source: ABCDelegation):
8282
8383
@params source : the source delegation.
8484
"""
85+
86+
@abstractmethod
87+
def is_exporting(self) -> bool:
88+
"""
89+
Checks if the reservation is exporting.
90+
91+
@return true if the reservation is exporting
92+
"""
93+
94+
@abstractmethod
95+
def set_exporting(self):
96+
"""
97+
Marks the reservation as exporting.
98+
"""

fabric_cf/actor/core/apis/abc_client_actor.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
from abc import abstractmethod
2929
from typing import TYPE_CHECKING
3030

31+
from fim.slivers.base_sliver import BaseSliver
32+
3133
from fabric_cf.actor.core.apis.abc_actor_mixin import ABCActorMixin
3234
from fabric_cf.actor.core.apis.abc_delegation import ABCDelegation
3335

@@ -151,43 +153,41 @@ def tickets_client(self, *, rset: ReservationSet):
151153
"""
152154

153155
@abstractmethod
154-
def modify(self, *, reservation_id: ID, modify_properties: dict):
156+
def modify(self, *, reservation_id: ID, modified_sliver: BaseSliver):
155157
"""
156158
Issue modify request for given reservation. Note: the reservation
157159
must have already been registered with the actor.
158160
159161
@param reservation_id reservationID for the reservation to modify
160-
@param modify_properties property list for modify
162+
@param modified_sliver modified_sliver
161163
@throws Exception in case of error
162164
"""
163165

164166
@abstractmethod
165167
def claim_delegation_client(self, *, delegation_id: str = None, slice_object: ABCSlice = None,
166-
broker: ABCBrokerProxy = None, id_token: str = None) -> ABCDelegation:
168+
broker: ABCBrokerProxy = None) -> ABCDelegation:
167169
"""
168170
Claims already exported resources from the given broker. The delegation
169171
will be stored in the default slice.
170172
171173
@param delegation_id delegation identifier of the exported delegation
172174
@param slice_object slice
173175
@param broker broker proxy
174-
@param id_token id token
175176
176177
@returns delegation
177178
@raises Exception in case of failure
178179
"""
179180

180181
@abstractmethod
181182
def reclaim_delegation_client(self, *, delegation_id: str = None, slice_object: ABCSlice = None,
182-
broker: ABCBrokerProxy = None, id_token: str = None) -> ABCDelegation:
183+
broker: ABCBrokerProxy = None) -> ABCDelegation:
183184
"""
184185
Reclaims already exported resources from the given broker. The delegation
185186
will be stored in the default slice.
186187
187188
@param delegation_id delegation identifier of the exported delegation
188189
@param slice_object slice
189190
@param broker broker proxy
190-
@param id_token id token
191191
192192
@returns delegation
193193
@raises Exception in case of failure

fabric_cf/actor/core/apis/abc_client_actor_management_object.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,11 @@ def demand_reservation_rid(self, *, rid: ID, caller: AuthToken) -> ResultAvro:
9696
"""
9797

9898
@abstractmethod
99-
def get_brokers(self, *, caller: AuthToken, broker_id: ID = None, id_token: str = None) -> ResultProxyAvro:
99+
def get_brokers(self, *, caller: AuthToken, broker_id: ID = None) -> ResultProxyAvro:
100100
"""
101101
Get all brokers
102102
@param caller: caller
103103
@param broker_id : broker_id
104-
@param id_token: id token
105104
@return list of all the brokers
106105
"""
107106

@@ -128,25 +127,21 @@ def get_broker_query_model(self, *, broker: ID, caller: AuthToken, id_token: str
128127
"""
129128

130129
@abstractmethod
131-
def claim_delegations(self, *, broker: ID, did: ID, caller: AuthToken,
132-
id_token: str = None) -> ResultDelegationAvro:
130+
def claim_delegations(self, *, broker: ID, did: ID, caller: AuthToken) -> ResultDelegationAvro:
133131
"""
134132
Claim delegations
135133
@param broker : broker ID
136134
@param did : delegations ID
137135
@param caller: caller
138-
@param id_token: id token
139136
@return ResultDelegationAvro
140137
"""
141138

142139
@abstractmethod
143-
def reclaim_delegations(self, *, broker: ID, did: ID, caller: AuthToken,
144-
id_token: str = None) -> ResultDelegationAvro:
140+
def reclaim_delegations(self, *, broker: ID, did: ID, caller: AuthToken) -> ResultDelegationAvro:
145141
"""
146142
ReClaim delegations
147143
@param broker : broker ID
148144
@param did : delegations ID
149145
@param caller: caller
150-
@param id_token: id token
151146
@return ResultDelegationAvro
152147
"""

fabric_cf/actor/core/apis/abc_concrete_set.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@
2929

3030
from abc import abstractmethod, ABC
3131
from typing import TYPE_CHECKING
32+
33+
from fim.slivers.base_sliver import BaseSliver
34+
3235
if TYPE_CHECKING:
3336
from fabric_cf.actor.core.apis.abc_authority_proxy import ABCAuthorityProxy
3437
from fabric_cf.actor.core.apis.abc_reservation_mixin import ABCReservationMixin
@@ -122,15 +125,11 @@ def is_active(self) -> bool:
122125
"""
123126

124127
@abstractmethod
125-
def modify(self, *, concrete_set: ABCConcreteSet, configure: bool):
128+
def modify(self, *, sliver: BaseSliver):
126129
"""
127130
Updates the units in the current set with information contained in the
128-
passed set. Note that the passed set may contain only a subset of the
129-
units contained in the current set. Optionally triggers configuration
130-
actions for all removed/modified units.
131-
@param concrete_set: set containing the update data
132-
@param configure : if true, configuration actions will be triggered for all
133-
modified units
131+
passed sliver.
132+
@param sliver: Updated Sliver
134133
@raises Exception in case of error
135134
"""
136135

fabric_cf/actor/core/apis/abc_controller.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@
3333
if TYPE_CHECKING:
3434
from fabric_cf.actor.core.apis.abc_controller_reservation import ABCControllerReservation
3535
from fabric_cf.actor.core.util.reservation_set import ReservationSet
36-
from fabric_cf.actor.security.auth_token import AuthToken
37-
from fabric_cf.actor.core.apis.abc_reservation_mixin import ABCReservationMixin
3836

3937

4038
class ABCController(ABCClientActor):

0 commit comments

Comments
 (0)