From 516f9675a86e97191fb9863d36f5ac6983979258 Mon Sep 17 00:00:00 2001 From: Nayeon Kim <76769919+n-y-kim@users.noreply.github.com> Date: Fri, 15 Mar 2024 07:35:55 +0900 Subject: [PATCH 01/19] Update Dockerfile --- app/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Dockerfile b/app/Dockerfile index e8c2b9b0..b9da8667 100644 --- a/app/Dockerfile +++ b/app/Dockerfile @@ -1,4 +1,4 @@ -FROM --platform=linux/amd64 nikolaik/python-nodejs:python3.10-nodejs21 +FROM nikolaik/python-nodejs:python3.10-nodejs21 # Set the working directory WORKDIR /app @@ -16,4 +16,4 @@ RUN cd frontend && npm install && cd .. RUN cd backend && python3 -m pip install -r requirements.txt && cd .. # Start your application -CMD ["/bin/bash", "-c", "source start-dev.sh"] \ No newline at end of file +CMD ["/bin/bash", "-c", "source start-dev.sh"] From 721a544da919027c17f50a8ab7b0d11ee2e76b7e Mon Sep 17 00:00:00 2001 From: Nayeon Kim <76769919+n-y-kim@users.noreply.github.com> Date: Fri, 15 Mar 2024 07:54:11 +0900 Subject: [PATCH 02/19] Update README.md local run --- README.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index efe3454c..3ff09a92 100644 --- a/README.md +++ b/README.md @@ -33,11 +33,16 @@ ### 로컬에서 앱 실행하기 1. `.env` 파일 만들기 -2. `app/start-dev.sh` 실행 +2. 가상환경 `venv` 만들기 +3. `app/start-dev.sh` 실행 ```bash + virtualenv venv # python3.10 으로! + cd app - source start.sh + + source venv/bin/activate + source start-dev.sh ``` 3. `http://localhost:50505` 로 접속 From 299a45f0019d55642b9ef10b1b507841e6dcc296 Mon Sep 17 00:00:00 2001 From: n-y-kim Date: Fri, 15 Mar 2024 08:11:09 +0900 Subject: [PATCH 03/19] Remove unused files and add .env --- .github/workflows/app.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/app.yaml b/.github/workflows/app.yaml index 56badab7..d0f7d9d9 100644 --- a/.github/workflows/app.yaml +++ b/.github/workflows/app.yaml @@ -10,6 +10,14 @@ jobs: steps: - name: Checkout source code uses: actions/checkout@v3 + with: + path: repo + + - name: Move app directory + run: mv repo/app . && rm -rf repo + + - name: Set up .env + run: echo "${{ secrets.ENV_SECRET }}" > .env - name: ACR build id: build-push-acr From 71f8ae7d0561f9c7e98c28a3fae6f179fdffebcf Mon Sep 17 00:00:00 2001 From: n-y-kim Date: Fri, 15 Mar 2024 08:12:17 +0900 Subject: [PATCH 04/19] Add workflow trigger path --- .github/workflows/app.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/app.yaml b/.github/workflows/app.yaml index d0f7d9d9..9675bfba 100644 --- a/.github/workflows/app.yaml +++ b/.github/workflows/app.yaml @@ -4,6 +4,7 @@ on: push: paths: - "app/**" + - ".github/workflows/app.yaml" jobs: build: runs-on: ubuntu-latest From 597eddaae8bac319018e7098edade598d49269a8 Mon Sep 17 00:00:00 2001 From: n-y-kim Date: Fri, 15 Mar 2024 08:15:58 +0900 Subject: [PATCH 05/19] Fix dir error --- .github/workflows/app.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/app.yaml b/.github/workflows/app.yaml index 9675bfba..8af63001 100644 --- a/.github/workflows/app.yaml +++ b/.github/workflows/app.yaml @@ -15,7 +15,7 @@ jobs: path: repo - name: Move app directory - run: mv repo/app . && rm -rf repo + run: mv repo/app . && mv repo/manifest . && rm -rf repo - name: Set up .env run: echo "${{ secrets.ENV_SECRET }}" > .env From 178cef4bf71bf22aab7d1ea9404fe65803f2f8dc Mon Sep 17 00:00:00 2001 From: n-y-kim Date: Fri, 15 Mar 2024 08:24:40 +0900 Subject: [PATCH 06/19] Update workflow --- .github/workflows/app.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/app.yaml b/.github/workflows/app.yaml index 8af63001..e8b4cba9 100644 --- a/.github/workflows/app.yaml +++ b/.github/workflows/app.yaml @@ -18,7 +18,7 @@ jobs: run: mv repo/app . && mv repo/manifest . && rm -rf repo - name: Set up .env - run: echo "${{ secrets.ENV_SECRET }}" > .env + run: echo "${{ secrets.ENV_SECRET }}" > app/.env - name: ACR build id: build-push-acr From 03efc2361dc40ae132cea759b4810a432ab848de Mon Sep 17 00:00:00 2001 From: n-y-kim Date: Fri, 15 Mar 2024 08:32:16 +0900 Subject: [PATCH 07/19] Check if .env file is in the folder --- app/start-prod.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/start-prod.sh b/app/start-prod.sh index a26ac957..77db0b0c 100644 --- a/app/start-prod.sh +++ b/app/start-prod.sh @@ -1,6 +1,7 @@ # Set environment variables source .env - +echo ls +cat .env # Activate virtual environment # source venv/bin/activate From 200127241adfac271cfd36734a69aac35dae1f52 Mon Sep 17 00:00:00 2001 From: n-y-kim Date: Fri, 15 Mar 2024 09:18:15 +0900 Subject: [PATCH 08/19] Update workflow --- .github/workflows/app.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/app.yaml b/.github/workflows/app.yaml index e8b4cba9..308affff 100644 --- a/.github/workflows/app.yaml +++ b/.github/workflows/app.yaml @@ -18,7 +18,10 @@ jobs: run: mv repo/app . && mv repo/manifest . && rm -rf repo - name: Set up .env - run: echo "${{ secrets.ENV_SECRET }}" > app/.env + run: echo "${{ secrets.ENV_SECRET }}" > .env + + - name: Check if .env file exists + run: pwd && ls -la - name: ACR build id: build-push-acr From c0a35f7b313f0e25cafe2f410f757484f49c3996 Mon Sep 17 00:00:00 2001 From: n-y-kim Date: Fri, 15 Mar 2024 09:30:31 +0900 Subject: [PATCH 09/19] Update workflow --- .github/workflows/app.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/app.yaml b/.github/workflows/app.yaml index 308affff..fdc6f4bb 100644 --- a/.github/workflows/app.yaml +++ b/.github/workflows/app.yaml @@ -18,7 +18,7 @@ jobs: run: mv repo/app . && mv repo/manifest . && rm -rf repo - name: Set up .env - run: echo "${{ secrets.ENV_SECRET }}" > .env + run: echo "${{ secrets.ENV_SECRET }}" > app/.env - name: Check if .env file exists run: pwd && ls -la From 129a93bad04f4e0cacbe666849bb902323a90ac6 Mon Sep 17 00:00:00 2001 From: n-y-kim Date: Fri, 15 Mar 2024 09:37:52 +0900 Subject: [PATCH 10/19] Update workflow --- .github/workflows/app.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/app.yaml b/.github/workflows/app.yaml index fdc6f4bb..4914c784 100644 --- a/.github/workflows/app.yaml +++ b/.github/workflows/app.yaml @@ -21,7 +21,7 @@ jobs: run: echo "${{ secrets.ENV_SECRET }}" > app/.env - name: Check if .env file exists - run: pwd && ls -la + run: cd app && ls - name: ACR build id: build-push-acr From 6377e6484ae581cc436872366628db526d3f9043 Mon Sep 17 00:00:00 2001 From: n-y-kim Date: Fri, 15 Mar 2024 09:56:04 +0900 Subject: [PATCH 11/19] update workflow --- .github/workflows/app.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/app.yaml b/.github/workflows/app.yaml index 4914c784..09050d2b 100644 --- a/.github/workflows/app.yaml +++ b/.github/workflows/app.yaml @@ -21,7 +21,7 @@ jobs: run: echo "${{ secrets.ENV_SECRET }}" > app/.env - name: Check if .env file exists - run: cd app && ls + run: cd app && ls -la - name: ACR build id: build-push-acr From 02c6bfd9601a7902ede659724fc786933e471e04 Mon Sep 17 00:00:00 2001 From: n-y-kim Date: Fri, 15 Mar 2024 10:24:38 +0900 Subject: [PATCH 12/19] Update dockerfile --- app/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Dockerfile b/app/Dockerfile index b9da8667..df603ae6 100644 --- a/app/Dockerfile +++ b/app/Dockerfile @@ -6,6 +6,7 @@ WORKDIR /app # Copy your application code to the container COPY . . +RUN ls /app # Install bash RUN apt-get update && apt-get install -y bash @@ -16,4 +17,4 @@ RUN cd frontend && npm install && cd .. RUN cd backend && python3 -m pip install -r requirements.txt && cd .. # Start your application -CMD ["/bin/bash", "-c", "source start-dev.sh"] +CMD ["/bin/bash", "-c", "source start-prod.sh"] From 280eeed4ce197b7da14ca4fdad08557123406ae0 Mon Sep 17 00:00:00 2001 From: n-y-kim Date: Fri, 15 Mar 2024 10:27:03 +0900 Subject: [PATCH 13/19] Update dockerfile --- app/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Dockerfile b/app/Dockerfile index df603ae6..c0c6f69e 100644 --- a/app/Dockerfile +++ b/app/Dockerfile @@ -6,7 +6,7 @@ WORKDIR /app # Copy your application code to the container COPY . . -RUN ls /app +RUN ls -a /app # Install bash RUN apt-get update && apt-get install -y bash From 8e4fe6ec20b6e52d3f73d93a8e18bd90d7dd7b42 Mon Sep 17 00:00:00 2001 From: n-y-kim Date: Fri, 15 Mar 2024 10:32:14 +0900 Subject: [PATCH 14/19] Update workflow --- .github/workflows/app.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/app.yaml b/.github/workflows/app.yaml index 09050d2b..93def5ff 100644 --- a/.github/workflows/app.yaml +++ b/.github/workflows/app.yaml @@ -23,6 +23,9 @@ jobs: - name: Check if .env file exists run: cd app && ls -la + - name: Copy .env file + run: cp .env ./app + - name: ACR build id: build-push-acr uses: azure/acr-build@v1 From a61797881c89209349c38450162153f5398df918 Mon Sep 17 00:00:00 2001 From: n-y-kim Date: Fri, 15 Mar 2024 11:10:23 +0900 Subject: [PATCH 15/19] Update workflow --- .github/workflows/app.yaml | 3 --- app/Dockerfile | 2 ++ 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/app.yaml b/.github/workflows/app.yaml index 93def5ff..09050d2b 100644 --- a/.github/workflows/app.yaml +++ b/.github/workflows/app.yaml @@ -23,9 +23,6 @@ jobs: - name: Check if .env file exists run: cd app && ls -la - - name: Copy .env file - run: cp .env ./app - - name: ACR build id: build-push-acr uses: azure/acr-build@v1 diff --git a/app/Dockerfile b/app/Dockerfile index c0c6f69e..3b38716f 100644 --- a/app/Dockerfile +++ b/app/Dockerfile @@ -5,8 +5,10 @@ WORKDIR /app # Copy your application code to the container COPY . . +COPY .env . RUN ls -a /app +RUN ls -a . # Install bash RUN apt-get update && apt-get install -y bash From b12115e97d71a0d9f2851c9f44eddede3d3cdce7 Mon Sep 17 00:00:00 2001 From: n-y-kim Date: Fri, 15 Mar 2024 16:56:18 +0900 Subject: [PATCH 16/19] Change acr push action to docker push --- .github/workflows/app.yaml | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/.github/workflows/app.yaml b/.github/workflows/app.yaml index 09050d2b..6ea4a5ff 100644 --- a/.github/workflows/app.yaml +++ b/.github/workflows/app.yaml @@ -23,25 +23,31 @@ jobs: - name: Check if .env file exists run: cd app && ls -la - - name: ACR build - id: build-push-acr - uses: azure/acr-build@v1 - with: - service_principal: ${{ secrets.SERVICE_PRINCIPAL }} - service_principal_password: ${{ secrets.SERVICE_PRINCIPAL_PASSWORD }} - tenant: ${{ secrets.TENANT }} - registry: ${{ secrets.REGISTRY }} - repository: ${{ secrets.REPOSITORY }} - image: chatbot-app - folder: app - branch: main - tag: ${{ github.sha }} + # - name: ACR build + # id: build-push-acr + # uses: azure/acr-build@v1 + # with: + # service_principal: ${{ secrets.SERVICE_PRINCIPAL }} + # service_principal_password: ${{ secrets.SERVICE_PRINCIPAL_PASSWORD }} + # tenant: ${{ secrets.TENANT }} + # registry: ${{ secrets.REGISTRY }} + # repository: ${{ secrets.REPOSITORY }} + # image: chatbot-app + # folder: app + # branch: main + # tag: ${{ githubsha }} - name: Azure login id: login uses: azure/login@v1.4.3 with: creds: ${{ secrets.AZURE_CREDENTIALS }} + + - name: Build and push Docker image to ACR + run: | + docker build -t ${{ secrets.REGISTRY }}.azurecr.io/${{ secrets.REPOSITORY }}/chatbot-app:${{ github.sha }} app + az acr login --name ${{ secrets.REGISTRY }} + docker push ${{ secrets.REGISTRY }}.azurecr.io/${{ secrets.REPOSITORY }}/chatbot-app:${{ github.sha }} - name: Set up kubelogin uses: azure/use-kubelogin@v1 From df97da521fafe9bd1d1fdae533a691e6c6530f5e Mon Sep 17 00:00:00 2001 From: n-y-kim Date: Fri, 15 Mar 2024 17:07:47 +0900 Subject: [PATCH 17/19] Update frontend to CloudClub --- app/frontend/src/components/Example/ExampleList.tsx | 6 +++--- app/frontend/src/pages/chat/Chat.tsx | 6 +++--- app/frontend/src/pages/layout/Layout.tsx | 2 +- docs/gh-action-setting.md | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/frontend/src/components/Example/ExampleList.tsx b/app/frontend/src/components/Example/ExampleList.tsx index 49c35cbd..5c35e5a4 100644 --- a/app/frontend/src/components/Example/ExampleList.tsx +++ b/app/frontend/src/components/Example/ExampleList.tsx @@ -3,9 +3,9 @@ import { Example } from "./Example"; import styles from "./Example.module.css"; const DEFAULT_EXAMPLES: string[] = [ - "What is included in my Northwind Health Plus plan that is not in standard?", - "What happens in a performance review?", - "What does a Product Manager do?" + "NCP 크레딧은 어떻게 받나요?", + "클라우드 클럽에 대해 소개해줘.", + "수료 기준이 어떻게 되나요?" ]; const GPT4V_EXAMPLES: string[] = [ diff --git a/app/frontend/src/pages/chat/Chat.tsx b/app/frontend/src/pages/chat/Chat.tsx index b046374b..a9fdbd82 100644 --- a/app/frontend/src/pages/chat/Chat.tsx +++ b/app/frontend/src/pages/chat/Chat.tsx @@ -280,8 +280,8 @@ const Chat = () => { {!lastQuestionRef.current ? (
) : ( @@ -347,7 +347,7 @@ const Chat = () => {
makeApiRequest(question)} /> diff --git a/app/frontend/src/pages/layout/Layout.tsx b/app/frontend/src/pages/layout/Layout.tsx index 157a6ffd..1d22d6f2 100644 --- a/app/frontend/src/pages/layout/Layout.tsx +++ b/app/frontend/src/pages/layout/Layout.tsx @@ -14,7 +14,7 @@ const Layout = () => {
-

GPT + Enterprise data | Sample

+

Cloud Club GPT