Commit 4b4f771f authored by Diego Molteni's avatar Diego Molteni
Browse files

Initial commit from Schlumberger

parents
Pipeline #18616 failed
# ============================================================================
# Copyright 2017-2019, Schlumberger
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ============================================================================
# Prerequisites
*.d
# Compiled Object files
*.slo
*.lo
*.o
*.obj
# Precompiled Headers
*.gch
*.pch
# Compiled Dynamic libraries
*.so
*.dylib
*.dll
# Fortran module files
*.mod
*.smod
# Compiled Static libraries
*.lai
*.la
*.a
*.lib
# Executables
*.exe
*.out
*.app
# Builds
build
_build_[Dd]ebug
_build_[Rr]elease
# Dists
dist
# IDE Configs
.vscode
# test
build-poly
build-google
\ No newline at end of file
include: devops/gitlab/.pipeline.yml
\ No newline at end of file
# ============================================================================
# Copyright 2017-2019, Schlumberger
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ============================================================================
[submodule "src/test/googletest"]
path = src/test/googletest
url = https://github.com/google/googletest.git
[submodule "src/third-party/crc32c"]
path = src/third-party/crc32c
url = https://github.com/google/crc32c.git
[submodule "src/benchmarks/benchmark"]
path = src/benchmarks/benchmark
url = https://github.com/google/benchmark.git
# Seismic Store C++ Client Api (sdapi) Change Log
The Change log contains all changes released to the seismic store client c++ api (sdapi).
<li><a href="https://dev.azure.com/slb-des-ext-collaboration/open-data-ecosystem/_git/os-seismic-store-cpp-lib/commit/1f308703adfdd2f89a5bdedf6df1a3258564cda2">2020-09-11</a> Fixed missing auth cahce in the Azure storage accessor</li>
<li><a href="https://dev.azure.com/slb-des-ext-collaboration/open-data-ecosystem/_git/os-seismic-store-cpp-lib/commit/0d42cf5a1b151702d35c1829e8ebdbe88c550301">2020-09-08</a> Fix cpprest_2_10.dll dependency bug</li>
<li><a href="https://dev.azure.com/slb-des-ext-collaboration/open-data-ecosystem/_git/os-seismic-store-cpp-lib/commit/e63bbf6a75fc8201134b9aec72ec406d56e58b18">2020-09-07</a> Add .PDBs to Windows libraries</li>
<li><a href="https://dev.azure.com/slb-des-ext-collaboration/open-data-ecosystem/_git/os-seismic-store-cpp-lib/commit/4935b70d557e1f58e2d92ba56014cbb8b2d57a50">2020-09-01</a> updating the object size method in the write block call</li>
<li><a href="https://dev.azure.com/slb-des-ext-collaboration/open-data-ecosystem/_git/os-seismic-store-cpp-lib/commit/01fabc5ffe5a62435d1ba85a06fceed04995c854">2020-08-31</a> Library reviewed for push in gilab (crc32c patch fix)</li>
<li><a href="https://dev.azure.com/slb-des-ext-collaboration/open-data-ecosystem/_git/os-seismic-store-cpp-lib/commit/822a12e735a0f9639f80e8b5fc13e6744fc55131">2020-08-30</a> Fix getFilename() bug in Windows build</li>
<li><a href="https://dev.azure.com/slb-des-ext-collaboration/open-data-ecosystem/_git/os-seismic-store-cpp-lib/commit/d68af7c873d6764b8a1daaa528bd00d8bb05bc7d">2020-08-30</a> Fix getTempDirectory() bug in Windows</li>
<li><a href="https://dev.azure.com/slb-des-ext-collaboration/open-data-ecosystem/_git/os-seismic-store-cpp-lib/commit/c26cb82ef2934ea85ae29d4902ac0c9fc04eb5b7">2020-08-28</a> Trivial fix to hide a breaking change to Seismic Store by modifying SDAPI.</li>
<li><a href="https://dev.azure.com/slb-des-ext-collaboration/open-data-ecosystem/_git/os-seismic-store-cpp-lib/commit/a8d47b30cd87670f7be6de6d114b02aaaad3ad44">2020-08-27</a> Fix Windows build</li>
<li><a href="https://dev.azure.com/slb-des-ext-collaboration/open-data-ecosystem/_git/os-seismic-store-cpp-lib/commit/eafdf2ee0a00e2eafcca22548d8d49a59542845b">2020-08-26</a> Get sdapi ready for Azure storage</li>
<li><a href="https://dev.azure.com/slb-des-ext-collaboration/open-data-ecosystem/_git/os-seismic-store-cpp-lib/commit/f27e5b35d3aab9ad63f4654646f9b06600fdc48c">2020-08-24</a> Fix sdapi double url encoding bug</li>
<li><a href="https://dev.azure.com/slb-des-ext-collaboration/open-data-ecosystem/_git/os-seismic-store-cpp-lib/commit/79603491c1b6677682ba16c3445e46f2fef08e98">2020-08-24</a> Fix build issues</li>
<li><a href="https://dev.azure.com/slb-des-ext-collaboration/open-data-ecosystem/_git/os-seismic-store-cpp-lib/commit/62bee59dcc2892b00ccd493ae7610ab1b1f44069">2020-08-12</a> Added expire time check</li>
<li><a href="https://dev.azure.com/slb-des-ext-collaboration/open-data-ecosystem/_git/os-seismic-store-cpp-lib/commit/fd2f949e07072e7eef7f70d26eb5d660c9f91992">2020-08-07</a> Solve build problem</li>
<li><a href="https://dev.azure.com/slb-des-ext-collaboration/open-data-ecosystem/_git/os-seismic-store-cpp-lib/commit/a73f560b64c0e02d974e80cd7b6531757fd574a3">2020-08-07</a> add optimization flags for Release</li>
<li><a href="https://dev.azure.com/slb-des-ext-collaboration/open-data-ecosystem/_git/os-seismic-store-cpp-lib/commit/00210cf97cd765e6e906e1173cbcef40afb3b958">2020-08-06</a> generate/load opening context from/to a generic dataset</li>
<li><a href="https://dev.azure.com/slb-des-ext-collaboration/open-data-ecosystem/_git/os-seismic-store-cpp-lib/commit/8eb52e9f365a5e23265d6ac0eda3d968d01e3474">2020-08-06</a> Update Azure auth provider</li>
<li><a href="https://dev.azure.com/slb-des-ext-collaboration/open-data-ecosystem/_git/os-seismic-store-cpp-lib/commit/c7fd7e6bd9756219ffd04471aa60de51ba3313b4">2020-07-30</a> Implement Azure storage accessor + Tests</li>
<li><a href="https://dev.azure.com/slb-des-ext-collaboration/open-data-ecosystem/_git/os-seismic-store-cpp-lib/commit/5119b2fe4336178fdddd4caff443b20ef7c75c0d">2020-07-30</a> Added build option for polycloud</li>
<li><a href="https://dev.azure.com/slb-des-ext-collaboration/open-data-ecosystem/_git/os-seismic-store-cpp-lib/commit/8593b4b4f3b0295aff34a4f90364872ec4b1e500">2020-07-22</a> Add regression test for variable object sizes</li>
<li><a href="https://dev.azure.com/slb-des-ext-collaboration/open-data-ecosystem/_git/os-seismic-store-cpp-lib/commit/cde374dc8a3c5fb8e55b92386895ffe29d03c5a6">2020-07-21</a> x-api-key to appkey</li>
<li><a href="https://dev.azure.com/slb-des-ext-collaboration/open-data-ecosystem/_git/os-seismic-store-cpp-lib/commit/b76f14b2d9c2998d46f5cadee69aae5c33e60a52">2020-07-06</a> Fixed code compilation</li>
<li><a href="https://dev.azure.com/slb-des-ext-collaboration/open-data-ecosystem/_git/os-seismic-store-cpp-lib/commit/90a841d2f1555daf5bdaf0e0ee857d13c7d2c08f">2020-07-05</a> sdapi telemetry for seismic store</li>
<li><a href="https://dev.azure.com/slb-des-ext-collaboration/open-data-ecosystem/_git/os-seismic-store-cpp-lib/commit/7c3314d90092116aed02c533f1f07ecb6d72445a">2020-06-29</a> Fixing compiling issue due to missing a forward declaration in Storage.h</li>
<li><a href="https://dev.azure.com/slb-des-ext-collaboration/open-data-ecosystem/_git/os-seismic-store-cpp-lib/commit/3c8632a6e4341f60eb01064ae39b6917444a5fb4">2020-06-29</a> Create SDAPI abstraction for storage access to support multi-cloud providers</li>
<li><a href="https://dev.azure.com/slb-des-ext-collaboration/open-data-ecosystem/_git/os-seismic-store-cpp-lib/commit/0391442e0c07b73b96ab17f425bebd7dde935a8b">2020-06-29</a> Increase minor version number</li>
<li><a href="https://dev.azure.com/slb-des-ext-collaboration/open-data-ecosystem/_git/os-seismic-store-cpp-lib/commit/9bd4c5f64c147d11c639a5fb7b24ad662e2cfb7d">2020-06-29</a> Fix unit test bug</li>
<li><a href="https://dev.azure.com/slb-des-ext-collaboration/open-data-ecosystem/_git/os-seismic-store-cpp-lib/commit/a1fdd69647e42c59b7255c7aacc701d8df565b4d">2020-06-29</a> Add SDAccessor::setContext()</li>
<li><a href="https://dev.azure.com/slb-des-ext-collaboration/open-data-ecosystem/_git/os-seismic-store-cpp-lib/commit/56491d18a65174007879f17dc6fc2728a5e7c26d">2020-06-22</a> Fixed utest error</li>
<li><a href="https://dev.azure.com/slb-des-ext-collaboration/open-data-ecosystem/_git/os-seismic-store-cpp-lib/commit/4de97a1c86f96ae57b44c2b0b38cbc0e9d8c9601">2020-06-21</a> Fix pedantic object size computation</li>
<li><a href="https://dev.azure.com/slb-des-ext-collaboration/open-data-ecosystem/_git/os-seismic-store-cpp-lib/commit/b283c6f5891568c8342fe57cbae08dea6c676fdb">2020-06-16</a> Updated Readme/Diagram & removed whitesource scripts</li>
<li><a href="https://dev.azure.com/slb-des-ext-collaboration/open-data-ecosystem/_git/os-seismic-store-cpp-lib/commit/106f34157e7706f40ca0d1d6754183eed9b9fac9">2020-06-16</a> Add multithreaded I/O to performance tests</li>
<li><a href="https://dev.azure.com/slb-des-ext-collaboration/open-data-ecosystem/_git/os-seismic-store-cpp-lib/commit/373b6ac2a961f54c5c97b9af7e9855e296e4b512">2020-06-15</a> Updated SDVersion.h</li>
<li><a href="https://dev.azure.com/slb-des-ext-collaboration/open-data-ecosystem/_git/os-seismic-store-cpp-lib/commit/9959464e1bd48efe762e88873b71af12f916b414">2020-06-15</a> fixed pedantic mode</li>
<li><a href="https://dev.azure.com/slb-des-ext-collaboration/open-data-ecosystem/_git/os-seismic-store-cpp-lib/commit/9a023ff79b95c6940419b63ef06d830790d255e4">2020-06-05</a> Enable telemetry sdapi</li>
<li><a href="https://dev.azure.com/slb-des-ext-collaboration/open-data-ecosystem/_git/os-seismic-store-cpp-lib/commit/f3c48f81972ac14d8bbfad6b32ebaf6f95f50033">2020-05-29</a> Modify csv file output</li>
<li><a href="https://dev.azure.com/slb-des-ext-collaboration/open-data-ecosystem/_git/os-seismic-store-cpp-lib/commit/cc5ee388bb75e8dc2589d88335ba99c0ecabe5b1">2020-05-27</a> Add performance test</li>
<li><a href="https://dev.azure.com/slb-des-ext-collaboration/open-data-ecosystem/_git/os-seismic-store-cpp-lib/commit/36016e275b8766183ccf7ba9a32fdc7e7eef7471">2020-05-20</a> Updated Readme/Diagram & removed whitesource scripts</li>
<li><a href="https://dev.azure.com/slb-des-ext-collaboration/open-data-ecosystem/_git/os-seismic-store-cpp-lib/commit/9b84bb31df5a56d65adafc0a40f45e9cf96d68a7">2020-05-18</a> Improve e2e regression test init</li>
<li><a href="https://dev.azure.com/slb-des-ext-collaboration/open-data-ecosystem/_git/os-seismic-store-cpp-lib/commit/fb04e770b40e91700f070bea8b4ae6721767e914">2020-05-18</a> Improved performance on MT opening</li>
<li><a href="https://dev.azure.com/slb-des-ext-collaboration/open-data-ecosystem/_git/os-seismic-store-cpp-lib/commit/04775df73e7da26329beff5a6924c9196107ac32">2020-05-14</a> Rename e2e test executable</li>
<li><a href="https://dev.azure.com/slb-des-ext-collaboration/open-data-ecosystem/_git/os-seismic-store-cpp-lib/commit/ef0fc603ff5d373bfc5e2b3a7967bb7a050b7bdb">2020-05-11</a> Allow e2e tests to build for Win64</li>
<li><a href="https://dev.azure.com/slb-des-ext-collaboration/open-data-ecosystem/_git/os-seismic-store-cpp-lib/commit/4c37a03c079f700eca7303d96465a7b4b2eb455d">2020-05-11</a> Fixed: Dataset ostream operator doesn't output tags.</li>
<li><a href="https://dev.azure.com/slb-des-ext-collaboration/open-data-ecosystem/_git/os-seismic-store-cpp-lib/commit/2ba03a829da8ffeb056b8d33c268094b0d308f83">2020-05-09</a> Tidy up e2e test output</li>
<li><a href="https://dev.azure.com/slb-des-ext-collaboration/open-data-ecosystem/_git/os-seismic-store-cpp-lib/commit/df824e41af3afc3c9cc23045e95c9bfca674df81">2020-05-07</a> Add blockExists and objectExists functions to Datasets</li>
<li><a href="https://dev.azure.com/slb-des-ext-collaboration/open-data-ecosystem/_git/os-seismic-store-cpp-lib/commit/3533110962aa26358492166c3990875014dacded">2020-05-05</a> Add type getter function to Datasets</li>
<li><a href="https://dev.azure.com/slb-des-ext-collaboration/open-data-ecosystem/_git/os-seismic-store-cpp-lib/commit/ec16fec5a51c7dda09597b2ee54b7a1149cc0acf">2020-05-04</a> Add legal-tag getter function to Datasets</li>
<li><a href="https://dev.azure.com/slb-des-ext-collaboration/open-data-ecosystem/_git/os-seismic-store-cpp-lib/commit/ae9743667507096e6b7bc9add22e6a9100c570c4">2020-05-04</a> Enable e2e test compilation steps for win64</li>
<li><a href="https://dev.azure.com/slb-des-ext-collaboration/open-data-ecosystem/_git/os-seismic-store-cpp-lib/commit/bf6dfb6b10758d5c3fc17a43083bc6dc2d054168">2020-05-01</a> Add e2e functional tests</li>
<li><a href="https://dev.azure.com/slb-des-ext-collaboration/open-data-ecosystem/_git/os-seismic-store-cpp-lib/commit/dd6fc4d640493c7ede5eb85d90e80f6caff18bf6">2020-04-22</a> Add sdapi version API</li>
Copyright 2017-2019, Schlumberger
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
\ No newline at end of file
# Seismic DMS C++ Client Library { SDAPI }
SDAPI is a C++ client api library designed to interact with seismic store.
Seismic Store is a Schlumberger cloud-based solution designed to store and manage datasets of any size in the cloud by enabling a secure way to access them through a scoped authorization mechanism. Seismic Store overcomes the object size limitations imposed by a cloud provider, by managing generic datasets as multi independent objects and, therefore, provides a generic, reliable and a better performed solution to handle data on a cloud storage.
The sdapi library will allow you to easily interact with seismic store and perform operations like upload, download and manage datasets of any size with seismic store.
- [Linux Build Instructions](#linux-build-instructions)
- [Linux Build DockerFile](#linux-build-dockerfile)
- [Windows Build Instructions](#windows-build-instructions)
- [Environemnt Control Variables](#environemnt-control-variables)
- [Usage Examples](#usage-examples)
![components interaction diagram](docs/components-interaction-diagram-plain.png)
## Linux Build Instructions
The sdapi library require third party software. Ensure to have these dependencies installed and the library path correctly updated (if not installed in the default system library path)
- [curl](https://github.com/curl/curl)
- [azure storage](https://github.com/Azure/azure-storage-cpp)
- [cpprest](https://github.com/microsoft/cpprestsdk)
- [libxml2](https://github.com/GNOME/libxml2)
- [libuuid](https://linux.die.net/man/3/libuuid)
- [boost](https://github.com/boostorg/boost)
- [openssl](https://github.com/openssl/openssl)
- [zlib](https://github.com/madler/zlib)
Clone the repository and move into the sdapi root directory
```bash
git clone git@community.opengroup.org:osdu/platform/domain-data-mgmt-services/seismic/seismic-dms-suite/seismic-store-cpp-lib.git --recursive && cd seismic-store-cpp-lib
```
Build the library executing the bash script for linux
```bash
# build the library with default build parameters value
./devops/scripts/build-linux64.sh
# build parameters
--build-mode = Debug | Release (default="Release")
--mnt-volume = sdapi root dir (default=".")
--lib-version = sdapi library version (default="0.0.0")
# build tests paramters
--build-ftest to build functional tests
--build-utest to build integral (unit) tests
--build-rtest to build regression(e2e) tests
--build-ptest to build performance tests
# usage example
./devops/scripts/build-linux64.sh --build-mode=Release --mnt-volume=/tmp/sdapi-repo --lib-version=3.1.32 --build-ftest --build-utest --build-rtest --build-ptest
```
## Linux Build DockerFile
The library can be build using one of the provided docker container definitions under [devops/docker](devops/docker).
```bash
# build the docker image (it will require several minutes)
docker build -f devops/docker/build.ubuntu.dockerfile -t sdapi-builder-ubuntu .
# build the library using the created container
docker run -u $(id -u):$(id -g) -v ${SDAPI_ROOT_DIR}:/sdapi sdapi-builder-ubuntu /sdapi/devops/scripts/build-linux64.sh --build-mode="Release" --mnt-volume="/sdapi" --lib-version="3.5.123"
```
## Windows Build Instructions
To build sdapi for Windows, [Visual Studio 2017](https://docs.microsoft.com/en-us/visualstudio/releasenotes/vs2017-relnotes) is required. Also, [MFC and ATL](https://docs.microsoft.com/en-us/cpp/mfc/mfc-and-atl?view=vs-2019) optional sub-components must be checked under the *Desktop development with C++* workload in the Visual Studio Installer program.
Dependencies in windows can be installed via [vcpkg](https://github.com/microsoft/vcpkg).
```powershell
# Download and install vcpkg
PS git clone https://github.com/microsoft/vcpkg.git
PS cd vcpkg
PS .\bootstrap-vcpkg.bat
# install required dependencies
PS .\vcpkg install azure-storage-cpp:x64-windows
PS .\vcpkg install curl:x64-windows
PS .\vcpkg integrate install
```
Build the library executing the powershell script for windows
```powershell
# build the library with default build parameters value
PS .\devops\scripts\build-win64.ps1
# build parameters
-build_type = Debug | Release (default="Release")
-vcpkg_path = vcpkg root dir (default=".")
-vcversion_cmake = cmake visual studio VC version (default="Visual Studio 15 2017 Win64")
-lib_version = sdapi library version (default="0.0.0")
# usage example
PS .\devops\scripts\build-win64.ps1 -build_type 'Release' -vcpkg_path 'D:/vcpkg' -vcversion_cmake 'Visual Studio 15 2017 Win64' -lib_version '3.5.323;
```
## Environemnt Control Variables
Library behaviours can be controlled via these environment variables:
- DISABLE_SSL_CERTIFICATE_VERIFICATION=ON|OFF, enable or disable the SSL certificate verification (enabled by default)
- ENABLE_CURL_SIGNAL_HANDLERS=ON|OFF, enable or disable the internal curl signal handling (disabled by default)
## Usage Examples
The SDManager is the main configuration object for seismic store. It stores and manages service url, key and user credentials. It must be initialized as first in a client code.
```cpp
#include "SDManager.h"
// default constructor will initialize the service URL
// and the service api key reading the SD_SVC_URL and
// SD_SVC_API_KEY environment variables.
seismicdrive::SDManager manager;
// It is required to set at least one Auth provider
manager.setAuthProviderFromImpToken("The seistore Impersonation JWT");
manager.setAuthProviderFromString( "The user idtoken");
```
### Uploader MulitObjects Example
```cpp
#include "SDGenericDataset.h"
#include <fstream>
#include <cmath>
// localFile: local file path
// seistoreFile: seistore file path sd://tenant/subproject/dataset
// chunkSize: size of a block (MB)
void upload(
const std::string& localFile,
const std::string& seistoreFile,
uint64_t chunkSize) {
// MB in bytes
chunkSize = chunkSize * 1048576;
// open the local file and retrieve the size
std::fstream file(localFile, std::ios::in | std::ios::binary | std::ios::ate);
std::streamsize size = file.tellg();
file.seekg(0, std::ios::beg);
// number of transfers to perform
auto ntrx = static_cast<int>(std::floor(size / chunkSize));
// size of the last transfer
auto rtrxSize = size - ntrx * chunkSize;
// initialize the configuration manager
seismicdrive::SDManager sdmanager;
sdmanager.setAuthProviderFromString( "The user idtoken");
// initialize the seismic store dataset
seismicdrive::SDGenericDataset sdgd(&sdmanager, seistoreFile);
// open the seismic store dataset as create (::OVERRIDE if already exist)
sdgd.open(seismicdrive::SDDatasetDisposition::CREATE);
// write blocks
std::vector<char> buffer(chunkSize);
for(auto ii=0; ii<ntrx; ii++) {
file.read(buffer.data(), chunkSize);
sdgd.writeBlock(ii, buffer.data(), chunkSize);
}
// write last block
if(rtrxSize) {
file.read(buffer.data(), rtrxSize);
sdgd.writeBlock(ntrx, buffer.data(), rtrxSize);
}
// close the seistore dataset
sdgd.close();
}
```
### Donwloader MulitObjects Example
```cpp
#include "SDGenericDataset.h"
#include <fstream>
#include <cmath>
// localFile: local file path
// seistoreFile: seistore file path sd://tenant/subproject/dataset
void downloader(
const std::string& localFile,
const std::string& seistoreFile) {
// initialize the configuration manager
seismicdrive::SDManager sdmanager;
sdmanager.setAuthProviderFromString( "The user idtoken");
// initialize the seismic store dataset
seismicdrive::SDGenericDataset sdgd(&sdmanager, seistoreFile);
// open the seismic store dataset for READ ONLY
sdgd.open(seismicdrive::SDDatasetDisposition::READ_ONLY);
// get the number of object
auto nobject = sdgd.getBlockNum();
// open the local file for write
std::fstream file(localFile, std::ios::out | std::ios::binary);
// read all blocks
for(auto ii=0; ii<nobject; ii++) {
// you can skip this if you already know the size (faster)
auto size = sdgd.getBlockSize(ii);
std::string res(size, 'x');
// read the block from seistore to local file
sdgd.readBlock(ii, const_cast<char*>(res.c_str()), 0, size);
std::fstream ofile(std::to_string(ii), std::ios::out | std::ios::binary);
file.write(res.c_str(), size);
}
// close local file
file.close();
// close seistore dataset
sdgd.close();
}
```
### More examples under [src/test/seismic-store](src/test/seismic-store)
\ No newline at end of file
# base image
FROM centos/devtoolset-7-toolchain-centos7
# build as root
USER 0
# build dependencies
ARG CMAKE_VERSION=3.19.1
# library dependencies
ARG LIB_ZLIB_VERSION=1.2.11
ARG LIB_OPENSSL_VERSION=1.1.1g
ARG LIB_CURL_VERSION=7.73.0
ARG LIB_BOOST_VERSION=1.73.0
ARG LIB_UUID_VERSION=1.0.3
ARG LIB_XML2_VERSION=2.9.10
ARG LIB_CPPREST_VERSION=2.10.16
ARG LIB_AZURE_STORAGE_VERSION=7.5.0
# library path
ARG LIBRARIES_INSTALL_PATH=/usr/local
# install required build tools via packet manager
RUN yum update -y && yum install -y wget which git libtool autoconf perl-devel python-devel xz-devel patch
# temporary working directory
WORKDIR /tmp
# [CMAKE]
RUN wget https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-Linux-x86_64.tar.gz \
&& tar -zxvf cmake-${CMAKE_VERSION}-Linux-x86_64.tar.gz -C /usr/local \
&& ln -s /usr/local/cmake-${CMAKE_VERSION}-Linux-x86_64/bin/cmake /usr/bin/cmake \
&& ln -s /usr/local/cmake-${CMAKE_VERSION}-Linux-x86_64/bin/ctest /usr/bin/ctest \
&& rm -rf cmake-${CMAKE_VERSION}-Linux-x86_64.tar.gz
# [ZLIB]
RUN wget https://www.zlib.net/zlib-${LIB_ZLIB_VERSION}.tar.gz \
&& tar -zxvf zlib-${LIB_ZLIB_VERSION}.tar.gz \
&& cd zlib-${LIB_ZLIB_VERSION} \
&& ./configure --prefix=${LIBRARIES_INSTALL_PATH} \
&& make -j $(nproc) \
&& make install \
&& cd .. \
&& rm -rf zlib-${LIB_ZLIB_VERSION}.tar.gz \
&& rm -rf zlib-${LIB_ZLIB_VERSION}
# [OPENSSL]
RUN wget https://www.openssl.org/source/openssl-${LIB_OPENSSL_VERSION}.tar.gz \
&& tar -zxvf openssl-${LIB_OPENSSL_VERSION}.tar.gz \
&& cd openssl-${LIB_OPENSSL_VERSION} \
&& ./config --prefix=${LIBRARIES_INSTALL_PATH} \
&& make -j $(nproc) \
&& make install_sw \
&& cd .. \
&& rm -rf openssl-${LIB_OPENSSL_VERSION}.tar.gz \
&& rm -rf openssl-${LIB_OPENSSL_VERSION}
# [BOOST]
RUN wget https://dl.bintray.com/boostorg/release/${LIB_BOOST_VERSION}/source/boost_$(echo "$LIB_BOOST_VERSION" | tr . _).tar.gz \
&& tar -zxvf boost_$(echo "$LIB_BOOST_VERSION" | tr . _).tar.gz \
&& cd boost_$(echo "$LIB_BOOST_VERSION" | tr . _) \
&& ./bootstrap.sh --prefix=${LIBRARIES_INSTALL_PATH} \
&& ./b2 stage -j $(nproc) threading=multi link=shared -q \
&& ./b2 install threading=multi link=shared \
&& ln -svf detail/sha1.hpp ${LIBRARIES_INSTALL_PATH}/include/boost/uuid/sha1.hpp \
&& cd .. \
&& rm -rf boost_$(echo "$LIB_BOOST_VERSION" | tr . _).tar.gz \
&& rm -rf boost_$(echo "$LIB_BOOST_VERSION" | tr . _)
# [UUID]
RUN wget https://vorboss.dl.sourceforge.net/project/libuuid/libuuid-${LIB_UUID_VERSION}.tar.gz \
&& tar -zxvf libuuid-${LIB_UUID_VERSION}.tar.gz \
&& cd libuuid-${LIB_UUID_VERSION} \
&& ./configure --prefix=${LIBRARIES_INSTALL_PATH} \
&& make -j $(nproc) \
&& make install \
&& cd .. \
&& rm -rf libuuid-${LIB_UUID_VERSION}.tar.gz \
&& rm -rf libuuid-${LIB_UUID_VERSION}
# [XML2]
RUN wget https://github.com/GNOME/libxml2/archive/v${LIB_XML2_VERSION}.tar.gz \
&& tar -zxvf v${LIB_XML2_VERSION}.tar.gz \
&& cd libxml2-${LIB_XML2_VERSION} \
&& ./autogen.sh --prefix=${LIBRARIES_INSTALL_PATH} \
&& make -j $(nproc) \
&& make install \
&& cd .. \
&& rm -rf v${LIB_XML2_VERSION}.tar.gz \
&& rm -rf libxml2-${LIB_XML2_VERSION}
# [CCPRESTSDK]
RUN git clone -b v${LIB_CPPREST_VERSION} https://github.com/microsoft/cpprestsdk.git cpprestsdk --recursive \
&& cd cpprestsdk \
&& mkdir build \
&& cd build \
&& cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${LIBRARIES_INSTALL_PATH} .. \
&& make -j $(nrpoc) \
&& make install \
&& cd ../.. \
&& rm -rf cpprestsdk
# [AZURESTORAGECPP]
RUN git clone -b v${LIB_AZURE_STORAGE_VERSION} https://github.com/Azure/azure-storage-cpp.git azure-storage-cpp --recursive \
&& cd azure-storage-cpp/Microsoft.WindowsAzure.Storage \
&& mkdir build.release \
&& cd build.release \
&& cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${LIBRARIES_INSTALL_PATH} .. \
&& make -j $(nproc) \
&& make install \
&& cd ../../.. \
&& rm -rf azure-storage-cpp
# [CURL]
RUN git clone -b curl-$(echo "$LIB_CURL_VERSION" | tr . _) https://github.com/curl/curl.git curl --recursive \
&& cd curl \
&& mkdir build \
&& cd build \
&& cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${LIBRARIES_INSTALL_PATH} .. \
&& make -j $(nrpoc) \
&& make install \
&& cd ../.. \
&& rm -rf curl
# finalize the build
WORKDIR /
USER 1001
\ No newline at end of file
# base image
FROM centos:8
# build as root
USER 0
# build dependencies
ARG CMAKE_VERSION=3.19.1
# library dependencies
ARG LIB_ZLIB_VERSION=1.2.11
ARG LIB_OPENSSL_VERSION=1.1.1g
ARG LIB_CURL_VERSION=7.73.0
ARG LIB_BOOST_VERSION=1.73.0
ARG LIB_UUID_VERSION=1.0.3
ARG LIB_XML2_VERSION=2.9.10
ARG LIB_CPPREST_VERSION=2.10.16
ARG LIB_AZURE_STORAGE_VERSION=7.5.0
# library path
ARG LIBRARIES_INSTALL_PATH=/usr/local
# install required build tools via packet manager
RUN dnf update -y && dnf install -y wget git gcc-c++ make libtool which xz-devel patch
# temporary working directory
WORKDIR /tmp
# [CMAKE]
RUN wget https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-Linux-x86_64.tar.gz \
&& tar -zxvf cmake-${CMAKE_VERSION}-Linux-x86_64.tar.gz -C /usr/local \
&& ln -s /usr/local/cmake-${CMAKE_VERSION}-Linux-x86_64/bin/cmake /usr/bin/cmake \
&& ln -s /usr/local/cmake-${CMAKE_VERSION}-Linux-x86_64/bin/ctest /usr/bin/ctest \
&& rm -rf cmake-${CMAKE_VERSION}-Linux-x86_64.tar.gz
# [ZLIB]
RUN wget https://www.zlib.net/zlib-${LIB_ZLIB_VERSION}.tar.gz \
&& tar -zxvf zlib-${LIB_ZLIB_VERSION}.tar.gz \
&& cd zlib-${LIB_ZLIB_VERSION} \
&& ./configure --prefix=${LIBRARIES_INSTALL_PATH} \
&& make -j $(nproc) \
&& make install \
&& cd .. \
&& rm -rf zlib-${LIB_ZLIB_VERSION}.tar.gz \
&& rm -rf zlib-${LIB_ZLIB_VERSION}
# [OPENSSL]
RUN wget https://www.openssl.org/source/openssl-${LIB_OPENSSL_VERSION}.tar.gz \
&& tar -zxvf openssl-${LIB_OPENSSL_VERSION}.tar.gz \
&& cd openssl-${LIB_OPENSSL_VERSION} \
&& ./config --prefix=${LIBRARIES_INSTALL_PATH} \
&& make -j $(nproc) \
&& make install_sw \
&& cd .. \
&& rm -rf openssl-${LIB_OPENSSL_VERSION}.tar.gz \
&& rm -rf openssl-${LIB_OPENSSL_VERSION}
# [BOOST]
RUN wget https://dl.bintray.com/boostorg/release/${LIB_BOOST_VERSION}/source/boost_$(echo "$LIB_BOOST_VERSION" | tr . _).tar.gz \
&& tar -zxvf boost_$(echo "$LIB_BOOST_VERSION" | tr . _).tar.gz \
&& cd boost_$(echo "$LIB_BOOST_VERSION" | tr . _) \
&& ./bootstrap.sh --prefix=${LIBRARIES_INSTALL_PATH} \
&& ./b2 stage -j $(nproc) threading=multi link=shared -q \
&& ./b2 install threading=multi link=shared \
&& ln -svf detail/sha1.hpp ${LIBRARIES_INSTALL_PATH}/include/boost/uuid/sha1.hpp \
&& cd .. \
&& rm -rf boost_$(echo "$LIB_BOOST_VERSION" | tr . _).tar.gz \
&& rm -rf boost_$(echo "$LIB_BOOST_VERSION" | tr . _)
# [UUID]
RUN wget https://vorboss.dl.sourceforge.net/project/libuuid/libuuid-${LIB_UUID_VERSION}.tar.gz \
&& tar -zxvf libuuid-${LIB_UUID_VERSION}.tar.gz \
&& cd libuuid-${LIB_UUID_VERSION} \
&& ./configure --prefix=${LIBRARIES_INSTALL_PATH} \
&& make -j $(nproc) \
&& make install \
&& cd .. \