From 2bd5944c28d7f56ad7d827fa02a913ab6df16d83 Mon Sep 17 00:00:00 2001 From: James Longo Date: Mon, 21 Oct 2024 17:01:24 -0400 Subject: [PATCH 1/4] add reinforcement_learning manyliux-2_28 --- .github/workflows/build_deploy_latest.yml | 1 + .github/workflows/build_deploy_tagged.yml | 1 + .github/workflows/build_pr.yaml | 4 ++ .../manylinux-2_28/build-boost.sh | 22 ++++++++ .../rl-manylinux-2_28-build.Dockerfile | 56 +++++++++++++++++++ 5 files changed, 84 insertions(+) create mode 100644 reinforcement_learning/manylinux-2_28/build-boost.sh create mode 100644 reinforcement_learning/manylinux-2_28/rl-manylinux-2_28-build.Dockerfile diff --git a/.github/workflows/build_deploy_latest.yml b/.github/workflows/build_deploy_latest.yml index d28b80e..d6fb0af 100644 --- a/.github/workflows/build_deploy_latest.yml +++ b/.github/workflows/build_deploy_latest.yml @@ -18,6 +18,7 @@ jobs: - { image_name: manylinux2014_aarch64-build, dockerfile: manylinux2014_aarch64-build.Dockerfile, context: ./vowpal_wabbit/manylinux/ } - { image_name: manylinux2014_x86_64-build, dockerfile: manylinux2014_x86_64-build.Dockerfile, context: ./vowpal_wabbit/manylinux/ } - { image_name: rl-manylinux2010-build, dockerfile: rl-manylinux2010-build.Dockerfile, context: ./reinforcement_learning/manylinux-2010/ } + - { image_name: rl-manylinux-2_28-build, dockerfile: rl-manylinux-2_28-build.Dockerfile, context: ./reinforcement_learning/manylinux-2_28/ } - { image_name: rl-ubuntu-1804, dockerfile: reinforcement_learning/ubuntu1804-build.Dockerfile, context: ./} steps: - uses: actions/checkout@master diff --git a/.github/workflows/build_deploy_tagged.yml b/.github/workflows/build_deploy_tagged.yml index e861927..865e030 100644 --- a/.github/workflows/build_deploy_tagged.yml +++ b/.github/workflows/build_deploy_tagged.yml @@ -18,6 +18,7 @@ jobs: - { image_name: manylinux2014_aarch64-build, dockerfile: manylinux2014_aarch64-build.Dockerfile, context: ./vowpal_wabbit/manylinux/ } - { image_name: manylinux2014_x86_64-build, dockerfile: manylinux2014_x86_64-build.Dockerfile, context: ./vowpal_wabbit/manylinux/ } - { image_name: rl-manylinux2010-build, dockerfile: rl-manylinux2010-build.Dockerfile, context: ./reinforcement_learning/manylinux-2010/ } + - { image_name: rl-manylinux-2_28-build, dockerfile: rl-manylinux-2_28-build.Dockerfile, context: ./reinforcement_learning/manylinux-2_28/ } - { image_name: rl-ubuntu-1804, dockerfile: reinforcement_learning/ubuntu1804-build.Dockerfile, context: ./} steps: - uses: actions/checkout@master diff --git a/.github/workflows/build_pr.yaml b/.github/workflows/build_pr.yaml index 43abe7b..5158623 100644 --- a/.github/workflows/build_pr.yaml +++ b/.github/workflows/build_pr.yaml @@ -35,6 +35,10 @@ jobs: dockerfile: rl-manylinux2010-build.Dockerfile context: ./reinforcement_learning/manylinux-2010/ changes_path_filter: reinforcement_learning/manylinux-2010/** + - image_name: rl-manylinux-2_28-build + dockerfile: rl-manylinux-2_28-build.Dockerfile + context: ./reinforcement_learning/manylinux-2_28/ + changes_path_filter: reinforcement_learning/manylinux-2_28/** - image_name: rl-ubuntu-1804 dockerfile: reinforcement_learning/ubuntu1804-build.Dockerfile context: ./ diff --git a/reinforcement_learning/manylinux-2_28/build-boost.sh b/reinforcement_learning/manylinux-2_28/build-boost.sh new file mode 100644 index 0000000..30bd5fd --- /dev/null +++ b/reinforcement_learning/manylinux-2_28/build-boost.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +# The only difference here to the other one is the addition of uuid and random + +set -ex + +BOOST_MAJOR=1 +BOOST_MINOR=70 +BOOST_PATCH=0 + +wget --no-check-certificate -O /tmp/boost.tar.gz "https://sourceforge.net/projects/boost/files/boost/${BOOST_MAJOR}.${BOOST_MINOR}.${BOOST_PATCH}/boost_${BOOST_MAJOR}_${BOOST_MINOR}_${BOOST_PATCH}.tar.gz/download" +mkdir /tmp/boost_src/ +tar -xzf /tmp/boost.tar.gz -C /tmp/boost_src/ +# This helps find then nested folder irrespective of verison. +BOOST_ROOT="$( find /tmp/boost_src/* -maxdepth 0 -type d -name 'boost*' )" +cd $BOOST_ROOT + +./bootstrap.sh --with-libraries=program_options,system,thread,test,chrono,date_time,atomic,random,filesystem,regex +./b2 -j$(nproc) cxxflags="-fPIC" variant=release link=static install + +cd / +rm -rf /tmp/boost_src/ /tmp/boost.tar.gz diff --git a/reinforcement_learning/manylinux-2_28/rl-manylinux-2_28-build.Dockerfile b/reinforcement_learning/manylinux-2_28/rl-manylinux-2_28-build.Dockerfile new file mode 100644 index 0000000..a980baf --- /dev/null +++ b/reinforcement_learning/manylinux-2_28/rl-manylinux-2_28-build.Dockerfile @@ -0,0 +1,56 @@ +FROM quay.io/pypa/manylinux_2_28_x86_64:latest + +RUN yum install -y wget ninja-build && yum clean all + +RUN version=3.18 && build=2 \ + && wget -qO- "https://cmake.org/files/v$version/cmake-$version.$build-Linux-x86_64.tar.gz" \ + | tar --strip-components=1 -xz -C /usr/local + +# Build and install OpenSSL from source with static libraries +RUN wget https://www.openssl.org/source/openssl-1.1.1l.tar.gz \ + && tar -xzf openssl-1.1.1l.tar.gz \ + && cd openssl-1.1.1l \ + && ./config no-shared --prefix=/usr/local/openssl --openssldir=/usr/local/openssl \ + && make -j$(nproc) \ + && make install \ + && cd .. \ + && rm -rf openssl-1.1.1l \ + && rm openssl-1.1.1l.tar.gz + +RUN wget -O zlib.tar.gz 'https://zlib.net/fossils/zlib-1.2.8.tar.gz' \ + && tar xvzf zlib.tar.gz \ + && cd zlib-1.2.8 \ + && ./configure --static --archs=-fPIC \ + && make -j$(nproc) \ + && make install \ + && cd .. && rm -rf zlib* + +# Install FlatBuffers 1.12.0 +RUN version=1.12.0 && \ + wget https://github.com/google/flatbuffers/archive/v$version.tar.gz \ + && tar -xzf v$version.tar.gz \ + && cd flatbuffers-$version \ + && mkdir build \ + && cd build \ + && cmake -G "Unix Makefiles" -DFLATBUFFERS_BUILD_TESTS=Off -DFLATBUFFERS_INSTALL=On -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_BUILD_FLATHASH=Off .. \ + && make install -j$(nproc) \ + && cd ../../ \ + && rm -rf flatbuffers-$version \ + && rm v$version.tar.gz + +COPY build-boost.sh build-boost.sh +RUN chmod +x build-boost.sh && ./build-boost.sh + +# Checkout 2.10.18 version of cpprestsdk +RUN git clone https://github.com/Microsoft/cpprestsdk.git cpprestsdk \ + && cd cpprestsdk \ + && git checkout 122d09549201da5383321d870bed45ecb9e168c5 \ + && git submodule update --init --recursive \ + && cd Release \ + && mkdir build \ + && cd build \ + && cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DBoost_USE_STATIC_LIBS=On -DWERROR=OFF -DBUILD_TESTS=OFF -DBUILD_SAMPLES=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=On -DOPENSSL_ROOT_DIR=/usr/local/openssl -DOPENSSL_LIBRARIES=/usr/local/openssl/lib -DOPENSSL_INCLUDE_DIR=/usr/local/openssl/include \ + && make -j `nproc` \ + && make install \ + && cd ../../../ \ + && rm -rf cpprestsdk From 51fac4b8d60b20094710feaccb32b0bdc5daac89 Mon Sep 17 00:00:00 2001 From: James Longo Date: Mon, 21 Oct 2024 17:14:37 -0400 Subject: [PATCH 2/4] add reinforcement_learning manyliux-2_28 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index af4ce81..1076226 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Tags on DockerHub correspond to [tags](https://github.com/VowpalWabbit/docker-im | [CentOS 7.6.1810](./vowpal_wabbit/centos7_6_1810-build.Dockerfile) | [vowpalwabbit/centos7_6_1810-build](https://hub.docker.com/r/vowpalwabbit/centos7_6_1810-build) | CI | | [RL Ubuntu 18.04](./reinforcement_learning/ubuntu1804-build.Dockerfile) | [vowpalwabbit/rl-ubuntu-1804](https://hub.docker.com/r/vowpalwabbit/rl-ubuntu-1804) | CI | | [RL Python ManyLinux 2010](./reinforcement_learning/manylinux-2010/rlclientlib-manylinux2010-build.Dockerfile) | [vowpalwabbit/rlclientlib-manylinux2010-build](https://hub.docker.com/r/vowpalwabbit/rlclientlib-manylinux2010-build) | CI/Python packaging | - +| [RL Python ManyLinux 2_28](./reinforcement_learning/manylinux-2_28/rlclientlib-manylinux-2_28-build.Dockerfile) | [vowpalwabbit/rlclientlib-manylinux-2_28-build](https://hub.docker.com/r/vowpalwabbit/rlclientlib-manylinux-2_28-build) | CI/Python packaging | ## Release steps From ed1030ad4a46bf8ec6d59adc60a09960b56eeedf Mon Sep 17 00:00:00 2001 From: James Longo Date: Tue, 22 Oct 2024 11:35:09 -0400 Subject: [PATCH 3/4] added manual build starting with reinforcement_learning manyliux-2_28 --- .github/workflows/build_deploy_manual.yml | 28 +++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/build_deploy_manual.yml diff --git a/.github/workflows/build_deploy_manual.yml b/.github/workflows/build_deploy_manual.yml new file mode 100644 index 0000000..2bb8db6 --- /dev/null +++ b/.github/workflows/build_deploy_manual.yml @@ -0,0 +1,28 @@ +name: Manual build and deploy to DockerHub + +on: + workflow_dispatch: + +jobs: + build: + name: rl-manylinux-2_28-build + runs-on: ubuntu-latest + strategy: + matrix: + config: + - { image_name: rl-manylinux-2_28-build, dockerfile: rl-manylinux-2_28-build.Dockerfile, context: ./reinforcement_learning/manylinux-2_28/ } + steps: + - uses: actions/checkout@master + - name: Set up QEMU + if: ${{ matrix.config.image_name == 'manylinux2014_aarch64-build' }} + uses: docker/setup-qemu-action@v1 + - name: Login, build and push image + if: success() + uses: whoan/docker-build-with-cache-action@v4 + with: + username: "${{ secrets.DOCKER_USERNAME }}" + password: "${{ secrets.DOCKER_PASSWORD }}" + image_name: "vowpalwabbit/${{matrix.config.image_name}}" + dockerfile: "${{matrix.config.dockerfile}}" + context: "${{ matrix.config.context }}" + push_image_and_stages: true From 418d90c3d46bd975721f3477473eb861a8467a3e Mon Sep 17 00:00:00 2001 From: James Longo Date: Tue, 5 Nov 2024 12:19:10 -0500 Subject: [PATCH 4/4] added a manual learning-loop image build/push action --- .../workflows/build_deploy_learning_loop.yml | 25 +++++++++ README.md | 3 +- learning-loop/ubuntu-build.dockerfile | 55 +++++++++++++++++++ 3 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/build_deploy_learning_loop.yml create mode 100644 learning-loop/ubuntu-build.dockerfile diff --git a/.github/workflows/build_deploy_learning_loop.yml b/.github/workflows/build_deploy_learning_loop.yml new file mode 100644 index 0000000..356b491 --- /dev/null +++ b/.github/workflows/build_deploy_learning_loop.yml @@ -0,0 +1,25 @@ +name: Manual build and deploy Learning Loop to DockerHub + +on: + workflow_dispatch: + +jobs: + build: + name: learning-loop-ubuntu + runs-on: ubuntu-latest + strategy: + matrix: + config: + - { image_name: learning-loop, dockerfile: ubuntu-build.dockerfile, context: ./learning-loop/ } + steps: + - uses: actions/checkout@v3 + - name: Login, build and push image + if: success() + uses: whoan/docker-build-with-cache-action@v4 + with: + username: "${{ secrets.DOCKER_USERNAME }}" + password: "${{ secrets.DOCKER_PASSWORD }}" + image_name: "vowpalwabbit/${{matrix.config.image_name}}" + dockerfile: "${{matrix.config.dockerfile}}" + context: "${{ matrix.config.context }}" + push_image_and_stages: true diff --git a/README.md b/README.md index 1076226..4309a04 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,8 @@ Tags on DockerHub correspond to [tags](https://github.com/VowpalWabbit/docker-im | [CentOS 7.6.1810](./vowpal_wabbit/centos7_6_1810-build.Dockerfile) | [vowpalwabbit/centos7_6_1810-build](https://hub.docker.com/r/vowpalwabbit/centos7_6_1810-build) | CI | | [RL Ubuntu 18.04](./reinforcement_learning/ubuntu1804-build.Dockerfile) | [vowpalwabbit/rl-ubuntu-1804](https://hub.docker.com/r/vowpalwabbit/rl-ubuntu-1804) | CI | | [RL Python ManyLinux 2010](./reinforcement_learning/manylinux-2010/rlclientlib-manylinux2010-build.Dockerfile) | [vowpalwabbit/rlclientlib-manylinux2010-build](https://hub.docker.com/r/vowpalwabbit/rlclientlib-manylinux2010-build) | CI/Python packaging | -| [RL Python ManyLinux 2_28](./reinforcement_learning/manylinux-2_28/rlclientlib-manylinux-2_28-build.Dockerfile) | [vowpalwabbit/rlclientlib-manylinux-2_28-build](https://hub.docker.com/r/vowpalwabbit/rlclientlib-manylinux-2_28-build) | CI/Python packaging | +| [RL Python ManyLinux 2_28](./reinforcement_learning/manylinux-2_28/rl-manylinux-2_28-build.Dockerfile) | [vowpalwabbit/rl-manylinux-2_28-build](https://hub.docker.com/r/vowpalwabbit/rl-manylinux-2_28-build) | CI/Python packaging | +| [Learning Loop Latest](./learning-loop/ubuntu-build.dockerfile) | [vowpalwabbit/learning-loop](https://hub.docker.com/r/vowpalwabbit/learning-loop) | CI | ## Release steps diff --git a/learning-loop/ubuntu-build.dockerfile b/learning-loop/ubuntu-build.dockerfile new file mode 100644 index 0000000..c2721b5 --- /dev/null +++ b/learning-loop/ubuntu-build.dockerfile @@ -0,0 +1,55 @@ +# build stage +FROM ubuntu:jammy AS build + +# set environment variables to avoid interaction during package installation +ENV DEBIAN_FRONTEND=noninteractive + +# update the package list and install build dependencies +RUN apt-get update && apt-get install -y \ + curl \ + wget \ + git \ + build-essential \ + cmake \ + pkg-config \ + ninja-build \ + zip \ + unzip \ + tar \ + dotnet-sdk-8.0 \ + && rm -rf /var/lib/apt/lists/* + +# clone the specified repository and build the project +RUN git clone https://github.com/microsoft/learning-loop.git /tmp/learning-loop +WORKDIR /tmp/learning-loop +RUN git submodule update --init --recursive +RUN mkdir artifacts +RUN dotnet build ./OnlineTrainerExe/OnlineTrainerExe.csproj -c Release +RUN dotnet publish ./OnlineTrainerExe/OnlineTrainerExe.csproj -c Release --no-build -o /publish + +# final runtime stage +FROM mcr.microsoft.com/dotnet/runtime:8.0 AS runtime + +# set environment variables to avoid interaction during package installation +ENV DEBIAN_FRONTEND=noninteractive + +# install only the necessary runtime dependencies +RUN apt-get update && apt-get install -y \ + curl \ + && rm -rf /var/lib/apt/lists/* + +# install Azure CLI +RUN curl -sL https://aka.ms/InstallAzureCLIDeb | bash && rm -rf /var/lib/apt/lists/* + +# copy the published output from the build stage +COPY --from=build /publish /app +COPY --from=build /tmp/learning-loop/artifacts/rl_sim /app/rl_sim + +WORKDIR /app + +RUN chmod 555 onlinetrainer.sh +RUN chmod 555 vw-bin/vw-* +RUN chmod 555 rl_sim.sh +RUN chmod 555 rl_sim/rl_sim-* + +ENTRYPOINT ["/bin/bash", "start-app.sh"] \ No newline at end of file