Skip to content
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

Enable publicapi to run on CF #3119

Open
wants to merge 46 commits into
base: main
Choose a base branch
from
Open

Enable publicapi to run on CF #3119

wants to merge 46 commits into from

Commits on Aug 7, 2024

  1. Updated .gitignore and refactored health check config in metricsforwa…

    …rder
    
     • Removed metricsforwarder and metricsforwarder.yml from .gitignore.
     • Changed health check configuration keys to nest under BasicAuth and ServerConfig.
     • Updated tests to reflect configuration changes and removed unused code.
     • Fixed request creation in tests to use dynamic server URL and proper basic auth setup.
    bonzofenix committed Aug 7, 2024
    Configuration menu
    Copy the full SHA
    3852b4b View commit details
    Browse the repository at this point in the history
  2. Add new files for autoscaler API and security, refactor scaling engin…

    …e server and tests
    
     • Add generate.go for autoscaler API generation
     • Create ogen-config.yaml to allow remote parser configuration
     • Introduce security.go with SecuritySource struct
     • Refactor main.go to remove Prometheus and health endpoint dependencies
     • Update scalingengine_suite_test.go and scalingengine_test.go to reflect new health server configuration and client creation
     • Modify config_test.go and valid.yml to adjust health server port configuration
     • Implement scaling_history_handler.go without bearer auth for internal mTLS use
     • Adjust scaling_history_handler_test.go to use new package path
     • Overhaul server.go to separate health and mTLS server creation, and to streamline router setup
     • Amend server_test.go to align with server refactoring and use dynamic URL construction
    bonzofenix committed Aug 7, 2024
    Configuration menu
    Copy the full SHA
    a4ff5ec View commit details
    Browse the repository at this point in the history
  3. Remove scaling engine client and refactor scaling history handler

     • Removed scalingEngineClient from PublicApiHandler and associated creation logic.
     • Replaced CreateHTTPClient with CreateHTTPSClient for eventGeneratorClient.
     • Deleted GetScalingHistories function as it's no longer needed.
     • Refactored NewPublicApiServer to use a new PublicApiServer struct and split into GetHealthServer and GetMtlsServer methods.
     • Updated import paths and variable names to reflect internal scaling history API changes.
     • Added SecuritySource struct to handle security for scaling history handler.
     • Modified ScalingHistoryHandler to use the new internal scaling history client and updated JSON marshaling logic.
    bonzofenix committed Aug 7, 2024
    Configuration menu
    Copy the full SHA
    fa178f4 View commit details
    Browse the repository at this point in the history
  4. Refactor API test suite and update health check configuration

     • Update API test suite to use testhelpers package for utility functions.
     • Modify health check configuration to use BasicAuth struct instead of separate username and password fields.
     • Remove unused variables and imports, and clean up test setup for clarity.
     • Adjust API server creation to directly instantiate servers without a separate function.
    bonzofenix committed Aug 7, 2024
    Configuration menu
    Copy the full SHA
    758f0fd View commit details
    Browse the repository at this point in the history
  5. Add go:generate directive and remote parsing to ogen, update health p…

    …ort config, and switch to HTTPS client in schedulerclient
    bonzofenix committed Aug 7, 2024
    Configuration menu
    Copy the full SHA
    a45b9c5 View commit details
    Browse the repository at this point in the history
  6. Add Makefile for eventgenerator and refactor eventgenerator tests

     • Add a new Makefile for the eventgenerator component with a fetch-config target to pull configuration and certificates from the metricsforwarder VM.
     • Refactor eventgenerator test suites to improve readability and organization, including the use of When blocks for context-specific conditions.
     • Update eventgenerator REST API tests to use helper functions for creating HTTP clients and constructing request URLs.
     • Modify the eventgenerator main.go to use a new server creation function that handles both MTLS and health endpoints.
     • Adjust eventgenerator configuration tests to reflect changes in the health check server configuration structure.
     • Implement server.go changes to separate the creation of the event generator and health routers, and to provide functions for retrieving MTLS and health servers.
     • Update server_suite_test.go to remove unnecessary setup code due to refactoring.
     • Refactor server_test.go to use the new server creation functions and to organize tests into When and Describe blocks for clarity.
    bonzofenix committed Aug 7, 2024
    Configuration menu
    Copy the full SHA
    16bbb99 View commit details
    Browse the repository at this point in the history
  7. Refactor HealthConfig to use BasicAuth model and update HTTP client c…

    …reation
    
     • Replace individual HealthCheckUsername and HealthCheckPassword fields with a BasicAuth struct in HealthConfig.
     • Update validation logic in HealthConfig to work with the new BasicAuth fields.
     • Modify tests to reflect changes in HealthConfig structure.
     • Implement TransportWithBasicAuth to add basic authentication headers to HTTP requests.
     • Adjust CreateHTTPClient function to accept BasicAuth and use TransportWithBasicAuth.
     • Add BasicAuth struct to models package to encapsulate basic authentication data.
    bonzofenix committed Aug 7, 2024
    Configuration menu
    Copy the full SHA
    9285c85 View commit details
    Browse the repository at this point in the history
  8. Refactor basic auth configuration in healthendpoint

     • Rename HealthCheckUsername and related fields to BasicAuth struct fields
     • Update health readiness tests to use new BasicAuth struct fields
     • Remove basic auth middleware implementation from server.go
     • Simplify health router creation by using helpers.CreateBasicAuthMiddleware
    bonzofenix committed Aug 7, 2024
    Configuration menu
    Copy the full SHA
    aa9a71c View commit details
    Browse the repository at this point in the history
  9. Refactor health endpoint and update HTTP client creation

     - Replace direct Prometheus registry creation with `createPrometheusRegistry` function.
     - Change `CreateHTTPClient` to `CreateHTTPSClient` for both scaling engine and scheduler clients.
     - Update health endpoint creation to use `NewHealthRouter` and `NewHTTPServer`.
     - Adjust health check configuration structure in tests and sample config.
    bonzofenix committed Aug 7, 2024
    Configuration menu
    Copy the full SHA
    2821c00 View commit details
    Browse the repository at this point in the history
  10. Add BasicAuthenticationMiddleware for healthcheck endpoint

     • Implement BasicAuthenticationMiddleware with bcrypt password hashing
     • Create middleware to protect healthcheck endpoint using basic auth
     • Add unit tests for BasicAuthenticationMiddleware with correct and incorrect credentials
    bonzofenix committed Aug 7, 2024
    Configuration menu
    Copy the full SHA
    4f8ea86 View commit details
    Browse the repository at this point in the history
  11. Refactor scaling history API and update Makefile for new paths

     - Move scaling history OpenAPI generation from helpers to api and scalingengine directories
     - Add new internal-scaling-history-api.openapi.yaml for Scaling History API
     - Update Makefile to handle OpenAPI client and server generation in new locations
     - Add NewScalingEngineClient function in testhelpers
    bonzofenix committed Aug 7, 2024
    Configuration menu
    Copy the full SHA
    204b2dc View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    31ddfbb View commit details
    Browse the repository at this point in the history

