Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions common/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
bump2version==1.0.1
packaging==25.0
packaging==26.0
pluggy==1.6.0
pyparsing==3.2.4
pytest==8.4.1
six==1.16.0
pyparsing==3.3.2
pytest==9.0.2
six==1.17.0
zipp==3.23.0
4 changes: 2 additions & 2 deletions common/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
PYTHON_SRC = 'src/main/python'

install_requires = [
"dvp-api == 1.9.0",
"six >= 1.16, < 1.17",
"dvp-api == 1.10.0",
"six >= 1.17, < 1.18",
]

with open(os.path.join(PYTHON_SRC, 'dlpx/virtualization/common/VERSION')) as version_file:
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.0.1
5.1.0
6 changes: 3 additions & 3 deletions docs/Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ verify_ssl = true
name = "pypi"

[packages]
mkdocs = "==1.4.3"
mkdocs-material = "==9.1.7"
mkdocs = "==1.6.1"
mkdocs-material = "==9.7.5"
markdown-include = "==0.8.1"
mkdocs-awesome-pages-plugin = "==2.9.1"
mkdocs-awesome-pages-plugin = "==2.10.1"

[requires]
python_version = "3.11"
Expand Down
757 changes: 428 additions & 329 deletions docs/Pipfile.lock

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions dvp/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
bump2version==1.0.1
packaging==25.0
packaging==26.0
pluggy==1.6.0
pyparsing==3.2.4
pytest==8.4.1
six==1.16.0
pyparsing==3.3.2
pytest==9.0.2
six==1.17.0
zipp==3.23.0
2 changes: 1 addition & 1 deletion dvp/src/main/python/dlpx/virtualization/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.0.1
5.1.0
8 changes: 4 additions & 4 deletions libs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
./../common
bump2version==1.0.1
mock==5.2.0
packaging==25.0
packaging==26.0
pluggy==1.6.0
pyparsing==3.2.4
pytest==8.4.1
six==1.16.0
pyparsing==3.3.2
pytest==9.0.2
six==1.17.0
zipp==3.23.0
4 changes: 2 additions & 2 deletions libs/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
version = version_file.read().strip()

install_requires = [
"dvp-api == 1.9.0",
"dvp-api == 1.10.0",
Copy link
Copy Markdown
Contributor

@SumoSourabh SumoSourabh Mar 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will need it to be 1.10.0.dev0 version for downloading it from testpypi. We will update it again when we will be releasing the project

"dvp-common == {}".format(version),
"six >= 1.16, < 1.17",
"six >= 1.17, < 1.18",
]

