source
stringclasses
1 value
repo
stringlengths
5
63
repo_url
stringlengths
24
82
path
stringlengths
5
167
language
stringclasses
1 value
license
stringclasses
5 values
stars
int64
10
51.4k
ref
stringclasses
23 values
size_bytes
int64
200
258k
text
stringlengths
137
258k
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/diego/task_environment_variable_collector.rb
Ruby
apache-2.0
203
main
915
require 'cloud_controller/diego/task_environment' module VCAP::CloudController module Diego class TaskEnvironmentVariableCollector class << self def for_task(task) app = task.app running_envs = VCAP::CloudController::EnvironmentVariableGroup.running.environment_json en...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/diego/ssh_key.rb
Ruby
apache-2.0
203
main
3,184
# frozen_string_literal: true require 'openssl' require 'digest' require 'base64' module VCAP module CloudController module Diego class SSHKey def initialize(bits=2048) @bits = bits end def private_key key.to_pem end def authorized_key ...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/diego/messenger.rb
Ruby
apache-2.0
203
main
1,959
require 'cloud_controller/dependency_locator' require 'cloud_controller/diego/desire_app_handler' module VCAP::CloudController module Diego class Messenger def send_stage_request(_config, staging_details) logger.info('staging.begin', package_guid: staging_details.package.guid) staging_guid...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/diego/windows_environment_sage.rb
Ruby
apache-2.0
203
main
573
# frozen_string_literal: true require 'cloud_controller/diego/bbs_environment_builder' module VCAP::CloudController module Diego class WindowsEnvironmentSage def self.ponder(app) windows_gmsa_credential_env(app) end def self.windows_gmsa_credential_env(app) credential_refs = a...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/diego/task_environment.rb
Ruby
apache-2.0
203
main
1,623
require 'credhub/config_helpers' module VCAP::CloudController module Diego class TaskEnvironment include ::Credhub::ConfigHelpers def initialize(app, task, space, initial_envs={}) @app = app @task = task @space = space @initial_envs = initial_e...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/diego/task_completion_handler.rb
Ruby
apache-2.0
203
main
1,298
module VCAP::CloudController module Diego class TaskCompletionHandler def complete_task(task, payload) begin response_parser.validate(payload) rescue Membrane::SchemaValidationError => e logger.error('failure.invalid-message', task_guid: task.guid, payload: payload, error...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/diego/egress_rules.rb
Ruby
apache-2.0
203
main
2,454
module VCAP::CloudController module Diego class EgressRules def running_protobuf_rules(process) running(process).map { |r| as_protobuf_rule(r) } end def staging_protobuf_rules(app_guid:) staging(app_guid:).map { |r| as_protobuf_rule(r) } end private def stagi...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/diego/staging_details.rb
Ruby
apache-2.0
203
main
315
module VCAP::CloudController module Diego class StagingDetails attr_accessor :staging_guid, :staging_memory_in_mb, :staging_disk_in_mb, :staging_log_rate_limit_bytes_per_second, :package, :environment_variables, :lifecycle, :start_after_staging, :isolation_segment end end end
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/diego/process_guid.rb
Ruby
apache-2.0
203
main
460
module VCAP::CloudController module Diego class ProcessGuid def self.from(process_guid, process_version) "#{process_guid}-#{process_version}" end def self.from_process(process) from(process.guid, process.version) end def self.cc_process_guid(versioned_guid) ...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/diego/constants.rb
Ruby
apache-2.0
203
main
1,625
require 'diego/lrp_constants' module VCAP::CloudController module Diego STAGING_DOMAIN = 'cf-app-staging'.freeze STAGING_TRUSTED_SYSTEM_CERT_PATH = '/etc/cf-system-certificates'.freeze STAGING_LOG_SOURCE = 'STG'.freeze STAGING_DEFAULT_LANG = 'en_US.UTF-8'.f...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/diego/runner.rb
Ruby
apache-2.0
203
main
2,221
module VCAP::CloudController module Diego class Runner class CannotCommunicateWithDiegoError < StandardError; end attr_writer :messenger def initialize(process, config) @process = process @config = config end def scale raise CloudController::Errors::ApiErro...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/diego/bbs_stager_client.rb
Ruby
apache-2.0
203
main
2,038
require 'diego/client' require 'cloud_controller/diego/constants' module VCAP::CloudController module Diego class BbsStagerClient ACCEPTABLE_DIEGO_ERRORS = [ ::Diego::Bbs::ErrorTypes::ResourceNotFound ].freeze def initialize(client, config) @client = client @config = co...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/diego/bbs_task_client.rb
Ruby
apache-2.0
203
main
2,619
require 'diego/client' require 'cloud_controller/diego/constants' module VCAP::CloudController module Diego class BbsTaskClient def initialize(config, client) @config = config @client = client end def desire_task(task, domain) logger.info('task.request', task_guid: task...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/diego/desire_app_handler.rb
Ruby
apache-2.0
203
main
356
module VCAP::CloudController module Diego class DesireAppHandler class << self def create_or_update_app(process, client) if (existing_lrp = client.get_app(process)) client.update_app(process, existing_lrp) else client.desire_app(process) end ...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/diego/staging_action_builder.rb
Ruby
apache-2.0
203
main
8,629
require 'credhub/config_helpers' require 'diego/action_builder' require 'digest/xxhash' module VCAP::CloudController module Diego class StagingActionBuilder include ::Credhub::ConfigHelpers include ::Diego::ActionBuilder attr_reader :config, :lifecycle_data, :staging_details def initial...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/diego/bbs_environment_builder.rb
Ruby
apache-2.0
203
main
316
module VCAP::CloudController module Diego class BbsEnvironmentBuilder def self.build(environment) env = NormalEnvHashToDiegoEnvArrayPhilosopher.muse(environment) env.map { |i| ::Diego::Bbs::Models::EnvironmentVariable.new(name: i['name'], value: i['value']) } end end end end
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/diego/lifecycle_protocol.rb
Ruby
apache-2.0
203
main
4,471
require 'cloud_controller/diego/windows_environment_sage' module VCAP::CloudController module Diego module LifecycleProtocol def self.protocol_for_type(lifecycle_type) case lifecycle_type when VCAP::CloudController::Lifecycles::BUILDPACK VCAP::CloudController::Diego::Buildpack::Li...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/diego/bbs_instances_client.rb
Ruby
apache-2.0
203
main
2,270
require 'diego/client' module VCAP::CloudController module Diego class BbsInstancesClient def initialize(client) @client = client end def lrp_instances(process) process_guid = ProcessGuid.from_process(process) logger.info('lrp.instances.request', process_guid:) ...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/diego/lifecycle_bundle_uri_generator.rb
Ruby
apache-2.0
203
main
853
module VCAP::CloudController module Diego class LifecycleBundleUriGenerator class InvalidStack < StandardError; end class InvalidCompiler < StandardError; end def self.uri(lifecycle_bundle) raise InvalidStack.new('no compiler defined for requested stack') unless lifecycle_bundle ...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/diego/task_completion_callback_generator.rb
Ruby
apache-2.0
203
main
508
module VCAP::CloudController module Diego class TaskCompletionCallbackGenerator def initialize(config=Config.config) @config = config end def generate(task) port = @config.get(:tls_port) schema = 'https' auth = '' host = @config.get(:internal_service_ho...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/diego/processes_sync.rb
Ruby
apache-2.0
203
main
6,556
require 'utils/workpool' module VCAP::CloudController module Diego class ProcessesSync BATCH_SIZE = 500 class Error < StandardError end class BBSFetchError < Error end def initialize(config:, statsd_updater: CloudController::DependencyLocator.instance.statsd_updater) ...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/diego/task_cpu_weight_calculator.rb
Ruby
apache-2.0
203
main
842
module VCAP module CloudController module Diego # Base 100% weight equals an 8G instance BASE_WEIGHT = 8192 class TaskCpuWeightCalculator def initialize(memory_in_mb:) @memory_in_mb = memory_in_mb @min_cpu_proxy = VCAP::CloudController::Config.config.get(:cpu_weight_m...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/diego/normal_env_hash_to_diego_env_array_philosopher.rb
Ruby
apache-2.0
203
main
434
require 'presenters/system_environment/system_env_presenter' module VCAP::CloudController module Diego class NormalEnvHashToDiegoEnvArrayPhilosopher def self.muse(hash) hash.map do |k, v| v = case v when Array, Hash Oj.dump(v) else ...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/diego/app_recipe_builder.rb
Ruby
apache-2.0
203
main
13,598
require 'cloud_controller/diego/protocol/app_volume_mounts' require 'cloud_controller/diego/protocol/container_network_info' require 'cloud_controller/diego/protocol/routing_info' require 'cloud_controller/diego/buildpack/desired_lrp_builder' require 'cloud_controller/diego/docker/desired_lrp_builder' require 'cloud_co...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/diego/tasks_sync.rb
Ruby
apache-2.0
203
main
4,765
module VCAP::CloudController module Diego class TasksSync BATCH_SIZE = 500 PENDING_TASK_EXPIRATION_IN_SECONDS = 300 class Error < StandardError end class BBSFetchError < Error end def initialize(config:) @config = config @workpool = WorkPool.new(50, st...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/diego/staging_completion_handler.rb
Ruby
apache-2.0
203
main
6,329
require 'actions/staging_cancel' module VCAP::CloudController module Diego class StagingCompletionHandler class MalformedDiegoResponseError < StandardError; end DEFAULT_STAGING_ERROR = 'StagingError'.freeze attr_reader :droplet, :build def initialize(build, runners=CloudController::Dep...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/diego/stager.rb
Ruby
apache-2.0
203
main
2,051
module VCAP::CloudController module Diego class Stager def initialize(config) @config = config end def stage(staging_details) send_stage_package_request(staging_details) rescue CloudController::Errors::ApiError => e logger.error('stage.package', package_guid: stagi...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/diego/service_binding_files_builder.rb
Ruby
apache-2.0
203
main
4,246
module VCAP::CloudController module Diego class ServiceBindingFilesBuilder class IncompatibleBindings < StandardError; end MAX_ALLOWED_BYTESIZE = 1_000_000 def self.build(app_or_process) new(app_or_process).build end def initialize(app_or_process) @app_or_process =...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/diego/main_lrp_action_builder.rb
Ruby
apache-2.0
203
main
5,020
module VCAP::CloudController module Diego class MainLRPActionBuilder include ::Diego::ActionBuilder include ::Credhub::ConfigHelpers class << self def build(process, lrp_builder, ssh_key) new(process, lrp_builder, ssh_key).build end end def initialize(proc...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/diego/failure_reason_sanitizer.rb
Ruby
apache-2.0
203
main
4,223
module VCAP::CloudController module Diego module CCMessages STAGING_ERROR = 'StagingError'.freeze INSUFFICIENT_RESOURCES = 'InsufficientResources'.freeze NO_COMPATIBLE_CELL = 'NoCompatibleCell'.freeze CELL_COMMUNICATION_ERROR = 'CellCommunicationError...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/diego/environment.rb
Ruby
apache-2.0
203
main
1,747
require 'presenters/system_environment/system_env_presenter' require 'cloud_controller/diego/normal_env_hash_to_diego_env_array_philosopher' require_relative '../../vcap/vars_builder' module VCAP::CloudController module Diego class Environment EXCLUDE = [:users].freeze def initialize(process, initia...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/diego/bbs_apps_client.rb
Ruby
apache-2.0
203
main
5,004
module VCAP::CloudController module Diego class BbsAppsClient def initialize(client, config) @client = client @config = config end def desire_app(process) logger.info('desire.app.request', process_guid: process.guid) handle_diego_errors(process.guid) do ...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/diego/droplet_url_generator.rb
Ruby
apache-2.0
203
main
1,249
module VCAP::CloudController module Diego class DropletUrlGenerator def initialize(internal_service_hostname:, external_port:, tls_port:, mtls:) @internal_service_hostname = internal_service_hostname @external_port = external_port @tls_port = tls_port ...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/diego/buildpack_entry_generator.rb
Ruby
apache-2.0
203
main
1,563
module VCAP::CloudController module Diego class BuildpackEntryGenerator def initialize(blobstore_url_generator, type) @blobstore_url_generator = blobstore_url_generator @type = type end def buildpack_entries(buildpack_infos, stack_name) return default_admin_buildpacks(st...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/diego/reporters/instances_stats_reporter.rb
Ruby
apache-2.0
203
main
10,090
require 'logcache/client' require 'cloud_controller/diego/reporters/reporter_mixins' module VCAP::CloudController module Diego class InstancesStatsReporter include ReporterMixins def initialize(bbs_instances_client, logstats_client) @bbs_instances_client = bbs_instances_client @logst...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/diego/reporters/instances_reporter.rb
Ruby
apache-2.0
203
main
5,866
require 'utils/workpool' require 'cloud_controller/diego/constants' require 'cloud_controller/diego/reporters/reporter_mixins' module VCAP::CloudController module Diego class InstancesReporter include ReporterMixins InstanceCountSummary = Struct.new(:starting_instances_count, :routable_instances_cou...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/diego/reporters/reporter_mixins.rb
Ruby
apache-2.0
203
main
606
module VCAP::CloudController module Diego module ReporterMixins private def nanoseconds_to_seconds(time) (time / 1e9).to_i end def fill_unreported_instances_with_down_instances(reported_instances, process, flat:) process.instances.times do |i| next if reported_i...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/diego/cnb/staging_action_builder.rb
Ruby
apache-2.0
203
main
2,097
require 'credhub/config_helpers' require 'diego/action_builder' require 'cloud_controller/diego/staging_action_builder' require 'digest/xxhash' module VCAP::CloudController module Diego module CNB class StagingActionBuilder < VCAP::CloudController::Diego::StagingActionBuilder def initialize(config,...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/diego/cnb/staging_completion_handler.rb
Ruby
apache-2.0
203
main
1,441
require 'cloud_controller/diego/staging_completion_handler' require 'utils/uri_utils' module VCAP::CloudController module Diego module CNB class StagingCompletionHandler < VCAP::CloudController::Diego::StagingCompletionHandler def logger_prefix 'diego.staging.cnb.' end de...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/diego/cnb/lifecycle_protocol.rb
Ruby
apache-2.0
203
main
1,465
require 'cloud_controller/diego/buildpack_entry_generator' require 'cloud_controller/diego/droplet_url_generator' require 'cloud_controller/diego/lifecycle_protocol' require 'cloud_controller/diego/cnb/lifecycle_data' require 'cloud_controller/diego/cnb/staging_action_builder' require 'cloud_controller/diego/buildpack/...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/diego/cnb/desired_lrp_builder.rb
Ruby
apache-2.0
203
main
4,707
module VCAP::CloudController module Diego module CNB class DesiredLrpBuilder include ::Diego::ActionBuilder class InvalidStack < StandardError; end attr_reader :start_command, :action_user def initialize(config, opts) @config = config @stack = opts[:sta...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/diego/cnb/lifecycle_data.rb
Ruby
apache-2.0
203
main
1,622
module VCAP::CloudController module Diego module CNB class LifecycleData attr_accessor :app_bits_download_uri, :build_artifacts_cache_download_uri, :build_artifacts_cache_upload_uri, :buildpacks, :app_bits_checksum, :droplet_upload_uri, :stack, :buildpack_cache_checksum, ...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/diego/protocol/container_network_info.rb
Ruby
apache-2.0
203
main
1,048
module VCAP::CloudController module Diego class Protocol class ContainerNetworkInfo attr_reader :app, :container_workload APP = 'app'.freeze STAGING = 'staging'.freeze TASK = 'task'.freeze def initialize(app, container_workload) @app = app @conta...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/diego/protocol/routing_info.rb
Ruby
apache-2.0
203
main
3,293
module VCAP::CloudController module Diego class Protocol class RoutingInfo attr_reader :process def initialize(process) @process = process end def routing_info process_eager = ProcessModel.eager(route_mappings: { route: %i[domain route_binding] }).where(...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/diego/protocol/app_volume_mounts.rb
Ruby
apache-2.0
203
main
295
module VCAP::CloudController module Diego class Protocol class AppVolumeMounts def initialize(app) @app = app end def as_json(_options={}) @app.service_bindings.map(&:volume_mounts).compact.flatten end end end end end
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/diego/buildpack/staging_completion_handler.rb
Ruby
apache-2.0
203
main
3,101
require 'cloud_controller/diego/staging_completion_handler' require 'utils/uri_utils' module VCAP::CloudController module Diego module Buildpack class StagingCompletionHandler < VCAP::CloudController::Diego::StagingCompletionHandler def logger_prefix 'diego.staging.buildpack.' end...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/diego/buildpack/task_action_builder.rb
Ruby
apache-2.0
203
main
4,316
require 'diego/action_builder' require 'cloud_controller/diego/task_environment_variable_collector' require 'credhub/config_helpers' module VCAP::CloudController module Diego module Buildpack class TaskActionBuilder include ::Diego::ActionBuilder class InvalidStack < StandardError; end ...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/diego/buildpack/lifecycle_protocol.rb
Ruby
apache-2.0
203
main
1,109
require 'cloud_controller/diego/droplet_url_generator' require 'cloud_controller/diego/lifecycle_protocol' require 'cloud_controller/diego/buildpack/lifecycle_data' require 'cloud_controller/diego/buildpack/staging_action_builder' module VCAP module CloudController module Diego module Buildpack cla...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/diego/buildpack/desired_lrp_builder.rb
Ruby
apache-2.0
203
main
4,602
module VCAP::CloudController module Diego module Buildpack class DesiredLrpBuilder include ::Diego::ActionBuilder class InvalidStack < StandardError; end attr_reader :start_command, :action_user def initialize(config, opts) @config = config @stack = opt...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/diego/buildpack/lifecycle_data.rb
Ruby
apache-2.0
203
main
1,410
module VCAP::CloudController module Diego module Buildpack class LifecycleData attr_accessor :app_bits_download_uri, :build_artifacts_cache_download_uri, :build_artifacts_cache_upload_uri, :buildpacks, :app_bits_checksum, :droplet_upload_uri, :stack, :buildpack_cache_checksum ...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/diego/buildpack/staging_action_builder.rb
Ruby
apache-2.0
203
main
1,964
require 'credhub/config_helpers' require 'diego/action_builder' require 'digest/xxhash' require 'cloud_controller/diego/staging_action_builder' module VCAP::CloudController module Diego module Buildpack class StagingActionBuilder < VCAP::CloudController::Diego::StagingActionBuilder def initialize(c...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/diego/docker/desired_lrp_builder.rb
Ruby
apache-2.0
203
main
2,404
module VCAP::CloudController module Diego module Docker class DesiredLrpBuilder attr_reader :start_command, :action_user def initialize(config, opts) @config = config @docker_image = opts[:docker_image] @execution_metadata = opts[:execution_metadata] ...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/diego/docker/docker_uri_converter.rb
Ruby
apache-2.0
203
main
685
require 'utils/uri_utils' module VCAP::CloudController class DockerURIConverter def convert(docker_uri) raise UriUtils::InvalidDockerURI.new "Docker URI [#{docker_uri}] should not contain scheme" if docker_uri.include? '://' host, path, tag_digest = UriUtils.parse_docker_uri(docker_uri) # add...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/diego/docker/lifecycle_protocol.rb
Ruby
apache-2.0
203
main
2,612
require 'cloud_controller/diego/docker/lifecycle_data' require 'cloud_controller/diego/docker/staging_action_builder' require 'cloud_controller/diego/docker/task_action_builder' require 'cloud_controller/diego/windows_environment_sage' module VCAP module CloudController module Diego module Docker c...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/diego/docker/staging_action_builder.rb
Ruby
apache-2.0
203
main
2,772
module VCAP::CloudController module Diego module Docker class StagingActionBuilder include ::Diego::ActionBuilder attr_reader :config, :staging_details def initialize(config, staging_details) @config = config @staging_details = staging_details e...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/diego/docker/lifecycle_data.rb
Ruby
apache-2.0
203
main
885
module VCAP::CloudController module Diego module Docker class LifecycleData attr_accessor :docker_image, :docker_login_server, :docker_user, :docker_password, :docker_email def message message = { docker_image:, docker_login_server:, docker_user...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/diego/docker/staging_completion_handler.rb
Ruby
apache-2.0
203
main
1,699
require 'securerandom' require 'cloud_controller/diego/staging_completion_handler' require 'actions/droplet_create' module VCAP::CloudController module Diego module Docker class StagingCompletionHandler < VCAP::CloudController::Diego::StagingCompletionHandler def logger_prefix 'diego.stag...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/diego/docker/task_action_builder.rb
Ruby
apache-2.0
203
main
2,241
require 'diego/action_builder' require 'cloud_controller/diego/docker/docker_uri_converter' require 'cloud_controller/diego/task_environment_variable_collector' require 'credhub/config_helpers' module VCAP::CloudController module Diego module Docker class TaskActionBuilder def initialize(config, ta...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/diego/lifecycles/docker_lifecycle.rb
Ruby
apache-2.0
203
main
465
module VCAP::CloudController class DockerLifecycle attr_reader :staging_message def initialize(package, staging_message) @staging_message = staging_message @package = package end def type Lifecycles::DOCKER end def create_lifecycle_data_model(_); end def staging_envir...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/diego/lifecycles/app_docker_lifecycle.rb
Ruby
apache-2.0
203
main
306
module VCAP::CloudController class AppDockerLifecycle def initialize(*_message); end def create_lifecycle_data_model(_); end def update_lifecycle_data_model(_); end def valid? true end def errors [] end def type Lifecycles::DOCKER end end end
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/diego/lifecycles/lifecycle_provider.rb
Ruby
apache-2.0
203
main
829
require 'cloud_controller/diego/lifecycles/buildpack_lifecycle' require 'cloud_controller/diego/lifecycles/docker_lifecycle' require 'cloud_controller/diego/lifecycles/cnb_lifecycle' require 'cloud_controller/diego/lifecycles/lifecycles' module VCAP::CloudController class LifecycleProvider TYPE_TO_LIFECYCLE_CLAS...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/diego/lifecycles/lifecycle_base.rb
Ruby
apache-2.0
203
main
1,003
require 'cloud_controller/diego/lifecycles/buildpack_info' require 'fetchers/buildpack_lifecycle_fetcher' module VCAP::CloudController class LifecycleBase attr_reader :staging_message, :buildpack_infos def initialize(package, staging_message) @staging_message = staging_message @package = package...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/diego/lifecycles/app_base_lifecycle.rb
Ruby
apache-2.0
203
main
966
module VCAP::CloudController class AppBaseLifecycle def update_lifecycle_data_model(app) if [update_lifecycle_data_buildpacks(app), update_lifecycle_data_stack(app)].any? app.lifecycle_data.save end end def update_lifecycle_data_buildpacks(app) return unless message.bu...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/diego/lifecycles/app_cnb_lifecycle.rb
Ruby
apache-2.0
203
main
1,361
require 'cloud_controller/diego/lifecycles/buildpack_info' require 'cloud_controller/diego/lifecycles/buildpack_lifecycle_data_validator' require 'cloud_controller/diego/lifecycles/app_base_lifecycle' require 'fetchers/buildpack_lifecycle_fetcher' module VCAP::CloudController class AppCNBLifecycle < AppBaseLifecycle...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/diego/lifecycles/app_buildpack_lifecycle.rb
Ruby
apache-2.0
203
main
1,088
require 'cloud_controller/diego/lifecycles/buildpack_info' require 'cloud_controller/diego/lifecycles/buildpack_lifecycle_data_validator' require 'cloud_controller/diego/lifecycles/app_base_lifecycle' require 'fetchers/buildpack_lifecycle_fetcher' module VCAP::CloudController class AppBuildpackLifecycle < AppBaseLif...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/diego/lifecycles/app_lifecycle_provider.rb
Ruby
apache-2.0
203
main
1,114
require 'cloud_controller/diego/lifecycles/app_buildpack_lifecycle' require 'cloud_controller/diego/lifecycles/app_docker_lifecycle' require 'cloud_controller/diego/lifecycles/app_cnb_lifecycle' require 'cloud_controller/diego/lifecycles/lifecycles' module VCAP::CloudController class AppLifecycleProvider TYPE_TO...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/diego/lifecycles/cnb_lifecycle.rb
Ruby
apache-2.0
203
main
959
require 'cloud_controller/diego/lifecycles/buildpack_info' require 'cloud_controller/diego/lifecycles/lifecycle_base' require 'cloud_controller/diego/lifecycles/buildpack_lifecycle_data_validator' require 'fetchers/buildpack_lifecycle_fetcher' module VCAP::CloudController class CNBLifecycle < LifecycleBase def t...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/diego/lifecycles/buildpack_lifecycle.rb
Ruby
apache-2.0
203
main
793
require 'cloud_controller/diego/lifecycles/buildpack_info' require 'cloud_controller/diego/lifecycles/lifecycle_base' require 'cloud_controller/diego/lifecycles/buildpack_lifecycle_data_validator' require 'fetchers/buildpack_lifecycle_fetcher' module VCAP::CloudController class BuildpackLifecycle < LifecycleBase ...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/diego/lifecycles/buildpack_lifecycle_data_validator.rb
Ruby
apache-2.0
203
main
917
require 'active_model' module VCAP::CloudController class BuildpackLifecycleDataValidator include ActiveModel::Model attr_accessor :buildpack_infos, :stack validate :buildpacks_are_uri_or_nil validate :stack_exists_in_db def buildpacks_are_uri_or_nil buildpack_infos.each do |buildpack_in...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/diego/lifecycles/buildpack_info.rb
Ruby
apache-2.0
203
main
758
require 'utils/uri_utils' module VCAP::CloudController class BuildpackInfo attr_accessor :buildpack, :buildpack_record, :buildpack_url def initialize(buildpack_name_or_url, buildpack_record) @buildpack = buildpack_name_or_url @buildpack_record = buildpack_record @buildpack_url = ...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/legacy_api/legacy_api_base.rb
Ruby
apache-2.0
203
main
613
module VCAP::CloudController class LegacyApiBase < RestController::BaseController include CloudController::Errors def default_space raise CloudController::Errors::ApiError.new_from_details('NotAuthorized') unless user space = user.default_space || user.spaces.first raise ApiError.new_from_...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/legacy_api/legacy_info.rb
Ruby
apache-2.0
203
main
1,415
module VCAP::CloudController class LegacyInfo < LegacyApiBase include CloudController::Errors allow_unauthenticated_access get '/info', :info def info info = { name: config.get(:info, :name), build: config.get(:info, :build), support: config.get(:info, :support_address)...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/errands/rotate_database_key.rb
Ruby
apache-2.0
203
main
2,605
module VCAP::CloudController class RotateDatabaseKey class << self def perform(batch_size: 1000) @logger = Steno.logger('cc.rotate_database_key') no_encryption_key! if Encryptor.current_encryption_key_label.blank? Encryptor.encrypted_classes.each do |klass| logger.info("R...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/logs/request_logs.rb
Ruby
apache-2.0
203
main
3,112
require 'ipaddr' module VCAP::CloudController module Logs class RequestLogs def initialize(logger) @incomplete_requests = {} @logger = logger end def start_request(request_id, env) request = ActionDispatch::Request.new(env) return if health_endpoint?(request) ...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/runners/puma_runner.rb
Ruby
apache-2.0
203
main
3,647
require 'puma' require 'puma/configuration' require 'puma/events' require 'steno/steno' require 'cloud_controller/execution_context' module VCAP::CloudController class PumaRunner def initialize(config, app, logger, periodic_updater, request_logs) @periodic_updater = periodic_updater @logger = logger ...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/backends/non_quota_validating_staging_memory_calculator.rb
Ruby
apache-2.0
203
main
290
module VCAP::CloudController class NonQuotaValidatingStagingMemoryCalculator def get_limit(requested_limit, _space, _org) [minimum_limit, requested_limit].compact.max end def minimum_limit Config.config.get(:staging, :minimum_staging_memory_mb) end end end
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/backends/stagers.rb
Ruby
apache-2.0
203
main
1,576
require 'cloud_controller/diego' require 'cloud_controller/diego/stager' require 'cloud_controller/diego/buildpack/staging_completion_handler' require 'cloud_controller/diego/buildpack/lifecycle_protocol' require 'cloud_controller/diego/docker/lifecycle_protocol' require 'cloud_controller/diego/docker/staging_completio...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/backends/staging_disk_calculator.rb
Ruby
apache-2.0
203
main
691
module VCAP::CloudController class StagingDiskCalculator class LimitExceeded < StandardError; end def get_limit(requested_limit) requested_limit = requested_limit.to_i return minimum_limit if requested_limit < minimum_limit raise LimitExceeded if requested_limit > maximum_limit reque...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/backends/instances_reporters.rb
Ruby
apache-2.0
203
main
1,874
require 'cloud_controller/diego/reporters/instances_reporter' require 'cloud_controller/diego/reporters/instances_stats_reporter' module VCAP::CloudController class InstancesReporters def number_of_starting_and_running_instances_for_process(app) diego_reporter.number_of_starting_and_running_instances_for_p...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/backends/quota_validating_staging_memory_calculator.rb
Ruby
apache-2.0
203
main
967
require 'cloud_controller/backends/non_quota_validating_staging_memory_calculator' module VCAP::CloudController class QuotaValidatingStagingMemoryCalculator < NonQuotaValidatingStagingMemoryCalculator class SpaceQuotaExceeded < StandardError; end class OrgQuotaExceeded < StandardError; end def get_limit...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/backends/runners.rb
Ruby
apache-2.0
203
main
241
require 'cloud_controller/diego/runner' module VCAP::CloudController class Runners def initialize(config) @config = config end def runner_for_process(process) Diego::Runner.new(process, @config) end end end
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/backends/staging_environment_builder.rb
Ruby
apache-2.0
203
main
1,086
require_relative '../../vcap/vars_builder' module VCAP::CloudController class StagingEnvironmentBuilder def build(app, space, lifecycle, memory_limit, staging_disk_in_mb, vars_from_message=nil) app_env = app.environment_variables || {} vars_from_message ||= {} staging_var_group = EnvironmentVar...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/backends/quota_validating_staging_log_rate_limit_calculator.rb
Ruby
apache-2.0
203
main
901
module VCAP::CloudController class QuotaValidatingStagingLogRateLimitCalculator class SpaceQuotaExceeded < StandardError; end class OrgQuotaExceeded < StandardError; end def get_limit(requested_limit, space, org) requested_limit = -1 if requested_limit.nil? requested_limit = requested_limit....
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/routing_api/router_group.rb
Ruby
apache-2.0
203
main
716
module VCAP::CloudController::RoutingApi class RouterGroup attr_reader :guid, :type, :name def initialize(hash) @guid = hash['guid'] @name = hash['name'] @type = hash['type'] @reservable_ports = hash['reservable_ports'] end def ==(other) guid == other.guid end ...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/routing_api/routing_api_client.rb
Ruby
apache-2.0
203
main
2,131
module VCAP::CloudController::RoutingApi class RoutingApiUnavailable < StandardError; end class UaaUnavailable < StandardError; end class Client attr_reader :skip_cert_verify, :routing_api_uri, :uaa_client ROUTER_GROUPS_PATH = '/routing/v1/router_groups'.freeze def initialize(routing_api_uri, uaa_c...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/routing_api/disabled_routing_api_client.rb
Ruby
apache-2.0
203
main
363
module VCAP::CloudController::RoutingApi class RoutingApiDisabled < StandardError; end class DisabledClient def enabled? false end def router_groups raise RoutingApiDisabled end def router_group(_guid) raise RoutingApiDisabled end def router_group_guid(_name) ...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/uaa/uaa_client.rb
Ruby
apache-2.0
203
main
6,785
module VCAP::CloudController class UaaClient attr_reader :uaa_target, :client_id, :secret, :ca_file, :http_timeout def self.default_http_timeout @default_http_timeout ||= VCAP::CloudController::Config.config.get(:uaa, :client_timeout) end def auth_header token = UaaTokenCache.get_token(c...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/uaa/uaa_token_cache.rb
Ruby
apache-2.0
203
main
555
class UaaTokenCache TokenValue = Struct.new(:token, :expires_at) @tokens = {} def self.get_token(client_id) token_value = @tokens[client_id] return unless token_value token_value.token if token_value.expires_at.nil? || Time.now < token_value.expires_at end def self.set_token(client_id, token, ...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/uaa/uaa_token_decoder.rb
Ruby
apache-2.0
203
main
4,753
require 'uaa/info' module VCAP::CloudController class UaaTokenDecoder class BadToken < StandardError end attr_reader :config def initialize(uaa_config, grace_period_in_seconds: 0, alternate_reference_time: nil) @config = uaa_config @logger = Steno.logger('cc.uaa_token_decoder') r...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/uaa/errors.rb
Ruby
apache-2.0
203
main
779
module VCAP::CloudController class UaaError < StandardError; end class UaaResourceNotFound < UaaError def message 'The requested resource was not found in the UAA' end end class UaaResourceAlreadyExists < UaaError def message 'The requested resource already exists in the UAA' end ...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/uaa/uaa_verification_keys.rb
Ruby
apache-2.0
203
main
1,666
module VCAP::CloudController class UaaVerificationKeys def initialize(info) @info = info end def value @uaa_keys = update_keys(@uaa_keys) if @uaa_keys.nil? || invalid_keys? @uaa_keys[:keys] end def refresh @uaa_keys = nil end private def update_keys(last_fet...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/strategies/non_manifest_strategy.rb
Ruby
apache-2.0
203
main
218
module VCAP::CloudController class NonManifestStrategy def initialize(message, process) @process = process @message = message end def updated_command @message.command end end end
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/strategies/manifest_strategy.rb
Ruby
apache-2.0
203
main
375
module VCAP::CloudController class ManifestStrategy NULL_START_COMMANDS = %w[default null].freeze def initialize(message, process) @process = process @message = message end def updated_command if NULL_START_COMMANDS.include?(@message.command) nil elsif @message.comman...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/rest_controller/routes.rb
Ruby
apache-2.0
203
main
2,225
require 'controllers/base/front_controller' module VCAP::CloudController::RestController module Routes def self.included(base) base.extend(ClassMethods) end module ClassMethods def define_route(verb, path, method=nil, &blk) opts = {} klass = self controller.send(verb,...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/rest_controller/common_params.rb
Ruby
apache-2.0
203
main
1,323
require 'cgi' module VCAP::CloudController::RestController class CommonParams def initialize(logger) @logger = logger end def parse(params, query_string=nil) @logger.debug "parse_params: #{params} #{query_string}" # Sinatra squashes duplicate query parms into a single entry rather ...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/rest_controller/secure_eager_loader.rb
Ruby
apache-2.0
203
main
3,052
module VCAP::CloudController::RestController class SecureEagerLoader def eager_load_dataset(dataset, starting_controller_class, default_visibility_filter, additional_visibility_filters, depth) eager_load_hash = build_eager_load_hash( starting_controller_class, dataset.model, default_...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/rest_controller/preloaded_object_serializer.rb
Ruby
apache-2.0
203
main
1,189
require 'presenters/v2/presenter_provider' module VCAP::CloudController::RestController class PreloadedObjectSerializer # Render an object as a hash, using export and security properties # set by its controller. # # @param [RestController] controller Controller for the object being # serialized. ...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/rest_controller/controller_dsl.rb
Ruby
apache-2.0
203
main
3,159
module VCAP::CloudController::RestController # DSL that is available inside define_attributes on a rest controller # class. module ControllerDSL include VCAP::RestAPI class ToRelationshipAttribute < NamedAttribute attr_reader :association_name, :link_only, :association_controller alias_method...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/rest_controller/paginated_collection_renderer.rb
Ruby
apache-2.0
203
main
5,532
require 'addressable/uri' require 'cloud_controller/rest_controller/order_applicator' module VCAP::CloudController::RestController class PaginatedCollectionRenderer attr_reader :collection_transformer def initialize(eager_loader, serializer, opts) @eager_loader = eager_loader @serializer = seria...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
lib/cloud_controller/rest_controller/object_renderer.rb
Ruby
apache-2.0
203
main
3,251
require 'addressable/uri' module VCAP::CloudController::RestController class ObjectRenderer attr_reader :object_transformer def initialize(eager_loader, serializer, opts) @eager_loader = eager_loader @serializer = serializer @max_inline_relations_depth = opts.fetch(:max_inline_relations_d...