Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 7 additions & 20 deletions DOCKER_SETUP.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,14 +161,7 @@ Some services require credential files (JSON files for GCP, OAuth, etc.). Follow
| `AWS_REGION` | AWS region (e.g., ap-south-1) |
| `AWS_KMS_ARN` | KMS key ARN for encryption |
| `AWS_QUEUE_URL` | SQS queue URL |
| `TRANSCRIPT_BUCKET_NAME` | Bucket for audio transcripts |
| `AUDIO_BUCKET_NAME` | Bucket for audio files |
| `AWS_GOLD_ASSET_BUCKET_NAME` | Bucket for gold/insights assets |
| `MODEL_STORAGE_BUCKET` | Bucket for ML models |
| `AGENT_YAML_BUCKET` | Bucket for agent YAML configs |
| `VOICE_AGENT_BUCKET` | Bucket for voice agent configs |
| `IMAGE_SEARCH_REFERENCE_IMAGES_BUCKET` | Bucket for reference images |
| `APPLICATION_BUCKET` | Bucket for API service applications |
| `APPLICATION_BUCKET` | S3 bucket for all application data (agents, transcripts, audio, models, etc.) |

#### GCP Configuration (if CLOUD_PROVIDER=gcp)

Expand All @@ -180,9 +173,8 @@ Some services require credential files (JSON files for GCP, OAuth, etc.). Follow
| `GCP_KMS_KEY_RING` | KMS key ring name |
| `GCP_KMS_CRYPTO_KEY` | KMS crypto key name |
| `GCP_KMS_CRYPTO_KEY_VERSION` | KMS key version (usually 1) |
| `GCP_ASSET_STORAGE_BUCKET` | Bucket for assets |
| `WORKFLOW_WORKER_TOPIC` | Workflow Pub/Sub topic |
| `APPLICATION_BUCKET` | Bucket for API service applications |
| `APPLICATION_BUCKET` | GCS bucket for all application data (agents, transcripts, audio, models, etc.) |

#### Optional Configurations

Expand Down Expand Up @@ -316,7 +308,7 @@ Uncomment the `inference_app` service in `docker-compose.yml` to enable.
|----------|-------------|
| `APP_ENV` | Application environment |
| `CLOUD_PROVIDER` | `aws` or `gcp` |
| `MODEL_STORAGE_BUCKET` | Bucket for ML models |
| `APPLICATION_BUCKET` | Bucket for ML models and inference data |

**If AWS**:

Expand Down Expand Up @@ -382,12 +374,9 @@ Uncomment the `inference_app` service in `docker-compose.yml` to enable.
}
```

3. **Create Buckets**:
3. **Create Bucket**:
```bash
aws s3 mb s3://your-transcript-bucket --region ap-south-1
aws s3 mb s3://your-audio-bucket --region ap-south-1
aws s3 mb s3://your-agent-yaml-bucket --region ap-south-1
# ... create other buckets as needed
aws s3 mb s3://your-application-bucket --region ap-south-1
```

### GCP Setup
Expand Down Expand Up @@ -419,11 +408,9 @@ Uncomment the `inference_app` service in `docker-compose.yml` to enable.
--iam-account=rootflo-backend@YOUR_PROJECT_ID.iam.gserviceaccount.com
```

4. **Create Buckets**:
4. **Create Bucket**:
```bash
gsutil mb -l asia-south1 gs://your-gcp-assets-bucket
gsutil mb -l asia-south1 gs://your-gcp-storage-bucket
# ... create other buckets as needed
gsutil mb -l asia-south1 gs://your-application-bucket
```

5. **Create Pub/Sub Topics**:
Expand Down
15 changes: 4 additions & 11 deletions docker-compose.sample.yml
Original file line number Diff line number Diff line change
Expand Up @@ -175,26 +175,19 @@ services:
- AWS_REGION=<YOUR_AWS_REGION>
- AWS_KMS_ARN=<YOUR_AWS_KMS_ARN>
- AWS_QUEUE_URL=<YOUR_AWS_QUEUE_URL>
- TRANSCRIPT_BUCKET_NAME=<YOUR_TRANSCRIPT_BUCKET>
- AUDIO_BUCKET_NAME=<YOUR_AUDIO_BUCKET>
- AWS_GOLD_ASSET_BUCKET_NAME=<YOUR_ASSETS_BUCKET>
- MODEL_STORAGE_BUCKET=<YOUR_MODEL_BUCKET>
- AGENT_YAML_BUCKET=<YOUR_AGENT_YAML_BUCKET>
- VOICE_AGENT_BUCKET=<YOUR_VOICE_AGENT_BUCKET>
- IMAGE_SEARCH_REFERENCE_IMAGES_BUCKET=<YOUR_IMAGES_BUCKET>
- APPLICATION_BUCKET=<YOUR_APPLICATION_BUCKET>

