From e3891b2ad91c10ec57f95a046d635e8681a3871e Mon Sep 17 00:00:00 2001 From: Marcin Kozlowski Date: Mon, 2 Dec 2024 12:46:51 +0100 Subject: [PATCH] Cleanup, removed GPT api env var --- cloudbuild.yaml | 64 ------------------------------- dockerhub/docker-compose.yml | 2 - gcrio/README.md | 17 --------- gcrio/docker-compose.yml | 74 ------------------------------------ 4 files changed, 157 deletions(-) delete mode 100644 cloudbuild.yaml delete mode 100644 gcrio/README.md delete mode 100644 gcrio/docker-compose.yml diff --git a/cloudbuild.yaml b/cloudbuild.yaml deleted file mode 100644 index 9a9d1a36..00000000 --- a/cloudbuild.yaml +++ /dev/null @@ -1,64 +0,0 @@ -steps: - # Step 1: Access the service account key from Secret Manager - - name: 'gcr.io/cloud-builders/gcloud' - entrypoint: 'bash' - args: - - '-c' - - | - gcloud secrets versions access latest --secret=ead8dc959ea862a93ac752d32753373eae458033 > /key.json - - # Step 2: Authenticate Docker with your service account key and configure Docker credentials - - name: 'gcr.io/cloud-builders/gcloud' - entrypoint: 'bash' - args: - - '-c' - - | - gcloud auth activate-service-account --key-file=/key.json - gcloud config set project ${PROJECT_ID} - gcloud auth configure-docker - - # Step 3: Set up Docker Buildx - - name: 'gcr.io/cloud-builders/docker' - args: ['buildx', 'create', '--name', 'mybuilder'] - - - name: 'gcr.io/cloud-builders/docker' - args: ['buildx', 'use', 'mybuilder'] - - - name: 'gcr.io/cloud-builders/docker' - args: ['buildx', 'inspect', '--bootstrap'] - - # Step 4: Build and push worker-cli image to GCR with multiple tags - - name: 'gcr.io/cloud-builders/docker' - id: Build and push worker-cli image to GCR - args: - [ - 'buildx', 'build', '.', - '--platform', 'linux/amd64,linux/arm64', - '--tag', 'gcr.io/${PROJECT_ID}/${_IMAGE_NAME}:amd64-${_TAG}', - '--tag', 'gcr.io/${PROJECT_ID}/${_IMAGE_NAME}:arm64-${_TAG}', - '--tag', 'gcr.io/${PROJECT_ID}/${_IMAGE_NAME}:${_TAG}', - '--push', - '--file', 'docker/docker/worker-cli/Dockerfile' - ] - - # Optional Step 5: Save the key to a specified location (like a Cloud Storage bucket) - - name: 'gcr.io/cloud-builders/gcloud' - entrypoint: 'bash' - args: - - '-c' - - | - gsutil cp /key.json gs://betterscan/ - -images: - - 'gcr.io/${PROJECT_ID}/${_IMAGE_NAME}:${_TAG}' - - 'gcr.io/${PROJECT_ID}/${_IMAGE_NAME}:amd64-${_TAG}' - - 'gcr.io/${PROJECT_ID}/${_IMAGE_NAME}:arm64-${_TAG}' - -options: - defaultLogsBucketBehavior: 'REGIONAL_USER_OWNED_BUCKET' - -substitutions: - _PAT: '' - _DOCKER_USERNAME: '' - _IMAGE_NAME: 'betterscan-worker-cli' - _TAG: 'latest' diff --git a/dockerhub/docker-compose.yml b/dockerhub/docker-compose.yml index 7321d881..ae0710da 100644 --- a/dockerhub/docker-compose.yml +++ b/dockerhub/docker-compose.yml @@ -3,7 +3,6 @@ services: image: tcosolutions/betterscan-server:latest restart: always environment: - OPENAI_GPT_API: ${OPENAI_GPT_API} QC_SETTINGS: /srv/betterscan/quantifiedcode/settings/default.yml depends_on: postgres: @@ -46,7 +45,6 @@ services: stack: -1 restart: always environment: - OPENAI_GPT_API: ${OPENAI_GPT_API} hostname: worker_1 depends_on: rabbitmq3: diff --git a/gcrio/README.md b/gcrio/README.md deleted file mode 100644 index 0e028eb1..00000000 --- a/gcrio/README.md +++ /dev/null @@ -1,17 +0,0 @@ -Setup - -# For amd64 -export ARCH=amd64 -docker-compose up - -# For arm64 -export ARCH=arm64 -docker-compose up - - -Go in the Bowser to: - -`http://localhost:5000` - -Signup up and login to use your local installation. - diff --git a/gcrio/docker-compose.yml b/gcrio/docker-compose.yml deleted file mode 100644 index 4396695a..00000000 --- a/gcrio/docker-compose.yml +++ /dev/null @@ -1,74 +0,0 @@ -x-platform: &platform - platform: ${PLATFORM:-linux/amd64} - -services: - server: - image: gcr.io/YOUR_PROJECT_ID/betterscan-server:${ARCH:-amd64}-latest - restart: always - environment: - OPENAI_GPT_API: ${OPENAI_GPT_API} - depends_on: - - postgres - working_dir: /srv/betterscan/ - entrypoint: sh - command: -c "mkdir -p data1/repositories data2/tasks setup_state && if [ -f /srv/betterscan/setup_state/setup_done ]; then python3.8 /srv/betterscan/manage.py runserver; else python3.8 /srv/betterscan/manage.py setup && touch /srv/betterscan/setup_state/setup_done; fi" - ports: - - 5001:5000 - volumes: - - ./data1:/srv/betterscan/quantifiedcode/data/ - - ./data2:/srv/betterscan/quantifiedcode/backend/data/tasks - - ./setup_state:/srv/betterscan/setup_state - <<: *platform - - postgres: - image: postgres:13.2 - restart: always - environment: - POSTGRES_DB: qc - POSTGRES_USER: qc - POSTGRES_PASSWORD: qc - PGDATA: /var/lib/postgresql/data/pgdata - ports: - - "5432:5432" - volumes: - - db-data:/var/lib/postgresql/data - - worker_1: - image: gcr.io/YOUR_PROJECT_ID/betterscan-worker:${ARCH:-amd64}-latest - ulimits: - stack: -1 - restart: always - environment: - OPENAI_GPT_API: ${OPENAI_GPT_API} - hostname: worker_1 - depends_on: - - rabbitmq3 - - postgres - - server - working_dir: /srv/betterscan/ - entrypoint: sh - command: -c "python3.8 /srv/betterscan/manage.py runworker" - volumes: - - ./data1:/srv/betterscan/quantifiedcode/data/ - - ./data2:/srv/betterscan/quantifiedcode/backend/data/tasks - <<: *platform - - rabbitmq3: - container_name: "rabbitmq" - image: rabbitmq:3.8-management-alpine - environment: - - RABBITMQ_DEFAULT_USER=qc - - RABBITMQ_DEFAULT_PASS=qc - ports: - - 5672:5672 - - 15672:15672 - healthcheck: - test: [ "CMD", "nc", "-z", "localhost", "5672" ] - interval: 5s - timeout: 15s - retries: 1 - -volumes: - db-data: - driver: local -