diff --git a/Requirements.md b/ProjectRequirements.md similarity index 100% rename from Requirements.md rename to ProjectRequirements.md diff --git a/deployment/cloud-run/service.yaml b/deployment/cloud-run/service.yaml index 947752e..b7f9c3a 100644 --- a/deployment/cloud-run/service.yaml +++ b/deployment/cloud-run/service.yaml @@ -18,8 +18,10 @@ spec: value: "gen-lang-client-0424120530" - name: FIRESTORE_CREDENTIALS_FILE value: "/var/secrets/google/key.json" + - name: GOOGLE_APPLICATION_CREDENTIALS + value: "/var/secrets/google/key.json" - name: GCS_BUCKET_NAME - value: "your-bucket-name" + value: "gen-lang-client-0424120530-images" - name: API_KEY_SECRET valueFrom: secretKeyRef: @@ -31,8 +33,26 @@ spec: name: sereact-vector-db-key key: latest - name: VECTOR_DB_ENVIRONMENT - value: "your-pinecone-env" + value: "gcp-starter" - name: VECTOR_DB_INDEX_NAME value: "image-embeddings" - name: LOG_LEVEL - value: "INFO" \ No newline at end of file + value: "INFO" + volumeMounts: + - name: gcp-sa-key + mountPath: /var/secrets/google + readOnly: true + startupProbe: + httpGet: + path: / + port: 8000 + initialDelaySeconds: 20 + periodSeconds: 5 + failureThreshold: 10 + volumes: + - name: gcp-sa-key + secret: + secretName: sereact-gcp-sa-key + items: + - key: latest + path: key.json \ No newline at end of file diff --git a/scripts/start.sh b/scripts/start.sh new file mode 100644 index 0000000..ad16ae0 --- /dev/null +++ b/scripts/start.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +# Activate virtual environment based on platform +if [ -d "venv" ]; then + if [ -f "venv/Scripts/activate" ]; then + # Windows with Git Bash + source venv/Scripts/activate + else + # Linux/macOS + source venv/bin/activate + fi + echo "Virtual environment activated" +else + echo "WARNING: Virtual environment not found!" +fi + +# Set development environment variables +export ENVIRONMENT=development +export LOG_LEVEL=DEBUG + +# Check for .env file and load it +if [ -f ".env" ]; then + echo "Loading environment variables from .env file" + export $(grep -v '^#' .env | xargs) +else + echo "WARNING: No .env file found. Using defaults or environment variables." +fi + +# Start server in development mode with hot reloading +echo "Starting development server..." +uvicorn main:app --host 0.0.0.0 --port 8000 --reload \ No newline at end of file diff --git a/temp_key.json b/temp_key.json new file mode 100644 index 0000000..54970f7 --- /dev/null +++ b/temp_key.json @@ -0,0 +1 @@ +{"type":"service_account","project_id":"gen-lang-client-0424120530","private_key_id":"placeholder","private_key":"placeholder","client_email":"placeholder@gen-lang-client-0424120530.iam.gserviceaccount.com","client_id":"placeholder","auth_uri":"https://accounts.google.com/o/oauth2/auth","token_uri":"https://oauth2.googleapis.com/token","auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs","client_x509_cert_url":"placeholder","universe_domain":"googleapis.com"}