Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a learning-loop image build/push #60

Merged
merged 5 commits into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
28 changes: 28 additions & 0 deletions .github/workflows/build_deploy_manual.yml
Original file line number Diff line number Diff line change
@@ -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
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"]
Loading