# GCP Configuration (if CLOUD_PROVIDER=gcp)
- GCP_PROJECT_ID=<YOUR_GCP_PROJECT_ID>
- GCP_LOCATION=<YOUR_GCP_LOCATION>
- GOOGLE_APPLICATION_CREDENTIALS=/app/credentials/gcp-service-account.json
- GCP_ASSET_STORAGE_BUCKET=<YOUR_GCP_ASSETS_BUCKET>
- GCP_KMS_KEY_RING=<YOUR_KEY_RING>
- GCP_KMS_CRYPTO_KEY=<YOUR_CRYPTO_KEY>
- GCP_KMS_CRYPTO_KEY_VERSION=<YOUR_GCP_KMS_CRYPTO_KEY_VERSION>
- GCP_GOLD_TOPIC_ID=<YOUR_GOLD_TOPIC>
- GCP_EMAIL_TOPIC_ID=<YOUR_EMAIL_TOPIC>
- WORKFLOW_WORKER_TOPIC=<YOUR_WORKFLOW_TOPIC>
- APPLICATION_BUCKET=<YOUR_APPLICATION_BUCKET>

# ============================================
# LLM/AI Configuration
Expand Down Expand Up @@ -415,13 +408,13 @@ services:
- AWS_ACCESS_KEY_ID=<YOUR_AWS_ACCESS_KEY>
- AWS_SECRET_ACCESS_KEY=<YOUR_AWS_SECRET_KEY>
- AWS_REGION=<YOUR_AWS_REGION>
- MODEL_STORAGE_BUCKET=<YOUR_MODEL_BUCKET>
- APPLICATION_BUCKET=<YOUR_APPLICATION_BUCKET>

# GCP Configuration (if CLOUD_PROVIDER=gcp)
- GCP_PROJECT_ID=<YOUR_GCP_PROJECT_ID>
- GCP_LOCATION=<YOUR_GCP_LOCATION>
- GOOGLE_APPLICATION_CREDENTIALS=/app/credentials/gcp-service-account.json
- MODEL_STORAGE_BUCKET=<YOUR_MODEL_BUCKET>
- APPLICATION_BUCKET=<YOUR_APPLICATION_BUCKET>

networks:
- floware-network
Expand Down
22 changes: 3 additions & 19 deletions wavefront/server/apps/floware/floware/config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -80,23 +80,14 @@ url=${WEB_URL}
[aws]
aws_access_key=${AWS_ACCESS_KEY_ID}
aws_secret_key=${AWS_SECRET_ACCESS_KEY}
transcript_bucket_name=${TRANSCRIPT_BUCKET_NAME}
aws_asset_storage_bucket=${AWS_GOLD_ASSET_BUCKET_NAME}
audio_bucket_name=${AUDIO_BUCKET_NAME}
model_storage_bucket=${MODEL_STORAGE_BUCKET}
queue_url=${AWS_QUEUE_URL}
region=${AWS_REGION}

[gcp]
transcript_bucket_name=${TRANSCRIPT_BUCKET_NAME}
audio_bucket_name=${AUDIO_BUCKET_NAME}
model_storage_bucket=${MODEL_STORAGE_BUCKET}
gcp_service_account_json = ${GCP_SERVICE_ACCOUNT_JSON}
gcp_asset_storage_bucket = ${GCP_ASSET_STORAGE_BUCKET}
gcp_project_id = ${GCP_PROJECT_ID}
gold_topic_id=${GCP_GOLD_TOPIC_ID}
email_topic_id=${GCP_EMAIL_TOPIC_ID}
gcp_storage_bucket_name = ${GCP_STORAGE_BUCKET_NAME}
gcp_location = ${GCP_LOCATION}
gcp_key_ring = ${GCP_KMS_KEY_RING}
gcp_crypto_key = ${GCP_KMS_CRYPTO_KEY}
Expand All @@ -110,6 +101,9 @@ dataset_id=${BQ_DATASET_ID}
[cloud_config]
cloud_provider=${CLOUD_PROVIDER}

