Foundry dea_ng in the Cloud source file analysis

Label Foundry CloudSource codeDea_ngDEA
1856 people read comments(0) Collection Report

The function of each file in /dea_ng/lib/dea/ directory

Bootstrap.rb: mainly responsible for the configuration of the other modules of dea_ng, also responsible for the work of these modules, the main modules are NATs, logging, loggregator, droplet_registry, instance_registry, staging_task_registry, instance_manager, snapshot, resource_manager, router_client, directory_server_v2, directories, pid_file, sweepers,, etc..

Config.rb: the main definition of a part of the configuration items, also defines the parameters of the parameters of the type of analysis.

Droplet.rb: responsible for creating the droplet specified directory, as well as the contents of the final droplet will be downloaded to the corresponding directory.

Droplet_registry.rb: it is actually a Hash object, is responsible for recording the Droplet in the local storage.

Env.rb: mainly responsible for the application of environmental variables, such as export system environment variables, user environment variables, etc..

Loggregator.rb: responsible for the DEA log processing and push.

Nats.rb: DEA module is mainly responsible for the NATS communication part, such as the subscription news, as well as the specific implementation process.

Promise.rb: in my understanding, is responsible for the management of the task distribution and processing of objects, can be tailored to the task of custom execution.

Protocol.rb: mainly responsible for the definition of the DEA used to define the message.

Registry_enumeration.rb: responsible for recording the current state of the memory and disk usage.

Resouce_manager.rb:DEA to create the application of resource management, including the limits of resources, the allocation of resources.

Router_client.rb: as the interaction with the DEA router client, is responsible for the registration of the domain name and the domain name registration by NATS at router.

Snapshot.rb: is responsible for the current status of the application of information to save the snapshot and snapshot information is exported, and applications.json similar to the V1, V2 for instances.json.

Stats_collector.rb: mainly responsible for the use of the collection of resources, including memory, disk, and the use of CPU.

Task.rb: mainly responsible for the creation of container warden, and through the promise to achieve a simple management of container.

User_facing_error.rb: the main description of the user to meet the simple error.

Version.rb: returns the version number of DEA.

The function of each file in /dea_ng/lib/dea/directory_server directory

Directory_server_v2.rb: configuration application path, packaged tasks these two objects, and provides a thin @file_api_server server side, in addition to provide authentication code HMAC authentication.

Hmac_help.rb: to provide HMAC authentication code generation and verification functions;

Instance_paths.rb: to provide users with the path of the corresponding application examples

Staging_tasks.rb: the HTTP request, access to the corresponding application of the path of the staging_task.

The function of each file in /dea_ng/lib/dea/health_check directory

Base.rb: to initialize the base class healthcheck.

Port_open.rb: through the EM to connect the port, to check whether the corresponding DEA port for the open state

State_file_ready.rb: check the status information in the file under the corresponding path.

The function of each file in /dea_ng/lib/dea/lifecycle directory

Evcacuation_handler.rb:DEA to do the evacuation application and the introduction of the matter, mainly to stop the application, to send the application of exit information, the status of the transfer of applications, etc..

Shutdown_handler.rb:DEA to do the closing operation, delete all the droplet information, stop all the tasks of the execution, and end the operation of the DEA process.

Signal_handler.rb: capture the signal sent to the process of the process, and do the corresponding processing, such as term, int, quit, usr1, usr2, etc..

The function of each file in /dea_ng/lib/dea/staging directory

Admin_buildpack_downloader.rb: by specifying the URL to download buildpack, through the Promise to complete.

Buildpack_manager.rb: is responsible for the management of buildpack, including download, list and delete, etc..

Staging_env.rb: is responsible for providing the system environment variables needed for application deployment.

Staging_message.rb: provides the relevant parameters needed for the package droplet process, such as: app_id, task_id, download_uri, upload_uri, buildpack_cache_upload_uri, buildpack_cache_download_uri, etc..

Staging_task.rb: defines the staging task, which contains a number of key steps in the process of staging implementation, such as unpack_app, unpack_buildpack_cache, stage, pack_app, copy_out, save_droplet, log_upload_started, staging_info serial implementation, etc..

Staging_task_registry.rb: is mainly responsible for recording staging_task, with task_id as the key to record the information of task.

Staging_task_workspace.rb: to provide the complete working space required by the staging task, including a large number of directories, such as: workspace_dir, warden_staged_droplet, warden_unstaged_buildpack_cache, warden_staged_buildpack_cache, warden_cache, wardeb_unstaged_dir, warden_staged_dir, TMPDIR, admin_buildpacks_dir, etc..

The function of each file in /dea_ng/lib/dea/starting directory

Instance.rb: defines the state of the application examples, as well as changes in the state of the application, and the application of the configuration of the start, the required environment, as well as the realization of the application of the start. Among them promise_droplet - droplet download, setup - container promise_extract_droplet, extract - droplet promise_start, execute - start script, etc. promise_container,,,,, and so on. The processing mechanism is also set up in the state of crash, and the application of the resource acquisition.

Instance_manager.rb: on the application of the creation, as well as the configuration of the application of state transition management.

Instance_registry.rb: is responsible for the management of application records, including the new application in the DEA records, when the withdrawal of the deleted, as there are regular processing of the application of crash records.

Running_env.rb: provides environmental variables used to load when starting the application.

Start_message.rb: provides all the parameters needed to start the application.

Startup_script_generator.rb: responsible for the generation of the application of the startup script, including the start of the script, load the environment variables, etc..

Data_uri_generator.rb: is responsible for the application of the database_url environment variable load value, the role of the unknown.

The function of each file in /dea_ng/lib/dea/responders directory

Dea_locator.rb: is responsible for the release of the message, to show the existence of dea.

Staging_locator.rb: is responsible for the release of the message, to show the existence of the staging module.

Staging.rb: is responsible for the opening and closing of the subscription to the staging module.

About the author:

Sun Hongliang,DAOCLOUDSoftware engineer. In the past two years, the main research areas of PaaS related knowledge and technology in the field of cloud computing. Firmly believe that the technology of lightweight virtual container, will bring the depth of the impact of the PaaS field, and even determine the future direction of PaaS technology.

Reproduced please indicate the source.

This article is more out of my own understanding, in some places, there are some deficiencies and errors. I hope this article can be of some help to people in contact with DEA_NG, if you are interested in this area, and have better ideas and suggestions, please contact me.

My email address:

Guess you're looking for
View comments
* the above user comments only represent their personal views, does not represent the views or position of the CSDN website
    personal data
    • Visit81595 times
    • Integral:One thousand three hundred and twenty-seven
    • Grade
    • Rank:18622nd name
    • Original47
    • Reproduced:0
    • Translation:1
    • Comments:49
    Blog column
    Contact information
    Latest comments