From 941309da31fcd3a685dfa779021fdda7a8c77da4 Mon Sep 17 00:00:00 2001 From: Yuqing Pan Date: Sun, 10 Dec 2023 17:36:08 -0500 Subject: [PATCH 01/18] ci-cd initial commit --- .github/workflows/ci-cd.yml | 110 +++++++++++++++++++++++++++ src/api-service/api/model_backend.py | 9 ++- src/frontend/src/App.jsx | 6 +- 3 files changed, 123 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/ci-cd.yml diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml new file mode 100644 index 0000000..681b0d9 --- /dev/null +++ b/.github/workflows/ci-cd.yml @@ -0,0 +1,110 @@ +name: Continuous Integration and Continuous Deployment +run-name: ${{ github.actor }} submitted a CI CD Action +on: + push: + branches: [ "main" ] + +jobs: + Explore-GitHub-Actions: + if: contains(github.event.head_commit.message, '/run-') + runs-on: ubuntu-latest + steps: + - run: echo "Comment ${{ github.event.head_commit.message }}" + - run: echo "Job was automatically triggered by a ${{ github.event_name }} event." + - run: echo "Job is now running on a ${{ runner.os }} server hosted by GitHub!" + - run: echo "Branch is ${{ github.ref }} and your repository is ${{ github.repository }}." + - name: Check out repository code + uses: actions/checkout@v4 + - id: 'auth' + uses: google-github-actions/auth@v1 + with: + credentials_json: '${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}' + - name: Configure Google Cloud SDK + uses: google-github-actions/setup-gcloud@v1 + - name: Configure Docker Client + run: |- + gcloud auth configure-docker # --quiet #authenticate to gcr + - run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner." + - run: echo "🖥️ The workflow is now ready to test your code on the runner." + - name: List files in the repository + run: | + ls ${{ github.workspace }} + - name: Build Deployment Container + run: |- + cd ${{ github.workspace }}/src/deployment/ + docker build -t mushroom-app-deployment -f Dockerfile . + - name: Run Deploy App + if: contains(github.event.head_commit.message, '/run-deploy-app') + run: |- + docker run --rm --name mushroom-app-deployment \ + -v /var/run/docker.sock:/var/run/docker.sock \ + -v $HOME/.ssh:/home/app/.ssh \ + -v ${{ github.workspace }}/src/frontend-react:/frontend-react \ + -v ${{ github.workspace }}/src/api-service:/api-service \ + -v ${{ github.workspace }}/src/data-collector:/data-collector \ + -v ${{ github.workspace }}/src/data-processor:/data-processor \ + --volume $GITHUB_WORKSPACE:/workspace \ + --mount type=bind,source=$GOOGLE_APPLICATION_CREDENTIALS,target=/secrets/deployment.json \ + --env GOOGLE_APPLICATION_CREDENTIALS=/secrets/deployment.json \ + -e USE_GKE_GCLOUD_AUTH_PLUGIN=True \ + -e GCP_PROJECT=ac215-project \ + -e GCP_ZONE=us-central1-a \ + mushroom-app-deployment sh deploy-app.sh + - name: Run Data Collector + if: contains(github.event.head_commit.message, '/run-data-collector') + run: |- + docker run --rm --name mushroom-app-deployment \ + -v /var/run/docker.sock:/var/run/docker.sock \ + -v ${{ github.workspace }}/src/frontend-react:/frontend-react \ + -v ${{ github.workspace }}/src/api-service:/api-service \ + -v ${{ github.workspace }}/src/data-collector:/data-collector \ + -v ${{ github.workspace }}/src/data-processor:/data-processor \ + --mount type=bind,source=$GOOGLE_APPLICATION_CREDENTIALS,target=/secrets/deployment.json \ + -e GOOGLE_APPLICATION_CREDENTIALS=/secrets/deployment.json \ + -e USE_GKE_GCLOUD_AUTH_PLUGIN=True \ + -e GCP_PROJECT=ac215-project \ + -e GCP_ZONE=us-central1-a \ + -e GCS_BUCKET_NAME=mushroom-app-ml-workflow-demo \ + -e GCS_SERVICE_ACCOUNT=ml-workflow@ac215-project.iam.gserviceaccount.com \ + -e GCP_REGION=us-central1 \ + -e GCS_PACKAGE_URI=gs://mushroom-app-trainer-code \ + mushroom-app-deployment sh run-data-collector.sh + - name: Run Data Processor + if: contains(github.event.head_commit.message, '/run-data-processor') + run: |- + docker run --rm --name mushroom-app-deployment \ + -v /var/run/docker.sock:/var/run/docker.sock \ + -v ${{ github.workspace }}/src/frontend-react:/frontend-react \ + -v ${{ github.workspace }}/src/api-service:/api-service \ + -v ${{ github.workspace }}/src/data-collector:/data-collector \ + -v ${{ github.workspace }}/src/data-processor:/data-processor \ + --mount type=bind,source=$GOOGLE_APPLICATION_CREDENTIALS,target=/secrets/deployment.json \ + -e GOOGLE_APPLICATION_CREDENTIALS=/secrets/deployment.json \ + -e USE_GKE_GCLOUD_AUTH_PLUGIN=True \ + -e GCP_PROJECT=ac215-project \ + -e GCP_ZONE=us-central1-a \ + -e GCS_BUCKET_NAME=mushroom-app-ml-workflow-demo \ + -e GCS_SERVICE_ACCOUNT=ml-workflow@ac215-project.iam.gserviceaccount.com \ + -e GCP_REGION=us-central1 \ + -e GCS_PACKAGE_URI=gs://mushroom-app-trainer-code \ + mushroom-app-deployment sh run-data-processor.sh + - name: Run ML Pipeline + if: contains(github.event.head_commit.message, '/run-ml-pipeline') + run: |- + docker run --rm --name mushroom-app-deployment \ + -v /var/run/docker.sock:/var/run/docker.sock \ + -v ${{ github.workspace }}/src/frontend-react:/frontend-react \ + -v ${{ github.workspace }}/src/api-service:/api-service \ + -v ${{ github.workspace }}/src/data-collector:/data-collector \ + -v ${{ github.workspace }}/src/data-processor:/data-processor \ + --mount type=bind,source=$GOOGLE_APPLICATION_CREDENTIALS,target=/secrets/deployment.json \ + -e GOOGLE_APPLICATION_CREDENTIALS=/secrets/deployment.json \ + -e USE_GKE_GCLOUD_AUTH_PLUGIN=True \ + -e GCP_PROJECT=ac215-project \ + -e GCP_ZONE=us-central1-a \ + -e GCS_BUCKET_NAME=mushroom-app-ml-workflow-demo \ + -e GCS_SERVICE_ACCOUNT=ml-workflow@ac215-project.iam.gserviceaccount.com \ + -e GCP_REGION=us-central1 \ + -e GCS_PACKAGE_URI=gs://mushroom-app-trainer-code \ + mushroom-app-deployment sh run-ml-pipeline.sh + - run: echo "Job's status is ${{ job.status }}." \ No newline at end of file diff --git a/src/api-service/api/model_backend.py b/src/api-service/api/model_backend.py index 9b00ac7..51a270f 100644 --- a/src/api-service/api/model_backend.py +++ b/src/api-service/api/model_backend.py @@ -115,8 +115,15 @@ def post(self): app = Flask(__name__) swagger = Swagger(app) - app.add_url_rule('/chat', view_func=ChatView.as_view('chat'), methods=['POST']) + +# @app.route('/status', methods=['GET']) +# def get_api_status(): +# return jsonify({ +# "version": "1.0", +# "torch_version": torch.__version__ +# }) + CORS(app) # Run the Flask app diff --git a/src/frontend/src/App.jsx b/src/frontend/src/App.jsx index 2f27ad4..f182988 100644 --- a/src/frontend/src/App.jsx +++ b/src/frontend/src/App.jsx @@ -2,6 +2,9 @@ import React, { useState, useEffect } from "react"; import "./App.css"; import { Configuration, OpenAIApi } from "openai"; +const BASE_API_URL = process.env.REACT_APP_BASE_API_URL; +const APP_VERSION = 1.1; + // Reference: https://github.com/EBEREGIT/react-chatgpt-tutorial const configuration = new Configuration({ @@ -83,7 +86,8 @@ function App() { setImage(null); console.log("Trying to send", chats, formData) - fetch("http://127.0.0.1:5000/chat", { + fetch(BASE_API_URL + "/chat", { + // fetch("http://127.0.0.1:5000/chat", { // fetch("http://34.125.158.148:5000/chat", { "method": "POST", body: formData From b926db2f5b672f559a812a4fe32919c99544a252 Mon Sep 17 00:00:00 2001 From: Yuqing Pan Date: Sun, 10 Dec 2023 18:08:34 -0500 Subject: [PATCH 02/18] add version in frontend --- src/frontend/src/App.jsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/frontend/src/App.jsx b/src/frontend/src/App.jsx index f182988..20c339a 100644 --- a/src/frontend/src/App.jsx +++ b/src/frontend/src/App.jsx @@ -2,8 +2,7 @@ import React, { useState, useEffect } from "react"; import "./App.css"; import { Configuration, OpenAIApi } from "openai"; -const BASE_API_URL = process.env.REACT_APP_BASE_API_URL; -const APP_VERSION = 1.1; +const APP_VERSION = 1.0; // Reference: https://github.com/EBEREGIT/react-chatgpt-tutorial @@ -86,8 +85,7 @@ function App() { setImage(null); console.log("Trying to send", chats, formData) - fetch(BASE_API_URL + "/chat", { - // fetch("http://127.0.0.1:5000/chat", { + fetch("http://127.0.0.1:5000/chat", { // fetch("http://34.125.158.148:5000/chat", { "method": "POST", body: formData @@ -119,6 +117,7 @@ function App() {

