[CI] Upgrade github workflows to use latest Conda setup action (#10320)
Co-authored-by: Christian Clauss <cclauss@me.com> Co-authored-by: Jiaming Yuan <jm.yuan@outlook.com>
This commit is contained in:
parent
e20ed8ab9c
commit
7ae5c972f9
21
.github/workflows/jvm_tests.yml
vendored
21
.github/workflows/jvm_tests.yml
vendored
@ -16,23 +16,20 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [windows-latest, ubuntu-latest, macos-11]
|
os: [windows-latest, ubuntu-latest, macos-13]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||||
with:
|
with:
|
||||||
submodules: 'true'
|
submodules: 'true'
|
||||||
|
|
||||||
- uses: mamba-org/setup-micromamba@422500192359a097648154e8db4e39bdb6c6eed7 # v1.8.1
|
- uses: conda-incubator/setup-miniconda@a4260408e20b96e80095f42ff7f1a15b27dd94ca # v3.0.4
|
||||||
with:
|
with:
|
||||||
micromamba-version: '1.5.6-0'
|
miniforge-variant: Mambaforge
|
||||||
environment-name: jvm_tests
|
miniforge-version: latest
|
||||||
create-args: >-
|
activate-environment: jvm_tests
|
||||||
python=3.10
|
environment-file: tests/ci_build/conda_env/jvm_tests.yml
|
||||||
awscli
|
use-mamba: true
|
||||||
cache-downloads: true
|
|
||||||
cache-environment: true
|
|
||||||
init-shell: bash powershell
|
|
||||||
|
|
||||||
- name: Cache Maven packages
|
- name: Cache Maven packages
|
||||||
uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
|
uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
|
||||||
@ -61,7 +58,7 @@ jobs:
|
|||||||
id: extract_branch
|
id: extract_branch
|
||||||
if: |
|
if: |
|
||||||
(github.ref == 'refs/heads/master' || contains(github.ref, 'refs/heads/release_')) &&
|
(github.ref == 'refs/heads/master' || contains(github.ref, 'refs/heads/release_')) &&
|
||||||
(matrix.os == 'windows-latest' || matrix.os == 'macos-11')
|
(matrix.os == 'windows-latest' || matrix.os == 'macos-13')
|
||||||
|
|
||||||
- name: Publish artifact xgboost4j.dll to S3
|
- name: Publish artifact xgboost4j.dll to S3
|
||||||
run: |
|
run: |
|
||||||
@ -85,7 +82,7 @@ jobs:
|
|||||||
python -m awscli s3 cp libxgboost4j_${{ github.sha }}.dylib s3://xgboost-nightly-builds/${{ steps.extract_branch.outputs.branch }}/libxgboost4j/ --acl public-read --region us-west-2
|
python -m awscli s3 cp libxgboost4j_${{ github.sha }}.dylib s3://xgboost-nightly-builds/${{ steps.extract_branch.outputs.branch }}/libxgboost4j/ --acl public-read --region us-west-2
|
||||||
if: |
|
if: |
|
||||||
(github.ref == 'refs/heads/master' || contains(github.ref, 'refs/heads/release_')) &&
|
(github.ref == 'refs/heads/master' || contains(github.ref, 'refs/heads/release_')) &&
|
||||||
matrix.os == 'macos-11'
|
matrix.os == 'macos-13'
|
||||||
env:
|
env:
|
||||||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID_IAM_S3_UPLOADER }}
|
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID_IAM_S3_UPLOADER }}
|
||||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY_IAM_S3_UPLOADER }}
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY_IAM_S3_UPLOADER }}
|
||||||
|
|||||||
23
.github/workflows/main.yml
vendored
23
.github/workflows/main.yml
vendored
@ -21,7 +21,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [macos-11]
|
os: [macos-12]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||||
with:
|
with:
|
||||||
@ -33,7 +33,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
mkdir build
|
mkdir build
|
||||||
cd build
|
cd build
|
||||||
cmake .. -DGOOGLE_TEST=ON -DUSE_OPENMP=ON -DUSE_DMLC_GTEST=ON -GNinja -DBUILD_DEPRECATED_CLI=ON
|
cmake .. -DGOOGLE_TEST=ON -DUSE_OPENMP=ON -DUSE_DMLC_GTEST=ON -GNinja -DBUILD_DEPRECATED_CLI=ON -DUSE_SANITIZER=ON -DENABLED_SANITIZERS=address -DCMAKE_BUILD_TYPE=RelWithDebInfo
|
||||||
ninja -v
|
ninja -v
|
||||||
- name: Run gtest binary
|
- name: Run gtest binary
|
||||||
run: |
|
run: |
|
||||||
@ -79,13 +79,13 @@ jobs:
|
|||||||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||||
with:
|
with:
|
||||||
submodules: 'true'
|
submodules: 'true'
|
||||||
- uses: mamba-org/provision-with-micromamba@3c96c0c27676490c63c18bc81f5c51895ac3e0e6 # v16
|
- uses: conda-incubator/setup-miniconda@a4260408e20b96e80095f42ff7f1a15b27dd94ca # v3.0.4
|
||||||
with:
|
with:
|
||||||
cache-downloads: true
|
miniforge-variant: Mambaforge
|
||||||
cache-env: true
|
miniforge-version: latest
|
||||||
environment-name: linux_sycl_test
|
activate-environment: linux_sycl_test
|
||||||
environment-file: tests/ci_build/conda_env/linux_sycl_test.yml
|
environment-file: tests/ci_build/conda_env/linux_sycl_test.yml
|
||||||
|
use-mamba: true
|
||||||
- name: Display Conda env
|
- name: Display Conda env
|
||||||
run: |
|
run: |
|
||||||
conda info
|
conda info
|
||||||
@ -121,12 +121,13 @@ jobs:
|
|||||||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||||
with:
|
with:
|
||||||
submodules: 'true'
|
submodules: 'true'
|
||||||
- uses: mamba-org/provision-with-micromamba@3c96c0c27676490c63c18bc81f5c51895ac3e0e6 # v16
|
- uses: conda-incubator/setup-miniconda@a4260408e20b96e80095f42ff7f1a15b27dd94ca # v3.0.4
|
||||||
with:
|
with:
|
||||||
cache-downloads: true
|
miniforge-variant: Mambaforge
|
||||||
cache-env: true
|
miniforge-version: latest
|
||||||
environment-name: cpp_test
|
activate-environment: cpp_test
|
||||||
environment-file: tests/ci_build/conda_env/cpp_test.yml
|
environment-file: tests/ci_build/conda_env/cpp_test.yml
|
||||||
|
use-mamba: true
|
||||||
- name: Display Conda env
|
- name: Display Conda env
|
||||||
run: |
|
run: |
|
||||||
conda info
|
conda info
|
||||||
|
|||||||
51
.github/workflows/python_tests.yml
vendored
51
.github/workflows/python_tests.yml
vendored
@ -24,12 +24,13 @@ jobs:
|
|||||||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||||
with:
|
with:
|
||||||
submodules: 'true'
|
submodules: 'true'
|
||||||
- uses: mamba-org/provision-with-micromamba@3c96c0c27676490c63c18bc81f5c51895ac3e0e6 # v16
|
- uses: conda-incubator/setup-miniconda@a4260408e20b96e80095f42ff7f1a15b27dd94ca # v3.0.4
|
||||||
with:
|
with:
|
||||||
cache-downloads: true
|
miniforge-variant: Mambaforge
|
||||||
cache-env: true
|
miniforge-version: latest
|
||||||
environment-name: python_lint
|
activate-environment: python_lint
|
||||||
environment-file: tests/ci_build/conda_env/python_lint.yml
|
environment-file: tests/ci_build/conda_env/python_lint.yml
|
||||||
|
use-mamba: true
|
||||||
- name: Display Conda env
|
- name: Display Conda env
|
||||||
run: |
|
run: |
|
||||||
conda info
|
conda info
|
||||||
@ -55,12 +56,13 @@ jobs:
|
|||||||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||||
with:
|
with:
|
||||||
submodules: 'true'
|
submodules: 'true'
|
||||||
- uses: mamba-org/provision-with-micromamba@3c96c0c27676490c63c18bc81f5c51895ac3e0e6 # v16
|
- uses: conda-incubator/setup-miniconda@a4260408e20b96e80095f42ff7f1a15b27dd94ca # v3.0.4
|
||||||
with:
|
with:
|
||||||
cache-downloads: true
|
miniforge-variant: Mambaforge
|
||||||
cache-env: true
|
miniforge-version: latest
|
||||||
environment-name: sdist_test
|
activate-environment: sdist_test
|
||||||
environment-file: tests/ci_build/conda_env/sdist_test.yml
|
environment-file: tests/ci_build/conda_env/sdist_test.yml
|
||||||
|
use-mamba: true
|
||||||
- name: Display Conda env
|
- name: Display Conda env
|
||||||
run: |
|
run: |
|
||||||
conda info
|
conda info
|
||||||
@ -81,14 +83,14 @@ jobs:
|
|||||||
name: Test installing XGBoost Python source package on ${{ matrix.os }}
|
name: Test installing XGBoost Python source package on ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [macos-11, windows-latest]
|
os: [macos-13, windows-latest]
|
||||||
python-version: ["3.8"]
|
python-version: ["3.8"]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||||
with:
|
with:
|
||||||
submodules: 'true'
|
submodules: 'true'
|
||||||
- name: Install osx system dependencies
|
- name: Install osx system dependencies
|
||||||
if: matrix.os == 'macos-11'
|
if: matrix.os == 'macos-13'
|
||||||
run: |
|
run: |
|
||||||
brew install ninja libomp
|
brew install ninja libomp
|
||||||
- uses: conda-incubator/setup-miniconda@a4260408e20b96e80095f42ff7f1a15b27dd94ca # v3.0.4
|
- uses: conda-incubator/setup-miniconda@a4260408e20b96e80095f42ff7f1a15b27dd94ca # v3.0.4
|
||||||
@ -119,19 +121,20 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
config:
|
config:
|
||||||
- {os: macos-11}
|
- {os: macos-13}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||||
with:
|
with:
|
||||||
submodules: 'true'
|
submodules: 'true'
|
||||||
|
|
||||||
- uses: mamba-org/provision-with-micromamba@3c96c0c27676490c63c18bc81f5c51895ac3e0e6 # v16
|
- uses: conda-incubator/setup-miniconda@a4260408e20b96e80095f42ff7f1a15b27dd94ca # v3.0.4
|
||||||
with:
|
with:
|
||||||
cache-downloads: true
|
miniforge-variant: Mambaforge
|
||||||
cache-env: true
|
miniforge-version: latest
|
||||||
environment-name: macos_test
|
activate-environment: macos_cpu_test
|
||||||
environment-file: tests/ci_build/conda_env/macos_cpu_test.yml
|
environment-file: tests/ci_build/conda_env/macos_cpu_test.yml
|
||||||
|
use-mamba: true
|
||||||
|
|
||||||
- name: Display Conda env
|
- name: Display Conda env
|
||||||
run: |
|
run: |
|
||||||
@ -222,12 +225,13 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
submodules: 'true'
|
submodules: 'true'
|
||||||
|
|
||||||
- uses: mamba-org/provision-with-micromamba@3c96c0c27676490c63c18bc81f5c51895ac3e0e6 # v16
|
- uses: conda-incubator/setup-miniconda@a4260408e20b96e80095f42ff7f1a15b27dd94ca # v3.0.4
|
||||||
with:
|
with:
|
||||||
cache-downloads: true
|
miniforge-variant: Mambaforge
|
||||||
cache-env: true
|
miniforge-version: latest
|
||||||
environment-name: linux_cpu_test
|
activate-environment: linux_cpu_test
|
||||||
environment-file: tests/ci_build/conda_env/linux_cpu_test.yml
|
environment-file: tests/ci_build/conda_env/linux_cpu_test.yml
|
||||||
|
use-mamba: true
|
||||||
|
|
||||||
- name: Display Conda env
|
- name: Display Conda env
|
||||||
run: |
|
run: |
|
||||||
@ -274,12 +278,13 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
submodules: 'true'
|
submodules: 'true'
|
||||||
|
|
||||||
- uses: mamba-org/provision-with-micromamba@3c96c0c27676490c63c18bc81f5c51895ac3e0e6 # v16
|
- uses: conda-incubator/setup-miniconda@a4260408e20b96e80095f42ff7f1a15b27dd94ca # v3.0.4
|
||||||
with:
|
with:
|
||||||
cache-downloads: true
|
miniforge-variant: Mambaforge
|
||||||
cache-env: true
|
miniforge-version: latest
|
||||||
environment-name: linux_sycl_test
|
activate-environment: linux_sycl_test
|
||||||
environment-file: tests/ci_build/conda_env/linux_sycl_test.yml
|
environment-file: tests/ci_build/conda_env/linux_sycl_test.yml
|
||||||
|
use-mamba: true
|
||||||
|
|
||||||
- name: Display Conda env
|
- name: Display Conda env
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
2
.github/workflows/python_wheels.yml
vendored
2
.github/workflows/python_wheels.yml
vendored
@ -28,7 +28,7 @@ jobs:
|
|||||||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||||
with:
|
with:
|
||||||
submodules: 'true'
|
submodules: 'true'
|
||||||
- uses: conda-incubator/setup-miniconda@v3.0.4
|
- uses: conda-incubator/setup-miniconda@a4260408e20b96e80095f42ff7f1a15b27dd94ca # v3.0.4
|
||||||
with:
|
with:
|
||||||
miniforge-variant: Mambaforge
|
miniforge-variant: Mambaforge
|
||||||
miniforge-version: latest
|
miniforge-version: latest
|
||||||
|
|||||||
@ -19,6 +19,7 @@
|
|||||||
#include <algorithm> // for sort
|
#include <algorithm> // for sort
|
||||||
#include <chrono> // for seconds, ms
|
#include <chrono> // for seconds, ms
|
||||||
#include <cstdint> // for int32_t
|
#include <cstdint> // for int32_t
|
||||||
|
#include <memory> // for unique_ptr
|
||||||
#include <string> // for string
|
#include <string> // for string
|
||||||
#include <utility> // for move, forward
|
#include <utility> // for move, forward
|
||||||
|
|
||||||
@ -376,20 +377,51 @@ Result RabitTracker::Bootstrap(std::vector<WorkerProxy>* p_workers) {
|
|||||||
if (!rc.OK()) {
|
if (!rc.OK()) {
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
auto host = gethostbyname(out->c_str());
|
|
||||||
|
|
||||||
// get ip address from host
|
addrinfo hints;
|
||||||
std::string ip;
|
addrinfo* servinfo;
|
||||||
rc = INetNToP(host, &ip);
|
|
||||||
if (!rc.OK()) {
|
std::memset(&hints, 0, sizeof(hints));
|
||||||
return rc;
|
hints.ai_family = AF_UNSPEC;
|
||||||
|
hints.ai_socktype = SOCK_STREAM;
|
||||||
|
hints.ai_flags = AI_PASSIVE;
|
||||||
|
|
||||||
|
std::int32_t errc{0};
|
||||||
|
std::unique_ptr<addrinfo*, std::function<void(addrinfo**)>> guard{&servinfo, [](addrinfo** ptr) {
|
||||||
|
freeaddrinfo(*ptr);
|
||||||
|
}};
|
||||||
|
if ((errc = getaddrinfo(nullptr, "0", &hints, &servinfo)) != 0) {
|
||||||
|
return Fail("Failed to get address info:" + std::string{gai_strerror(errc)});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(ip.size() >= 4 && ip.substr(0, 4) == "127.")) {
|
// https://beej.us/guide/bgnet/html/#getaddrinfoprepare-to-launch
|
||||||
// return if this is a public IP address.
|
std::vector<SockAddress> addresses;
|
||||||
// not entirely accurate, we have other reserved IPs
|
for (addrinfo* p = servinfo; p != nullptr; p = p->ai_next) {
|
||||||
*out = ip;
|
// Get the pointer to the address itself, different fields in IPv4 and IPv6:
|
||||||
return Success();
|
if (p->ai_family == AF_INET) { // IPv4
|
||||||
|
struct sockaddr_in* ipv4 = reinterpret_cast<sockaddr_in*>(p->ai_addr);
|
||||||
|
addresses.emplace_back(SockAddrV4{*ipv4});
|
||||||
|
auto ip = addresses.back().V4().Addr();
|
||||||
|
// Priortize V4.
|
||||||
|
// Return if this is a public IP address. Not accurate, we have other reserved IPs
|
||||||
|
if (ip.size() > 4 && ip.substr(0, 4) != "127." && ip != SockAddrV4::InaddrAny().Addr()) {
|
||||||
|
*out = ip;
|
||||||
|
return Success();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
struct sockaddr_in6* ipv6 = reinterpret_cast<sockaddr_in6*>(p->ai_addr);
|
||||||
|
addresses.emplace_back(SockAddrV6{*ipv6});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// If not v4 address is found, we try v6
|
||||||
|
for (auto const& addr : addresses) {
|
||||||
|
if (addr.IsV6()) {
|
||||||
|
auto ip = addr.V6().Addr();
|
||||||
|
if (ip != SockAddrV6::InaddrAny().Addr() && ip != SockAddrV6::Loopback().Addr()) {
|
||||||
|
*out = ip;
|
||||||
|
return Success();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create an UDP socket to prob the public IP address, it's fine even if it's
|
// Create an UDP socket to prob the public IP address, it's fine even if it's
|
||||||
@ -413,7 +445,7 @@ Result RabitTracker::Bootstrap(std::vector<WorkerProxy>* p_workers) {
|
|||||||
if (getsockname(sock, reinterpret_cast<struct sockaddr*>(&addr), &len) == -1) {
|
if (getsockname(sock, reinterpret_cast<struct sockaddr*>(&addr), &len) == -1) {
|
||||||
return Fail("Failed to get sock name.");
|
return Fail("Failed to get sock name.");
|
||||||
}
|
}
|
||||||
ip = inet_ntoa(addr.sin_addr);
|
std::string ip = inet_ntoa(addr.sin_addr);
|
||||||
|
|
||||||
err = system::CloseSocket(sock);
|
err = system::CloseSocket(sock);
|
||||||
if (err != 0) {
|
if (err != 0) {
|
||||||
|
|||||||
6
tests/ci_build/conda_env/jvm_tests.yml
Normal file
6
tests/ci_build/conda_env/jvm_tests.yml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
name: jvm_tests
|
||||||
|
channels:
|
||||||
|
- conda-forge
|
||||||
|
dependencies:
|
||||||
|
- python=3.10
|
||||||
|
- awscli
|
||||||
Loading…
x
Reference in New Issue
Block a user