private static Optional<ExternalContext> buildExternalContext(Config config) {
    /*
     * By default, use an empty ExternalContext here. In a custom fork of Samza, this can be implemented to pass
     * a non-empty ExternalContext to SamzaContainer. Only config should be used to build the external context. In the
     * future, components like the application descriptor may not be available to LocalContainerRunner.
     */
    return Optional.empty();
  }
This method launches a Samza container in a managed cluster, e.g. Yarn.
samza-core/src/main/java/org/apache/samza/runtime/ContainerLaunchUtil.java