setuptools.setup(name='dvp-libs',
Expand Down
2 changes: 1 addition & 1 deletion libs/src/main/python/dlpx/virtualization/libs/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.0.1
5.1.0
8 changes: 4 additions & 4 deletions platform/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
./../common
bump2version==1.0.1
mock==5.2.0
packaging==25.0
packaging==26.0
pluggy==1.6.0
pyparsing==3.2.4
pytest==8.4.1
six==1.16.0
pyparsing==3.3.2
pytest==9.0.2
six==1.17.0
zipp==3.23.0
4 changes: 2 additions & 2 deletions platform/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
version = version_file.read().strip()

install_requires = [
"dvp-api == 1.9.0",
"dvp-api == 1.10.0",
"dvp-common == {}".format(version),
"six >= 1.16, < 1.17",
"six >= 1.17, < 1.18",
]

setuptools.setup(name='dvp-platform',
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.0.1
5.1.0
146 changes: 145 additions & 1 deletion platform/src/main/python/dlpx/virtualization/platform/_linked.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from dlpx.virtualization.common.exceptions import PluginRuntimeError
from dlpx.virtualization.platform import (DirectSource, Mount,
MountSpecification, StagedSource,
Status)
Status, PhysicalSource)
from dlpx.virtualization.platform import validation_util as v
from dlpx.virtualization.platform.exceptions import (
IncorrectReturnTypeError, OperationAlreadyDefinedError,
Expand All @@ -33,6 +33,7 @@ def __init__(self):
self.worker_impl = None
self.mount_specification_impl = None
self.source_size_impl = None
self.source_to_physical_impl = None

def pre_snapshot(self):
def pre_snapshot_decorator(pre_snapshot_impl):
Expand Down Expand Up @@ -112,6 +113,16 @@ def source_size_decorator(source_size_impl):

return source_size_decorator

def source_to_physical(self):
def source_to_physical_decorator(source_to_physical_impl):
if self.source_to_physical_impl:
raise OperationAlreadyDefinedError(Op.LINKED_SOURCE_TO_PHYSICAL)
self.source_to_physical_impl = v.check_function(source_to_physical_impl,
Op.LINKED_SOURCE_TO_PHYSICAL)
return source_to_physical_impl

return source_to_physical_decorator

@staticmethod
def _from_protobuf_remote_mount(remote_mount):
return Mount(remote_environment=RemoteEnvironment.from_proto(
Expand Down Expand Up @@ -323,6 +334,69 @@ def _internal_direct_source_size(self, request):

return direct_source_size_response

def _internal_direct_source_to_physical(self, request):
"""Direct Virtual to Physical Wrapper for direct plugins.

Executed as part of several operations to convert a virtual source
to a physical source for a direct source.
Comment on lines +337 to +341
Comment on lines +337 to +341

Run virtual_to_physical operation for a direct source.

Args:
request (DirectSourceToPhysicalRequest): Virtual to Physical Request
arguments.

Returns:
DirectSourceToPhysicalResponse: A response containing the return value -
DirectSourceToPhysicalResult. In case of errors, response object will
contain PluginErrorResult.
"""
# Reasoning for method imports are in this file's docstring.
from generated.definitions import RepositoryDefinition
from generated.definitions import LinkedSourceDefinition
from generated.definitions import SourceConfigDefinition
from generated.definitions import SnapshotDefinition
from generated.definitions import VirtualToPhysicalDefinition

#
# While linked.virtual_to_physical() is not a required operation,
# this should not be called if it wasn't implemented.
#
if not self.source_to_physical_impl:
raise OperationNotDefinedError(Op.LINKED_SOURCE_TO_PHYSICAL)

direct_source_definition = LinkedSourceDefinition.from_dict(
json.loads(request.direct_source.linked_source.parameters.json))
direct_source = DirectSource(
guid=request.direct_source.linked_source.guid,
connection=RemoteConnection.from_proto(
request.direct_source.connection),
parameters=direct_source_definition)
virtual_to_physical_source_definition = VirtualToPhysicalDefinition.from_dict(
json.loads(request.physical_source.parameters.json))
physical_source = PhysicalSource(guid=request.physical_source.guid,
connection=RemoteConnection.from_proto(
request.physical_source.connection),
target_directory=request.physical_source.target_directory,
parameters=virtual_to_physical_source_definition)

repository = RepositoryDefinition.from_dict(
json.loads(request.repository.parameters.json))
source_config = SourceConfigDefinition.from_dict(
json.loads(request.source_config.parameters.json))
snapshot = SnapshotDefinition.from_dict(
json.loads(request.snapshot.parameters.json))

virtual_to_physical = self.source_to_physical_impl(
direct_source=direct_source,
repository=repository,
source_config=source_config,
snapshot = snapshot,
physical_source = physical_source)

direct_source_to_physical_response = platform_pb2.DirectSourceToPhysicalResponse()
return direct_source_to_physical_response

def _internal_staged_pre_snapshot(self, request):
"""Pre Snapshot Wrapper for staged plugins.

Expand Down Expand Up @@ -852,3 +926,73 @@ def _internal_staged_source_size(self, request):
staged_source_size_response.return_value.database_size = source_size

return staged_source_size_response

def _internal_staged_source_to_physical(self, request):
"""Staged Virtual to Physical Wrapper for staged plugins.

Executed as part of several operations to convert a virtual source
to a physical source for a staged source.

Run virtual_to_physical operation for a staged source.

Args:
request (StagedSourceToPhysicalRequest): Virtual to Physical Request
arguments.

Returns:
StagedSourceToPhysicalResponse: A response containing the return value -
StagedSourceToPhysicalResult. In case of errors, response object will
contain PluginErrorResult.
"""
# Reasoning for method imports are in this file's docstring.
from generated.definitions import RepositoryDefinition
from generated.definitions import LinkedSourceDefinition
from generated.definitions import SourceConfigDefinition
from generated.definitions import SnapshotDefinition
from generated.definitions import VirtualToPhysicalDefinition

#
# While linked.virtual_to_physical() is not a required operation,
# this should not be called if it wasn't implemented.
#
if not self.source_to_physical_impl:
raise OperationNotDefinedError(Op.LINKED_SOURCE_TO_PHYSICAL)

staged_source_definition = LinkedSourceDefinition.from_dict(
json.loads(request.staged_source.linked_source.parameters.json))
staged_mount, mounts = LinkedOperations._get_mounts_from_request(request)
staged_source = StagedSource(
guid=request.staged_source.linked_source.guid,
source_connection=RemoteConnection.from_proto(
request.staged_source.source_connection),
parameters=staged_source_definition,
mount=staged_mount,
staged_connection=RemoteConnection.from_proto(
request.staged_source.staged_connection),
mounts=mounts)

virtual_to_physical_source_definition = VirtualToPhysicalDefinition.from_dict(
json.loads(request.physical_source.parameters.json))
physical_source = PhysicalSource(guid=request.physical_source.guid,
connection=RemoteConnection.from_proto(
request.physical_source.connection),
target_directory=request.physical_source.target_directory,
parameters=virtual_to_physical_source_definition)

repository = RepositoryDefinition.from_dict(
json.loads(request.repository.parameters.json))
source_config = SourceConfigDefinition.from_dict(
json.loads(request.source_config.parameters.json))
snapshot = SnapshotDefinition.from_dict(
json.loads(request.snapshot.parameters.json))

virtual_to_physical = self.source_to_physical_impl(
staged_source=staged_source,
repository=repository,
source_config=source_config,
snapshot=snapshot,
physical_source=physical_source
)

staged_source_to_physical_response = platform_pb2.StagedSourceToPhysicalResponse()
return staged_source_to_physical_response
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@
of the autogenerated classes from the schemas (e.g. VirtualSourceDefinition)
"""
__all__ = [
"VirtualSource", "StagedSource", "DirectSource", "Status", "MigrationType",
"Mount", "OwnershipSpecification", "MountSpecification"
"VirtualSource", "StagedSource", "DirectSource", "PhysicalSource",
"Status", "MigrationType", "Mount", "OwnershipSpecification",
"MountSpecification"
]


Expand Down Expand Up @@ -136,6 +137,43 @@ def parameters(self):
"""
return self._parameters

class PhysicalSource(object):
def __init__(self, guid, connection, target_directory, parameters):
self._guid = guid
if not isinstance(connection, RemoteConnection):
raise IncorrectTypeError(RemoteConnection, 'connection',
type(connection), RemoteConnection)
self._connection = connection
if not isinstance(target_directory, six.string_types):
raise IncorrectTypeError(PhysicalSource, 'target_directory',
type(target_directory),
six.string_types[0])
self._target_directory = target_directory
self._parameters = parameters

@property
def guid(self):
"""str: The unique guid identifier for this PhysicalSource."""
return self._guid

@property
def connection(self):
"""RemoteConnection: The RemoteConnection for this
PhysicalSource."""
return self._connection

@property
def target_directory(self):
"""str: The target directory path for this PhysicalSource."""
return self._target_directory

@property
def parameters(self):
"""PhysicalSourceDefinition: The PhysicalSourceDefinition for this
PhysicalSource.
"""
return self._parameters


class Status(Enum):
ACTIVE = 0
Expand Down
Loading
Loading