From 9501130419568aa35a7a804779501f521b182e5a Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Tue, 3 Oct 2023 16:30:44 +0100 Subject: [PATCH 1/2] Trying dvc pull in github actions and copying into docker --- .github/workflows/Deploy.yml | 9 +++++++++ deployment/Dockerfile.prediction.lambda | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/Deploy.yml b/.github/workflows/Deploy.yml index 330855c..5f42eae 100644 --- a/.github/workflows/Deploy.yml +++ b/.github/workflows/Deploy.yml @@ -22,6 +22,10 @@ jobs: npm install -g serverless npm install -g serverless-domain-manager + - name: Install DVC + run: | + pip install dvc + # Set up all of the secrets required for the deployment - name: set secret prefix which is used across multiple steps id: secret_prefix @@ -79,6 +83,11 @@ jobs: aws-secret-access-key: ${{ secrets.PROD_AWS_SECRET_ACCESS_KEY }} aws-region: eu-west-2 + - name: DVC Pull + run: | + cd modules/ml-pipeline/src/pipeline + dvc pull -r ${{ steps.set_runtime_environment.outputs.runtime_environment }} + - name: Setup Docker uses: docker/setup-buildx-action@v1 diff --git a/deployment/Dockerfile.prediction.lambda b/deployment/Dockerfile.prediction.lambda index b4f2323..35fc756 100644 --- a/deployment/Dockerfile.prediction.lambda +++ b/deployment/Dockerfile.prediction.lambda @@ -14,12 +14,12 @@ RUN yum install -y gcc python3-devel # Install python packages COPY modules/ml-pipeline/src/pipeline/requirements/predictions/requirements.txt ./requirements.txt RUN pip install --no-cache-dir -r ./requirements.txt +RUN pip install --no-cache-dir -r ./requirements-vc.txt # Copy the project code COPY modules/ml-pipeline/src/pipeline ./pipeline # Copy the handler COPY deployment/handlers/prediction_app.py prediction_app.py -# Get the model -# RUN dvc pull -r ${RUNTIME_ENVIRONMENT} + CMD [ "prediction_app.handler" ] From 5960ebbf22729c8d96550ff9fedfccc790e6c3b2 Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Tue, 3 Oct 2023 16:31:40 +0100 Subject: [PATCH 2/2] remove install of version control requirements --- deployment/Dockerfile.prediction.lambda | 1 - 1 file changed, 1 deletion(-) diff --git a/deployment/Dockerfile.prediction.lambda b/deployment/Dockerfile.prediction.lambda index 35fc756..58c3a88 100644 --- a/deployment/Dockerfile.prediction.lambda +++ b/deployment/Dockerfile.prediction.lambda @@ -14,7 +14,6 @@ RUN yum install -y gcc python3-devel # Install python packages COPY modules/ml-pipeline/src/pipeline/requirements/predictions/requirements.txt ./requirements.txt RUN pip install --no-cache-dir -r ./requirements.txt -RUN pip install --no-cache-dir -r ./requirements-vc.txt # Copy the project code COPY modules/ml-pipeline/src/pipeline ./pipeline