diff --git a/.github/workflows/ghcr_house_price_prediction.yml b/.github/workflows/ghcr_house_price_prediction.yml new file mode 100644 index 0000000000..b809003b6f --- /dev/null +++ b/.github/workflows/ghcr_house_price_prediction.yml @@ -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 diff --git a/cookbook/case_studies/ml_training/house_price_prediction/Dockerfile b/cookbook/case_studies/ml_training/house_price_prediction/Dockerfile index 3f067ce768..aa6ab94148 100644 --- a/cookbook/case_studies/ml_training/house_price_prediction/Dockerfile +++ b/cookbook/case_studies/ml_training/house_price_prediction/Dockerfile @@ -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/