Commits on Aug 29, 2024

  1. Configuration menu
    Copy the full SHA
    cef43b9 View commit details
    Browse the repository at this point in the history

Commits on Oct 10, 2024

  1. Configuration menu
    Copy the full SHA
    2103d1f View commit details
    Browse the repository at this point in the history
  2. Merge debox

    bonzofenix committed Oct 10, 2024
    Configuration menu
    Copy the full SHA
    25b355a View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    f0bb44a View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    f385475 View commit details
    Browse the repository at this point in the history
  5. Fix lint

    bonzofenix committed Oct 10, 2024
    Configuration menu
    Copy the full SHA
    817c1de View commit details
    Browse the repository at this point in the history
  6. Small fix

    bonzofenix committed Oct 10, 2024
    Configuration menu
    Copy the full SHA
    c5f8138 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    4b10025 View commit details
    Browse the repository at this point in the history
  8. Fix lint

    bonzofenix committed Oct 10, 2024
    Configuration menu
    Copy the full SHA
    b8bdaed View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    288606f View commit details
    Browse the repository at this point in the history

Commits on Oct 11, 2024

  1. Fix test

    Improve error logging in metric_poller_test and update health port configuration structure
    
    configuration in both config_test.go and exampleconfig/config.yml.
    bonzofenix committed Oct 11, 2024
    Configuration menu
    Copy the full SHA
    167ec9c View commit details
    Browse the repository at this point in the history

