-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a learning-loop image build/push (#60)
* 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
1 parent
28d39c0
commit 5fab302
Showing
3 changed files
with
82 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |