From 262ce1ba4dbf9e778a109f7f5fb6dffd16d0b434 Mon Sep 17 00:00:00 2001 From: nalbam Date: Thu, 22 Aug 2024 16:16:16 +0900 Subject: [PATCH] chore: Update Python version to 3.11 and serverless-python-requirements to 6.1.1 --- .env.example | 3 --- .github/workflows/5-sync-notion.yml | 2 +- .github/workflows/6-start-ingestion.yml | 2 +- .github/workflows/push.yml | 4 ++-- .gitignore | 5 ++++- package-lock.json | 11 ++++++----- package.json | 2 +- serverless.yml | 4 +++- 8 files changed, 18 insertions(+), 15 deletions(-) diff --git a/.env.example b/.env.example index ea3d4fc..b242fdb 100644 --- a/.env.example +++ b/.env.example @@ -13,6 +13,3 @@ MODEL_ID_IMAGE="stability.stable-diffusion-xl-v1" ALLOWED_CHANNEL_IDS="C000000,C000001" SYSTEM_MESSAGE="너는 AWSKRUG(AWS Korea User Group)에서 친절하게 도움을 주는 구름이(Gurumi)야." - -MAX_LEN_SLACK="3000" -MAX_LEN_BEDROCK="4000" diff --git a/.github/workflows/5-sync-notion.yml b/.github/workflows/5-sync-notion.yml index 79c8964..3fedc62 100644 --- a/.github/workflows/5-sync-notion.yml +++ b/.github/workflows/5-sync-notion.yml @@ -57,7 +57,7 @@ jobs: ${{ env.AWS_DEST_PATH }}/${{ env.NOTION_PAGE_NAME }}/ - name: Sync to AWS Bedrock Knowledge Base - if: env.ENABLE_NOTION_SYNC == 'Yes' + if: env.ENABLE_NOTION_SYNC == 'Yes' && env.KNOWLEDGE_BASE_ID != 'None' && env.DATA_SOURCE_ID != 'None' env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} diff --git a/.github/workflows/6-start-ingestion.yml b/.github/workflows/6-start-ingestion.yml index e2a3045..9fa4a99 100644 --- a/.github/workflows/6-start-ingestion.yml +++ b/.github/workflows/6-start-ingestion.yml @@ -30,7 +30,7 @@ jobs: python-version: 3.9 - name: Sync to AWS Bedrock Knowledge Base - if: env.ENABLE_NOTION_SYNC == 'Yes' + if: env.ENABLE_NOTION_SYNC == 'Yes' && env.KNOWLEDGE_BASE_ID != 'None' && env.DATA_SOURCE_ID != 'None' env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 2e4d8cd..21d08f8 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -33,10 +33,10 @@ jobs: with: fetch-depth: 0 - - name: Setup Python 3.9 🐍 + - name: Setup Python 3.11 🐍 uses: actions/setup-python@v5 with: - python-version: '3.9' + python-version: '3.11' - name: Install dependencies run: npm install diff --git a/.gitignore b/.gitignore index 8dfc142..047da22 100644 --- a/.gitignore +++ b/.gitignore @@ -32,11 +32,14 @@ dist/ *.log *.tmp +# serverless +.env +.serverless + # python venv *.pyc staticfiles -.env db.sqlite3 __pycache__ diff --git a/package-lock.json b/package-lock.json index d0a6da0..7e30599 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6,7 +6,7 @@ "": { "devDependencies": { "serverless-dotenv-plugin": "^6.0.0", - "serverless-python-requirements": "^6.1.0" + "serverless-python-requirements": "^6.1.1" } }, "node_modules/@aws-crypto/ie11-detection": { @@ -6610,10 +6610,11 @@ } }, "node_modules/serverless-python-requirements": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/serverless-python-requirements/-/serverless-python-requirements-6.1.0.tgz", - "integrity": "sha512-+cgHLXT7AnjAiOXF/lIuw9RWz7GrgTmgpq8FijzKuahEMzcK5J1p+8odiX0V3zMm4CWpFBxQrcCcGaq2zmw8dA==", + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/serverless-python-requirements/-/serverless-python-requirements-6.1.1.tgz", + "integrity": "sha512-SQsDKjoZXWvRJNsKL7NvHiMM+B6kG0a4RkVexhPCxId/rVMLVyz0UHg7v34kzaklfsXTQIkez+9x7HP3FwdRVQ==", "dev": true, + "license": "MIT", "dependencies": { "@iarna/toml": "^2.2.5", "appdirectory": "^0.1.0", @@ -6636,7 +6637,7 @@ "node": ">=12.0" }, "peerDependencies": { - "serverless": "^2.32 || 3" + "serverless": ">=2.32" } }, "node_modules/set-blocking": { diff --git a/package.json b/package.json index a39ff66..65a6fe2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "devDependencies": { "serverless-dotenv-plugin": "^6.0.0", - "serverless-python-requirements": "^6.1.0" + "serverless-python-requirements": "^6.1.1" } } diff --git a/serverless.yml b/serverless.yml index 567e6d8..5ca5919 100644 --- a/serverless.yml +++ b/serverless.yml @@ -1,8 +1,10 @@ +# org: nalbam +app: lambda-gureumi-ai-bot service: lambda-gurumi-ai-bot provider: name: aws region: us-east-1 - runtime: python3.9 + runtime: python3.11 # stage: prod # memorySize: 5120 timeout: 600