Skip to content

Commit

Permalink
Add CI for House Price Prediction Example (flyteorg#279)
Browse files Browse the repository at this point in the history
* Add CI for House Price Prediction Example

Signed-off-by: Haytham Abuelfutuh <[email protected]>

* Fix paths

Signed-off-by: Haytham Abuelfutuh <[email protected]>
  • Loading branch information
EngHabu authored Jun 8, 2021
1 parent 6951858 commit 4a0ceb0
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 3 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/ghcr_house_price_prediction.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Build and Push House Price Prediction example Docker Images

on:
pull_request:
create:
tags:
- v*

jobs:
push-github:
name: Push House Price Prediction example to GHCR
runs-on: ubuntu-latest
defaults:
run:
working-directory: cookbook
steps:
- uses: actions/checkout@v2
with:
fetch-depth: "0"
- name: Push Docker Image to Github Registry
uses: whoan/docker-build-with-cache-action@v5
with:
# https://docs.github.com/en/packages/learn-github-packages/publishing-a-package
username: "${{ secrets.FLYTE_BOT_USERNAME }}"
password: "${{ secrets.FLYTE_BOT_PAT }}"
image_name: ${{ github.repository_owner }}/flytecookbook
image_tag: house_price_prediction-latest,house_price_prediction-${{ github.sha }},house_price_prediction-${{ github.event.ref }}
push_git_tag: ${{ github.event_name != 'pull_request' }}
push_image_and_stages: ${{ github.event_name != 'pull_request' }}
registry: ghcr.io
build_extra_args: "--compress=true --build-arg=tag=ghcr.io/${{ github.repository_owner }}/flytecookbook:house_price_prediction-${{ github.sha }}"
context: ./cookbook/case_studies/ml_training/
dockerfile: house_price_prediction/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ RUN python3.8 -m venv ${VENV}
RUN ${VENV}/bin/pip install wheel

# Install Python dependencies
COPY ml_training/house_price_prediction/requirements.txt /root
COPY house_price_prediction/requirements.txt /root
RUN ${VENV}/bin/pip install -r /root/requirements.txt

# Copy the makefile targets to expose on the container. This makes it easier to register.
COPY in_container.mk /root/Makefile
COPY ml_training/house_price_prediction/sandbox.config /root
COPY house_price_prediction/sandbox.config /root

# Copy the actual code
COPY ml_training/house_price_prediction/ /root/house_price_prediction/
COPY house_price_prediction/ /root/house_price_prediction/

# Copy over the helper script that the SDK relies on
RUN cp ${VENV}/bin/flytekit_venv /usr/local/bin/
Expand Down

0 comments on commit 4a0ceb0

Please sign in to comment.