Commit ad0bec6c authored by Diego Molteni's avatar Diego Molteni
Browse files

fix: merge with master

parents 1f239f8c 3633f203
Pipeline #109118 failed with stages
in 67 minutes and 15 seconds
# ============================================================================
# Copyright 2017-2019, Schlumberger
# Copyright 2017-2022, Schlumberger
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
......@@ -49,8 +49,9 @@
# Builds
build
_build_[Dd]ebug
_build_[Rr]elease
_build_[Dd]ebug*
_build_[Rr]elease*
versions.json
# Dists
dist
......@@ -62,4 +63,7 @@ dist
# test
build-poly
build-google
\ No newline at end of file
build-google
# Frequently used for development
.devcontainer.json
......@@ -13,6 +13,9 @@ include:
# aws
- local: "devops/osdu/global/cloud-providers/aws.yml"
# gcs
- local: "devops/osdu/global/cloud-providers/gcs.yml"
# build
# global
- local: "devops/osdu/compile/global.yml"
......@@ -29,6 +32,9 @@ include:
# ibm
- local: "/devops/osdu/compile/ibm.yml"
# gcs
- local: "/devops/osdu/compile/gcs.yml"
# global
- local: "/devops/osdu/compile/seismic-store-sdapi.yml"
......@@ -56,6 +62,9 @@ include:
# aws
- local: "/devops/osdu/scanners/abi-check-sdapi-aws.yml"
# gcs
- local: "/devops/osdu/scanners/abi-check-sdapi-gcs.yml"
# ibm
- local: "/devops/osdu/scanners/abi-check-sdapi-ibm.yml"
......@@ -75,6 +84,9 @@ include:
# ibm
- local: "/devops/osdu/deploy/ibm.yml"
# gcs
- local: "/devops/osdu/deploy/gcs.yml"
# integration
# azure
- local: "/devops/osdu/integration/azure.yml"
......
......@@ -125,22 +125,22 @@ options:
Build performance tests
--no-cloud-providers
Just build SDAPI with the default GCS implementation. No optional Cloud provider
Just build SDAPI with the default GCS accessor implementation. No optional cloud provider.
--azure-provider
Also build the Azure optional cloud provider code. ( functional, based on Azure Storage C++ SDK cpprest based)
--gcs-provider
Also build the optional GCS cloud provider code (functional, based on Google Cloud Storage C++ Client Library)
--azure-curl-provider
Also build the Azure optional cloud provider code. ( functional, based on Azure Storage C++ SDK curl based)
Also build the optional Azure cloud provider code. (functional, based on Azure Storage C++ SDK curl based)
--azure-provider
Also build the deprecated Azure cloud provider code. (functional, based on the outdated Azure Storage C++ SDK cpprest based)
--aws-provider
Also build the AWS optional cloud provider code. ( non-functional, based on AWS C++ SDK )
Also build the optional AWS cloud provider code. (non-functional, based on AWS C++ SDK)
--ibm-provider
Also build the IBM optional cloud provider code. ( non-functional, based on AWS C++ SDK )
--gcp-provider
Also build the GCP optional cloud provider code ( non-functional, based on Google Cloud C++ SDK )
Also build the optional IBM cloud provider code. (non-functional, based on AWS C++ SDK)
```
```bash
......@@ -182,7 +182,7 @@ docker run \
--mnt-volume=/osdu-sdapi-cpp \
--lib-version=9.99.9999 \
--build-utest --build-ftest --build-rtest --build-ptest \
--azure-provider --aws-provider --gcp-provider
--azure-provider --aws-provider --gcs-provider
# verify that we have produced a shared library that does not
# impose its own third-party dependencies onto its own customer
......@@ -245,8 +245,8 @@ PS .\devops\scripts\build-win64.ps1 -build_type 'Release' -vcpkg_path 'D:/vcpkg'
Library behaviors can be controlled via these environment variables:
- SDAPI_USE_GCS_SDK=ON|OFF, use the Google Cloud Storage Client API (rather than the old GCS Accessor based interface) when accessing GCS resources (OFF by default)
- DISABLE_SSL_CERTIFICATE_VERIFICATION=ON|OFF, enable or disable the SSL certificate verification (enabled by default)
- ENABLE_AZURE_CURL_BASED=ON|OFF, enable the usage of the azure sdk based on curl in case the library is built with both, --azure-provider(cpprest) --azure-curl-provider. (disabled by default)
- SDAPI_RETRY_CLOSING_DATASETS_IN_DCTOR=ON|OFF : default OFF. allows to change behavior of SDGenericDataset destructor ( closes datasets, ignoring failure by default ). Turn ON if you want to do truncated exponential backOff in the destructor.
- SDAPI_LOGLEVEL=0|1|... set the logging level (0 by default)
- DISABLE_SDAPI_401_RETRY=ON|OFF, enable or disable http 401 retries for SDAPI. By default SDAPI will retry calls on 401 return code by automatically refreshing credentials, when is possible, if the returned message match the following syntax (in all other cases the call is not retried):
......@@ -255,7 +255,8 @@ Library behaviors can be controlled via these environment variables:
- "[seismic-store-service] Unauthenticated Access. Authorizations not found in the request.": SDMS service returned message in case authorization header is missing or empty. This message is returned in case the service is not sit behind a proxy.
- DISABLE_SDAPI_403_RETRY=ON|OFF, enable or disable http 403 retries for SDAPI. By default SDAPI will retry calls on 403 return code by automatically refreshing credentials, when is possible, if the returned message match the following syntax (in all other cases the call is not retried):
- "RBAC: access denied": ISTIO proxy returned message in case authorization header is missing or empty
- SDAPI_USE_OUTDATED_AZURE_REST=ON|OFF, use the outdated rest-based azure sdk if the library is built with both --azure-provider(cpprest) --azure-curl-provider (OFF by default)
---
## Usage examples
......
# ============================================================================
# Copyright 2017-2021, Schlumberger
# Copyright 2017-2022, Schlumberger
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
......@@ -25,7 +25,7 @@ ARG LIBRARIES_INSTALL_PATH=/usr/local
ARG KEEP_DEPENDENCIES=false
# 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
RUN yum upgrade -y && yum install -y wget which git libtool autoconf perl-devel python-devel xz-devel patch
# temporary working directory
WORKDIR /tmp
......@@ -56,7 +56,7 @@ RUN wget https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cm
# ----------------------------------------------------------------------------------------------------------------------------
RUN echo "{" > /versions.json
FROM dev as rest-dev
FROM dev as zlib-dev
# [ZLIB]
ARG LIB_ZLIB_VERSION=1.2.11
......@@ -74,11 +74,13 @@ RUN wget https://www.zlib.net/zlib-${LIB_ZLIB_VERSION}.tar.gz \
RUN echo " \"zlib\": { \"version\" : \"${LIB_ZLIB_VERSION}\", \"url\" : \"https://www.zlib.net\" }," >> /versions.json
From zlib-dev as openssl-dev
# [OPENSSL]
# this has TCC implications
# consider instead RUN apt-get install openssl-libs openssl-dev
ARG LIB_OPENSSL_VERSION=1.1.1g
RUN wget https://www.openssl.org/source/openssl-${LIB_OPENSSL_VERSION}.tar.gz \
RUN wget https://www.openssl.org/source/openssl-${LIB_OPENSSL_VERSION}.tar.gz --no-check-certificate \
&& tar -zxvf openssl-${LIB_OPENSSL_VERSION}.tar.gz \
&& cd /tmp/openssl-${LIB_OPENSSL_VERSION} \
&& ./config --prefix=${LIBRARIES_INSTALL_PATH} no-shared \
......@@ -92,9 +94,11 @@ RUN wget https://www.openssl.org/source/openssl-${LIB_OPENSSL_VERSION}.tar.gz \
RUN echo " \"openssl\": { \"version\" : \"${LIB_OPENSSL_VERSION}\", \"url\" : \"https://www.openssl.org/\" }," >> /versions.json
FROM openssl-dev as uuid-dev
# [UUID]
ARG LIB_UUID_VERSION=1.0.3
RUN wget https://sourceforge.net/projects/libuuid/files/libuuid-${LIB_UUID_VERSION}.tar.gz \
RUN wget https://sourceforge.net/projects/libuuid/files/libuuid-${LIB_UUID_VERSION}.tar.gz --no-check-certificate \
&& tar -zxvf libuuid-${LIB_UUID_VERSION}.tar.gz \
&& cd /tmp/libuuid-${LIB_UUID_VERSION} \
&& ./configure --prefix=${LIBRARIES_INSTALL_PATH} --with-pic --enable-shared=no --enable-static=yes \
......@@ -108,29 +112,32 @@ RUN wget https://sourceforge.net/projects/libuuid/files/libuuid-${LIB_UUID_VERSI
RUN echo " \"libuuid\": { \"version\" : \"${LIB_UUID_VERSION}\", \"url\" : \"https://sourceforge.net/projects/libuuid/\" }," >> /versions.json
FROM uuid-dev as curl-dev
# [CURL]
# this is not equivalent to the system one built with libtool ... soname, versions are not done the same way.
# may require a patch for locally built nghttp2? or http3 libraries
ARG LIB_CURL_VERSION=7.74.0
RUN git clone -b curl-$(echo "$LIB_CURL_VERSION" | tr . _) https://github.com/curl/curl.git curl --recursive \
RUN git clone --depth 1 -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} -DBUILD_SHARED_LIBS=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=ON .. \
&& cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${LIBRARIES_INSTALL_PATH} -DBUILD_SHARED_LIBS=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=ON .. \
&& make -j $(nproc) \
&& make install \
&& cd ../.. \
&& if [ "${KEEP_DEPENDENCIES}" = "false" ]; then \
rm -rf curl; \
fi
fi \
&& ldconfig
RUN echo " \"curl\": { \"version\" : \"${LIB_CURL_VERSION}\", \"url\" : \"https://github.com/curl/curl\" }," >> /versions.json
FROM rest-dev as azure-dev
FROM curl-dev as boost-dev
# [BOOST]
ARG LIB_BOOST_VERSION=1.73.0
RUN wget https://sourceforge.net/projects/boost/files/boost/${LIB_BOOST_VERSION}/boost_$(echo "$LIB_BOOST_VERSION" | tr . _).tar.gz \
RUN wget https://sourceforge.net/projects/boost/files/boost/${LIB_BOOST_VERSION}/boost_$(echo "$LIB_BOOST_VERSION" | tr . _).tar.gz --no-check-certificate \
&& tar -zxvf boost_$(echo "$LIB_BOOST_VERSION" | tr . _).tar.gz \
&& cd boost_$(echo "$LIB_BOOST_VERSION" | tr . _) \
&& ./bootstrap.sh --prefix=${LIBRARIES_INSTALL_PATH} \
......@@ -145,6 +152,8 @@ RUN wget https://sourceforge.net/projects/boost/files/boost/${LIB_BOOST_VERSION}
RUN echo " \"boost\": { \"version\" : \"${LIB_BOOST_VERSION}\", \"url\" : \"https://boost.org\" }," >> /versions.json
FROM boost-dev as azure-dev
# [XZ]
# because we need liblzma that can be found and consumed by CMake
ARG LIB_XZ_COMMIT=e7da44d
......@@ -159,7 +168,8 @@ RUN git clone https://git.tukaani.org/xz.git xz \
&& cd ../.. \
&& if [ "${KEEP_DEPENDENCIES}" = "false" ]; then \
rm -rf xz; \
fi
fi \
&& ldconfig
RUN echo " \"xz\": { \"version\" : \"${LIB_XZ_COMMIT}\", \"url\" : \"https://git.tukaani.org/xz.git\" }," >> /versions.json
......@@ -181,33 +191,35 @@ RUN echo " \"libxml2\": { \"version\" : \"${LIB_XML2_VERSION}\",
# [CPPRESTSDK]
ARG LIB_CPPREST_VERSION=2.10.16
RUN git clone -b v${LIB_CPPREST_VERSION} https://github.com/microsoft/cpprestsdk.git cpprestsdk --recursive \
RUN git clone --depth 1 -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} -DBUILD_SHARED_LIBS=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DBoost_USE_STATIC_LIBS=ON -DBUILD_SAMPLES=OFF .. \
&& cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${LIBRARIES_INSTALL_PATH} -DBUILD_SHARED_LIBS=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DBoost_USE_STATIC_LIBS=ON -DBUILD_SAMPLES=OFF .. \
&& make -j $(nproc) \
&& make install \
&& cd ../.. \
&& if [ "${KEEP_DEPENDENCIES}" = "false" ]; then \
rm -rf cpprestsdk; \
fi
fi \
&& ldconfig
RUN echo " \"cpprest\": { \"version\" : \"${LIB_CPPREST_VERSION}\", \"url\" : \"https://github.com/microsoft/cpprestsdk\" }," >> /versions.json
# [AZURESTORAGECPP]
ARG LIB_AZURE_STORAGE_VERSION=7.5.0
RUN git clone -b v${LIB_AZURE_STORAGE_VERSION} https://github.com/Azure/azure-storage-cpp.git azure-storage-cpp --recursive \
RUN git clone --depth 1 -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} -DBUILD_SHARED_LIBS=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DBoost_USE_STATIC_LIBS=ON .. \
&& cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${LIBRARIES_INSTALL_PATH} -DBUILD_SHARED_LIBS=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DBoost_USE_STATIC_LIBS=ON .. \
&& make -j $(nproc) \
&& make install \
&& cd ../../.. \
&& if [ "${KEEP_DEPENDENCIES}" = "false" ]; then \
rm -rf azure-storage-cpp; \
fi
fi \
&& ldconfig
RUN echo " \"azurestorage\": { \"version\" : \"${LIB_AZURE_STORAGE_VERSION}\", \"url\" : \"http://github.com/Azure/azure-storage-cpp\" }," >> /versions.json
......@@ -225,7 +237,8 @@ RUN wget https://github.com/Azure/azure-sdk-for-cpp/archive/refs/tags/azure-stor
&& if [ "${KEEP_DEPENDENCIES}" = "false" ]; then \
rm -rf azure-sdk-for-cpp-azure-storage-blobs_${AZURE_STORAGE_FOR_CPP_VERSION} \
azure-storage-blobs_${AZURE_STORAGE_FOR_CPP_VERSION}.tar.gz; \
fi
fi \
&& ldconfig
RUN echo " \"azure_sdk_for_cpp\": { \"version\" : \"${AZURE_STORAGE_FOR_CPP_VERSION}\", \"url\" : \"https://github.com/Azure/azure-sdk-for-cpp\" }," >> /versions.json
......@@ -240,19 +253,20 @@ RUN wget -O crc32c_${CRC32C_VERSION}.tar.gz https://github.com/google/crc32c/arc
&& cd crc32c-${CRC32C_VERSION} \
&& mkdir build \
&& cd build \
&& cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=NO -DCRC32C_BUILD_TESTS=0 -DCRC32C_BUILD_BENCHMARKS=0 -DCRC32C_USE_GLOG=OFF -DENABLE_TESTING=OFF .. \
&& cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=NO -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCRC32C_BUILD_TESTS=0 -DCRC32C_BUILD_BENCHMARKS=0 -DCRC32C_USE_GLOG=OFF -DENABLE_TESTING=OFF .. \
&& make -j $(nproc) \
&& make install \
&& if [ "${KEEP_DEPENDENCIES}" = "false" ]; then \
rm -rf crc32c_${CRC32C_VERSION} \
crc32c_${CRC32C_VERSION}.tar.gz; \
fi
fi \
&& ldconfig
RUN echo " \"crc32c\": { \"version\" : \"${CRC32C_VERSION}\", \"url\" : \"https://github.com/google/crc32c\" }," >> /versions.json
# [AWS SDK PATCHED] # AWS SHOULD FIX IT!
ARG AWS_SDK_CPP_PATCHED_COMMIT=95b4403042458bb1de9697052d6da43c09579ee8
RUN git clone --recursive https://github.com/alichnewsky/aws-sdk-cpp aws-sdk-cpp \
RUN git clone --recursive https://github.com/alichnewsky/aws-sdk-cpp aws-sdk-cpp \
&& cd aws-sdk-cpp \
&& git checkout ${AWS_SDK_CPP_PATCHED_COMMIT} \
&& cd .. \
......@@ -264,21 +278,101 @@ RUN git clone --recursive https://github.com/alichnewsky/aws-sdk-cpp aws-sdk-cp
&& cd ../.. \
&& if [ "${KEEP_DEPENDENCIES}" = "false" ]; then \
rm -rf aws-sdk-cpp; \
fi
RUN echo "}" >> /versions.json
RUN perl -pi -e 's/ +/ /g' /versions.json \
&& cat /versions.json
fi \
&& ldconfig
FROM aws-dev as gcs-cl-dev
# Google cloud storage client library - dependencies
## Abseil
ARG ABSEIL_VERSION=20211102.0
ARG ABSEIL_DIR=abseil-cpp-${ABSEIL_VERSION}
RUN mkdir -p ${ABSEIL_DIR} \
&& wget -q https://github.com/abseil/abseil-cpp/archive/${ABSEIL_VERSION}.tar.gz \
&& tar -xf ${ABSEIL_VERSION}.tar.gz -C ${ABSEIL_DIR} --strip-components=1 \
&& rm -rf ${ABSEIL_VERSION}.tar.gz
RUN cmake -DCMAKE_CXX_STANDARD=14 \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=${LIBRARIES_INSTALL_PATH} \
-DBUILD_TESTING=OFF \
-DBUILD_SHARED_LIBS=NO \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
-H${ABSEIL_DIR} \
-B${ABSEIL_DIR}/cmake-out \
&& cmake --build ${ABSEIL_DIR}/cmake-out \
--target install -- -j $(nproc) \
&& rm -rf ${ABSEIL_DIR} \
&& ldconfig
RUN echo " \"Abseil\": { \"version\" : \"${ABSEIL_VERSION}\", \"url\" : \"https://github.com/abseil/abseil-cpp/archive/${ABSEIL_VERSION}.tar.gz\" }," >> /versions.json
## nlohmann/json
ARG NLOHMANN_JSON_VERSION="3.10.5"
RUN git clone --depth 1 --branch v${NLOHMANN_JSON_VERSION} https://github.com/nlohmann/json
RUN cmake -DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=NO \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
-DBUILD_TESTING=OFF \
-DJSON_BuildTests=OFF \
-DCMAKE_INSTALL_PREFIX=${LIBRARIES_INSTALL_PATH} \
-Hjson -Bjson/cmake-out \
&& cmake --build json/cmake-out --target install -- -j $(nproc) \
&& rm -rf json \
&& ldconfig
RUN echo " \"nlohmann_json\": { \"version\" : \"${NLOHMANN_JSON_VERSION}\", \"url\" : \"https://github.com/nlohmann/json\" }," >> /versions.json
# Google cloud storage client library
ARG GCS_SDK_VERSION="1.33.0"
ARG GCS_SDK_DIR=google-cloud-cpp-${GCS_SDK_VERSION}
RUN mkdir -p ${GCS_SDK_DIR} \
&& wget -q https://github.com/googleapis/google-cloud-cpp/archive/v${GCS_SDK_VERSION}.tar.gz \
&& tar -xf v${GCS_SDK_VERSION}.tar.gz -C ${GCS_SDK_DIR} --strip=1 \
&& rm -rf v${GCS_SDK_VERSION}.tar.gz
RUN cmake -DGOOGLE_CLOUD_CPP_ENABLE=storage \
-DBUILD_TESTING=OFF \
-DGOOGLE_CLOUD_CPP_ENABLE_EXAMPLES=OFF \
-DBUILD_SHARED_LIBS=NO \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
-DCMAKE_INSTALL_PREFIX=${LIBRARIES_INSTALL_PATH} \
-H${GCS_SDK_DIR} \
-B${GCS_SDK_DIR}/cmake-out \
&& cmake --build ${GCS_SDK_DIR}/cmake-out \
--target install -- -j $(nproc) \
&& rm -rf ${GCS_SDK_DIR} \
&& ldconfig
RUN echo " \"gcs_sdk\": { \"version\" : \"${GCS_SDK_VERSION}\", \"url\" : \"https://github.com/googleapis/google-cloud-cpp/archive/v${GCS_SDK_VERSION}.tar.gz\" }," >> /versions.json
FROM gcs-cl-dev as abi-check-dev
# ABI checker
WORKDIR /
RUN git clone https://github.com/lvc/abi-compliance-checker \
&& cd abi-compliance-checker \
&& git checkout 8e819827e8d707c7addc4a08f5cf74045f2302bb
WORKDIR /tmp
# Clang sanitizers
WORKDIR /
RUN yum install -y devtoolset-7-libasan-devel.x86_64 devtoolset-7-libtsan-devel.x86_64 devtoolset-7-liblsan-devel.x86_64 devtoolset-7-libubsan-devel.x86_64
RUN ldconfig /usr/local/lib*
RUN echo "\"end\":\"end\" }" >> /versions.json
RUN perl -pi -e 's/ +/ /g' /versions.json \
&& cat /versions.json
# Shell basics
RUN echo $'export PS1="\\[\\e[32m\\]\\w\\[\\e[m\\]\\[\\e[36m\\]-\\[\\e[m\\]\\[\\e[36m\\]\\\\$\\[\\e[m\\] " \n\
alias ll="ls -AlF" \n\
alias h="history" \n\
' >> ~/.bashrc
WORKDIR /
# ============================================================================
# Copyright 2017-2021, 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.
# ============================================================================
# base image
FROM ubuntu:20.04 AS dev
# build as root
USER 0
# install required build tools via packet manager
RUN apt-get -y update && apt-get -y install wget git g++ make libtool pkgconf liblzma-dev
# temporary working directory
WORKDIR /tmp
# [CMAKE]
ARG CMAKE_VERSION=3.19.4
RUN wget https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-Linux-x86_64.tar.gz --no-check-certificate \
&& 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
RUN echo "{" > /versions.json
FROM dev as rest-dev
# library path
ARG LIBRARIES_INSTALL_PATH=/usr/local
# [ZLIB]
ARG LIB_ZLIB_VERSION=1.2.11
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}
RUN echo " \"zlib\": { \"version\" : \"${LIB_ZLIB_VERSION}\", \"url\" : \"https://www.zlib.net\" }," >> /versions.json
# [OPENSSL]
ARG LIB_OPENSSL_VERSION=1.1.1g
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}
RUN echo " \"openssl\": { \"version\" : \"${LIB_OPENSSL_VERSION}\", \"url\" : \"https://www.openssl.org/\" }," >> /versions.json
# [UUID]
ARG LIB_UUID_VERSION=1.0.3
RUN wget https://sourceforge.net/projects/libuuid/files/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}
RUN echo " \"libuuid\": { \"version\" : \"${LIB_UUID_VERSION}\", \"url\" : \"https://sourceforge.net/projects/libuuid/\" }," >> /versions.json
# [CURL]
ARG LIB_CURL_VERSION=7.81.0
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
RUN echo " \"curl\": { \"version\" : \"${LIB_CURL_VERSION}\", \"url\" : \"https://github.com/curl/curl\" }," >> /versions.json
FROM rest-dev as azure-storage-dev
# library path
ARG LIBRARIES_INSTALL_PATH=/usr/local
# [BOOST]
ARG LIB_BOOST_VERSION=1.73.0
RUN wget https://boostorg.jfrog.io/artifactory/main/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 . _)
RUN echo " \"boost\": { \"version\" : \"${LIB_BOOST_VERSION}\", \"url\" : \"https://boost.org\" }," >> /versions.json
# [LIBXML2]
ARG LIB_XML2_VERSION=2.9.10
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}
RUN echo " \"libxml2\": { \"version\" : \"${LIB_XML2_VERSION}\", \"url\" : \"https://github.com/GNOME/libxml2\" }," >> /versions.json
# [CPPREST]
ARG LIB_CPPREST_VERSION=2.10.16
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
RUN echo " \"cpprest\": { \"version\" : \"${LIB_CPPREST_VERSION}\", \"url\" : \"https://github.com/microsoft/cpprestsdk\" }," >> /versions.json
# [AZURE-STORAGE-CPP]
ARG LIB_AZURE_STORAGE_VERSION=7.5.0
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
RUN echo " \"azurestorage\": { \"version\" : \"${LIB_AZURE_STORAGE_VERSION}\", \"url\" : \"http://github.com/Azure/azure-storage-cpp\" }," >> /versions.json
# [AZURE-STORAGE-FOR-CPP]
ARG AZURE_STORAGE_FOR_CPP_VERSION=12.3.0
RUN wget https://github.com/Azure/azure-sdk-for-cpp/archive/refs/tags/azure-storage-blobs_${AZURE_STORAGE_FOR_CPP_VERSION}.tar.gz \
&& tar -zxvf azure-storage-blobs_${AZURE_STORAGE_FOR_CPP_VERSION}.tar.gz \
&& cd azure-sdk-for-cpp-azure-storage-blobs_${AZURE_STORAGE_FOR_CPP_VERSION} \
&& mkdir build \
&& cd build \
&& cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS:BOOL=YES -DBUILD_TRANSPORT_CURL:BOOL=ON .. \
&& make -j $(nproc) \
&& make install \
&& rm -rf azure-sdk-for-cpp-azure-storage-blobs_${AZURE_STORAGE_FOR_CPP_VERSION} \
&& rm -rf azure-storage-blobs_${AZURE_STORAGE_FOR_CPP_VERSION}.tar.gz
RUN echo " \"azure_sdk_for_cpp\": { \"version\" : \"${AZURE_STORAGE_FOR_CPP_VERSION}\", \"url\" : \"https://github.com/Azure/azure-sdk-for-cpp\" }," >> /versions.json
RUN echo "}" >> /versions.json