From 85881a574d547fd58157cd4066b23a8ec0eb8c21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Mon, 29 Mar 2021 15:22:00 +0200 Subject: [PATCH 1/3] Make sure python VolumeDataAccess test follows protocol --- tests/python/VolumeDataAccessor.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/python/VolumeDataAccessor.py b/tests/python/VolumeDataAccessor.py index 7cabc0f3..34213249 100644 --- a/tests/python/VolumeDataAccessor.py +++ b/tests/python/VolumeDataAccessor.py @@ -8,6 +8,9 @@ if not TEST_URL: handle = openvds.open(TEST_URL, TEST_CONNECTION) acc = openvds.VolumeDataAccessManager(handle) r = acc.requestVolumeSubset((0,0,0),(100,100,100)) +r.waitForCompletion() accessor = acc.createVolumeData3DReadAccessorR32(openvds.DimensionsND.Dimensions_012) v = accessor.getValue((100,100,100)) + +openvds.close(handle) -- GitLab From fbfaa5b1e769572e8153e474193e6d5610bc4e37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Mon, 29 Mar 2021 15:23:49 +0200 Subject: [PATCH 2/3] Update sliceserer arguments help text --- examples/SliceServer/sliceserver.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/SliceServer/sliceserver.py b/examples/SliceServer/sliceserver.py index 59cc68af..7cc36838 100644 --- a/examples/SliceServer/sliceserver.py +++ b/examples/SliceServer/sliceserver.py @@ -14,8 +14,8 @@ from PIL import Image VDSs = {} parser = argparse.ArgumentParser(description="Starts a service that creates png images of the slices of a VDS.") -parser.add_argument("--url", help="The AWS bucket of the VDSs to start serving") -parser.add_argument("--connection", help="The Azure Blob Storage connection string."); +parser.add_argument("--url", help="The url of the VDSs to start serving") +parser.add_argument("--connection", help="The connection string for the url.") parser.add_argument("--key", help="The key of the VDSs to start serving") parser.add_argument("--allow-remote", action='store_true', help="Allow remote connections to server.") -- GitLab From ba1689ec3c1cdbc6988769ff5ed09da61fdfb404 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Mon, 29 Mar 2021 15:48:43 +0200 Subject: [PATCH 3/3] Fallback to interpret url as file if protocol scheme is not recognised --- docs/connection.rst | 19 ++++++++++++++++++- src/OpenVDS/OpenVDS.cpp | 4 +--- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/docs/connection.rst b/docs/connection.rst index 1a5c9288..71ace16f 100644 --- a/docs/connection.rst +++ b/docs/connection.rst @@ -12,7 +12,12 @@ backend to be used. Currently this can be: - s3 - azure - gs + - sd - azureSAS + - file + +If the file protocol scheme is used the rest of the path will be decoded according to url encoding, however +if OpenVDS fails to recognise the protocol of a url it will treat the url as a local file. For ``s3`` and ``gs`` the ``resource`` will be the bucket while for ``azure`` the ``resource`` will be the container. ``azureSAS`` will treat ``resource/sub_path`` as the baseURL @@ -54,6 +59,13 @@ https://docs.microsoft.com/en-us/azure/storage/common/storage-configure-connecti - SignedUrl (Possible values: True, Yes, On, False, No, Off. Default value: False, No, Off) The Token is the OAuth2 token. +``sd`` will accept the following keys + + - sdauthorityurl + - sdapikey + - sdtoken + - loglevel + ``azureSAS`` will accept the following keys - Suffix @@ -75,7 +87,12 @@ Azure:: GS:: url = "gs://my_bucket/somepath" - connection = "Token=ya29.c.Ko8B3wcAmfbKdqtd9OeEA4pod000u-KFdpFOiXx3S3wQK2WV-DL7oO3dAdCVTGyldJClv-4JIvUtdgFdzeYzzeNv1tG8aGXn_jjZLZkMAThV_0gYGnO2HBUwaqYeNMPlBa9RX4yEPRe4RZiAHk3Btkb29yfLyEJBkx321ntr00lhmAJksqli7igD1xBPlpeK3F0" + connection = "Token=some_token" + +SD:: + + url = "sd://tenent/subprojet/subfolder" + connection = "sdauthorityurl=https://some_osdu.instance.com/seistore-svc/api/v3;sdapikey=ABC;sdtoken=some_token" AzureSAS:: diff --git a/src/OpenVDS/OpenVDS.cpp b/src/OpenVDS/OpenVDS.cpp index 21013982..3f357518 100644 --- a/src/OpenVDS/OpenVDS.cpp +++ b/src/OpenVDS/OpenVDS.cpp @@ -432,9 +432,7 @@ OpenOptions* CreateOpenOptions(StringWrapper url, StringWrapper connectionString if (!openOptions) { - error.code = -1; - error.string = fmt::format("Unknown url scheme for {}.", std::string(url.data, url.data + url.size)); - return nullptr; + openOptions.reset(new VDSFileOpenOptions(std::string(url.data, url.size))); } return openOptions.release(); -- GitLab