Skip to content

Commit

Permalink
fix for azure build (#611)
Browse files Browse the repository at this point in the history
* fix for azure build

* updated actions/upload-artifact@v1/2/3 -> v4

* changed the nuget package artifact names to include the os name in the matrix build

* updated actions/download-artifact@v1/2/3 -> v4

* attempt to update the image to address upload-artifacts > v1

* attempt to update the image to address upload-artifacts > v1

* updated paths related to artifact@v4 changes

* troubleshoot dotnet_nugets

* troubleshoot dotnet_nugets

* troubleshoot dotnet_nugets

* troubleshoot dotnet_nugets

* troubleshoot build_rlclientlib

* troubleshoot build_rlclientlib

* troubleshoot build_rlclientlib

* troubleshoot lint job

* troubleshoot lint job

* troubleshoot lint job

* troubleshoot lint job

* troubleshoot lint job

* updated python builds to vowpalwabbit/rl-manylinux-2_28-build:latest

* troubleshoot python wheel builds

* troubleshoot python wheel builds
  • Loading branch information
v-jameslongo authored Oct 22, 2024
1 parent e1b77f6 commit 51abe08
Show file tree
Hide file tree
Showing 8 changed files with 139 additions and 40 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand All @@ -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/
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build_nuget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down Expand Up @@ -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
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/build_python_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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/
Expand All @@ -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: |
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/build_rlclientlib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
52 changes: 27 additions & 25 deletions .github/workflows/dotnet_nugets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand All @@ -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: >
Expand Down Expand Up @@ -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') }}
Expand All @@ -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') }}
Expand All @@ -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:
Expand All @@ -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/[email protected]
- 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/
Expand All @@ -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
Expand All @@ -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
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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/
Expand All @@ -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: |
Expand Down
82 changes: 82 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -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$<$<CONFIG:Debug>: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": [
Expand All @@ -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": [
Expand Down
7 changes: 6 additions & 1 deletion include/azure_credentials_provider.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 51abe08

Please sign in to comment.