gen is the library responsible for generating static configuration for DC/OS cluster nodes from configuration parameters. This is achieved in part with a custom template engine whose primary feature is generating a parameter schema from a template. To see an example of this in action, check out the DC/OS Settings Template
aws/: AWS Cloudformation templates used in both simple and advanced Cloudformation templatesazure/: templates used for Azure Resource Manager deploymentsbuild_deploy/: instructions for how to construct the templates and associated artifacts per deployment methodcoreosandcoreos-aws: templated add-ons for CoreOSip-detect: commonly used ip-detect scripts which can be pulled up as defaults
__init__.py: contains the combined methods for generating a complete deployment artifacts for a given configurationcalc.py: methods for top-level option determination and validationinternals.py: tools for defining required arguments as well how to conditionally resolve themtemplate.py: custom templating engine
The artifacts configured by gen templates and built by pkgpanda are actually delivered to hosts via one of the deployment methods crafted in the do_create function of the modules in gen.build_deploy.
The modules gen.build_deploy.aws and gen.build_deploy.azure provide templates that interact directly with the specific provider services and APIs. By leveraging the native tools of a cloud provider, DC/OS can be spun up much faster with appropriate configurations. The downside is that relying on provider APIs can make upgrading much harder as many more settings outside of DC/OS need to be touched. Finally, some settings need to be baked into a template as provider APIs might not allow the required level of configuration flexibility.
The on-prem installer is a docker image that is loaded with an entry-point for the program dcos_installer (hosted in the top-level of this repository) as well as the complete set of built packages. The installer can:
- use SSH to push packages to hosts
- call gen to configure DC/OS to the fullest
- generate configured artifacts for other provisioning methods
The Dockerfile is templated and must be processed by gen to inject the build-specific artifact paths. The setup of the installer software is easily handled by extracting the installer bootstrap tarball to /opt/mesosphere and sourcing /opt/mesosphere/environment.export