ScienceTutor

+

version {APP_VERSION}

{chats && chats.length From d850ab7480de52a9d2ea0f987604178674379e96 Mon Sep 17 00:00:00 2001 From: Yuqing Pan Date: Sun, 10 Dec 2023 18:52:24 -0500 Subject: [PATCH 03/18] add update k8s cluster --- .github/workflows/ci-cd.yml | 69 ++-------------------- src/app_deploy/deploy-app.sh | 2 + src/app_deploy/inventory-prod.yml | 9 +++ src/app_deploy/update-k8s-cluster.yml | 82 +++++++++++++++++++++++++++ 4 files changed, 98 insertions(+), 64 deletions(-) create mode 100644 src/app_deploy/deploy-app.sh create mode 100644 src/app_deploy/inventory-prod.yml create mode 100644 src/app_deploy/update-k8s-cluster.yml diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 681b0d9..861b9b3 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -2,7 +2,7 @@ name: Continuous Integration and Continuous Deployment run-name: ${{ github.actor }} submitted a CI CD Action on: push: - branches: [ "main" ] + branches: [ "main", "milestone6", "milestone6-yp"] jobs: Explore-GitHub-Actions: @@ -29,82 +29,23 @@ jobs: - name: List files in the repository run: | ls ${{ github.workspace }} - - name: Build Deployment Container + - name: Build App Deploy Container run: |- cd ${{ github.workspace }}/src/deployment/ - docker build -t mushroom-app-deployment -f Dockerfile . + docker build -t app-deployment -f Dockerfile . - name: Run Deploy App if: contains(github.event.head_commit.message, '/run-deploy-app') run: |- - docker run --rm --name mushroom-app-deployment \ + docker run --rm --name app-deployment \ -v /var/run/docker.sock:/var/run/docker.sock \ -v $HOME/.ssh:/home/app/.ssh \ -v ${{ github.workspace }}/src/frontend-react:/frontend-react \ -v ${{ github.workspace }}/src/api-service:/api-service \ - -v ${{ github.workspace }}/src/data-collector:/data-collector \ - -v ${{ github.workspace }}/src/data-processor:/data-processor \ --volume $GITHUB_WORKSPACE:/workspace \ --mount type=bind,source=$GOOGLE_APPLICATION_CREDENTIALS,target=/secrets/deployment.json \ --env GOOGLE_APPLICATION_CREDENTIALS=/secrets/deployment.json \ -e USE_GKE_GCLOUD_AUTH_PLUGIN=True \ -e GCP_PROJECT=ac215-project \ -e GCP_ZONE=us-central1-a \ - mushroom-app-deployment sh deploy-app.sh - - name: Run Data Collector - if: contains(github.event.head_commit.message, '/run-data-collector') - run: |- - docker run --rm --name mushroom-app-deployment \ - -v /var/run/docker.sock:/var/run/docker.sock \ - -v ${{ github.workspace }}/src/frontend-react:/frontend-react \ - -v ${{ github.workspace }}/src/api-service:/api-service \ - -v ${{ github.workspace }}/src/data-collector:/data-collector \ - -v ${{ github.workspace }}/src/data-processor:/data-processor \ - --mount type=bind,source=$GOOGLE_APPLICATION_CREDENTIALS,target=/secrets/deployment.json \ - -e GOOGLE_APPLICATION_CREDENTIALS=/secrets/deployment.json \ - -e USE_GKE_GCLOUD_AUTH_PLUGIN=True \ - -e GCP_PROJECT=ac215-project \ - -e GCP_ZONE=us-central1-a \ - -e GCS_BUCKET_NAME=mushroom-app-ml-workflow-demo \ - -e GCS_SERVICE_ACCOUNT=ml-workflow@ac215-project.iam.gserviceaccount.com \ - -e GCP_REGION=us-central1 \ - -e GCS_PACKAGE_URI=gs://mushroom-app-trainer-code \ - mushroom-app-deployment sh run-data-collector.sh - - name: Run Data Processor - if: contains(github.event.head_commit.message, '/run-data-processor') - run: |- - docker run --rm --name mushroom-app-deployment \ - -v /var/run/docker.sock:/var/run/docker.sock \ - -v ${{ github.workspace }}/src/frontend-react:/frontend-react \ - -v ${{ github.workspace }}/src/api-service:/api-service \ - -v ${{ github.workspace }}/src/data-collector:/data-collector \ - -v ${{ github.workspace }}/src/data-processor:/data-processor \ - --mount type=bind,source=$GOOGLE_APPLICATION_CREDENTIALS,target=/secrets/deployment.json \ - -e GOOGLE_APPLICATION_CREDENTIALS=/secrets/deployment.json \ - -e USE_GKE_GCLOUD_AUTH_PLUGIN=True \ - -e GCP_PROJECT=ac215-project \ - -e GCP_ZONE=us-central1-a \ - -e GCS_BUCKET_NAME=mushroom-app-ml-workflow-demo \ - -e GCS_SERVICE_ACCOUNT=ml-workflow@ac215-project.iam.gserviceaccount.com \ - -e GCP_REGION=us-central1 \ - -e GCS_PACKAGE_URI=gs://mushroom-app-trainer-code \ - mushroom-app-deployment sh run-data-processor.sh - - name: Run ML Pipeline - if: contains(github.event.head_commit.message, '/run-ml-pipeline') - run: |- - docker run --rm --name mushroom-app-deployment \ - -v /var/run/docker.sock:/var/run/docker.sock \ - -v ${{ github.workspace }}/src/frontend-react:/frontend-react \ - -v ${{ github.workspace }}/src/api-service:/api-service \ - -v ${{ github.workspace }}/src/data-collector:/data-collector \ - -v ${{ github.workspace }}/src/data-processor:/data-processor \ - --mount type=bind,source=$GOOGLE_APPLICATION_CREDENTIALS,target=/secrets/deployment.json \ - -e GOOGLE_APPLICATION_CREDENTIALS=/secrets/deployment.json \ - -e USE_GKE_GCLOUD_AUTH_PLUGIN=True \ - -e GCP_PROJECT=ac215-project \ - -e GCP_ZONE=us-central1-a \ - -e GCS_BUCKET_NAME=mushroom-app-ml-workflow-demo \ - -e GCS_SERVICE_ACCOUNT=ml-workflow@ac215-project.iam.gserviceaccount.com \ - -e GCP_REGION=us-central1 \ - -e GCS_PACKAGE_URI=gs://mushroom-app-trainer-code \ - mushroom-app-deployment sh run-ml-pipeline.sh + app-deployment sh deploy-app.sh - run: echo "Job's status is ${{ job.status }}." \ No newline at end of file diff --git a/src/app_deploy/deploy-app.sh b/src/app_deploy/deploy-app.sh new file mode 100644 index 0000000..83ff1af --- /dev/null +++ b/src/app_deploy/deploy-app.sh @@ -0,0 +1,2 @@ +ansible-playbook deploy-docker-images.yml -i inventory.yml +ansible-playbook update-k8s-cluster.yml -i inventory-prod.yml \ No newline at end of file diff --git a/src/app_deploy/inventory-prod.yml b/src/app_deploy/inventory-prod.yml new file mode 100644 index 0000000..66aa9d2 --- /dev/null +++ b/src/app_deploy/inventory-prod.yml @@ -0,0 +1,9 @@ +all: + vars: + gcp_service_account_file: "/secrets/deployment.json" + gcp_service_account_email: "deployment@ac215project-398401.iam.gserviceaccount.com" + gcp_auth_kind: "serviceaccount" + gcp_scopes: "https://www.googleapis.com/auth/compute" + gcp_project: "ac215project-398401" + gcp_region: "us-west3" + gcp_zone: "us-west3-b" \ No newline at end of file diff --git a/src/app_deploy/update-k8s-cluster.yml b/src/app_deploy/update-k8s-cluster.yml new file mode 100644 index 0000000..6e497e4 --- /dev/null +++ b/src/app_deploy/update-k8s-cluster.yml @@ -0,0 +1,82 @@ +--- +- name: "Update Kubernetes Cluster" + hosts: localhost + gather_facts: false + + vars: + cluster_name: "science-tutor-cluster" + + tasks: + - name: "Connect to cluster (update kubeconfig)" + shell: "gcloud container clusters get-credentials {{ cluster_name }} --zone {{ gcp_zone }} --project {{ gcp_project }}" + + - name: "Copy docker tag file" + copy: + src: .docker-tag + dest: .docker-tag + mode: 0644 + + - name: "Get docker tag" + shell: "cat .docker-tag" + register: tag + + - name: "Print tag" + debug: + var: tag + + - name: "Update Deployment for Frontend" + k8s: + state: present + definition: + apiVersion: v1 + kind: Deployment + metadata: + name: frontend + namespace: "{{cluster_name}}-namespace" + spec: + selector: + matchLabels: + run: frontend + template: + metadata: + labels: + run: frontend + spec: + containers: + - image: "gcr.io/{{ gcp_project }}/science-tutor-frontend-react:{{ tag.stdout}}" + imagePullPolicy: IfNotPresent + name: frontend + ports: + - containerPort: 80 + protocol: TCP + restartPolicy: Always + + - name: "Update Deployment for API Service" + k8s: + state: present + definition: + apiVersion: v1 + kind: Deployment + metadata: + name: api + namespace: "{{cluster_name}}-namespace" + spec: + selector: + matchLabels: + run: api + template: + metadata: + labels: + run: api + spec: + volumes: + - name: persistent-vol + emptyDir: {} + - name: google-cloud-key + secret: + secretName: gcp-service-key + containers: + - image: gcr.io/{{ gcp_project }}/science-tutor-api-service:{{ tag.stdout}} + imagePullPolicy: IfNotPresent + name: api + restartPolicy: Always \ No newline at end of file From 306866dd19d5e2c9b435eb248ba892bc09844def Mon Sep 17 00:00:00 2001 From: Yuqing Pan Date: Sun, 10 Dec 2023 19:08:36 -0500 Subject: [PATCH 04/18] /run-deploy-app --- src/frontend/src/App.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frontend/src/App.jsx b/src/frontend/src/App.jsx index 20c339a..86820e4 100644 --- a/src/frontend/src/App.jsx +++ b/src/frontend/src/App.jsx @@ -2,7 +2,7 @@ import React, { useState, useEffect } from "react"; import "./App.css"; import { Configuration, OpenAIApi } from "openai"; -const APP_VERSION = 1.0; +const APP_VERSION = "1.0"; // Reference: https://github.com/EBEREGIT/react-chatgpt-tutorial From 28f8b9311de0769678d7c08badbd363798ed9649 Mon Sep 17 00:00:00 2001 From: Yuqing Pan Date: Sun, 10 Dec 2023 19:16:59 -0500 Subject: [PATCH 05/18] /run-deploy-app --- .github/workflows/ci-cd.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 861b9b3..aaa479c 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -31,21 +31,21 @@ jobs: ls ${{ github.workspace }} - name: Build App Deploy Container run: |- - cd ${{ github.workspace }}/src/deployment/ - docker build -t app-deployment -f Dockerfile . + cd ${{ github.workspace }}/src/app_deploy/ + docker build -t app_deployment --platform=linux/amd64 -f Dockerfile . - name: Run Deploy App if: contains(github.event.head_commit.message, '/run-deploy-app') run: |- - docker run --rm --name app-deployment \ + docker run --rm --name app_deployment \ -v /var/run/docker.sock:/var/run/docker.sock \ -v $HOME/.ssh:/home/app/.ssh \ - -v ${{ github.workspace }}/src/frontend-react:/frontend-react \ + -v ${{ github.workspace }}/src/frontend:/frontend-react \ -v ${{ github.workspace }}/src/api-service:/api-service \ --volume $GITHUB_WORKSPACE:/workspace \ --mount type=bind,source=$GOOGLE_APPLICATION_CREDENTIALS,target=/secrets/deployment.json \ --env GOOGLE_APPLICATION_CREDENTIALS=/secrets/deployment.json \ -e USE_GKE_GCLOUD_AUTH_PLUGIN=True \ - -e GCP_PROJECT=ac215-project \ - -e GCP_ZONE=us-central1-a \ - app-deployment sh deploy-app.sh + -e GCP_PROJECT=ac215project-398401 \ + -e GCP_ZONE=us-west3-b \ + app_deployment sh deploy-app.sh - run: echo "Job's status is ${{ job.status }}." \ No newline at end of file From 4a3fa7730430daef7f51c397162f3ce14cf70b16 Mon Sep 17 00:00:00 2001 From: Yuqing Pan Date: Sun, 10 Dec 2023 19:33:56 -0500 Subject: [PATCH 06/18] /run-deploy-app --- src/app_deploy/Dockerfile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/app_deploy/Dockerfile b/src/app_deploy/Dockerfile index f0530a8..25a1116 100644 --- a/src/app_deploy/Dockerfile +++ b/src/app_deploy/Dockerfile @@ -3,6 +3,9 @@ FROM ubuntu:20.04 # Set the environment variable for non-interactive installations ENV DEBIAN_FRONTEND=noninteractive +ENV LANG=C.UTF-8 +ENV PYENV_SHELL=/bin/bash +ENV PYTHONUNBUFFERED=1 # Install required dependencies RUN apt-get update && \ @@ -32,7 +35,7 @@ RUN curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.28/deb/Release.key | gpg --d curl https://baltocdn.com/helm/signing.asc | apt-key add -&& \ echo "deb https://baltocdn.com/helm/stable/debian/ all main" | tee /etc/apt/sources.list.d/helm-stable-debian.list && \ apt-get update && \ - apt-get install -y --no-install-recommends kubectl helm python3 python3-pip && \ + apt-get install -y --no-install-recommends kubectl helm python3.9 python3-pip && \ pip install openshift ansible docker apache-libcloud RUN useradd -ms /bin/bash app -d /home/app -u 1000 -p "$(openssl passwd -1 passw0rd)" && \ From 8d9eb1da87a2edea98c576441982d9206c2283de Mon Sep 17 00:00:00 2001 From: Yuqing Pan Date: Sun, 10 Dec 2023 21:57:21 -0500 Subject: [PATCH 07/18] /run-deploy-app --- src/frontend/src/App.jsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/frontend/src/App.jsx b/src/frontend/src/App.jsx index 86820e4..6ca4dbb 100644 --- a/src/frontend/src/App.jsx +++ b/src/frontend/src/App.jsx @@ -2,7 +2,7 @@ import React, { useState, useEffect } from "react"; import "./App.css"; import { Configuration, OpenAIApi } from "openai"; -const APP_VERSION = "1.0"; +const APP_VERSION = "1.2"; // Reference: https://github.com/EBEREGIT/react-chatgpt-tutorial @@ -85,8 +85,8 @@ function App() { setImage(null); console.log("Trying to send", chats, formData) - fetch("http://127.0.0.1:5000/chat", { - // fetch("http://34.125.158.148:5000/chat", { + fetch("/api/chat", { // for nginx + // fetch("http://127.0.0.1:5000/chat", { // for Docker.dev "method": "POST", body: formData }) From a0dd43548ee2dddad3921051137f4d63a46c5de7 Mon Sep 17 00:00:00 2001 From: Yuqing Pan Date: Sun, 10 Dec 2023 22:29:16 -0500 Subject: [PATCH 08/18] /run-deploy-app --- .github/workflows/ci-cd.yml | 3 ++- src/app_deploy/deploy-app.sh | 3 ++- src/frontend/src/App.jsx | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index aaa479c..9608f0d 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -47,5 +47,6 @@ jobs: -e USE_GKE_GCLOUD_AUTH_PLUGIN=True \ -e GCP_PROJECT=ac215project-398401 \ -e GCP_ZONE=us-west3-b \ - app_deployment sh deploy-app.sh + app_deployment + docker exec -it app_deployment sh deploy-app.sh - run: echo "Job's status is ${{ job.status }}." \ No newline at end of file diff --git a/src/app_deploy/deploy-app.sh b/src/app_deploy/deploy-app.sh index 83ff1af..a7ff2d3 100644 --- a/src/app_deploy/deploy-app.sh +++ b/src/app_deploy/deploy-app.sh @@ -1,2 +1,3 @@ ansible-playbook deploy-docker-images.yml -i inventory.yml -ansible-playbook update-k8s-cluster.yml -i inventory-prod.yml \ No newline at end of file +ansible-playbook update-k8s-cluster.yml -i inventory-prod.yml +echo "updated app deployment" \ No newline at end of file diff --git a/src/frontend/src/App.jsx b/src/frontend/src/App.jsx index 6ca4dbb..10201f9 100644 --- a/src/frontend/src/App.jsx +++ b/src/frontend/src/App.jsx @@ -2,7 +2,7 @@ import React, { useState, useEffect } from "react"; import "./App.css"; import { Configuration, OpenAIApi } from "openai"; -const APP_VERSION = "1.2"; +const APP_VERSION = "1.1"; // Reference: https://github.com/EBEREGIT/react-chatgpt-tutorial From d6a56b772bf71d20b203a0bc7f754040d2d9ac5a Mon Sep 17 00:00:00 2001 From: Yuqing Pan Date: Sun, 10 Dec 2023 22:36:24 -0500 Subject: [PATCH 09/18] /run-deploy-app --- .github/workflows/ci-cd.yml | 3 +-- src/app_deploy/deploy-app.sh | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) mode change 100644 => 100755 src/app_deploy/deploy-app.sh diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 9608f0d..aaa479c 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -47,6 +47,5 @@ jobs: -e USE_GKE_GCLOUD_AUTH_PLUGIN=True \ -e GCP_PROJECT=ac215project-398401 \ -e GCP_ZONE=us-west3-b \ - app_deployment - docker exec -it app_deployment sh deploy-app.sh + app_deployment sh deploy-app.sh - run: echo "Job's status is ${{ job.status }}." \ No newline at end of file diff --git a/src/app_deploy/deploy-app.sh b/src/app_deploy/deploy-app.sh old mode 100644 new mode 100755 index a7ff2d3..b86cf30 --- a/src/app_deploy/deploy-app.sh +++ b/src/app_deploy/deploy-app.sh @@ -1,3 +1,4 @@ +echo "Updating deployment" ansible-playbook deploy-docker-images.yml -i inventory.yml ansible-playbook update-k8s-cluster.yml -i inventory-prod.yml -echo "updated app deployment" \ No newline at end of file +echo "Complete updating" \ No newline at end of file From 4de5d8390a561f860bf7aae3245325639996b29a Mon Sep 17 00:00:00 2001 From: Yuqing Pan Date: Sun, 10 Dec 2023 23:03:28 -0500 Subject: [PATCH 10/18] /run-deploy-app --- .github/workflows/ci-cd.yml | 2 ++ src/app_deploy/deploy-app.sh | 4 +--- src/frontend/src/App.jsx | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index aaa479c..4c9f503 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -48,4 +48,6 @@ jobs: -e GCP_PROJECT=ac215project-398401 \ -e GCP_ZONE=us-west3-b \ app_deployment sh deploy-app.sh + docker ps + docker exec app_deployment /bin/bash -c 'sh deploy-app.sh' - run: echo "Job's status is ${{ job.status }}." \ No newline at end of file diff --git a/src/app_deploy/deploy-app.sh b/src/app_deploy/deploy-app.sh index b86cf30..83ff1af 100755 --- a/src/app_deploy/deploy-app.sh +++ b/src/app_deploy/deploy-app.sh @@ -1,4 +1,2 @@ -echo "Updating deployment" ansible-playbook deploy-docker-images.yml -i inventory.yml -ansible-playbook update-k8s-cluster.yml -i inventory-prod.yml -echo "Complete updating" \ No newline at end of file +ansible-playbook update-k8s-cluster.yml -i inventory-prod.yml \ No newline at end of file diff --git a/src/frontend/src/App.jsx b/src/frontend/src/App.jsx index 10201f9..debb7b2 100644 --- a/src/frontend/src/App.jsx +++ b/src/frontend/src/App.jsx @@ -2,7 +2,7 @@ import React, { useState, useEffect } from "react"; import "./App.css"; import { Configuration, OpenAIApi } from "openai"; -const APP_VERSION = "1.1"; +const APP_VERSION = "1.0"; // Reference: https://github.com/EBEREGIT/react-chatgpt-tutorial From 22756c4a883487ddd666abbefff5143c3144eef2 Mon Sep 17 00:00:00 2001 From: Yuqing Pan Date: Sun, 10 Dec 2023 23:10:42 -0500 Subject: [PATCH 11/18] /run-deploy-app --- .github/workflows/ci-cd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 4c9f503..776ecb4 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -36,7 +36,7 @@ jobs: - name: Run Deploy App if: contains(github.event.head_commit.message, '/run-deploy-app') run: |- - docker run --rm --name app_deployment \ + docker run --name app_deployment \ -v /var/run/docker.sock:/var/run/docker.sock \ -v $HOME/.ssh:/home/app/.ssh \ -v ${{ github.workspace }}/src/frontend:/frontend-react \ From f6e26d80471241674723791af93ba192b0ad9687 Mon Sep 17 00:00:00 2001 From: Yuqing Pan Date: Sun, 10 Dec 2023 23:28:04 -0500 Subject: [PATCH 12/18] /run-deploy-app --- .github/workflows/ci-cd.yml | 4 +- src/app_deploy/update-k8s-cluster.yml | 58 +++++++++++++-------------- 2 files changed, 30 insertions(+), 32 deletions(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 776ecb4..aaa479c 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -36,7 +36,7 @@ jobs: - name: Run Deploy App if: contains(github.event.head_commit.message, '/run-deploy-app') run: |- - docker run --name app_deployment \ + docker run --rm --name app_deployment \ -v /var/run/docker.sock:/var/run/docker.sock \ -v $HOME/.ssh:/home/app/.ssh \ -v ${{ github.workspace }}/src/frontend:/frontend-react \ @@ -48,6 +48,4 @@ jobs: -e GCP_PROJECT=ac215project-398401 \ -e GCP_ZONE=us-west3-b \ app_deployment sh deploy-app.sh - docker ps - docker exec app_deployment /bin/bash -c 'sh deploy-app.sh' - run: echo "Job's status is ${{ job.status }}." \ No newline at end of file diff --git a/src/app_deploy/update-k8s-cluster.yml b/src/app_deploy/update-k8s-cluster.yml index 6e497e4..85a7a9f 100644 --- a/src/app_deploy/update-k8s-cluster.yml +++ b/src/app_deploy/update-k8s-cluster.yml @@ -51,32 +51,32 @@ protocol: TCP restartPolicy: Always - - name: "Update Deployment for API Service" - k8s: - state: present - definition: - apiVersion: v1 - kind: Deployment - metadata: - name: api - namespace: "{{cluster_name}}-namespace" - spec: - selector: - matchLabels: - run: api - template: - metadata: - labels: - run: api - spec: - volumes: - - name: persistent-vol - emptyDir: {} - - name: google-cloud-key - secret: - secretName: gcp-service-key - containers: - - image: gcr.io/{{ gcp_project }}/science-tutor-api-service:{{ tag.stdout}} - imagePullPolicy: IfNotPresent - name: api - restartPolicy: Always \ No newline at end of file + # - name: "Update Deployment for API Service" + # k8s: + # state: present + # definition: + # apiVersion: v1 + # kind: Deployment + # metadata: + # name: api + # namespace: "{{cluster_name}}-namespace" + # spec: + # selector: + # matchLabels: + # run: api + # template: + # metadata: + # labels: + # run: api + # spec: + # volumes: + # - name: persistent-vol + # emptyDir: {} + # - name: google-cloud-key + # secret: + # secretName: gcp-service-key + # containers: + # - image: gcr.io/{{ gcp_project }}/science-tutor-api-service:{{ tag.stdout}} + # imagePullPolicy: IfNotPresent + # name: api + # restartPolicy: Always \ No newline at end of file From e5b556522e1c47e81bed687bb1b311075e346bc3 Mon Sep 17 00:00:00 2001 From: Yuqing Pan Date: Mon, 11 Dec 2023 00:20:40 -0500 Subject: [PATCH 13/18] Added update-deploy-app.sh --- src/app_deploy/update-deploy-app.sh | 30 ++++++++++++++ src/app_deploy/update-k8s-cluster.yml | 58 +++++++++++++-------------- src/frontend/src/App.jsx | 2 +- 3 files changed, 60 insertions(+), 30 deletions(-) create mode 100644 src/app_deploy/update-deploy-app.sh diff --git a/src/app_deploy/update-deploy-app.sh b/src/app_deploy/update-deploy-app.sh new file mode 100644 index 0000000..6fff81a --- /dev/null +++ b/src/app_deploy/update-deploy-app.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +# exit immediately if a command exits with a non-zero status +#set -e + +# Define some environment variables +export IMAGE_NAME="app_deployment" +export BASE_DIR=$(pwd) +export SECRETS_DIR=$(pwd)/../../../secrets/ +export GCP_PROJECT="ac215project-398401" # Change to your GCP Project +export GCP_ZONE="us-west3-b" +export GOOGLE_APPLICATION_CREDENTIALS=/secrets/deployment.json + +# Build the image based on the Dockerfile +#docker build -t $IMAGE_NAME -f Dockerfile . +docker build -t $IMAGE_NAME --platform=linux/amd64 -f Dockerfile . + +# Run the container +docker run --rm --name $IMAGE_NAME \ +-v /var/run/docker.sock:/var/run/docker.sock \ +-v "$BASE_DIR":/app \ +-v "$SECRETS_DIR":/secrets \ +-v "$HOME/.ssh":/home/app/.ssh \ +-v "$BASE_DIR/../api-service":/api-service \ +-v "$BASE_DIR/../frontend":/frontend-react \ +-e GOOGLE_APPLICATION_CREDENTIALS=$GOOGLE_APPLICATION_CREDENTIALS \ +-e USE_GKE_GCLOUD_AUTH_PLUGIN=True \ +-e GCP_PROJECT=$GCP_PROJECT \ +-e GCP_ZONE=$GCP_ZONE \ +$IMAGE_NAME sh deploy-app.sh \ No newline at end of file diff --git a/src/app_deploy/update-k8s-cluster.yml b/src/app_deploy/update-k8s-cluster.yml index 85a7a9f..6e497e4 100644 --- a/src/app_deploy/update-k8s-cluster.yml +++ b/src/app_deploy/update-k8s-cluster.yml @@ -51,32 +51,32 @@ protocol: TCP restartPolicy: Always - # - name: "Update Deployment for API Service" - # k8s: - # state: present - # definition: - # apiVersion: v1 - # kind: Deployment - # metadata: - # name: api - # namespace: "{{cluster_name}}-namespace" - # spec: - # selector: - # matchLabels: - # run: api - # template: - # metadata: - # labels: - # run: api - # spec: - # volumes: - # - name: persistent-vol - # emptyDir: {} - # - name: google-cloud-key - # secret: - # secretName: gcp-service-key - # containers: - # - image: gcr.io/{{ gcp_project }}/science-tutor-api-service:{{ tag.stdout}} - # imagePullPolicy: IfNotPresent - # name: api - # restartPolicy: Always \ No newline at end of file + - name: "Update Deployment for API Service" + k8s: + state: present + definition: + apiVersion: v1 + kind: Deployment + metadata: + name: api + namespace: "{{cluster_name}}-namespace" + spec: + selector: + matchLabels: + run: api + template: + metadata: + labels: + run: api + spec: + volumes: + - name: persistent-vol + emptyDir: {} + - name: google-cloud-key + secret: + secretName: gcp-service-key + containers: + - image: gcr.io/{{ gcp_project }}/science-tutor-api-service:{{ tag.stdout}} + imagePullPolicy: IfNotPresent + name: api + restartPolicy: Always \ No newline at end of file diff --git a/src/frontend/src/App.jsx b/src/frontend/src/App.jsx index debb7b2..10201f9 100644 --- a/src/frontend/src/App.jsx +++ b/src/frontend/src/App.jsx @@ -2,7 +2,7 @@ import React, { useState, useEffect } from "react"; import "./App.css"; import { Configuration, OpenAIApi } from "openai"; -const APP_VERSION = "1.0"; +const APP_VERSION = "1.1"; // Reference: https://github.com/EBEREGIT/react-chatgpt-tutorial From 03c2bc09a60cf072ee1967be4c37486fcf8501e7 Mon Sep 17 00:00:00 2001 From: Yuqing Pan Date: Mon, 11 Dec 2023 01:05:05 -0500 Subject: [PATCH 14/18] /run-deploy-app --- .github/workflows/ci-cd.yml | 2 +- src/app_deploy/docker-entrypoint.sh | 10 +++++++++- src/app_deploy/docker-shell.sh | 2 +- src/app_deploy/update-deploy-app.sh | 4 ++-- src/frontend/src/App.jsx | 2 +- 5 files changed, 14 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index aaa479c..e422f2f 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -47,5 +47,5 @@ jobs: -e USE_GKE_GCLOUD_AUTH_PLUGIN=True \ -e GCP_PROJECT=ac215project-398401 \ -e GCP_ZONE=us-west3-b \ - app_deployment sh deploy-app.sh + app_deployment ./deploy-app.sh - run: echo "Job's status is ${{ job.status }}." \ No newline at end of file diff --git a/src/app_deploy/docker-entrypoint.sh b/src/app_deploy/docker-entrypoint.sh index 9aae40b..1b11817 100644 --- a/src/app_deploy/docker-entrypoint.sh +++ b/src/app_deploy/docker-entrypoint.sh @@ -9,4 +9,12 @@ gcloud config set project $GCP_PROJECT # Configure GCR gcloud auth configure-docker gcr.io -q -/bin/bash \ No newline at end of file +args="$@" +echo $args + +if [[ -z ${args} ]]; +then + /bin/bash +else + /bin/bash $args +fi \ No newline at end of file diff --git a/src/app_deploy/docker-shell.sh b/src/app_deploy/docker-shell.sh index 8b9f68f..0d94342 100644 --- a/src/app_deploy/docker-shell.sh +++ b/src/app_deploy/docker-shell.sh @@ -1,7 +1,7 @@ #!/bin/bash # exit immediately if a command exits with a non-zero status -#set -e +set -e # Define some environment variables export IMAGE_NAME="app_deployment" diff --git a/src/app_deploy/update-deploy-app.sh b/src/app_deploy/update-deploy-app.sh index 6fff81a..d3c7eea 100644 --- a/src/app_deploy/update-deploy-app.sh +++ b/src/app_deploy/update-deploy-app.sh @@ -1,7 +1,7 @@ #!/bin/bash # exit immediately if a command exits with a non-zero status -#set -e +set -e # Define some environment variables export IMAGE_NAME="app_deployment" @@ -27,4 +27,4 @@ docker run --rm --name $IMAGE_NAME \ -e USE_GKE_GCLOUD_AUTH_PLUGIN=True \ -e GCP_PROJECT=$GCP_PROJECT \ -e GCP_ZONE=$GCP_ZONE \ -$IMAGE_NAME sh deploy-app.sh \ No newline at end of file +$IMAGE_NAME ./deploy-app.sh \ No newline at end of file diff --git a/src/frontend/src/App.jsx b/src/frontend/src/App.jsx index 10201f9..debb7b2 100644 --- a/src/frontend/src/App.jsx +++ b/src/frontend/src/App.jsx @@ -2,7 +2,7 @@ import React, { useState, useEffect } from "react"; import "./App.css"; import { Configuration, OpenAIApi } from "openai"; -const APP_VERSION = "1.1"; +const APP_VERSION = "1.0"; // Reference: https://github.com/EBEREGIT/react-chatgpt-tutorial From ce491cc33dd518dc1ab8d41d17173b2d985368bd Mon Sep 17 00:00:00 2001 From: Yuqing Pan Date: Mon, 11 Dec 2023 11:15:29 -0500 Subject: [PATCH 15/18] Add deploy-app-init.sh --- src/app_deploy/deploy-app-init.sh | 5 +++++ src/app_deploy/deploy-app.sh | 2 ++ 2 files changed, 7 insertions(+) create mode 100644 src/app_deploy/deploy-app-init.sh diff --git a/src/app_deploy/deploy-app-init.sh b/src/app_deploy/deploy-app-init.sh new file mode 100644 index 0000000..7e1a4e6 --- /dev/null +++ b/src/app_deploy/deploy-app-init.sh @@ -0,0 +1,5 @@ +# Build and Push Docker Containers to GCR +ansible-playbook deploy-docker-images.yml -i inventory.yml +# Create and Deploy Cluster +ansible-playbook deploy-k8s-cluster.yml -i inventory.yml --extra-vars cluster_state=present +# Once the command runs go to http://.sslip.io \ No newline at end of file diff --git a/src/app_deploy/deploy-app.sh b/src/app_deploy/deploy-app.sh index 83ff1af..80cf9af 100755 --- a/src/app_deploy/deploy-app.sh +++ b/src/app_deploy/deploy-app.sh @@ -1,2 +1,4 @@ +# # Build and Push Docker Containers to GCR ansible-playbook deploy-docker-images.yml -i inventory.yml +# Update Cluster ansible-playbook update-k8s-cluster.yml -i inventory-prod.yml \ No newline at end of file From e93c1f89e719ac4e6c4c461a406beb8dc7a8f0c2 Mon Sep 17 00:00:00 2001 From: Yuqing Pan Date: Mon, 11 Dec 2023 12:36:44 -0500 Subject: [PATCH 16/18] /run-deploy-app --- src/api-service/api/model_backend.py | 14 ++++++-------- src/frontend/src/App.jsx | 17 +++++++++++++++-- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/src/api-service/api/model_backend.py b/src/api-service/api/model_backend.py index 51a270f..0d60081 100644 --- a/src/api-service/api/model_backend.py +++ b/src/api-service/api/model_backend.py @@ -9,8 +9,6 @@ pwd = Path(__file__).parent.resolve() import sys, os sys.path.insert(0, "LLaVA") -# print(sys.path) -# print(os.environ.get("PYTHONPATH")) from llava.constants import IMAGE_TOKEN_INDEX, DEFAULT_IMAGE_TOKEN, DEFAULT_IM_START_TOKEN, DEFAULT_IM_END_TOKEN from llava.conversation import conv_templates, SeparatorStyle from llava.model.builder import load_pretrained_model @@ -117,12 +115,12 @@ def post(self): swagger = Swagger(app) app.add_url_rule('/chat', view_func=ChatView.as_view('chat'), methods=['POST']) -# @app.route('/status', methods=['GET']) -# def get_api_status(): -# return jsonify({ -# "version": "1.0", -# "torch_version": torch.__version__ -# }) +@app.route('/status', methods=['GET']) +def get_api_status(): + return jsonify({ + "api_version": "1.1", + "torch_version": torch.__version__ + }) CORS(app) diff --git a/src/frontend/src/App.jsx b/src/frontend/src/App.jsx index debb7b2..9b98b44 100644 --- a/src/frontend/src/App.jsx +++ b/src/frontend/src/App.jsx @@ -17,10 +17,23 @@ function App() { const [image, setImage] = useState(null); const [chats, setChats] = useState([]); const [isTyping, setIsTyping] = useState(false); + const [api_version, setAPIVersion] = useState(null); + const [torch_version, setTorchVersion] = useState(null); useEffect(() => { - const delayBeforeHello = 1000; // Adjust the delay in milliseconds + console.log("API Version", api_version, torch_version) + fetch("/api/status", { + "method": "GET", + }) + .then(response => response.json()) + .then(data => { + console.log(data); + setAPIVersion(data.api_version); + setTorchVersion(data.torch_version); + }) + .catch(error => console.error('Error:', error)); + const delayBeforeHello = 1000; // Adjust the delay in milliseconds setTimeout(() => { const systemMessage = "Hello! This is your Science Tutor. I can provide instant and expert answers to K12 science questions that you may have in different domains such as natural, social and language science. Feel free to ask me any questions you have and upload an image to start!"; @@ -117,7 +130,7 @@ function App() {

ScienceTutor

-

version {APP_VERSION}

+

APP v{APP_VERSION}   API v{api_version}   PyTorch v{torch_version}

{chats && chats.length From 1f11fe906a1474651cd462066f85f952b80dd127 Mon Sep 17 00:00:00 2001 From: Yuqing Pan Date: Mon, 11 Dec 2023 12:51:29 -0500 Subject: [PATCH 17/18] /run-deploy-app --- src/api-service/api/model_backend.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api-service/api/model_backend.py b/src/api-service/api/model_backend.py index 0d60081..4803405 100644 --- a/src/api-service/api/model_backend.py +++ b/src/api-service/api/model_backend.py @@ -118,7 +118,7 @@ def post(self): @app.route('/status', methods=['GET']) def get_api_status(): return jsonify({ - "api_version": "1.1", + "api_version": "1.2", "torch_version": torch.__version__ }) From 27dc7f8993a22e55611184078ae8c9bfffa20a1f Mon Sep 17 00:00:00 2001 From: Yuqing Pan Date: Mon, 11 Dec 2023 18:36:38 -0500 Subject: [PATCH 18/18] /run-deploy-app --- src/api-service/api/model_backend.py | 2 +- src/app_deploy/deploy-app.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/api-service/api/model_backend.py b/src/api-service/api/model_backend.py index 4803405..184e7c1 100644 --- a/src/api-service/api/model_backend.py +++ b/src/api-service/api/model_backend.py @@ -118,7 +118,7 @@ def post(self): @app.route('/status', methods=['GET']) def get_api_status(): return jsonify({ - "api_version": "1.2", + "api_version": "1.0", "torch_version": torch.__version__ }) diff --git a/src/app_deploy/deploy-app.sh b/src/app_deploy/deploy-app.sh index 80cf9af..7cc51e2 100755 --- a/src/app_deploy/deploy-app.sh +++ b/src/app_deploy/deploy-app.sh @@ -1,4 +1,4 @@ -# # Build and Push Docker Containers to GCR +# Build and Push Docker Containers to GCR ansible-playbook deploy-docker-images.yml -i inventory.yml # Update Cluster ansible-playbook update-k8s-cluster.yml -i inventory-prod.yml \ No newline at end of file