[storage]
application_bucket=${APPLICATION_BUCKET}
Comment on lines +104 to +105
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify config.ini changes and bucket reference updates

echo "=== Checking config.ini lines 104-105 ==="
cat -n wavefront/server/apps/floware/floware/config.ini | sed -n '100,110p'

echo ""
echo "=== Searching for removed bucket configuration references ==="
echo ""

# Search for old bucket references
echo "agent_yaml_bucket:"
rg -n "agent_yaml_bucket" --type py 2>/dev/null | head -20

echo ""
echo "voice_agent_bucket:"
rg -n "voice_agent_bucket" --type py 2>/dev/null | head -20

echo ""
echo "reference_images_bucket:"
rg -n "reference_images_bucket" --type py 2>/dev/null | head -20

echo ""
echo "aws_asset_storage_bucket:"
rg -n "aws_asset_storage_bucket" --type py 2>/dev/null | head -20

echo ""
echo "gcp_asset_storage_bucket:"
rg -n "gcp_asset_storage_bucket" --type py 2>/dev/null | head -20

echo ""
echo "model_storage_bucket:"
rg -n "model_storage_bucket" --type py 2>/dev/null | head -20

echo ""
echo "transcript_bucket_name:"
rg -n "transcript_bucket_name" --type py 2>/dev/null | head -20

echo ""
echo "audio_bucket_name:"
rg -n "audio_bucket_name" --type py 2>/dev/null | head -20

echo ""
echo "=== Checking application_bucket usage ==="
rg -n "application_bucket" --type py 2>/dev/null | head -30

Repository: rootflo/wavefront

Length of output: 9624


Update bucket configuration references in multiple modules to use new [storage] section.

The config.ini changes are correct, but verification reveals that several code locations still reference the old bucket configuration paths that have been removed:

  • aws_asset_storage_bucket: knowledge_base_document_controller.py:308, outlook_service.py:258
  • gcp_asset_storage_bucket: knowledge_base_document_controller.py:306, outlook_service.py:256, floware/config_service.py:25/47/74
  • model_storage_bucket: inference_app/inference_controller.py:67-70

These references must be updated to use config['storage']['application_bucket'] (or config.storage.application_bucket). Some modules like insights, voice_agents, and plugins have been properly updated, but knowledge_base, auth, and inference_app modules have not.

Additionally, test configuration files contain old bucket references that should be cleaned up for consistency.

🤖 Prompt for AI Agents
In wavefront/server/apps/floware/floware/config.ini around lines 104-105 the
bucket was moved into the [storage] section
(application_bucket=${APPLICATION_BUCKET}); update all code locations still
reading the old config keys to reference the new path: replace uses of
aws_asset_storage_bucket, gcp_asset_storage_bucket, and model_storage_bucket
with config['storage']['application_bucket'] (or
config.storage.application_bucket) — specifically change
knowledge_base_document_controller.py lines ~306-308, outlook_service.py lines
~256-258, floware/config_service.py lines ~25/47/74, and
inference_app/inference_controller.py lines ~67-70 to read from
config['storage']['application_bucket']; also remove or update old bucket keys
in test config files so tests use the new [storage].application_bucket key for
consistency.


[email]
email_provider=${EMAIL_PROVIDER}

Expand Down Expand Up @@ -142,9 +136,6 @@ openai_model_name=${OPENAI_MODEL_NAME}
[leads]
enabled=${LEADS_ENABLED}

[agents]
agent_yaml_bucket=${AGENT_YAML_BUCKET}

[auth]
max_failed_attempts=${MAX_FAILED_ATTEMPTS}
lockout_duration_hours=${LOCKOUT_DURATION_HOURS}
Expand All @@ -156,15 +147,8 @@ inference_service_url=${INFERENCE_SERVICE_URL}
[embedding_url]
embedding_service_url=${EMBEDDING_SERVICE_URL}

