-
Notifications
You must be signed in to change notification settings - Fork 1
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
Update services #48
base: main
Are you sure you want to change the base?
Update services #48
Conversation
WalkthroughThe pull request introduces changes to multiple configuration files, primarily focusing on logging settings. The logging level for console output has been modified from "debug" to "info" in several configuration files, while the file logging settings remain unchanged. Additionally, some configuration files have undergone structural changes, including the addition of new logging sections and the removal of obsolete settings. The Changes
Possibly related PRs
Suggested labels
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 3
🧹 Outside diff range and nitpick comments (9)
configuration/virtual-plc/config.json (1)
8-10
: Consider using a relative or configurable path for log files.The hardcoded absolute path
/home/bringauto/virtual-plc/log/
might cause issues in different deployment environments. Consider:
- Using a relative path
- Making it configurable through environment variables
- Using a standard logging directory (e.g.,
/var/log/
)Example using environment variable:
- "path": "/home/bringauto/virtual-plc/log/" + "path": "${VIRTUAL_PLC_LOG_PATH:-/var/log/virtual-plc/}"configuration/integration-layer/config.json (2)
Line range hint
15-29
: Consider security improvements for API keys.The configuration contains hardcoded API keys ("ProtocolStaticAccessKey", "ManagementStaticAccessKey"). While this might be acceptable for development, it's recommended to use environment variables or secrets management for production deployments.
Consider using environment variable substitution in the config:
"protocol": { "host": "http://http-api:8080/v2/protocol", - "api_key": "ProtocolStaticAccessKey", + "api_key": "${PROTOCOL_API_KEY}", ... }, "management": { "host": "http://management-api:8081/v2/management", - "api_key": "ManagementStaticAccessKey" + "api_key": "${MANAGEMENT_API_KEY}" }
Line range hint
8-10
: Review log path configuration for containerization.The hardcoded log path
/home/bringauto/log/
might not be optimal for containerized environments. Consider making it configurable through environment variables or mounting it to a volume path that follows container best practices.Consider using environment variable substitution:
"file": { "level": "debug", "use": true, - "path": "/home/bringauto/log/" + "path": "${LOG_PATH:-/var/log/bringauto/}" }configuration/http-api/config.json (2)
Line range hint
15-20
: Consider externalizing sensitive configuration.The configuration file contains sensitive information like database credentials and Keycloak settings. Consider moving these to environment variables or a secure configuration management system.
Example approach using environment variables:
{ "database": { "server": { "username": "${DB_USERNAME}", "password": "${DB_PASSWORD}" } }, "security": { "client_id": "${KEYCLOAK_CLIENT_ID}", "client_secret_key": "${KEYCLOAK_SECRET}" } }Also applies to: 33-39
Line range hint
41-43
: Remove trailing newlines.The JSON file contains multiple trailing newlines at the end. While this doesn't affect functionality, it's recommended to maintain a single newline at the end of the file for consistency with JSON formatting standards.
configuration/module-gateway/config.json (1)
2-11
: Consider making the log path configurable via environment variables.The logging configuration structure looks good and aligns with the standardization across other services. However, the hard-coded log path
/home/bringauto/log/
might cause issues in different environments.Consider:
- Making the path configurable via environment variables
- Documenting the required permissions for the log directory
- Standardizing the trailing slash usage in paths
"file": { "level": "debug", "use": true, - "path": "/home/bringauto/log/" + "path": "${LOG_PATH:-/home/bringauto/log}" }configuration/virtual-vehicle-utility/config.json (1)
2-12
: LGTM! Consider making the log path configurable.The new logging structure is well-organized with separate console and file configurations. However, the hardcoded log path
/virtual-vehicle-utility/log/
might be inflexible for different deployment scenarios.Consider making it configurable through environment variables:
"file": { "level": "debug", "use": true, - "path": "/virtual-vehicle-utility/log/" + "path": "${LOG_PATH:-/virtual-vehicle-utility/log/}" }configuration/external-server/config.json (2)
Line range hint
21-42
: Security: Consider using environment variables for API keys.The configuration contains hardcoded API keys that are identical across all modules. This poses a security risk and makes key rotation difficult.
Consider:
- Using environment variables for API keys
- Using unique keys for each module
- Implementing a secure key management solution
Example modification:
"config": { "api_url": "http://http-api:8080/v2/protocol", - "api_key": "ProtocolStaticAccessKey", + "api_key": "${MISSION_MODULE_API_KEY}",
Line range hint
21-42
: Refactor: Consider extracting common module configurations.The configuration for each module contains identical settings for request thresholds, delays, and API endpoints.
Consider:
- Moving common settings to a shared configuration section
- Having module-specific sections only override necessary values
- Using JSON schema validation to ensure consistency
Example structure:
{ "common_module_defaults": { "api_url": "http://http-api:8080/v2/protocol", "max_requests_threshold_count": "10", "max_requests_threshold_period_ms": "5000", "delay_after_threshold_reached_ms": "5000", "retry_requests_delay_ms": "200" }, "common_modules": { "1": { "lib_path": "/home/bringauto/modules/mission_module/lib/libmission-external-server-shared.so", "config": { "api_key": "${MISSION_MODULE_API_KEY}" } } // Other modules follow the same pattern } }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (8)
configuration/external-server/config.json
(1 hunks)configuration/http-api/config.json
(1 hunks)configuration/integration-layer/config.json
(1 hunks)configuration/management-api/config.json
(1 hunks)configuration/module-gateway/config.json
(1 hunks)configuration/virtual-plc/config.json
(1 hunks)configuration/virtual-vehicle-utility/config.json
(3 hunks)docker-compose.yml
(6 hunks)
🔇 Additional comments (12)
configuration/virtual-plc/config.json (1)
2-12
: LGTM: Improved logging structure.
The new structured logging configuration is a good improvement:
- Separates console and file logging concerns
- Provides granular control over logging levels
- Aligns with the project-wide logging standardization
configuration/integration-layer/config.json (1)
4-4
: LGTM: Appropriate logging level adjustment.
The change from "debug" to "info" level for console logging is a good practice that reduces log verbosity while maintaining important operational information. This aligns well with the logging changes across other services.
configuration/http-api/config.json (1)
4-4
: LGTM! Appropriate logging level adjustment.
The change from "debug" to "info" for console logging while maintaining debug-level file logging is a good practice. This reduces console noise in production while maintaining detailed logs for troubleshooting.
configuration/module-gateway/config.json (1)
8-10
: Verify log directory permissions and existence.
The file logging is enabled with debug level, but we need to ensure the specified directory exists and has proper write permissions.
✅ Verification successful
Log directory is properly mounted via Docker volumes
The log directory /home/bringauto/log/
is correctly handled through Docker volume mounts in docker-compose.yml
. The directory is mounted from local docker_volumes
directories for each service:
./docker_volumes/module-gateway:/home/bringauto/log/
./docker_volumes/external-server/:/home/bringauto/log/
./docker_volumes/http-api:/home/bringauto/log
./docker_volumes/integration-layer:/home/bringauto/log
./docker_volumes/management-api:/home/bringauto/log
This is a proper setup as:
- The host machine handles directory creation and permissions
- Logs are persisted outside the container
- Multiple services can write logs independently in their own mounted volumes
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check if the log directory exists in the container and verify permissions
# Search for Dockerfile or docker-compose entries that might create this directory
echo "Checking for log directory setup in Docker files..."
rg -l "/home/bringauto/log" --type dockerfile --type yaml
# Search for any permission or directory creation commands
echo "Checking for directory creation or permission commands..."
rg -l "mkdir.*bringauto/log|chmod.*bringauto/log" --type dockerfile --type yaml
Length of output: 447
Script:
#!/bin/bash
# Let's try a different approach to find Docker-related files and log directory setup
echo "Searching for Dockerfile and docker-compose files..."
fd -e dockerfile -e yml -e yaml
echo -e "\nSearching for log directory references..."
rg "/home/bringauto/log"
echo -e "\nSearching for directory creation or permission commands..."
rg "mkdir.*log|chmod.*log"
Length of output: 1259
configuration/virtual-vehicle-utility/config.json (3)
32-32
: LGTM! Consistent naming convention applied.
The rename to provider-simulation-settings
follows the established pattern of prefixing provider-specific configurations.
41-42
: LGTM! Verify module gateway connectivity.
The renaming to fleet-provider-type
and provider-internal-protocol-settings
maintains consistency. Since this PR updates services, please ensure the module gateway connection settings remain compatible.
✅ Verification successful
Module gateway connectivity configuration is consistent
The module gateway port 1636 is consistently configured across the services:
- In virtual-vehicle-utility as the client port
- In virtual-plc connecting to the same port
- Module gateway service is properly referenced in docker compose configuration
The renaming of fleet provider settings maintains compatibility while the underlying connection parameters remain unchanged.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Check if the module gateway port is consistently configured across services
rg '"module-gateway-port":\s*1636' --type json
Length of output: 130
Script:
#!/bin/bash
# Let's check for any other module gateway port configurations across the codebase
rg '"module-gateway-port"' --type json -A 1
Length of output: 207
Script:
#!/bin/bash
# Also check for any module gateway related settings in the codebase
rg 'module[- ]gateway' --type json -A 2
Length of output: 1404
Script:
#!/bin/bash
# Check if there are any other fleet provider configurations
rg '"fleet-provider-type"|"provider-internal-protocol-settings"' --type json -A 2
Length of output: 445
29-30
: Verify the new in-stop-delay value.
A new configuration parameter in-stop-delay-s
has been added with a value of 10 seconds. Please confirm if this delay is appropriate for your use case, as it will affect vehicle behavior at stops.
configuration/external-server/config.json (2)
4-4
: LGTM: Logging level change aligns with PR objectives.
The change from "debug" to "info" for console logging while maintaining "debug" level for file logging is a good balance between reducing console verbosity and maintaining detailed logs for troubleshooting.
Line range hint 1-58
: Verify: Ensure configuration compatibility with updated services.
Since this PR updates all services to their latest versions, we should verify that this configuration file remains compatible.
Let's check for any version-specific configuration changes in the documentation:
✅ Verification successful
Configuration changes are compatible with updated services
The recent changes in the configuration files are minimal and maintain backward compatibility:
- Only logging level changes from "debug" to "info" in console output across all services
- Module Gateway's logging structure was standardized to match other services
- All core configuration parameters (endpoints, modules, paths) remain unchanged
- No breaking changes or new required fields were introduced
The configuration structure remains consistent with all interconnected services (http-api, management-api, module-gateway) and maintains the required parameters for proper system operation.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Search for configuration-related changes in documentation and changelog files
echo "Searching for configuration changes in documentation..."
rg -i -g "CHANGELOG*|README*|docs/*" "config.*changes|breaking.*changes|upgrade"
Length of output: 352
Script:
#!/bin/bash
# Let's try a broader search for documentation files first
echo "Finding documentation files..."
fd -e md -e txt
# Search for configuration files to understand the structure
echo -e "\nFinding configuration files..."
fd -e json -e yaml -e yml
# Look for any upgrade or migration guides
echo -e "\nSearching for upgrade/migration content..."
rg -i "upgrade|migration|breaking.?change|config" -g "*.md" -g "*.txt"
Length of output: 3418
Script:
#!/bin/bash
# Let's compare the configuration structure with other services
echo "Checking http-api config structure..."
cat configuration/http-api/config.json
echo -e "\nChecking management-api config structure..."
cat configuration/management-api/config.json
echo -e "\nChecking module-gateway config structure..."
cat configuration/module-gateway/config.json
# Let's also check if there are any recent changes to these config files
echo -e "\nChecking recent config file changes..."
git log -p -- configuration/external-server/config.json configuration/http-api/config.json configuration/management-api/config.json configuration/module-gateway/config.json
Length of output: 11850
docker-compose.yml (3)
3-3
: LGTM: Version updates for virtual-vehicle and virtual-plc services.
The version updates follow semantic versioning with minor version increments, suggesting backward compatibility is maintained.
Also applies to: 18-18
80-80
: LGTM: Patch version updates for API services.
The patch version updates for both http-api and management-api services indicate bug fixes or minor improvements without breaking changes.
Also applies to: 112-112
33-33
: Verify impact of removing --verbose flag from module-gateway.
While the version update looks good, the removal of the --verbose flag might affect debugging capabilities. This change aligns with the PR's logging improvements, but please ensure:
- The new version (v1.3.0) has adequate default logging
- There's documentation on how to enable verbose logging if needed
Also applies to: 41-41
All services in docker-compose are updated to latest versions with improved logging. Config files are adjusted for these new versions.
Summary by CodeRabbit
Release Notes
New Features
Improvements
virtual-vehicle-utility
configuration for better consistency.Bug Fixes
Chores
docker-compose.yml
file for improved performance and stability.module-gateway
andinitialize-log-folders
services to streamline operations.