diff --git a/.github/workflows/build_docs.yml b/.github/workflows/build_docs.yml index 6da8307b1..62339920f 100644 --- a/.github/workflows/build_docs.yml +++ b/.github/workflows/build_docs.yml @@ -29,7 +29,7 @@ jobs: cd doc/cpp/ doxygen - name: Upload built docs - uses: actions/upload-artifact@v1 + uses: actions/upload-artifact@v4 with: name: cxx_docs path: doc/cpp/html/ @@ -54,7 +54,7 @@ jobs: cd bindings/python/docs make html SPHINXBUILD=/opt/python/cp38-cp38/bin/sphinx-build - name: Upload built docs - uses: actions/upload-artifact@v1 + uses: actions/upload-artifact@v4 with: name: python_docs path: bindings/python/docs/build/ @@ -71,11 +71,11 @@ jobs: if: github.event_name == 'release' run: echo "FOLDER_NAME=$(echo ${GITHUB_REF:10})" >> $GITHUB_ENV - name: Download c++ Docs - uses: actions/download-artifact@v1 + uses: actions/download-artifact@v4 with: name: cxx_docs - name: Download Python Docs - uses: actions/download-artifact@v1 + uses: actions/download-artifact@v4 with: name: python_docs - uses: actions/checkout@v1 diff --git a/.github/workflows/build_nuget.yml b/.github/workflows/build_nuget.yml index 4644be064..bf137f05b 100644 --- a/.github/workflows/build_nuget.yml +++ b/.github/workflows/build_nuget.yml @@ -97,7 +97,7 @@ jobs: echo "Found nuget package: ${NugetFileName[0]}" echo "NugetFileName=${NugetFileName[0]}" >> $GITHUB_OUTPUT - name: Upload package - uses: actions/upload-artifact@v1 + uses: actions/upload-artifact@v4 with: name: RLClientLibNativeStatic-${{ matrix.toolset }}-${{ matrix.build_type }}-x64.${{ steps.get_version.outputs.version }}.nupkg path: nuget_staging/${{ steps.nuget_name.outputs.NugetFileName }} @@ -132,7 +132,7 @@ jobs: echo "version=$version" >> $GITHUB_OUTPUT # Download and install nuget - - uses: actions/download-artifact@v1 + - uses: actions/download-artifact@v4 with: name: RLClientLibNativeStatic-${{ matrix.toolset }}-${{ matrix.build_type }}-x64.${{ steps.get_version.outputs.version }}.nupkg path: downloaded_nugets diff --git a/.github/workflows/build_python_wheels.yml b/.github/workflows/build_python_wheels.yml index 410fcaa0d..3be9ceb1d 100644 --- a/.github/workflows/build_python_wheels.yml +++ b/.github/workflows/build_python_wheels.yml @@ -12,7 +12,7 @@ on: jobs: build: container: - image: vowpalwabbit/rlclientlib-manylinux2010-build:latest + image: vowpalwabbit/rl-manylinux-2_28-build:latest runs-on: ubuntu-latest strategy: matrix: @@ -29,10 +29,13 @@ jobs: - name: Build wheel shell: bash run: | + export OPENSSL_ROOT_DIR=/usr/local/openssl + export OPENSSL_LIBRARIES=/usr/local/openssl/lib + export OPENSSL_INCLUDE_DIR=/usr/local/openssl/include ${{ matrix.config.base_path }}bin/pip wheel . -w wheel_output/ --verbose auditwheel repair wheel_output/*whl -w audit_output/ - name: Upload built wheel - uses: actions/upload-artifact@v1 + uses: actions/upload-artifact@v4 with: name: wheel_${{ matrix.config.version }} path: audit_output/ @@ -53,9 +56,10 @@ jobs: with: submodules: recursive - name: Download Wheel - uses: actions/download-artifact@v1 + uses: actions/download-artifact@v4 with: name: wheel_${{ matrix.config.version }} + path: ${{ github.workspace }}/wheel_${{ matrix.config.version }} - name: Test wheel shell: bash run: | diff --git a/.github/workflows/build_rlclientlib.yml b/.github/workflows/build_rlclientlib.yml index 20aeefeee..8087f72aa 100644 --- a/.github/workflows/build_rlclientlib.yml +++ b/.github/workflows/build_rlclientlib.yml @@ -133,9 +133,11 @@ jobs: - name: Install dotnet t4 run: dotnet tool install --global dotnet-t4 - name: Setup .NET Core SDK - uses: actions/setup-dotnet@v1 + uses: actions/setup-dotnet@v4 with: - dotnet-version: '3.1.x' + dotnet-version: | + 3.1.x + 8.0.x - run: echo "VCPKG_COMMIT=$(git rev-parse :ext_libs/vcpkg)" >> $GITHUB_ENV shell: bash - run: mkdir -p ${{ env.VCPKG_DEFAULT_BINARY_CACHE }} diff --git a/.github/workflows/dotnet_nugets.yml b/.github/workflows/dotnet_nugets.yml index 323f4257a..d304486b3 100644 --- a/.github/workflows/dotnet_nugets.yml +++ b/.github/workflows/dotnet_nugets.yml @@ -27,11 +27,11 @@ jobs: fail-fast: false matrix: config: - - { os: "windows-latest", runtime_id: "win-x64", vcpkg_target_triplet: "x64-windows-static" } - - { os: "ubuntu-latest", runtime_id: "linux-x64", vcpkg_target_triplet: "x64-linux" } - - { os: "macos-13", runtime_id: "osx-x64", vcpkg_target_triplet: "x64-osx" } + - { os: "windows-latest", os_name: "windows-latest", runtime_id: "win-x64", vcpkg_target_triplet: "x64-windows-static" } + - { os: "ubuntu-latest", os_name: "ubuntu-latest", runtime_id: "linux-x64", vcpkg_target_triplet: "x64-linux" } + - { os: "macos-13", os_name: "macos-latest", runtime_id: "osx-x64", vcpkg_target_triplet: "x64-osx" } runs-on: ${{matrix.config.os}} - name: build-nuget-dotnet (${{ startsWith(matrix.config.os, 'macos') && 'macos-latest' || matrix.config.os }}, ${{ matrix.config.runtime_id }}, ${{ matrix.config.vcpkg_target_triplet }}) + name: build-nuget-dotnet (${{ matrix.config.os_name }}, ${{ matrix.config.runtime_id }}, ${{ matrix.config.vcpkg_target_triplet }}) steps: - uses: actions/checkout@v2 - run: | @@ -53,7 +53,7 @@ jobs: uses: actions/cache@v3 with: path: ${{ env.VCPKG_DEFAULT_BINARY_CACHE }}/* - key: ${{ startsWith(matrix.config.os, 'macos') && 'macos-latest' || matrix.config.os }}-build-${{ matrix.config.vcpkg_target_triplet }}-${{ hashFiles('vcpkg.json') }}-${{ env.VCPKG_COMMIT }} + key: ${{ matrix.config.os_name }}-build-${{ matrix.config.vcpkg_target_triplet }}-${{ hashFiles('vcpkg.json') }}-${{ env.VCPKG_COMMIT }} - name: Configure .NET Core run: > @@ -81,15 +81,15 @@ jobs: run: cmake --build build --config RelWithDebInfo -t rl.net - if: ${{ startsWith(matrix.config.os, 'windows') }} - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: - name: artifacts + name: artifacts-${{ matrix.config.os_name }} path: build/binaries/*.dll - if: ${{ startsWith(matrix.config.os, 'windows') }} - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: - name: symbols + name: symbols-${{ matrix.config.os_name }} path: build/binaries/*.pdb - if: ${{ startsWith(matrix.config.os, 'ubuntu') }} @@ -99,15 +99,15 @@ jobs: strip --strip-debug --strip-unneeded build/bindings/cs/rl.net.native/librlnetnative.so - if: ${{ startsWith(matrix.config.os, 'ubuntu') }} - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: - name: artifacts + name: artifacts-${{ matrix.config.os_name }} path: build/bindings/cs/rl.net.native/librlnetnative.so - if: ${{ startsWith(matrix.config.os, 'ubuntu') }} - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: - name: symbols + name: symbols-${{ matrix.config.os_name }} path: symbols/librlnetnative.debug - if: ${{ startsWith(matrix.config.os, 'macos') }} @@ -117,15 +117,15 @@ jobs: strip -S build/bindings/cs/rl.net.native/librlnetnative.dylib - if: ${{ startsWith(matrix.config.os, 'macos') }} - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: - name: artifacts + name: artifacts-${{ matrix.config.os_name }} path: build/bindings/cs/rl.net.native/librlnetnative.dylib - if: ${{ startsWith(matrix.config.os, 'macos') }} - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: - name: symbols + name: symbols-${{ matrix.config.os_name }} path: symbols/librlnetnative.dSYM package-nuget: @@ -144,13 +144,15 @@ jobs: echo "Generated version number: $version" echo "RL_NUGET_VERSION=$GENERATED_VERSION" >> $GITHUB_ENV - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: - name: artifacts path: artifacts + merge-multiple: true + - name: Display structure of artifacts + run: ls -R artifacts - uses: NuGet/setup-nuget@v1.1.1 - run: nuget pack nuget/dotnet/rl.net.nuspec -Properties RL_NUGET_PACKAGE_VERSION=$RL_NUGET_VERSION -BasePath artifacts -OutputDirectory nuget_output - - uses: actions/upload-artifact@v1 + - uses: actions/upload-artifact@v4 with: name: dist path: nuget_output/ @@ -161,11 +163,11 @@ jobs: fail-fast: false matrix: config: - - { os: "windows-latest", runtime_id: "win-x64" } - - { os: "ubuntu-latest", runtime_id: "linux-x64" } - - { os: "macos-13", runtime_id: "osx-x64" } + - { os: "windows-latest", os_name: "windows-latest", runtime_id: "win-x64" } + - { os: "ubuntu-latest", os_name: "ubuntu-latest", runtime_id: "linux-x64" } + - { os: "macos-13", os_name: "macos-latest", runtime_id: "osx-x64" } runs-on: ${{matrix.config.os}} - name: test-nuget (${{ startsWith(matrix.config.os, 'macos') && 'macos-latest' || matrix.config.os }}, ${{ matrix.config.runtime_id }}) + name: test-nuget (${{ matrix.config.os_name }}, ${{ matrix.config.runtime_id }}) steps: - uses: actions/checkout@v2 - name: Update git tags @@ -178,7 +180,7 @@ jobs: GENERATED_VERSION=$(./.scripts/version_number.py) echo "Generated version number: $version" echo "RL_NUGET_VERSION=$GENERATED_VERSION" >> $GITHUB_ENV - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: dist path: dist diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 6516724a2..ff8b98bdd 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -13,7 +13,7 @@ jobs: typecheck-build: name: lint.python.typecheck-build container: - image: vowpalwabbit/rlclientlib-manylinux2010-build:latest + image: vowpalwabbit/rl-manylinux-2_28-build:latest runs-on: ubuntu-latest strategy: matrix: @@ -27,11 +27,14 @@ jobs: - name: Build wheel shell: bash run: | + export OPENSSL_ROOT_DIR=/usr/local/openssl + export OPENSSL_LIBRARIES=/usr/local/openssl/lib + export OPENSSL_INCLUDE_DIR=/usr/local/openssl/include ${{ matrix.config.base_path }}bin/pip wheel . -w wheel_output/ --verbose auditwheel repair wheel_output/*whl -w audit_output/ - name: Upload built wheel # v1 must be used because newer versions require a node.js version that will not run on this old image. - uses: actions/upload-artifact@v1 + uses: actions/upload-artifact@v4 with: name: wheel_${{ matrix.config.version }} path: audit_output/ @@ -50,9 +53,10 @@ jobs: with: submodules: recursive - name: Download Wheel - uses: actions/download-artifact@v1 + uses: actions/download-artifact@v4 with: name: wheel_${{ matrix.config.version }} + path: ${{ github.workspace }}/wheel_${{ matrix.config.version }} - name: Install dependencies shell: bash run: | diff --git a/CMakePresets.json b/CMakePresets.json index 9cf49d0e4..2b9df3031 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -146,6 +146,72 @@ "value": "On" } } + }, + { + "name": "vcpkg-azure", + "inherits": "default", + "cacheVariables": { + "CMAKE_BUILD_TYPE": { + "type": "STRING", + "value": "Release" + }, + "vw_USE_AZURE_FACTORIES": { + "type": "BOOL", + "value": "ON" + }, + "RL_LINK_AZURE_LIBS": { + "type": "BOOL", + "value": "ON" + } + } + }, + { + "name": "vcpkg-azure-static", + "inherits": "vcpkg-azure", + "cacheVariables": { + "RL_STATIC_DEPS": { + "type": "BOOL", + "value": "ON" + } + } + }, + { + "name": "vcpkg-azure-static-windows", + "inherits": "vcpkg-azure-static", + "cacheVariables": { + "CMAKE_MSVC_RUNTIME_LIBRARY": { + "type": "STRING", + "value": "MultiThreaded$<$:Debug>" + }, + "VCPKG_TARGET_TRIPLET": { + "type": "STRING", + "value": "x64-windows-static" + }, + "VCPKG_HOST_TRIPLET": { + "type": "STRING", + "value": "x64-windows-static" + } + } + }, + { + "name": "vcpkg-azure-static-linux", + "inherits": "vcpkg-azure-static", + "cacheVariables": { + "VCPKG_TARGET_TRIPLET": { + "type": "STRING", + "value": "x64-linux" + } + } + }, + { + "name": "vcpkg-azure-static-osx", + "inherits": "vcpkg-azure-static", + "cacheVariables": { + "VCPKG_TARGET_TRIPLET": { + "type": "STRING", + "value": "x64-osx" + } + } } ], "buildPresets": [ @@ -156,6 +222,22 @@ { "name": "vcpkg-release", "configurePreset": "vcpkg-release" + }, + { + "name": "vcpkg-azure", + "configurePreset": "vcpkg-azure" + }, + { + "name": "vcpkg-azure-static-windows", + "configurePreset": "vcpkg-azure-static-windows" + }, + { + "name": "vcpkg-azure-static-linux", + "configurePreset": "vcpkg-azure-static-linux" + }, + { + "name": "vcpkg-azure-static-osx", + "configurePreset": "vcpkg-azure-static-osx" } ], "testPresets": [ diff --git a/include/azure_credentials_provider.h b/include/azure_credentials_provider.h index f7f440f06..bd7e0431e 100644 --- a/include/azure_credentials_provider.h +++ b/include/azure_credentials_provider.h @@ -31,9 +31,14 @@ inline std::chrono::system_clock::duration get_gmt_offset() }; std::time_t now = std::time(nullptr); std::tm local_tm{}; - localtime_s(&local_tm, &now); std::tm gmt_tm{}; +# ifdef _WIN32 + localtime_s(&local_tm, &now); gmtime_s(&gmt_tm, &now); +# else + localtime_r(&now, &local_tm); + gmtime_r(&now, &gmt_tm); +# endif return get_time_point(local_tm) - get_time_point(gmt_tm); } } // namespace