Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
8073a1f
Merge pull request #2 from delphix/develop
mothslaw Jul 14, 2020
80fdf42
Add support for extended hooks
mothslaw Jul 23, 2020
c87d730
Fix lint
mothslaw Jul 23, 2020
310fe90
Add hooks to workflow images
mothslaw Jul 27, 2020
8680605
Add HTML source for new diagrams
mothslaw Jul 27, 2020
66f2615
Bump minor version
mothslaw Jul 27, 2020
659fa0b
update test version
mothslaw Jul 27, 2020
cc91983
Merge pull request #239 from mothslaw/develop
mothslaw Jul 29, 2020
72c9d1e
Merge pull request #4 from delphix/develop
mothslaw Jul 29, 2020
4924ba8
Implement scratch paths for plugins
mothslaw Aug 7, 2020
7d65ec8
Add missing file
mothslaw Aug 7, 2020
f662e09
fix test
mothslaw Aug 7, 2020
621efb9
Merge branch 'release/2.1.0' into develop
fdrozdowski Aug 8, 2020
f4f9ae4
Fix old copy/paste mistake
mothslaw Aug 11, 2020
0ddd6cc
Merge release/2.1.0 into develop
fdrozdowski Aug 11, 2020
eb3a086
Merge pull request #247 from mothslaw/develop
mothslaw Aug 12, 2020
f8d97b2
Update dependabot's schedule (#251)
fdrozdowski Aug 19, 2020
ec0e5eb
Fixes #253 Move some CLI tests from Blackbox to SDK repo (#254)
vr-delphix Sep 1, 2020
a075954
Merge pull request #6 from delphix/develop
mothslaw Sep 4, 2020
7d18f8d
Fixes #250 Support empty VDBs
mothslaw Sep 10, 2020
1b98209
Jeff's feedback on empty VDB code
mothslaw Sep 11, 2020
5d3921d
Add initialize to fake plugins
mothslaw Sep 11, 2020
f234e12
Merge pull request #256 from mothslaw/develop
mothslaw Sep 14, 2020
2dfbee8
Update SDK to add SnapshotParametersDefinition in uploaded artifact (…
nhlien93 Sep 25, 2020
ac029f0
Fixes #258 Add clearer doc for JSON schema's default keyword
mothslaw Oct 7, 2020
958fee8
Ravi's feedback
mothslaw Oct 8, 2020
159431b
Merge pull request #259 from mothslaw/develop
mothslaw Oct 9, 2020
e6f1896
Update engine api for snapshot parameters and rewrite params default …
nhlien93 Oct 15, 2020
111176f
Fixes #262 Add test_virtual_initialize_return_none
Oct 20, 2020
86aa267
Merge pull request #263 from AleksandrLiber/initializeNoneTest
AleksandrLiber Oct 22, 2020
bfa7c6d
Update CODEOWNERS to be the current list of GKs (#264)
ankursarin Nov 2, 2020
8ba21a5
Rollback engine api version to 1.11.6 for 6.0.6.0 backports #270 (#271)
jeffngo Nov 21, 2020
9ed06b4
Fixes #53 Rename "name" to "plugin_id" and "prettyName" to "name" (#266)
ravi-cm Dec 4, 2020
707d0de
Publishing docs to GitHub pages fails because set-env has been deprec…
jeffngo Dec 16, 2020
6cd64ef
Bump dvp-api and VSDK versions to release formats (#291)
jeffngo Jan 6, 2021
6acfa72
Virtualization SDK Docs - New plugin config property snapshotParamete…
jeffngo Jan 13, 2021
7d95126
Virtualization SDK Docs - Final VSDK 3.0.0 docs and release changes (…
jeffngo Jan 21, 2021
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
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 2.1.0
current_version = 3.0.0
commit = False
tag = False
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\.(?P<release>[a-z]+)(?P<dev>\d+))?
Expand Down
10 changes: 5 additions & 5 deletions .dependabot/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@ update_configs:
# Keep requirements.txt files up-to-date in each package.
- package_manager: "python"
directory: "/dvp"
update_schedule: "daily"
update_schedule: "monthly"
target_branch: "develop"
- package_manager: "python"
directory: "/common"
update_schedule: "daily"
update_schedule: "monthly"
target_branch: "develop"
- package_manager: "python"
directory: "/platform"
update_schedule: "daily"
update_schedule: "monthly"
target_branch: "develop"
- package_manager: "python"
directory: "/libs"
update_schedule: "daily"
update_schedule: "monthly"
target_branch: "develop"
- package_manager: "python"
directory: "/tools"
update_schedule: "daily"
update_schedule: "monthly"
target_branch: "develop"
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @ankursarin @fdrozdowski @nhlien93 @crystalplumage
* @ankursarin @nhlien93 @mothslaw
10 changes: 6 additions & 4 deletions .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ jobs:
run: |
CURRENT_BRANCH_VAR=${GITHUB_REF#refs/heads/}
echo "Current branch: $CURRENT_BRANCH_VAR"
# Set CURRENT_BRANCH environment variable to the current branch name.
echo "::set-env name=CURRENT_BRANCH::$(echo $CURRENT_BRANCH_VAR)"
# Set CURRENT_BRANCH environment variable to the current branch name. Refrain from using 'set-env' as
# GitHub has identified the command as a moderate security vulnerability.
echo "CURRENT_BRANCH=$(echo $CURRENT_BRANCH_VAR)" >> $GITHUB_ENV
- name: Display all remote branches
working-directory: ${{ matrix.package }}
run: |
Expand All @@ -46,8 +47,9 @@ jobs:
# Get only docs branches, extract the "docs/x.y.z" part, sort them in descending order, and get the first one.
LATEST_DOCS_BRANCH_VAR=$(git branch -r | grep -e ".*\/*docs\/[0-9].[0-9].[0-9]" | sed -n "s/.*\/*\(docs\/[0-9].[0-9].[0-9]\).*/\1/p" | sort -r | head -n 1)
echo "Latest docs branch: $LATEST_DOCS_BRANCH_VAR"
# Set the LATEST_DOCS_BRANCH environment variable.
echo "::set-env name=LATEST_DOCS_BRANCH::$(echo $LATEST_DOCS_BRANCH_VAR)"
# Set the LATEST_DOCS_BRANCH environment variable. Refrain from using 'set-env' as GitHub has identified the
# command as a moderate security vulnerability.
echo "LATEST_DOCS_BRANCH=$(echo $LATEST_DOCS_BRANCH_VAR)" >> $GITHUB_ENV
- name: Check that the current branch is the latest docs branch, fail otherwise
working-directory: ${{ matrix.package }}
run: |
Expand Down
8 changes: 4 additions & 4 deletions README-dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,17 +125,17 @@ To run blackbox tests, follow these steps:
2. Navigate to the app-gate directory and start tests using `git blackbox`. For the guide on which test suite to use,
see the next sections.

At a minimum, each pull request should pass `appdata_python_samples` and `appdata_sanity` tests with a direct or staged plugin.
At a minimum, each pull request should pass `appdata_python_samples` and `appdata_basic` tests with a direct or staged plugin.
See the section below for the description of each test suite.

#### Blackbox tests targeting wrappers (mostly Delphix Engine workflows)
* appdata_python_samples (sample plugins from the app-gate):
`git blackbox -s appdata_python_samples --extra-params="-p virt-sdk-repo=https://github.com/<username>/virtualization-sdk.git -p virt-sdk-branch=my-feature"`,
* appdata_sanity with a direct Python plugin on CentOS 7.3: `git blackbox -s appdata_sanity -c APPDATA_PYTHON_DIRECT_CENTOS73 -a --extra-params="-p virt-sdk-repo=https://github.com/<username>/virtualization-sdk.git -p virt-sdk-branch=my-feature"`,
* appdata_sanity with a staged Python plugin on CentOS 7.3: `git blackbox -s appdata_sanity -c APPDATA_PYTHON_STAGED_CENTOS73 -a --extra-params="-p virt-sdk-repo=https://github.com/<username>/virtualization-sdk.git -p virt-sdk-branch=my-feature"`.
* appdata_basic with a direct Python plugin on CentOS 7.3: `git blackbox -s appdata_basic -c APPDATA_PYTHON_DIRECT_CENTOS73 -a --extra-params="-p virt-sdk-repo=https://github.com/<username>/virtualization-sdk.git -p virt-sdk-branch=my-feature"`,
* appdata_basic with a staged Python plugin on CentOS 7.3: `git blackbox -s appdata_basic -c APPDATA_PYTHON_STAGED_CENTOS73 -a --extra-params="-p virt-sdk-repo=https://github.com/<username>/virtualization-sdk.git -p virt-sdk-branch=my-feature"`.

#### Blackbox tests targeting the CLI (~80% CLI tests)
* virtualization_sdk (installs and tests a direct Python plugin on Ubuntu 18):
`git blackbox -s virtualization_sdk -c APPDATA_SDK_UBUNTU18_DIRECT_CENTOS73 --extra-params="-p virt-sdk-repo=https://github.com/<username>/virtualization-sdk.git -p virt-sdk-branch=my-feature"`,
* virtualization_sdk (installs and tests a staged Python plugin on Ubuntu 18):
`git blackbox -s virtualization_sdk -c APPDATA_SDK_UBUNTU18_STAGED_CENTOS73 --extra-params="-p virt-sdk-repo=https://github.com/<username>/virtualization-sdk.git -p virt-sdk-branch=my-feature"`.
`git blackbox -s virtualization_sdk -c APPDATA_SDK_UBUNTU18_STAGED_CENTOS73 --extra-params="-p virt-sdk-repo=https://github.com/<username>/virtualization-sdk.git -p virt-sdk-branch=my-feature"`.
2 changes: 1 addition & 1 deletion common/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
PYTHON_SRC = 'src/main/python'

install_requires = [
"dvp-api == 1.3.0",
"dvp-api == 1.4.0",
]

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 @@
2.1.0
3.0.0
1 change: 1 addition & 0 deletions docs/docs/Best_Practices/.pages
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ arrange:
- Sensitive_Data.md
- Unicode_Data.md
- Working_with_Powershell.md
- Scratch_Paths.md
19 changes: 19 additions & 0 deletions docs/docs/Best_Practices/Scratch_Paths.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#Scratch Paths

A scratch path is a directory reserved for plugin use on each remote host. This is intended for uses such as:

- Storage of small amounts of persistent data
- A place to mount VDB data
- Temporary logs for debugging (Be careful that you don't use too much space though!)

The location of this scratch area is given by the `scratch_path` property on the [RemoteHost](/References/Classes/#remotehost) object.


Things to note about the scratch path:

- No guarantees are made about where the path is located on the system.
- No guarantees are made about how much space might be available in this directory. It is strongly advised that you use only a small amount of disk space here.
- The directory will be owned by the "primary user" associated with the remote host. This might be a completely different user from the one that is associated with a particular dsource or VDB.
- If you need to store dSource- or VDB-specific data, it is highly recommended that you create a separate subdirectory for each dSource/VDB inside this scratch area. It's also recommended to name this subdirectory using the GUID of the dSource/VDB, so that you avoid accidental name collisions.
- The Delphix Engine will not do any cleanup for you, so be sure to delete anything you're no longer using. For example, any VDB-specific information must be deleted in your [unconfigure](/References/Plugin_Operations/#virtual-source-unconfigure) operation (and dSource data gets deleted in your [stopStaging](/References/Plugin_Operations/#staged-linked-source-stop-staging) operation.)
- Do not store any [sensitive information](Sensitive_Data.md) here!
6 changes: 3 additions & 3 deletions docs/docs/Building_Your_First_Plugin/Data_Ingestion.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ quite limiting.

For our first plugin, we will be using the more flexible [staging](/References/Glossary.md#staged-linkingsyncing) strategy. With this strategy, the Delphix Engine uses NFS for Unix environments (or iSCSI on Windows environments) to mount storage onto a [staging environment](/References/Glossary.md#staging-environment). Our plugin will then be in full control of how to get data from the source environment onto this storage mount.

With the staging strategy, there are two types of syncs: sync and resync. A `sync` is used to ingestion incremental changes while a `resync` is used to re-ingest all the data for the dSource. For databases, this could mean re-ingesting from a full database backup to reset the dSource. A `sync` and a `resync` execute the same plugin operations and are differentiated by a boolean flag in the [snapshot_parameters](/References/Classes.md#snapshotparametersdefinition) argument passed into [linked.pre_snapshot](/References/Plugin_Operations.md#staged-linked-source-pre-snapshot) and [linked.post_snapshot](/References/Plugin_Operations.md#staged-linked-source-post-snapshot).
With the staging strategy, there are two types of syncs: sync and resync. A `sync` is used to ingest incremental changes while a `resync` is used to re-ingest all the data for the dSource. For databases, this could mean re-ingesting from a full database backup to reset the dSource. A `sync` and a `resync` will execute the same plugin operations. To differentiate a `sync` from a `resync`, simply add a boolean property (i.e. `resync`) in the plugin's [snapshot parameters definition](References/Schemas_and_Autogenerated_Classes.md#snapshotparametersdefinition-schema). Once `sync` or `resync` is selected, the property will be passed into [linked.pre_snapshot](/References/Plugin_Operations.md#staged-linked-source-pre-snapshot) and [linked.post_snapshot](/References/Plugin_Operations.md#staged-linked-source-post-snapshot) as a [snapshot parameter](/References/Glossary.md#snapshot-parameters).

A regular `sync` is the default and is executed as part of policy driven syncs. A `resync` is only executed during initial ingestion or if the Delphix user manually starts one. The customer can manually trigger a `resync` via the UI by selecting the dSource, going to more options and selecting **Resynchronize dSource**. ![Screenshot](images/Resync.png)

Expand Down Expand Up @@ -168,7 +168,7 @@ Next, we'll add a new function:

```python
@plugin.linked.pre_snapshot()
def copy_data_from_source(staged_source, repository, source_config, snapshot_parameters):
def copy_data_from_source(staged_source, repository, source_config, optional_snapshot_parameters):
stage_mount_path = staged_source.mount.mount_path
data_location = "{}@{}:{}".format(staged_source.parameters.username,
staged_source.parameters.source_address,
Expand Down Expand Up @@ -249,7 +249,7 @@ In fact, the default implementation that was generated by `dvp init` will work j
def linked_post_snapshot(staged_source,
repository,
source_config,
snapshot_parameters):
optional_snapshot_parameters):
return SnapshotDefinition()
```

Expand Down
28 changes: 3 additions & 25 deletions docs/docs/References/Classes.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,29 +144,6 @@ Field | Type | Description
mounts | list[[Mount](#mount)] | The list of mounts to export the data sets to.
ownership_specification | [OwnershipSpecification](#ownershipspecification) | **Optional.** Control the ownership attributes for the data set. It defaults to the environment user of the remote environment if it is not specified.

## SnapshotParametersDefinition

User provided parameters for the snapshot operation. It includes a boolean property named `resync` that can be used to indicate to the plugin whether or not to initiate a full ingestion of the dSource. The parameters are only set during a manual snapshot. When using a sync policy, `resync` defaults to `false`.

```python
from dlpx.virtualization.platform import Plugin

plugin = Plugin()

@plugin.linked.pre_snapshot()
def linked_pre_snapshot(staged_source, repository, source_config, snapshot_parameters):
if snapshot_parameter.resync:
print(snapshot_parameter.resync)
```

> This class will be generated during build and is located with the autogenerated classes. As it is passed into the operation, importing it is not neccessary.

### Fields

Field | Type | Description
----- | ---- | -----------
resync | Boolean | Determines if this snapshot should ingest the dSource from scratch.

## RemoteEnvironment

Represents a remote environment.
Expand Down Expand Up @@ -203,7 +180,8 @@ Field | Type | Description
name | String | Host address.
reference | String | Unique identifier for the host.
binary_path | String | Path to Delphix provided binaries on the host, which are present in the toolkit pushed to the remote host like `dlpx_db_exec`, `dlpx_pfexec`, etc. This property is only available for Unix hosts.
scratch_path | String | Path to scratch path on the host.
scratch_path | String | Path to scratch area on the host. See details [here](/Best_Practices/Scratch_Paths.md).


## RemoteUser

Expand All @@ -220,4 +198,4 @@ user = RemoteUser(name, reference)
Field | Type | Description
----- | ---- | -----------
name | String | User name.
reference | String | Unique identifier for the user.
reference | String | Unique identifier for the user.
5 changes: 3 additions & 2 deletions docs/docs/References/Decorators.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ plugin = Plugin()
# Use the decorator to annotate the function that corresponds to the "Virtual Source Start" Plugin Operation
@plugin.virtual_source.start()
def my_start(virtual_source, repository, source_config):
print "running start"
print "running start"
```

!!! info
Decorators exposed by the Virtualization SDK are inherently python function calls and needs parentheses `()` appended at the end.

Assuming the name of the object, is `plugin` as above, the table below lists the corresponding decorators for each plugin operation.
Assuming the name of the object is `plugin` as above, the table below lists the corresponding decorators for each plugin operation.

Plugin Operation | Decorator
---------------- | --------
Expand All @@ -35,6 +35,7 @@ Plugin Operation | Decorator
[Staged Linked Source Worker](Plugin_Operations.md#staged-linked-source-worker) | `@plugin.linked.worker()`
[Staged Linked Source Mount Specification](Plugin_Operations.md#staged-linked-source-mount-specification) | `@plugin.linked.mount_specification()`
[Virtual Source Configure](Plugin_Operations.md#virtual-source-configure) | `@plugin.virtual.configure()`
[Virtual Source Initialize](Plugin_Operations.md#virtual-source-initialize) | `@plugin.virtual.initialize()`
[Virtual Source Unconfigure](Plugin_Operations.md#virtual-source-unconfigure) | `@plugin.virtual.unconfigure()`
[Virtual Source Reconfigure](Plugin_Operations.md#virtual-source-reconfigure) | `@plugin.virtual.reconfigure()`
[Virtual Source Start](Plugin_Operations.md#virtual-source-start) | `@plugin.virtual.start()`
Expand Down
15 changes: 11 additions & 4 deletions docs/docs/References/Glossary.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ The process by which the Delphix Engine learns about how a particular environmen
## dSource
See [Linked Dataset](#linked-dataset)

## Empty VDB
A VDB that is created from scratch, without provisioning from another dataset. Users can create empty VDBs when they want to construct a brand-new dataset from within Delphix, instead of creating it externally and then ingesting it.

This "empty" VDB, of course, will typically not stay empty for long. Data will be added as users work with the new dataset.

A plugin can support this functionality by implementing the [initialize](Plugin_Operations.md#virtual-source-initialize) operation.

## Environment
A remote system that the Delphix Engine can interact with. An environment can be used as a [source](#source-environment), [staging](#staging-environment) or [target](#target-environment) environment (or any combination of those). For example, a Linux machine that the Delphix Engine can connect to is an environment.

Expand Down Expand Up @@ -81,10 +88,10 @@ Information that represents a set of dependencies that a dataset requires in ord
A formal description of a data type. Plugins use JSON format for their [schemas](Schemas_and_Autogenerated_Classes.md#schemas-and-autogenerated-classes).

## Snapshot
A point-in-time read-only copy of a dataset. A snapshot includes associated metadata represented by the [SnapshotDefinition Schema](Schemas_and_Autogenerated_Classes.md#snapshotdefinition)
A point-in-time read-only copy of a dataset. A snapshot includes associated metadata represented by the [SnapshotDefinition Schema](Schemas_and_Autogenerated_Classes.md#snapshotdefinition).

## Snapshot Parameter
User provided parameters for the snapshot operation. Currently the only properties the parameter has is resync.
## Snapshot Parameters
User provided parameters for the snapshot operation which can be defined in a [Snapshot Parameters Definition](Schemas_and_Autogenerated_Classes.md#snapshotparametersdefinition).

## Source Config
A collection of information that the Delphix Engine needs to interact with a dataset (whether [linked](#linked-dataset) or [virtual](#virtual-dataset) on an [environment](#environment).
Expand All @@ -105,7 +112,7 @@ The process by which the Delphix Engine ingests data from a dataset on a [source
An [environment](#environment) on which Delphix-provided virtualized datasets can be used.

## Lua Toolkit
Legacy model for writing "plugins" in Lua, with limited documentation and support for writing, building and uploading toolkits. This was the predecessor to the Virtualization SDK.
Legacy model for writing "plugins" in Lua, with limited documentation and limited support for writing, building and uploading toolkits. This was the predecessor to the Virtualization SDK.

## Upgrade Operation
A special plugin operation that takes data produced by an older version of a plugin, and transforms it into the format expected by the new version of the plugin.
Expand Down
1 change: 1 addition & 0 deletions docs/docs/References/Plugin_Config.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ The name of the file can be specified during the build. By default, the build lo
|language|Y|enum|Must be `PYTHON27`.|
|defaultLocale|N|enum|The locale to be used by the plugin if the Delphix user does not specify one. Plugin messages will be displayed in this locale by default. The default value is `en-us`.|
|rootSquashEnabled|N|boolean|This dictates whether "root squash" is enabled on NFS mounts for the plugin (i.e. whether the `root` user on remote hosts has access to the NFS mounts). Setting this to `false` allows processes usually run as `root`, like Docker daemons, access to the NFS mounts. The default value is `true`. This field only applies to Unix hosts.|
|extendedStartStopHooks|N|boolean|This controls whether the user's pre-start and post-start hooks will run during enable operations (and, likewise, whether pre-stop and post-stop hooks will run during disable operations). The default value is `false`.|

## Example
Assume the following basic plugin structure:
Expand Down
Loading