Skip to content

Commit

Permalink
Added a learning-loop image build/push (#60)
Browse files Browse the repository at this point in the history
* add reinforcement_learning manyliux-2_28

* add reinforcement_learning manyliux-2_28

* added manual build starting with reinforcement_learning manyliux-2_28

* added a manual learning-loop image build/push action
  • Loading branch information
v-jameslongo authored Nov 5, 2024
1 parent 28d39c0 commit 5fab302
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 1 deletion.
25 changes: 25 additions & 0 deletions .github/workflows/build_deploy_learning_loop.yml
Original file line number Diff line number Diff line change
@@ -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
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
55 changes: 55 additions & 0 deletions learning-loop/ubuntu-build.dockerfile
Original file line number Diff line number Diff line change
@@ -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"]

0 comments on commit 5fab302

Please sign in to comment.