From 61be9ff7f25c652dc61caa2fcbb43e3dca978288 Mon Sep 17 00:00:00 2001 From: EC2 Default User Date: Sat, 18 Nov 2023 16:02:36 +0000 Subject: [PATCH 01/16] submmit --- .../.circleci/config.yaml | 48 +++++++++++++++++++ project-ml-microservice-kubernetes/Dockerfile | 7 ++- .../output_txt_files/docker_out.txt | 11 ++++- .../output_txt_files/kubernetes_out.txt | 30 +++++++++++- .../run_docker.sh | 10 +++- .../run_kubernetes.sh | 10 +++- .../upload_docker.sh | 32 +++++++++---- 7 files changed, 132 insertions(+), 16 deletions(-) create mode 100644 project-ml-microservice-kubernetes/.circleci/config.yaml diff --git a/project-ml-microservice-kubernetes/.circleci/config.yaml b/project-ml-microservice-kubernetes/.circleci/config.yaml new file mode 100644 index 000000000..4d9f9448c --- /dev/null +++ b/project-ml-microservice-kubernetes/.circleci/config.yaml @@ -0,0 +1,48 @@ +version: 2.1 + +jobs: + build: + docker: + - image: circleci/python:3.7.3-stretch + + working_directory: ~/repo + + steps: + - checkout + + # Set up Docker environment + - setup_remote_docker + + # Download and cache dependencies + - restore_cache: + keys: + - v1-dependencies-{{ checksum "requirements.txt" }} + # fallback to using the latest cache if no exact match is found + - v1-dependencies- + + - run: + name: install dependencies + command: | + cd $(eval echo "$CIRCLE_WORKING_DIRECTORY/DevOps_Microservices/project-ml-microservice-kubernetes") + python3 -m venv venv + . venv/bin/activate + pip install -r requirements.txt + - save_cache: + paths: + - ./venv + key: v1-dependencies-{{ checksum "requirements.txt" }} + + # run tests! + - run: + name: run tests + command: | + cd $(eval echo "$CIRCLE_WORKING_DIRECTORY/DevOps_Microservices/project-ml-microservice-kubernetes") + . venv/bin/activate + make test + # run lints! + - run: + name: run lint + command: | + cd $(eval echo "$CIRCLE_WORKING_DIRECTORY/DevOps_Microservices/project-ml-microservice-kubernetes") + . venv/bin/activate + make lint diff --git a/project-ml-microservice-kubernetes/Dockerfile b/project-ml-microservice-kubernetes/Dockerfile index 8f70001b5..4a1935be9 100644 --- a/project-ml-microservice-kubernetes/Dockerfile +++ b/project-ml-microservice-kubernetes/Dockerfile @@ -2,17 +2,22 @@ FROM python:3.7.3-stretch ## Step 1: # Create a working directory +WORKDIR /app ## Step 2: # Copy source code to working directory +COPY requirements.txt ./ ## Step 3: # Install packages from requirements.txt # hadolint ignore=DL3013 +RUN pip install --no-cache-dir -r requirements.txt +COPY . . ## Step 4: # Expose port 80 +EXPOSE 80 ## Step 5: # Run app.py at container launch - +CMD [ "python", "app.py" ] diff --git a/project-ml-microservice-kubernetes/output_txt_files/docker_out.txt b/project-ml-microservice-kubernetes/output_txt_files/docker_out.txt index 79b164d89..a5d547f2a 100644 --- a/project-ml-microservice-kubernetes/output_txt_files/docker_out.txt +++ b/project-ml-microservice-kubernetes/output_txt_files/docker_out.txt @@ -1 +1,10 @@ - \ No newline at end of file + +[2023-11-18 08:50:23,684] INFO in app: JSON payload: +{'CHAS': {'0': 0}, 'RM': {'0': 6.575}, 'TAX': {'0': 296.0}, 'PTRATIO': {'0': 15.3}, 'B': {'0': 396.9}, 'LSTAT': {'0': 4.98}} +[2023-11-18 08:50:23,695] INFO in app: Inference payload DataFrame: + CHAS RM TAX PTRATIO B LSTAT +0 0 6.575 296.0 15.3 396.9 4.98 +[2023-11-18 08:50:23,703] INFO in app: Scaling Payload: + CHAS RM TAX PTRATIO B LSTAT +0 0 6.575 296.0 15.3 396.9 4.98 +172.17.0.1 - - [18/Nov/2023 08:50:23] "POST /predict HTTP/1.1" 200 - \ No newline at end of file diff --git a/project-ml-microservice-kubernetes/output_txt_files/kubernetes_out.txt b/project-ml-microservice-kubernetes/output_txt_files/kubernetes_out.txt index a79241a75..335d7d6d6 100644 --- a/project-ml-microservice-kubernetes/output_txt_files/kubernetes_out.txt +++ b/project-ml-microservice-kubernetes/output_txt_files/kubernetes_out.txt @@ -1 +1,29 @@ - \ No newline at end of file + +### K8s: +voclabs:~/environment/DevOps_Microservices/project-ml-microservice-kubernetes (master) $ kubectl get pods --all-namespaces +NAMESPACE NAME READY STATUS RESTARTS AGE +kube-system coredns-5dd5756b68-rt42b 1/1 Running 0 21m +kube-system etcd-minikube 1/1 Running 0 21m +kube-system kube-apiserver-minikube 1/1 Running 0 21m +kube-system kube-controller-manager-minikube 1/1 Running 0 21m +kube-system kube-proxy-qgfbj 1/1 Running 0 21m +kube-system kube-scheduler-minikube 1/1 Running 0 21m +kube-system storage-provisioner 1/1 Running 1 (20m ago) 21m +voclabs:~/environment/DevOps_Microservices/project-ml-microservice-kubernetes (master) $ ./run_kubernetes.sh +lx96/udacity-pj4:v1.0.0 +deployment.apps/udacity-pj4 created +NAME READY STATUS RESTARTS AGE +udacity-pj4-7759b46ccd-hv79b 0/1 ContainerCreating 0 0s +error: unable to forward port because pod is not running. Current status=Pending +voclabs:~/environment/DevOps_Microservices/project-ml-microservice-kubernetes (master) $ kubectl port-forward deployment.apps/udacity-pj4 --address 0.0.0.0 8000:80 +Forwarding from 0.0.0.0:8000 -> 80 +Handling connection for 8000 + +### Call API +voclabs:~/environment/DevOps_Microservices/project-ml-microservice-kubernetes (master) $ ./make_prediction.sh +Port: 8000 +{ + "prediction": [ + 20.35373177134412 + ] +} \ No newline at end of file diff --git a/project-ml-microservice-kubernetes/run_docker.sh b/project-ml-microservice-kubernetes/run_docker.sh index 65c3f832e..55f697569 100755 --- a/project-ml-microservice-kubernetes/run_docker.sh +++ b/project-ml-microservice-kubernetes/run_docker.sh @@ -3,10 +3,16 @@ ## Complete the following steps to get Docker running locally # Step 1: +image_name=udacity-pj4 +image_tag=v1.0.0 +container_name=udacity-pj4 + # Build image and add a descriptive tag +docker build -t $image_name:$image_tag . -# Step 2: # List docker images +docker image list -# Step 3: # Run flask app +docker run --name $container_name -p 8000:80 --rm $image_name:$image_tag + diff --git a/project-ml-microservice-kubernetes/run_kubernetes.sh b/project-ml-microservice-kubernetes/run_kubernetes.sh index b041b1082..5134d9460 100755 --- a/project-ml-microservice-kubernetes/run_kubernetes.sh +++ b/project-ml-microservice-kubernetes/run_kubernetes.sh @@ -1,18 +1,26 @@ #!/usr/bin/env bash # This tags and uploads an image to Docker Hub +image_name=udacity-pj4 +image_tag=v1.0.0 +deployment_name=udacity-pj4 # Step 1: # This is your Docker ID/path -# dockerpath=<> +docker_path=lx96 +echo $docker_path/$image_name:$image_tag # Step 2 # Run the Docker Hub container with kubernetes +kubectl create deploy $deployment_name --image=$docker_path/$image_name:$image_tag # Step 3: # List kubernetes pods +kubectl get pods # Step 4: # Forward the container port to a host +kubectl port-forward deployment.apps/$deployment_name --address 0.0.0.0 8000:80 + diff --git a/project-ml-microservice-kubernetes/upload_docker.sh b/project-ml-microservice-kubernetes/upload_docker.sh index 19baeafe4..8fbf7608b 100755 --- a/project-ml-microservice-kubernetes/upload_docker.sh +++ b/project-ml-microservice-kubernetes/upload_docker.sh @@ -1,15 +1,27 @@ -#!/usr/bin/env bash -# This file tags and uploads an image to Docker Hub +#!/bin/bash -# Assumes that an image is built via `run_docker.sh` +image_name=udacity-pj4 +image_tag=v1.0.0 -# Step 1: -# Create dockerpath -# dockerpath= +# Create docker_path +docker_path=lx96 -# Step 2: -# Authenticate & tag -echo "Docker ID and Image: $dockerpath" +# Add variable DOCKER_PASSWORD +source .env + +# Log in to Docker +echo docker login --username "$docker_path" --password-stdin $DOCKER_PASSWORD + +# Check if login was successful +if [ $? -eq 0 ]; then + echo "Docker authentication successful!" +else + echo "Docker authentication failed!" +fi + +echo "Docker ID and Image: $docker_path" + +docker image tag "$image_name:$image_tag" "$docker_path/$image_name:$image_tag" -# Step 3: # Push image to a docker repository +docker push "$docker_path/$image_name:$image_tag" \ No newline at end of file From 2f397a07bf96994491e765b9af741b0303bea1bb Mon Sep 17 00:00:00 2001 From: lx96 Date: Sat, 18 Nov 2023 16:04:17 +0000 Subject: [PATCH 02/16] submmit --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..112032326 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*.devops/ +*.env \ No newline at end of file From 19ef86f787e945dc2448a50f0e50c8b6029b70fc Mon Sep 17 00:00:00 2001 From: lx0612 <100019383+lx0612@users.noreply.github.com> Date: Sun, 19 Nov 2023 00:50:06 +0700 Subject: [PATCH 03/16] Add .circleci/config.yml --- .circleci/config.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 000000000..4175da6cf --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,26 @@ +# Use the latest 2.1 version of CircleCI pipeline process engine. +# See: https://circleci.com/docs/configuration-reference +version: 2.1 + +# Define a job to be invoked later in a workflow. +# See: https://circleci.com/docs/configuration-reference/#jobs +jobs: + say-hello: + # Specify the execution environment. You can specify an image from Docker Hub or use one of our convenience images from CircleCI's Developer Hub. + # See: https://circleci.com/docs/configuration-reference/#executor-job + docker: + - image: cimg/base:stable + # Add steps to the job + # See: https://circleci.com/docs/configuration-reference/#steps + steps: + - checkout + - run: + name: "Say hello" + command: "echo Hello, World!" + +# Orchestrate jobs using workflows +# See: https://circleci.com/docs/configuration-reference/#workflows +workflows: + say-hello-workflow: + jobs: + - say-hello From fa12ee7e933dd689f4aabeca3fa8a7157e30f466 Mon Sep 17 00:00:00 2001 From: lx96 Date: Sat, 18 Nov 2023 17:55:01 +0000 Subject: [PATCH 04/16] submmit --- project-ml-microservice-kubernetes/app.py | 7 ++++++- .../output_txt_files/docker_out.txt | 10 +++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/project-ml-microservice-kubernetes/app.py b/project-ml-microservice-kubernetes/app.py index 7d583b72e..730ef514c 100644 --- a/project-ml-microservice-kubernetes/app.py +++ b/project-ml-microservice-kubernetes/app.py @@ -1,4 +1,8 @@ -from flask import Flask, request, jsonify +from flask import ( + Flask, + request, + jsonify + ) from flask.logging import create_logger import logging @@ -63,6 +67,7 @@ def predict(): # get an output prediction from the pretrained model, clf prediction = list(clf.predict(scaled_payload)) # TO DO: Log the output prediction value + LOG.info(f'prediction value: {prediction}') return jsonify({'prediction': prediction}) if __name__ == "__main__": diff --git a/project-ml-microservice-kubernetes/output_txt_files/docker_out.txt b/project-ml-microservice-kubernetes/output_txt_files/docker_out.txt index a5d547f2a..4e12d1e8f 100644 --- a/project-ml-microservice-kubernetes/output_txt_files/docker_out.txt +++ b/project-ml-microservice-kubernetes/output_txt_files/docker_out.txt @@ -1,10 +1,10 @@ - -[2023-11-18 08:50:23,684] INFO in app: JSON payload: +[2023-11-18 17:43:35,145] INFO in app: JSON payload: {'CHAS': {'0': 0}, 'RM': {'0': 6.575}, 'TAX': {'0': 296.0}, 'PTRATIO': {'0': 15.3}, 'B': {'0': 396.9}, 'LSTAT': {'0': 4.98}} -[2023-11-18 08:50:23,695] INFO in app: Inference payload DataFrame: +[2023-11-18 17:43:35,157] INFO in app: Inference payload DataFrame: CHAS RM TAX PTRATIO B LSTAT 0 0 6.575 296.0 15.3 396.9 4.98 -[2023-11-18 08:50:23,703] INFO in app: Scaling Payload: +[2023-11-18 17:43:35,165] INFO in app: Scaling Payload: CHAS RM TAX PTRATIO B LSTAT 0 0 6.575 296.0 15.3 396.9 4.98 -172.17.0.1 - - [18/Nov/2023 08:50:23] "POST /predict HTTP/1.1" 200 - \ No newline at end of file +[2023-11-18 17:43:35,168] INFO in app: prediction value: [20.35373177134412] +172.17.0.1 - - [18/Nov/2023 17:43:35] "POST /predict HTTP/1.1" 200 - \ No newline at end of file From 6de2f6d250c6dbc789e3f104afdd873cfbbf2906 Mon Sep 17 00:00:00 2001 From: lx96 Date: Sat, 18 Nov 2023 17:57:56 +0000 Subject: [PATCH 05/16] submmit --- .circleci/config.yml | 60 ++++++++++++++++++++++++++++++-------------- 1 file changed, 41 insertions(+), 19 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4175da6cf..4d9f9448c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,26 +1,48 @@ -# Use the latest 2.1 version of CircleCI pipeline process engine. -# See: https://circleci.com/docs/configuration-reference version: 2.1 -# Define a job to be invoked later in a workflow. -# See: https://circleci.com/docs/configuration-reference/#jobs jobs: - say-hello: - # Specify the execution environment. You can specify an image from Docker Hub or use one of our convenience images from CircleCI's Developer Hub. - # See: https://circleci.com/docs/configuration-reference/#executor-job + build: docker: - - image: cimg/base:stable - # Add steps to the job - # See: https://circleci.com/docs/configuration-reference/#steps + - image: circleci/python:3.7.3-stretch + + working_directory: ~/repo + steps: - checkout - - run: - name: "Say hello" - command: "echo Hello, World!" -# Orchestrate jobs using workflows -# See: https://circleci.com/docs/configuration-reference/#workflows -workflows: - say-hello-workflow: - jobs: - - say-hello + # Set up Docker environment + - setup_remote_docker + + # Download and cache dependencies + - restore_cache: + keys: + - v1-dependencies-{{ checksum "requirements.txt" }} + # fallback to using the latest cache if no exact match is found + - v1-dependencies- + + - run: + name: install dependencies + command: | + cd $(eval echo "$CIRCLE_WORKING_DIRECTORY/DevOps_Microservices/project-ml-microservice-kubernetes") + python3 -m venv venv + . venv/bin/activate + pip install -r requirements.txt + - save_cache: + paths: + - ./venv + key: v1-dependencies-{{ checksum "requirements.txt" }} + + # run tests! + - run: + name: run tests + command: | + cd $(eval echo "$CIRCLE_WORKING_DIRECTORY/DevOps_Microservices/project-ml-microservice-kubernetes") + . venv/bin/activate + make test + # run lints! + - run: + name: run lint + command: | + cd $(eval echo "$CIRCLE_WORKING_DIRECTORY/DevOps_Microservices/project-ml-microservice-kubernetes") + . venv/bin/activate + make lint From 7e7dcc2b385ecadedcea68c282848d083e20fdac Mon Sep 17 00:00:00 2001 From: lx96 Date: Sat, 18 Nov 2023 18:02:21 +0000 Subject: [PATCH 06/16] submmit --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4d9f9448c..5d726155f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -23,6 +23,7 @@ jobs: - run: name: install dependencies command: | + ls cd $(eval echo "$CIRCLE_WORKING_DIRECTORY/DevOps_Microservices/project-ml-microservice-kubernetes") python3 -m venv venv . venv/bin/activate From feecb15b100cec360e2efbea34692ebe9a7a3024 Mon Sep 17 00:00:00 2001 From: lx96 Date: Sat, 18 Nov 2023 18:04:00 +0000 Subject: [PATCH 07/16] submmit --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5d726155f..6ee59874c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -24,7 +24,7 @@ jobs: name: install dependencies command: | ls - cd $(eval echo "$CIRCLE_WORKING_DIRECTORY/DevOps_Microservices/project-ml-microservice-kubernetes") + cd $(eval echo "$CIRCLE_WORKING_DIRECTORY/project-ml-microservice-kubernetes") python3 -m venv venv . venv/bin/activate pip install -r requirements.txt From 297d6121a23030770f633e53e069c73f8a1c4338 Mon Sep 17 00:00:00 2001 From: lx96 Date: Sat, 18 Nov 2023 18:04:37 +0000 Subject: [PATCH 08/16] submmit --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6ee59874c..4ba66bf1e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -37,13 +37,13 @@ jobs: - run: name: run tests command: | - cd $(eval echo "$CIRCLE_WORKING_DIRECTORY/DevOps_Microservices/project-ml-microservice-kubernetes") + cd $(eval echo "$CIRCLE_WORKING_DIRECTORY/project-ml-microservice-kubernetes") . venv/bin/activate make test # run lints! - run: name: run lint command: | - cd $(eval echo "$CIRCLE_WORKING_DIRECTORY/DevOps_Microservices/project-ml-microservice-kubernetes") + cd $(eval echo "$CIRCLE_WORKING_DIRECTORY/project-ml-microservice-kubernetes") . venv/bin/activate make lint From 9fd4e159bad41dd69e67bf466dc698a1f9288745 Mon Sep 17 00:00:00 2001 From: lx96 Date: Sat, 18 Nov 2023 18:08:09 +0000 Subject: [PATCH 09/16] submmit --- .circleci/config.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4ba66bf1e..1b221156d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -46,4 +46,6 @@ jobs: command: | cd $(eval echo "$CIRCLE_WORKING_DIRECTORY/project-ml-microservice-kubernetes") . venv/bin/activate + sudo wget -O /bin/hadolint https://github.com/hadolint/hadolint/releases/download/v1.16.3/hadolint-Linux-x86_64 + sudo chmod +x /bin/hadolint make lint From e60f64a7d7be479e0e804ba99e4b380a1a989f49 Mon Sep 17 00:00:00 2001 From: lx96 Date: Sat, 18 Nov 2023 18:35:04 +0000 Subject: [PATCH 10/16] submmit --- project-ml-microservice-kubernetes/README.md | 26 +++++++++++++++++--- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/project-ml-microservice-kubernetes/README.md b/project-ml-microservice-kubernetes/README.md index a5bd8fee6..4a6f7cd87 100644 --- a/project-ml-microservice-kubernetes/README.md +++ b/project-ml-microservice-kubernetes/README.md @@ -1,4 +1,5 @@ +[![lx0612](https://circleci.com/gh/lx0612/DevOps_Microservices.svg?style=svg)](https://app.circleci.com/pipelines/github/lx0612/DevOps_Microservices) ## Project Overview @@ -44,7 +45,24 @@ source .devops/bin/activate ### Kubernetes Steps -* Setup and Configure Docker locally -* Setup and Configure Kubernetes locally -* Create Flask app in Container -* Run via kubectl +1. **Setup and Configure Docker** + - Go to the Docker Desktop website at https://www.docker.com/products/docker-desktop/ and follow the instructions to install Docker Desktop. + - Verify : `docker --version`. + +2. **Setup and Configure Kubernetes** + - For Windows users, the recommended way is to use Docker Desktop. Open Docker Desktop, go to Settings, navigate to Kubernetes, and check "Enable Kubernetes." + - Verify the Kubernetes configuration by running: `kubectl version --output json`. + +3. **Create Flask App in a Container** + - Build the Docker image for the Flask app using the following command: `docker build --tag udacity-pj4:v1.0.0 .` + - Run the container with the created image: `docker run -d --rm -p 8000:80 udacity-pj4:v1.0.0` + +4. **Deploy Flask App via Kubernetes** + - Create an environment file `.env` and set variable `DOCKER_PASSWORD=`. + - run: `source .env`. + - Export your Docker Hub ID using: `export docker_path=`. + - Log in to Docker Hub to push the image: `echo "$DOCKER_PASSWORD" | docker login --username $docker_path --password-stdin`. + - Tag and push the Docker image to Docker Hub: `docker image tag udacity-pj4:v1.0.0 $docker_path/udacity-pj4:v1.0.0 && docker image push $docker_path/udacity-pj4:v1.0.0`. + - Create a Kubernetes deployment: `kubectl create deploy udacity-pj4 --image="$docker_path/udacity-pj4:v1.0.0"`. + - Check whether the pod is in the READY state: `kubectl get pods`. + - Wait pods ready, forward the port to access the Flask app locally: `kubectl port-forward deployment.apps/udacity-pj4 8000:80`. From 340bd40ede68bdd8d85d322b79826c3badad2104 Mon Sep 17 00:00:00 2001 From: lx96 Date: Sat, 18 Nov 2023 18:37:00 +0000 Subject: [PATCH 11/16] submmit --- project-ml-microservice-kubernetes/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project-ml-microservice-kubernetes/README.md b/project-ml-microservice-kubernetes/README.md index 4a6f7cd87..5ba3e285a 100644 --- a/project-ml-microservice-kubernetes/README.md +++ b/project-ml-microservice-kubernetes/README.md @@ -1,4 +1,4 @@ - + [![lx0612](https://circleci.com/gh/lx0612/DevOps_Microservices.svg?style=svg)](https://app.circleci.com/pipelines/github/lx0612/DevOps_Microservices) ## Project Overview From bc7b4732ecd24dd77418bfd0883fa00ff706456e Mon Sep 17 00:00:00 2001 From: lx96 Date: Sat, 18 Nov 2023 19:31:22 +0000 Subject: [PATCH 12/16] submmit --- project-ml-microservice-kubernetes/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/project-ml-microservice-kubernetes/Makefile b/project-ml-microservice-kubernetes/Makefile index 759f77a42..37ddfedc1 100644 --- a/project-ml-microservice-kubernetes/Makefile +++ b/project-ml-microservice-kubernetes/Makefile @@ -22,6 +22,8 @@ test: lint: # See local hadolint install instructions: https://github.com/hadolint/hadolint + sudo wget -O /bin/hadolint https://github.com/hadolint/hadolint/releases/download/v1.16.3/hadolint-Linux-x86_64 + sudo chmod +x /bin/hadolint # This is linter for Dockerfiles hadolint Dockerfile # This is a linter for Python source code linter: https://www.pylint.org/ From 21bc451a1bebe59c588f33d3ddeb0b1be6604df7 Mon Sep 17 00:00:00 2001 From: lx96 Date: Sat, 18 Nov 2023 19:51:40 +0000 Subject: [PATCH 13/16] submmit --- .circleci/config.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1b221156d..4ba66bf1e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -46,6 +46,4 @@ jobs: command: | cd $(eval echo "$CIRCLE_WORKING_DIRECTORY/project-ml-microservice-kubernetes") . venv/bin/activate - sudo wget -O /bin/hadolint https://github.com/hadolint/hadolint/releases/download/v1.16.3/hadolint-Linux-x86_64 - sudo chmod +x /bin/hadolint make lint From 6994e7084dedbda30a2390063b96a90d447c409e Mon Sep 17 00:00:00 2001 From: lx96 Date: Sat, 18 Nov 2023 20:05:20 +0000 Subject: [PATCH 14/16] submmit --- project-ml-microservice-kubernetes/Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/project-ml-microservice-kubernetes/Makefile b/project-ml-microservice-kubernetes/Makefile index 37ddfedc1..ed6eb33d9 100644 --- a/project-ml-microservice-kubernetes/Makefile +++ b/project-ml-microservice-kubernetes/Makefile @@ -9,6 +9,7 @@ setup: # Create python virtualenv & source it # source ~/.devops/bin/activate python3 -m venv ~/.devops + source ~/.devops/bin/activate install: # This should be run from inside a virtualenv @@ -22,8 +23,8 @@ test: lint: # See local hadolint install instructions: https://github.com/hadolint/hadolint - sudo wget -O /bin/hadolint https://github.com/hadolint/hadolint/releases/download/v1.16.3/hadolint-Linux-x86_64 - sudo chmod +x /bin/hadolint + sudo wget -O /hadolint https://github.com/hadolint/hadolint/releases/download/v1.16.3/hadolint-Linux-x86_64 \ + # sudo chmod +x /hadolint # This is linter for Dockerfiles hadolint Dockerfile # This is a linter for Python source code linter: https://www.pylint.org/ From 2182e49a0dced766ed4dfc65eb1788682459b3b8 Mon Sep 17 00:00:00 2001 From: lx96 Date: Sat, 18 Nov 2023 20:09:33 +0000 Subject: [PATCH 15/16] submmit --- project-ml-microservice-kubernetes/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project-ml-microservice-kubernetes/Makefile b/project-ml-microservice-kubernetes/Makefile index ed6eb33d9..9041460d3 100644 --- a/project-ml-microservice-kubernetes/Makefile +++ b/project-ml-microservice-kubernetes/Makefile @@ -24,7 +24,7 @@ test: lint: # See local hadolint install instructions: https://github.com/hadolint/hadolint sudo wget -O /hadolint https://github.com/hadolint/hadolint/releases/download/v1.16.3/hadolint-Linux-x86_64 \ - # sudo chmod +x /hadolint + sudo chmod +x /hadolint # This is linter for Dockerfiles hadolint Dockerfile # This is a linter for Python source code linter: https://www.pylint.org/ From d611a5955d4f193ff0b8d6946ea51c311c5805c2 Mon Sep 17 00:00:00 2001 From: lx96 Date: Sat, 18 Nov 2023 20:13:49 +0000 Subject: [PATCH 16/16] submmit --- project-ml-microservice-kubernetes/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/project-ml-microservice-kubernetes/Makefile b/project-ml-microservice-kubernetes/Makefile index 9041460d3..ad653bbcc 100644 --- a/project-ml-microservice-kubernetes/Makefile +++ b/project-ml-microservice-kubernetes/Makefile @@ -23,10 +23,10 @@ test: lint: # See local hadolint install instructions: https://github.com/hadolint/hadolint - sudo wget -O /hadolint https://github.com/hadolint/hadolint/releases/download/v1.16.3/hadolint-Linux-x86_64 \ - sudo chmod +x /hadolint + wget -O ./hadolint https://github.com/hadolint/hadolint/releases/download/v1.16.3/hadolint-Linux-x86_64 &&\ + chmod +x ./hadolint # This is linter for Dockerfiles - hadolint Dockerfile + ./hadolint Dockerfile # This is a linter for Python source code linter: https://www.pylint.org/ # This should be run from inside a virtualenv pylint --disable=R,C,W1203,W1202 app.py