Commits on Oct 14, 2024

  1. Add new API paths and relocate scaling history API in golangapiserve…

    …r and scalingengine packages
    bonzofenix committed Oct 14, 2024
    Configuration menu
    Copy the full SHA
    f5eb301 View commit details
    Browse the repository at this point in the history
  2. Refactor deployment script to use interpolated secrets from a template

     - Add a new template for autoscaler secrets (autoscaler-secrets.yml.tpl)
     - Update deploy-autoscaler.sh to interpolate secrets from the new template instead of fetching individually with credhub
    bonzofenix committed Oct 14, 2024
    Configuration menu
    Copy the full SHA
    fc05d9b View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    991291d View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    51dc5ef View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    005450b View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    26f6c7a View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    0c81532 View commit details
    Browse the repository at this point in the history
  8. Refactor health endpoint configuration across multiple jobs

     • Consolidate health endpoint configuration into server_config and basic_auth sections for eventgenerator, golangapiserver, metricsforwarder, operator, and scalingengine jobs.
     • Enable TLS configuration within the server_config section when certificates are provided.
     • Update corresponding specs to reflect the new configuration structure and verify TLS settings and basic auth credentials.
    bonzofenix committed Oct 14, 2024
    Configuration menu
    Copy the full SHA
    8034c1a View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    b466497 View commit details
    Browse the repository at this point in the history
  10. Update devbox

    bonzofenix committed Oct 14, 2024
    Configuration menu
    Copy the full SHA
    ef9cbc2 View commit details
    Browse the repository at this point in the history

Commits on Oct 17, 2024

  1. Update publicapi routes

    bonzofenix committed Oct 17, 2024
    Configuration menu
    Copy the full SHA
    fc6a724 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    38e7627 View commit details
    Browse the repository at this point in the history

Commits on Oct 18, 2024

  1. Remove metrics forwarder host configuration and update deployment scr…

    …ipts
    
     • Eliminate metrics forwarder host variable from deployment manifest and Makefile
     • Adjust default METRICSFORWARDER_HOST and add METRICSFORWARDER_MTLS_HOST in build-extension-file.sh
     • Update GO_INSTALL_PACKAGE_SPEC in mta.tpl.yaml to point to new publicapiserver path
     • Add publicapiserver-config resource with metrics forwarder URLs in build-extension-file.sh
    bonzofenix committed Oct 18, 2024
    Configuration menu
    Copy the full SHA
    26afce8 View commit details
    Browse the repository at this point in the history
  2. Refactor config loading and add error handling in autoscaler API

     - Replace `io.Reader` with `os` package for file handling
     - Introduce error variables for config file reading and missing server config
     - Change `PublicApiServer` struct field to `Server`
     - Add `defaultConfig` function for initializing default config values
     - Implement `loadYamlFile` and `loadPublicApiServerConfig` for config loading
     - Modify `LoadConfig` to use new helper functions and handle VCAP configuration
     - Update tests to reflect changes and use `testhelpers.BytesToFile` for file operations
     - Add new default JSON files for catalog, config, and info
     - Update build-extension-file.sh to include `skip_ssl_validation` in parameters
    bonzofenix committed Oct 18, 2024
    Configuration menu
    Copy the full SHA
    e871698 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    92cfb07 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    61ab5c4 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    ec54859 View commit details
    Browse the repository at this point in the history
  6. Refactor configuration loading and database connection in api/main.go

     • Implement VCAP configuration reader for loading config
     • Streamline error handling for configuration and database initialization
     • Update references from conf.DB to conf.Db to match case changes
     • Modify PublicApiServer to use s.conf.Server instead of s.conf.PublicApiServer
    bonzofenix committed Oct 18, 2024
    Configuration menu
    Copy the full SHA
    9db24ff View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    4b0bb74 View commit details
    Browse the repository at this point in the history
  8. Fix typos

    bonzofenix committed Oct 18, 2024
    Configuration menu
    Copy the full SHA
    f315395 View commit details
    Browse the repository at this point in the history

Commits on Oct 21, 2024

  1. Fix typo

    bonzofenix committed Oct 21, 2024
    Configuration menu
    Copy the full SHA
    e6c2c4f View commit details
    Browse the repository at this point in the history

Commits on Oct 22, 2024

  1. Add database certificate generation to test script and implement unif…

    …ied server for CF in API tests
    
     • Extend generate_test_certs.sh to create and sign a certificate for the postgres database.
     • Modify API tests to support running in Cloud Foundry (CF) with a unified server, including environment setup and teardown.
     • Add scheduler configuration to default_config.json.
     • Refactor PublicApiServer to improve setup and routing, including health and MTLS server creation.
     • Update error message in config.go to correctly reference publicapiserver instead of metricsforwarder.
     • Introduce vcapPort in API tests for dynamic port assignment based on parallel test execution.
    bonzofenix committed Oct 22, 2024
    Configuration menu
    Copy the full SHA
    b8529ce View commit details
    Browse the repository at this point in the history

Commits on Oct 23, 2024

  1. WIP

    bonzofenix committed Oct 23, 2024
    Configuration menu
    Copy the full SHA
    d15a401 View commit details
    Browse the repository at this point in the history