Loading src/sunrise6g_opensdk/edgecloud/adapters/i2edge/client.py +9 −6 Changes for src/sunrise6g_opensdk/edgecloud/adapters/i2edge/client.py: 9 added lines, 6 removed lines. Original line number Diff line number Diff line Loading @@ -109,7 +109,6 @@ class EdgeApplicationManager(EdgeCloudManagementInterface): # ------------------------------------------------------------------------ # Artefact Management (i2Edge-Specific, Non-CAMARA) # ------------------------------------------------------------------------ # All artefact methods now return Response objects for API consistency def create_artefact( self, Loading Loading @@ -380,7 +379,7 @@ class EdgeApplicationManager(EdgeCloudManagementInterface): name=app_metadata.get("appName", ""), version=app_metadata.get("version", ""), appProvider=profile_data.get("appProviderId", ""), # Hardcoding mandatory fields that don't exist in i2Edge # Hardcoding mandatory fields that doesn't exist in i2Edge packageType="CONTAINER", appRepo={"type": "PUBLICREPO", "imagePath": "not-available"}, requiredResources={ Loading Loading @@ -462,18 +461,22 @@ class EdgeApplicationManager(EdgeCloudManagementInterface): appId=camara_schemas.AppId(appId), appInstanceId=camara_schemas.AppInstanceId(app_instance_id), appProvider=camara_schemas.AppProvider(appProviderId), status=camara_schemas.Status.instantiating, # 202 means deployment is in progress status=camara_schemas.Status.instantiating, edgeCloudZoneId=camara_schemas.EdgeCloudZoneId(zone_id), ) # CAMARA spec requires appInstances array wrapper camara_response = {"appInstances": [app_instance_info.model_dump(mode="json")]} camara_response = app_instance_info.model_dump(mode="json") # Add mandatory Location header location_url = f"/appinstances/{app_instance_id}" camara_headers = {"Content-Type": "application/json", "Location": location_url} log.info("App deployment request submitted successfully") return build_custom_http_response( status_code=i2edge_response.status_code, content=camara_response, headers={"Content-Type": "application/json"}, headers=camara_headers, encoding="utf-8", url=i2edge_response.url, request=i2edge_response.request, Loading Loading @@ -541,7 +544,7 @@ class EdgeApplicationManager(EdgeCloudManagementInterface): ), status=camara_schemas.Status( camara_status ), # Map the i2Edge "DEPLOYED" status to the CAMARA "ready" status for consistency with CAMARA specifications. ), # FIX: Map DEPLOYED -> ready edgeCloudZoneId=camara_schemas.EdgeCloudZoneId( zone_id ), # FIX: Extract from nodeSelector Loading tests/edgecloud/test_e2e.py +8 −14 Changes for tests/edgecloud/test_e2e.py: 8 added lines, 14 removed lines. Original line number Diff line number Diff line Loading @@ -176,26 +176,20 @@ def app_instance_id(edgecloud_client): deploy_payload = config["APP_DEPLOY_PAYLOAD"] app_id = deploy_payload["appId"] app_zones = deploy_payload["appZones"] # edgecloud_client.deploy_app maps with CAMARA POST /appinstances response = edgecloud_client.deploy_app(app_id, app_zones) assert isinstance(response, Response) # All CAMARA-compliant adapters should return 202 for async deployment assert response.status_code == 202 assert ( response.status_code == 202 ), f"Expected 202, got {response.status_code}: {response.text}" response_data = response.json() instance_info = camara_schemas.AppInstanceInfo(**response_data) # Use CAMARA schema validation for deployment response assert "appInstances" in response_data assert isinstance(response_data["appInstances"], list) assert len(response_data["appInstances"]) > 0 # Validate each app instance with CAMARA schema for instance_data in response_data["appInstances"]: camara_schemas.AppInstanceInfo(**instance_data) # Extract appInstanceId from first instance app_instance_id = response_data["appInstances"][0].get("appInstanceId") # Extract appInstanceId from the validated object app_instance_id = instance_info.appInstanceId.root assert app_instance_id is not None yield app_instance_id Loading Loading
src/sunrise6g_opensdk/edgecloud/adapters/i2edge/client.py +9 −6 Changes for src/sunrise6g_opensdk/edgecloud/adapters/i2edge/client.py: 9 added lines, 6 removed lines. Original line number Diff line number Diff line Loading @@ -109,7 +109,6 @@ class EdgeApplicationManager(EdgeCloudManagementInterface): # ------------------------------------------------------------------------ # Artefact Management (i2Edge-Specific, Non-CAMARA) # ------------------------------------------------------------------------ # All artefact methods now return Response objects for API consistency def create_artefact( self, Loading Loading @@ -380,7 +379,7 @@ class EdgeApplicationManager(EdgeCloudManagementInterface): name=app_metadata.get("appName", ""), version=app_metadata.get("version", ""), appProvider=profile_data.get("appProviderId", ""), # Hardcoding mandatory fields that don't exist in i2Edge # Hardcoding mandatory fields that doesn't exist in i2Edge packageType="CONTAINER", appRepo={"type": "PUBLICREPO", "imagePath": "not-available"}, requiredResources={ Loading Loading @@ -462,18 +461,22 @@ class EdgeApplicationManager(EdgeCloudManagementInterface): appId=camara_schemas.AppId(appId), appInstanceId=camara_schemas.AppInstanceId(app_instance_id), appProvider=camara_schemas.AppProvider(appProviderId), status=camara_schemas.Status.instantiating, # 202 means deployment is in progress status=camara_schemas.Status.instantiating, edgeCloudZoneId=camara_schemas.EdgeCloudZoneId(zone_id), ) # CAMARA spec requires appInstances array wrapper camara_response = {"appInstances": [app_instance_info.model_dump(mode="json")]} camara_response = app_instance_info.model_dump(mode="json") # Add mandatory Location header location_url = f"/appinstances/{app_instance_id}" camara_headers = {"Content-Type": "application/json", "Location": location_url} log.info("App deployment request submitted successfully") return build_custom_http_response( status_code=i2edge_response.status_code, content=camara_response, headers={"Content-Type": "application/json"}, headers=camara_headers, encoding="utf-8", url=i2edge_response.url, request=i2edge_response.request, Loading Loading @@ -541,7 +544,7 @@ class EdgeApplicationManager(EdgeCloudManagementInterface): ), status=camara_schemas.Status( camara_status ), # Map the i2Edge "DEPLOYED" status to the CAMARA "ready" status for consistency with CAMARA specifications. ), # FIX: Map DEPLOYED -> ready edgeCloudZoneId=camara_schemas.EdgeCloudZoneId( zone_id ), # FIX: Extract from nodeSelector Loading
tests/edgecloud/test_e2e.py +8 −14 Changes for tests/edgecloud/test_e2e.py: 8 added lines, 14 removed lines. Original line number Diff line number Diff line Loading @@ -176,26 +176,20 @@ def app_instance_id(edgecloud_client): deploy_payload = config["APP_DEPLOY_PAYLOAD"] app_id = deploy_payload["appId"] app_zones = deploy_payload["appZones"] # edgecloud_client.deploy_app maps with CAMARA POST /appinstances response = edgecloud_client.deploy_app(app_id, app_zones) assert isinstance(response, Response) # All CAMARA-compliant adapters should return 202 for async deployment assert response.status_code == 202 assert ( response.status_code == 202 ), f"Expected 202, got {response.status_code}: {response.text}" response_data = response.json() instance_info = camara_schemas.AppInstanceInfo(**response_data) # Use CAMARA schema validation for deployment response assert "appInstances" in response_data assert isinstance(response_data["appInstances"], list) assert len(response_data["appInstances"]) > 0 # Validate each app instance with CAMARA schema for instance_data in response_data["appInstances"]: camara_schemas.AppInstanceInfo(**instance_data) # Extract appInstanceId from first instance app_instance_id = response_data["appInstances"][0].get("appInstanceId") # Extract appInstanceId from the validated object app_instance_id = instance_info.appInstanceId.root assert app_instance_id is not None yield app_instance_id Loading