From 30afd1eb89f586a69f448495965311278927de55 Mon Sep 17 00:00:00 2001 From: George Arama <50641385+gearama@users.noreply.github.com> Date: Fri, 17 Feb 2023 11:40:54 -0800 Subject: [PATCH] reworked docker file (#4344) * reworked docker file * removed unnecessary su * update docker file * qwq * Update sdk/core/azure-core/test/libcurl-stress-test/Dockerfile Co-authored-by: Ben Broderick Phillips * url --------- Co-authored-by: Ben Broderick Phillips --- README.md | 2 +- .../test/libcurl-stress-test/Dockerfile | 32 +++++++++++++++---- .../libcurl-stress-test/scenarios-matrix.yaml | 2 +- 3 files changed, 28 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 38ffeed40..6f9280ce7 100644 --- a/README.md +++ b/README.md @@ -322,7 +322,7 @@ The following SDK library releases are available on [vcpkg](https://github.com/m * `azure-storage-files-shares-cpp` * `azure-storage-queues-cpp` -> NOTE: In case of getting linker errors when consuming the SDK on Windows, make sure that [vcpkg triplet](https://github.com/microsoft/vcpkg/blob/master/docs/users/triplets.md) being consumed matches the [CRT link flags](https://docs.microsoft.com/cpp/build/reference/md-mt-ld-use-run-time-library?view=msvc-160) being set for your app or library build. See also `MSVC_USE_STATIC_CRT` build flag. +> NOTE: In case of getting linker errors when consuming the SDK on Windows, make sure that [vcpkg triplet](https://github.com/microsoft/vcpkg-docs/blob/main/vcpkg/users/triplets.md) being consumed matches the [CRT link flags](https://docs.microsoft.com/cpp/build/reference/md-mt-ld-use-run-time-library?view=msvc-160) being set for your app or library build. See also `MSVC_USE_STATIC_CRT` build flag. ## OpenSSL Version diff --git a/sdk/core/azure-core/test/libcurl-stress-test/Dockerfile b/sdk/core/azure-core/test/libcurl-stress-test/Dockerfile index 43dc3889d..a7a674f38 100644 --- a/sdk/core/azure-core/test/libcurl-stress-test/Dockerfile +++ b/sdk/core/azure-core/test/libcurl-stress-test/Dockerfile @@ -1,13 +1,33 @@ # Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. All rights reserved. # SPDX-License-Identifier: MIT +FROM mcr.microsoft.com/mirror/docker/library/ubuntu:22.04 as build +# FROM mcr.microsoft.com/mirror/docker/library/ubuntu:22.04 + +# install the mem check tool along side the other deps +RUN apt-get update -y +RUN apt-get install -y gcc cmake make g++ git zip unzip build-essential pkg-config wget curl valgrind +RUN wget -O vcpkg.tar.gz https://github.com/microsoft/vcpkg/archive/master.tar.gz +RUN mkdir /opt/vcpkg +RUN tar xf vcpkg.tar.gz --strip-components=1 -C /opt/vcpkg +RUN /opt/vcpkg/bootstrap-vcpkg.sh +RUN ln -s /opt/vcpkg/vcpkg /usr/local/bin/vcpkg + +ADD . /src +WORKDIR /build +RUN cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DBUILD_TRANSPORT_CURL=ON /src +RUN cmake --build . --target azure-core-libcurl-stress-test + FROM mcr.microsoft.com/mirror/docker/library/ubuntu:22.04 -# copy the tagrget binary -COPY ./bin/libcurl-stress-test/azure-core-libcurl-stress-test ./azure-core-libcurl-stress-test +RUN apt-get update -y +RUN apt-get install -y valgrind +WORKDIR / + +# copy the target binary +COPY --from=build ./build/sdk/core/azure-core/test/libcurl-stress-test/azure-core-libcurl-stress-test ./azure-core-libcurl-stress-test RUN chmod +x ./azure-core-libcurl-stress-test -# install the mem check tool -RUN apt-get update -y -RUN apt-get install valgrind -y - +CMD ./azure-core-libcurl-stress-test +# this should be run by the scenarios matrix , run valgrind only when needed since it impacts performance and resources. \ No newline at end of file diff --git a/sdk/core/azure-core/test/libcurl-stress-test/scenarios-matrix.yaml b/sdk/core/azure-core/test/libcurl-stress-test/scenarios-matrix.yaml index 0b344332a..76ad99b22 100644 --- a/sdk/core/azure-core/test/libcurl-stress-test/scenarios-matrix.yaml +++ b/sdk/core/azure-core/test/libcurl-stress-test/scenarios-matrix.yaml @@ -8,7 +8,7 @@ matrix: images: cpp: image: Dockerfile - imageBuildDir: "./" + imageBuildDir: "../../../../../" scenarios: constantDetach: testTarget: azure-core-libcurl-stress-test