From a083934ffbadd787d3e1d151bfc53ff5cf606f01 Mon Sep 17 00:00:00 2001 From: Michael Duong Date: Sun, 2 Nov 2025 11:53:44 +0000 Subject: [PATCH] changed docker images python version and add github action --- .github/workflows/MLPipelinePullRequest.yml | 31 +++++++++++++++++++ deployment/Dockerfile.prediction.lambda | 2 +- modules/ml-pipeline/src/Prediction.Dockerfile | 2 +- 3 files changed, 33 insertions(+), 2 deletions(-) diff --git a/.github/workflows/MLPipelinePullRequest.yml b/.github/workflows/MLPipelinePullRequest.yml index 451b0a8..8cbab20 100644 --- a/.github/workflows/MLPipelinePullRequest.yml +++ b/.github/workflows/MLPipelinePullRequest.yml @@ -32,6 +32,37 @@ jobs: # echo "Please choose one of these tags: 'major', 'major', 'patch'" # exit(1) + Verify-Lambda: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Install packages to retrieve artifacts + env: + AWS_ACCESS_KEY_ID: ${{ secrets.ROBOT_AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.ROBOT_AWS_SECRET_ACCESS_KEY }} + run: | + pip install --upgrade pip + pip install -r modules/ml-pipeline/src/pipeline/requirements/version_control/requirements.txt + + - name: Retrieve artifacts (dvc.lock) + env: + AWS_ACCESS_KEY_ID: ${{ secrets.ROBOT_AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.ROBOT_AWS_SECRET_ACCESS_KEY }} + run: | + cd modules/ml-pipeline/src/pipeline + dvc pull -r experiments + + - name: Build Lambda docker Image + run: | + cd deployment/ + docker build . --file Dockerfile.prediction.lambda --tag lambda_test + + - name: Run lambda docker container + run: | + docker run lambda_test + Verify-Model: runs-on: ubuntu-latest diff --git a/deployment/Dockerfile.prediction.lambda b/deployment/Dockerfile.prediction.lambda index 9ee4306..22acf57 100644 --- a/deployment/Dockerfile.prediction.lambda +++ b/deployment/Dockerfile.prediction.lambda @@ -1,4 +1,4 @@ -FROM public.ecr.aws/lambda/python:3.10 +FROM public.ecr.aws/lambda/python:3.12 # Set the working directory WORKDIR ${LAMBDA_TASK_ROOT} diff --git a/modules/ml-pipeline/src/Prediction.Dockerfile b/modules/ml-pipeline/src/Prediction.Dockerfile index deb8c45..c026ac2 100644 --- a/modules/ml-pipeline/src/Prediction.Dockerfile +++ b/modules/ml-pipeline/src/Prediction.Dockerfile @@ -1,5 +1,5 @@ # Dockerfile that can be used to test loading a model to generate a prediction (part of CI/CD flow) -FROM python:3.10.12-slim +FROM python:3.12.12-slim RUN apt-get update && apt-get install -y libgomp1 gcc python3-dev