-
Notifications
You must be signed in to change notification settings - Fork 53
(feature): Enable eventgenerator in mtar deployment #3638
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…fig map in metricsforwarder config
• Centralize database configuration logic into db.ConfigureDb and db.ConfigureStoredProcedureDb • Remove individual configurePolicyDb and configureBindingDb functions • Move DatabaseConfig struct to a new models.go file in the db package • Update calls to database configuration in both API and metrics forwarder to use the new centralized functions
• Change db.ConfigureDb calls to vcapReader.ConfigureDb for PolicyDb and BindingDb. • Introduce vcapReader.ConfigureStoredProcedureDb for handling stored procedure database configuration. • Remove ConfigureStoredProcedureDb and ConfigureDb from db/helper.go. • Update tests to reflect changes in database configuration methods.
…est in autoscaler config utils
- Import the "time" package in db.go for time.Duration usage. - Introduce DatabaseConfig struct in db.go with connection parameters. - Delete models.go, moving DatabaseConfig to db.go.
• Implement configuration loading for stored procedure database in config.go • Enable tests for stored procedure database when cred_helper_impl is set to default in config_test.go
…ting Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
…tgenerator module with configuration and routes, and set default instances to 0 for new modules in autoscaler app.
41ec81e
to
6c5b7c7
Compare
… eventgenerator • Refactor LoadConfig to read from file and VCAP services • Add error variables for configuration loading issues • Introduce loadYamlFile and loadVcapConfig helper functions • Update tests with new configuration loading logic and VCAP reader mocks • Remove unused imports and adjust defaultConfig function signature
6c5b7c7
to
792c984
Compare
- Correct grammar in test descriptions for database configuration calls. - Change cred_helper_impl to 'stored_procedure' for storedProcedure_db service. - Remove redundant storedProcedureConfig and read directly from VCAP services. - Remove outdated tests related to default cred_helper_impl for storedProcedure_db.
… eventgenerator • Refactor LoadConfig to read from file and VCAP services • Add error variables for configuration loading issues • Introduce loadYamlFile and loadVcapConfig helper functions • Update tests with new configuration loading logic and VCAP reader mocks • Remove unused imports and adjust defaultConfig function signature
…enerator config • Implement ConfigureDb method in VCAPConfiguration to set database URL • Use ConfigureDb to configure PolicyDb and AppMetricsDb in eventgenerator • Add AppMetricsDb constant to db package • Update tests to reflect changes in database configuration methods
…ventgenerator • Update DBConfig and DatabaseConfig struct references to use pointers in eventgenerator_suite_test.go and main.go. • Change struct field names from DB to Db and PolicyDB to PolicyDb, AppMetricDB to AppMetricDb to align with Go naming conventions.
…Db in eventgenerator
ba2457c
to
4489e00
Compare
- Update eventgenerator configuration to use pointers for optional structs and add JSON tags - Modify eventgenerator test suite to handle CF environment variables and dynamically set config - Adjust eventgenerator main.go to load and validate config with VCAP services support - Implement ToJSON method in config.go for marshaling configuration to JSON - Change environment variable keys in mta.tpl.yaml to uppercase and use placeholders for Go version
63e2b63
to
1b9ab3a
Compare
• Introduce eventgenerator_health_password in build-extension-file.sh for event generator health checks. • Add eventgenerator-config resource with basic auth password in mta.tpl.yaml. • Implement configureMetricsCollectorTLS function in eventgenerator/config/config.go to load TLS configuration for the metrics collector from logcache-client. • Update eventgenerator unit tests to reflect new TLS configuration loading. • Remove scaling engine and metric collector TLS configs from default_config.json, streamline cf_server and db configurations. • Add logcache-client as a user-provided service in mta.tpl.yaml.
…nd When blocks - Replace Context blocks with When for better readability - Utilize HaveExactKeys custom matcher to simplify policy retrieval assertions - Remove redundant clock increment and policy existence checks
a472064
to
2267a64
Compare
…rwarder module in build-extension-file.sh
… to be overridden in build script
• Remove ToJSON method from Config structs in api and eventgenerator modules • Add generic ToJSON function in configutil module to handle JSON marshaling • Update tests and usages to call configutil.ToJSON instead of Config's ToJSON • Remove redundant tests for ToJSON in api/config after refactoring
…ture • Replace interface{} with any in VCAP_SERVICES map • Remove redundant logcache-client TODO comment • Move YAML file loading to helpers.LoadYamlFile • Remove unused os import from config.go
We should reframe from adding complexity/tests to the cmd and relay on integration and acceptance instead. main.go should have as less logic as possible.
…_STATE_PATH in uaa-login.sh
…ntgenerator config.
bonzofenix
commented
May 27, 2025
src/autoscaler/eventgenerator/cmd/eventgenerator/eventgenerator_test.go
Outdated
Show resolved
Hide resolved
src/autoscaler/eventgenerator/cmd/eventgenerator/eventgenerator_test.go
Outdated
Show resolved
Hide resolved
src/autoscaler/dbtasks/src/main/resources/bin/apply-changelog.sh
Outdated
Show resolved
Hide resolved
asalan316
approved these changes
May 27, 2025
- Modify deployment script to adjust the order of operations files - Extend configure-cf-services.yml to enable CF server communication for eventgenerator and add route registration details
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request includes several changes to the
autoscaler
project, focusing on improving deployment configurations, scripts, and server configurations. The most important changes involve adding a new UAA login script, modifying deployment-related environment variables, and updating server configurations to use more descriptive names.Deployment and Login Improvements:
uaa-login
target toMakefile
to facilitate UAA login. (Makefile
)uaa-login.sh
script to handle UAA login. (ci/autoscaler/scripts/uaa-login.sh
)cf-login.sh
to use${DEPLOYMENT_NAME}
instead of${PR_NUMBER}
for the autoscaling API URL. (ci/autoscaler/scripts/cf-login.sh
)Environment Variable Management:
ENABLE_MTAR
environment variable and logic to setDEPLOYMENT_NAME
based on its value. (ci/autoscaler/scripts/vars.source.sh
) [1] [2]build-extension-file.sh
to include new environment variables for event generator and metrics forwarder. (src/autoscaler/build-extension-file.sh
) [1] [2] [3]Server Configuration Updates:
VCAPServer
toCFServer
in multiple files for better clarity. (src/autoscaler/api/config/config.go
,src/autoscaler/api/config/config_test.go
,src/autoscaler/api/publicapiserver/public_api_server.go
,src/autoscaler/api/publicapiserver/publicapiserver_suite_test.go
) [1] [2] [3] [4] [5]broker_server
to useHealthPath
instead ofBrokerHealthPath
for health checks. (src/autoscaler/api/brokerserver/broker_server.go
)Miscellaneous Changes:
cf target
commands incommon.sh
to reduce log noise. (ci/autoscaler/scripts/common.sh
) [1] [2]configure-cf-services.yml
anduse-cf-services.yml
. (operations/configure-cf-services.yml
,operations/use-cf-services.yml
) [1] [2]