-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build the docker and push #33
Changes from 42 commits
c43536c
dfb13a2
6e47c1f
5ed04de
985c459
9293c74
cbde083
078d697
fa1df60
523f893
98383b7
118613c
2928f51
be3f179
60d5c74
3632a85
0eae4e9
37e7a78
a8d9ba2
305bd67
400e78b
88de713
9971cac
42ca604
f7d2dd4
0120421
8aeef5c
7afe9a7
0323ab6
50e4d7c
f41f091
fb542a3
7b39813
9b2a639
3d6d0a0
db18bd8
eee6049
444d4b3
d8f621f
94ef465
f9f7d4a
0b1cefb
dab514f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,18 @@ | ||
OPENAI_API_KEY=sk | ||
WEAVIATE_URL = | ||
WEAVIATE_API_KEY = | ||
ENVIRONMENT = docker | ||
ENV = docker | ||
POSTGRES_USER = bla | ||
POSTGRES_PASSWORD = bla | ||
POSTGRES_DB = bubu | ||
POSTGRES_HOST = localhost | ||
POSTGRES_HOST_DOCKER = postgres | ||
SEGMENT_KEY = Etl4WJwzOkeDPAjaOXOMgyU16hO7mV7B | ||
COG_ARCH_DIR = cognitive_architecture | ||
GRAPH_DB_URL = | ||
GRAPH_DB_PW = | ||
GRAPH_DB_USER = | ||
GRAPH_DB_URL = | ||
GRAPH_DB_PW = | ||
GRAPH_DB_USER = | ||
AWS_ACCESS_KEY_ID = | ||
AWS_SECRET_ACCESS_KEY = | ||
QDRANT_API_KEY | ||
QDRANT_API_URL | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,38 +23,38 @@ jobs: | |
steps: | ||
- name: Take code from repo | ||
uses: actions/checkout@v3 | ||
# - name: Set environment variable for stage | ||
# id: set-env | ||
# run: | | ||
# if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then | ||
# echo "STAGE=prd" >> $GITHUB_ENV | ||
# echo "::set-output name=stage::prd" | ||
# else | ||
# echo "STAGE=dev" >> $GITHUB_ENV | ||
# echo "::set-output name=stage::dev" | ||
# fi | ||
# - name: Use output | ||
# run: echo "The stage is ${{ steps.set-env.outputs.stage }}" | ||
# - name: Configure AWS credentials | ||
# uses: aws-actions/configure-aws-credentials@v1 | ||
# with: | ||
# role-to-assume: ${{ env.AWS_ROLE_DEV_CICD }} | ||
# aws-region: eu-west-1 | ||
# - name: Create Docker image and push to ECR | ||
# uses: ./.github/actions/image_builder | ||
# id: generate-promethai-docker | ||
# with: | ||
# stage: prd | ||
# aws_account_id: ${{ env.AWS_ACCOUNT_ID_DEV }} | ||
# should_publish: true | ||
# ecr_image_repo_name: promethai-prd-backend-promethai-backend-memory | ||
# dockerfile_location: ./level_2 | ||
# - name: Export Docker image tag | ||
# id: export-promethai-docker-tag | ||
# run: | | ||
# export DOCKER_TAG=$(cat /tmp/.DOCKER_IMAGE_VERSION) | ||
# echo "Docker tag is: $DOCKER_TAG" | ||
# echo "promethai_docker_tag_backend=$DOCKER_TAG" >> $GITHUB_OUTPUT | ||
- name: Set environment variable for stage | ||
id: set-env | ||
run: | | ||
if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then | ||
echo "STAGE=prd" >> $GITHUB_ENV | ||
echo "::set-output name=stage::prd" | ||
else | ||
echo "STAGE=dev" >> $GITHUB_ENV | ||
echo "::set-output name=stage::dev" | ||
fi | ||
- name: Use output | ||
run: echo "The stage is ${{ steps.set-env.outputs.stage }}" | ||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v1 | ||
with: | ||
role-to-assume: ${{ env.AWS_ROLE_DEV_CICD }} | ||
aws-region: eu-west-1 | ||
- name: Create Docker image and push to ECR | ||
uses: ./.github/actions/image_builder | ||
id: generate-promethai-docker | ||
with: | ||
stage: prd | ||
aws_account_id: ${{ env.AWS_ACCOUNT_ID_DEV }} | ||
should_publish: true | ||
ecr_image_repo_name: promethai-prd-backend-promethai-backend | ||
dockerfile_location: ./ | ||
- name: Export Docker image tag | ||
id: export-promethai-docker-tag | ||
run: | | ||
export DOCKER_TAG=$(cat /tmp/.DOCKER_IMAGE_VERSION) | ||
echo "Docker tag is: $DOCKER_TAG" | ||
echo "promethai_docker_tag_backend=$DOCKER_TAG" >> $GITHUB_OUTPUT | ||
|
||
# - name: Create Tag and Release | ||
# runs-on: ubuntu-latest | ||
|
@@ -78,22 +78,22 @@ jobs: | |
# with: | ||
# tag_name: ${{ steps.bump_version_and_push_tag.outputs.tag }} | ||
# release_name: Release ${{ steps.bump_version_and_push_tag.outputs.tag }} | ||
# outputs: | ||
# promethai_docker_tag_backend: ${{ steps.export-promethai-docker-tag.outputs.promethai_docker_tag_backend }} | ||
outputs: | ||
promethai_docker_tag_backend: ${{ steps.export-promethai-docker-tag.outputs.promethai_docker_tag_backend }} | ||
|
||
# apply_tf: | ||
# name: Trigger terraform apply workflow | ||
# runs-on: ubuntu-latest | ||
# needs: publish_docker_to_ecr | ||
# steps: | ||
# - name: TF apply workflow triggers step | ||
# uses: actions/github-script@v6 | ||
# with: | ||
# github-token: ${{ secrets.PAT_FOR_CROSS_REPOS_CICD_TRIGGERING }} | ||
# script: | | ||
# await github.rest.actions.createWorkflowDispatch({ | ||
# owner: 'topoteretes', | ||
# repo: 'PromethAI-Infra', | ||
# workflow_id: 'terraform.apply.yml', | ||
# ref: 'main' | ||
# }) | ||
apply_tf: | ||
name: Trigger terraform apply workflow | ||
runs-on: ubuntu-latest | ||
needs: publish_docker_to_ecr | ||
steps: | ||
- name: TF apply workflow triggers step | ||
uses: actions/github-script@v6 | ||
with: | ||
github-token: ${{ secrets.PAT_FOR_CROSS_REPOS_CICD_TRIGGERING }} | ||
script: | | ||
await github.rest.actions.createWorkflowDispatch({ | ||
owner: 'topoteretes', | ||
repo: 'PromethAI-Infra', | ||
workflow_id: 'terraform.apply.yml', | ||
ref: 'main' | ||
}) | ||
Comment on lines
78
to
+99
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The commented-out code for creating tags and releases is still present in the workflow file. If these steps have been implemented elsewhere, this commented-out code should be removed to avoid confusion and maintain cleanliness of the workflow file. - # - name: Create Tag and Release
- # runs-on: ubuntu-latest
- # uses: actions/checkout@v3
- # needs: publish_docker_to_ecr # ensure this job runs after Docker image is pushed
- # steps:
- # - name: Check out code
- # uses: actions/checkout@v3
- # - name: Bump version and push tag
- # id: bump_version_and_push_tag
- # uses: anothrNick/[email protected]
- # env:
- # GITHUB_TOKEN: ${{ secrets.PAT_FOR_CROSS_REPOS_CICD_TRIGGERING }}
- # WITH_V: true
- # DEFAULT_BUMP: 'minor' # or 'minor' or 'major'
- # - name: Create Release
- # id: create_release
- # uses: actions/create-release@v1
- # env:
- # GITHUB_TOKEN: ${{ secrets.PAT_FOR_CROSS_REPOS_CICD_TRIGGERING }}
- # with:
- # tag_name: ${{ steps.bump_version_and_push_tag.outputs.tag }}
- # release_name: Release ${{ steps.bump_version_and_push_tag.outputs.tag }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The search results indicate that the
ENVIRONMENT
variable is still being used in several places within the codebase:entrypoint.sh
README.md
(twice, in instructions)iterations/level_3/create_database.py
iterations/level_3/entrypoint.sh
iterations/level_3/database/database.py
iterations/level_2/entrypoint.sh
Given this information, the renaming of
ENVIRONMENT
toENV
in the.env.template
file is not consistently applied across the entire project. The references toENVIRONMENT
in theREADME.md
are likely instructional and may need to be updated to reflect the changes in the.env.template
file. The occurrences in the scripts and Python files suggest that the code still expects anENVIRONMENT
variable to be set.Based on these findings, the following issues have been identified:
ENVIRONMENT
variable is still being used in multiple places, which could lead to inconsistencies or errors if the environment variable is expected to beENV
now.README.md
file contains outdated instructions regarding theENVIRONMENT
variable.Analysis chain
Ensure that the new AWS and QDRANT API keys are handled securely and are not exposed in the codebase or version control. Verify that the renaming of
ENVIRONMENT
toENV
is consistently applied across the entire project.Scripts Executed
The following scripts were executed for the analysis:
Script:
Length of output: 55
Script:
Length of output: 495