[image_search]
reference_images_bucket = ${IMAGE_SEARCH_REFERENCE_IMAGES_BUCKET}

[voice_agents]
call_processing_base_url=${CALL_PROCESSING_BASE_URL}
voice_agent_bucket=${VOICE_AGENT_BUCKET}

[api_service]
application_bucket=${APPLICATION_BUCKET}

[hermes]
url=${HERMES_URL:http://localhost:8080/flo-hermes}
Expand Down
21 changes: 15 additions & 6 deletions wavefront/server/apps/floware/floware/services/config_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,21 @@ def __init__(

def _get_gcp_credentials(self) -> dict[str, Any]:
config_credentials = self.config.get('gcp')
storage_config = self.config.get('storage')
if not isinstance(config_credentials, dict):
raise HTTPException(status_code=500, detail='GCP configuration is missing')
if not config_credentials.get(
'gcp_asset_storage_bucket'
) or not config_credentials.get('config_file_name'):
raise HTTPException(status_code=500, detail='Incomplete GCP configuration')
if not isinstance(storage_config, dict):
raise HTTPException(
status_code=500, detail='Storage configuration is missing'
)
if not storage_config.get('application_bucket') or not config_credentials.get(
'config_file_name'
):
raise HTTPException(
status_code=500, detail='Incomplete GCP or storage configuration'
)
# Merge storage config into credentials dict for backward compatibility
config_credentials['application_bucket'] = storage_config['application_bucket']
return config_credentials

async def store_app_config(
Expand All @@ -44,7 +53,7 @@ async def store_app_config(
if file_content:
self.cloud_manager.save_small_file(
file_content,
config_credentials['gcp_asset_storage_bucket'],
config_credentials['application_bucket'],
config_credentials['config_file_name'],
)
# if atleast one icon or file_content is there then allow the all_config to be saved
Expand All @@ -71,7 +80,7 @@ async def get_app_config(self):
config_credentials = self._get_gcp_credentials()
# Generate new presigned URL
url = self.cloud_manager.generate_presigned_url(
config_credentials['gcp_asset_storage_bucket'],
config_credentials['application_bucket'],
config_path,
'get',
)
Expand Down
6 changes: 4 additions & 2 deletions wavefront/server/apps/floware/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,12 @@ def mock_config_repository():
def mock_config():
"""Mock configuration for testing"""
return {
'storage': {
'application_bucket': 'test-bucket',
},
'gcp': {
'gcp_asset_storage_bucket': 'test-bucket',
'config_file_name': 'config.png',
}
},
}


Expand Down
7 changes: 2 additions & 5 deletions wavefront/server/apps/inference_app/inference_app/config.ini
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
[aws]
model_storage_bucket=${MODEL_STORAGE_BUCKET}

[gcp]
model_storage_bucket=${MODEL_STORAGE_BUCKET}
[storage]
application_bucket=${APPLICATION_BUCKET}

[cloud_config]
cloud_provider=${CLOUD_PROVIDER}
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,7 @@ async def generic_inference_handler(
),
):
try:
provider = config['cloud_config']['cloud_provider']
model_storage_bucket = (
config['gcp']['model_storage_bucket']
if provider.lower() == 'gcp'
else config['aws']['model_storage_bucket']
)
model_storage_bucket = config['storage']['application_bucket']

logger.info(
f'Loading model from bucket: {model_storage_bucket}, model_info: {payload.model_info}'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,16 @@ app_env = ${APP_ENV:dev}
passthrough_secret = ${PASSTHROUGH_SECRET}
batch_size = ${BATCH_SIZE:5}

[agents]
agent_yaml_bucket = ${AGENT_YAML_BUCKET}

[cloud_config]
cloud_provider = ${CLOUD_PROVIDER}

[storage]
application_bucket = ${APPLICATION_BUCKET}

[gcp_config]
project_id = ${GCP_PROJECT_ID}
pubsub_subscription_id = ${GCP_PUBSUB_SUBSCRIPTION_ID}
pubsub_topic_id = ${GCP_PUBSUB_TOPIC_ID}
bucket = ${APPLICATION_BUCKET}

[gcp]
gcp_asset_storage_bucket = ${APPLICATION_BUCKET}

[hermes]
url=${HERMES_URL}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class AgentsContainer(containers.DeclarativeContainer):
namespace_service=namespace_service,
cloud_storage_manager=cloud_storage_manager,
cache_manager=cache_manager,
bucket_name=config.agents.agent_yaml_bucket,
bucket_name=config.storage.application_bucket,
)

# Agent inference service
Expand All @@ -57,7 +57,7 @@ class AgentsContainer(containers.DeclarativeContainer):
namespace_service=namespace_service,
cloud_storage_manager=cloud_storage_manager,
cache_manager=cache_manager,
bucket_name=config.agents.agent_yaml_bucket,
bucket_name=config.storage.application_bucket,
agent_crud_service=agent_crud_service,
tool_loader=tool_loader,
)
Expand All @@ -66,7 +66,7 @@ class AgentsContainer(containers.DeclarativeContainer):
WorkflowInferenceService,
cloud_storage_manager=cloud_storage_manager,
cache_manager=cache_manager,
bucket_name=config.agents.agent_yaml_bucket,
bucket_name=config.storage.application_bucket,
agent_crud_service=agent_crud_service,
tool_loader=tool_loader,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,11 +252,7 @@ async def _process_and_publish_emails(
f'kb_{existing_kb.id}/{message.id}/{message.conversation_id}'
)
# Get bucket name from config
bucket_name = (
config['gcp']['gcp_asset_storage_bucket']
if config['cloud_config']['cloud_provider'] == 'gcp'
else config['aws']['aws_asset_storage_bucket']
)
bucket_name = config['storage']['application_bucket']

# Get topic/queue URL from config
topic_id = (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ class GoldContainer(containers.DeclarativeContainer):

aws_image_service = providers.Singleton(
AWSImageService,
bucket_name=config.aws.aws_asset_storage_bucket,
bucket_name=config.storage.application_bucket,
queue_url=config.aws.queue_url,
region=config.aws.region,
)

gcp_image_service = providers.Singleton(
GCPImageService,
bucket_name=config.gcp.gcp_asset_storage_bucket,
bucket_name=config.storage.application_bucket,
project_id=config.gcp.gcp_project_id,
topic_id=config.gcp.gold_topic_id,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,7 @@ async def model_loading(
),
cache_manager: CacheManager = Depends(Provide[CommonContainer.cache_manager]),
):
provider = config['cloud_config']['cloud_provider']
model_storage_bucket = (
config['gcp']['model_storage_bucket']
if provider.lower() == 'gcp'
else config['aws']['model_storage_bucket']
)
model_storage_bucket = config['storage']['application_bucket']
if cache_manager.get_str(f"model_name_key_{model_file.filename.split('.')[0]}"):
return JSONResponse(
status_code=status.HTTP_400_BAD_REQUEST,
Expand Down
3 changes: 1 addition & 2 deletions wavefront/server/modules/inference_module/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,7 @@ def setup_containers(test_engine, test_session, test_user_id, test_session_id):
mock_config_service = Mock()
mock_config_service.config = {
'cloud_config': {'cloud_provider': 'gcp'},
'gcp': {'model_storage_bucket': 'test_bucket'},
'aws': {'model_storage_bucket': 'test_bucket'},
'storage': {'application_bucket': 'test_bucket'},
}
inference_container.config.override(
providers.Singleton(lambda: mock_config_service.config)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@ class InsightsContainer(containers.DeclarativeContainer):
cloud_service = providers.Singleton(
AWSServices,
insights_service=insights_service,
transcript_bucket_name=config.aws.transcript_bucket_name,
audio_bucket_name=config.aws.audio_bucket_name,
transcript_bucket_name=config.storage.application_bucket,
audio_bucket_name=config.storage.application_bucket,
)
elif cloud_provider == 'gcp':
cloud_service = providers.Singleton(
GCPServices,
insights_service=insights_service,
transcript_bucket_name=config.gcp.transcript_bucket_name,
audio_bucket_name=config.gcp.audio_bucket_name,
transcript_bucket_name=config.storage.application_bucket,
audio_bucket_name=config.storage.application_bucket,
)

colud_manager = providers.Singleton(
Expand Down
Loading