Skip to content
This repository has been archived by the owner on Mar 3, 2023. It is now read-only.

[Heron-3724] Separate the Manager and Executors. #3741

Merged
merged 61 commits into from
Dec 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
7cde13b
[Kubernetes] <V1Controller>
surahman Nov 18, 2021
e7b5cd6
[Kubernetes] <V1Controller>
surahman Nov 18, 2021
b0155d2
[Kubernetes] <V1Controller>
surahman Nov 19, 2021
678da38
[Kubernetes] <V1Controller>
surahman Nov 19, 2021
34431c3
[Kubernetes] <V1Controller>
surahman Nov 19, 2021
3b0da78
[Kubernetes] <KubernetesContext>
surahman Nov 19, 2021
27c0bfb
[Kubernetes] <V1Controller>
surahman Nov 19, 2021
13042b8
[Tests] <V1Controller>
surahman Nov 19, 2021
4fa0b4a
[Kubernetes] <V1Controller>
surahman Nov 19, 2021
23e0b21
[Kubernetes] <V1Controller>
surahman Nov 19, 2021
971a27f
[Kubernetes] <V1Controller>
surahman Nov 19, 2021
44afa88
[Kubernetes] <V1Controller>
surahman Nov 19, 2021
c9119ad
[Kubernetes] <V1Controller>
surahman Nov 19, 2021
1564bec
[Kubernetes] Deployments
surahman Nov 19, 2021
b156218
[Kubernetes] <V1Controller>
surahman Nov 20, 2021
ba251e1
[Kubernetes] <V1Controller>
surahman Nov 20, 2021
3cfd24b
[Kubernetes] <V1Controller>
surahman Nov 20, 2021
75bd760
[Kubernetes] <V1Controller>
surahman Nov 20, 2021
aca9776
[Kubernetes] <Context>
surahman Nov 21, 2021
87094b4
[Kubernetes] <V1Controller>
surahman Nov 21, 2021
0d3e2b9
[Test] <V1Controller>
surahman Nov 21, 2021
dfcbdb5
[Kubernetes] <V1Controller>
surahman Nov 21, 2021
56e3de7
[Tests] <V1Controller>
surahman Nov 23, 2021
58b59f1
[Kubernetes] <V1Controller>
surahman Nov 21, 2021
5ae10c6
[Tests] <V1Controller>
surahman Nov 23, 2021
ba22a0b
[Kubernetes] <V1Controller>
surahman Nov 21, 2021
3c73d49
[Docs] instructions for the CLI commands.
surahman Dec 1, 2021
1758c16
[Kubernetes] <V1Controller>
surahman Nov 27, 2021
cb62fd8
[Kubernetes] <Context>
surahman Nov 28, 2021
921c110
[Kubernetes] <V1Controller>
surahman Nov 28, 2021
1812aed
[Tests] <V1Controller>
surahman Nov 28, 2021
f01aa1e
[Kubernetes] <V1Controller>
surahman Nov 28, 2021
7d0fbf7
[Kubernetes] <V1Controller>
surahman Nov 28, 2021
e88382f
[Kubernetes] <V1Controller>
surahman Nov 28, 2021
2882e4b
[Kubernetes] <V1Controller>
surahman Nov 28, 2021
34e859c
[Kubernetes] <Context>
surahman Nov 29, 2021
976d381
[Kubernetes] <V1Controller>
surahman Nov 29, 2021
aea8998
[Kubernetes] <V1Controller>
surahman Nov 29, 2021
7699fe1
[Kubernetes] <Context>
surahman Nov 29, 2021
857f410
[Kubernetes] <V1Controller>
surahman Nov 30, 2021
5154b5f
[Kubernetes] <Context>
surahman Nov 30, 2021
8124f1d
[Kubernetes] <V1Controller>
surahman Nov 30, 2021
96a5c4a
[Kubernetes] <V1Controller>
surahman Dec 1, 2021
5356072
[Tests] <V1Controller>
surahman Dec 1, 2021
7b36df1
[Tests] <V1Controller>
surahman Dec 1, 2021
c84f262
Merge branch '3724-Separate-Executor-Manager-dev' into 3724-Separate-…
surahman Dec 1, 2021
3cfef11
[Kubernetes] <V1Controller>
surahman Dec 1, 2021
a3ef579
[Kubernetes] <Context>
surahman Dec 1, 2021
7c9d291
[Docs] Pod Templates
surahman Dec 1, 2021
a812bcb
[Docs] Persistent Volumes via CLI
surahman Dec 1, 2021
f4474ba
[Docs] Limits and Requests via CLI
surahman Dec 1, 2021
c13c0ee
[Docs] K8s execution environment customization
surahman Dec 1, 2021
d7e68dc
Merge branch '3724-Separate-Executor-Manager-dev' into 3724-Separate-…
surahman Dec 1, 2021
61ba6bd
[Docs] Removed old K8s docs.
surahman Dec 1, 2021
ae2a660
Merge branch '3724-Separate-Executor-Manager-dev' into 3724-Separate-…
surahman Dec 1, 2021
58713a7
[Docs] K8s execution environment customization
surahman Dec 1, 2021
9fd7809
[Docs] K8s execution environment customization
surahman Dec 3, 2021
5068c79
Merge branch '3724-Separate-Executor-Manager-dev' into 3724-Separate-…
surahman Dec 3, 2021
50dc44e
[Docs] K8s execution environment customization
surahman Dec 3, 2021
b060bdd
[Kubernetes] <V1Controller>
surahman Dec 3, 2021
b53d476
Merge branch '3724-Separate-Executor-Manager-dev' into 3724-Separate-…
surahman Dec 3, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion deploy/kubernetes/general/apiserver.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ spec:
-D heron.uploader.dlog.topologies.namespace.uri=distributedlog://zookeeper:2181/heron
-D heron.statefulstorage.classname=org.apache.heron.statefulstorage.dlog.DlogStorage
-D heron.statefulstorage.dlog.namespace.uri=distributedlog://zookeeper:2181/heron
-D heron.kubernetes.pod.template.configmap.disabled=false
-D heron.kubernetes.pod.template.disabled=false
-D heron.kubernetes.persistent.volume.claims.cli.disabled=false

---
Expand Down
3 changes: 2 additions & 1 deletion deploy/kubernetes/helm/templates/tools.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ spec:
-D heron.class.repacking.algorithm=org.apache.heron.packing.binpacking.FirstFitDecreasingPacking
{{- end }}
-D heron.kubernetes.resource.request.mode={{ .Values.topologyResourceRequestMode }}
-D heron.kubernetes.pod.template.configmap.disabled={{ .Values.disablePodTemplates }}
-D heron.kubernetes.pod.template.disabled={{ .Values.disablePodTemplates }}
-D heron.kubernetes.persistent.volume.claims.cli.disabled={{ .Values.disablePersistentVolumeMountsCLI }}
envFrom:
- configMapRef:
Expand Down Expand Up @@ -297,6 +297,7 @@ rules:
- patch
- update
- watch
- deletecollection
- apiGroups:
- ""
resources:
Expand Down
2 changes: 1 addition & 1 deletion deploy/kubernetes/minikube/apiserver.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ spec:
-D heron.uploader.dlog.topologies.namespace.uri=distributedlog://zookeeper:2181/heronbkdl
-D heron.statefulstorage.classname=org.apache.heron.statefulstorage.dlog.DlogStorage
-D heron.statefulstorage.dlog.namespace.uri=distributedlog://zookeeper:2181/heronbkdl
-D heron.kubernetes.pod.template.configmap.disabled=false
-D heron.kubernetes.pod.template.disabled=false
-D heron.kubernetes.persistent.volume.claims.cli.disabled=false

---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ private KubernetesConstants() {
public static final String CPU = "cpu";

public static final String EXECUTOR_NAME = "executor";
public static final String MANAGER_NAME = "manager";

// container env constants
public static final String ENV_HOST = "HOST";
Expand Down Expand Up @@ -89,6 +90,9 @@ private KubernetesConstants() {
public static final String JOB_LINK =
"/api/v1/namespaces/kube-system/services/kubernetes-dashboard/proxy/#/pod";

protected static final String JSON_PATCH_STATEFUL_SET_REPLICAS_FORMAT =
"[{\"op\":\"replace\",\"path\":\"/spec/replicas\",\"value\":%d}]";

public static final Pattern VALID_POD_NAME_REGEX =
Pattern.compile("[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*",
Pattern.CASE_INSENSITIVE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,11 @@ public enum KubernetesResourceRequestMode {
public static final String KUBERNETES_VOLUME_AWS_EBS_FS_TYPE =
"heron.kubernetes.volume.awsElasticBlockStore.fsType";

// pod template configmap
public static final String KUBERNETES_POD_TEMPLATE_CONFIGMAP_NAME =
"heron.kubernetes.pod.template.configmap.name";
public static final String KUBERNETES_POD_TEMPLATE_CONFIGMAP_DISABLED =
"heron.kubernetes.pod.template.configmap.disabled";
// Pod Template ConfigMap: heron.kubernetes.[executor | manager].pod.template
public static final String KUBERNETES_POD_TEMPLATE_LOCATION =
"heron.kubernetes.%s.pod.template";
public static final String KUBERNETES_POD_TEMPLATE_DISABLED =
"heron.kubernetes.pod.template.disabled";

// container mount volume mount keys
public static final String KUBERNETES_CONTAINER_VOLUME_MOUNT_NAME =
Expand All @@ -116,9 +116,15 @@ public enum KubernetesResourceRequestMode {
// Persistent Volume Claims
public static final String KUBERNETES_PERSISTENT_VOLUME_CLAIMS_CLI_DISABLED =
"heron.kubernetes.persistent.volume.claims.cli.disabled";
// heron.kubernetes.volumes.persistentVolumeClaim.VOLUME_NAME.OPTION=OPTION_VALUE
// heron.kubernetes.[executor | manager].volumes.persistentVolumeClaim.VOLUME_NAME.OPTION=VALUE
public static final String KUBERNETES_VOLUME_CLAIM_PREFIX =
"heron.kubernetes.volumes.persistentVolumeClaim.";
"heron.kubernetes.%s.volumes.persistentVolumeClaim.";
// heron.kubernetes.[executor | manager].limits.OPTION=VALUE
public static final String KUBERNETES_RESOURCE_LIMITS_PREFIX =
"heron.kubernetes.%s.limits.";
// heron.kubernetes.[executor | manager].requests.OPTION=VALUE
public static final String KUBERNETES_RESOURCE_REQUESTS_PREFIX =
"heron.kubernetes.%s.requests.";

private KubernetesContext() {
}
Expand Down Expand Up @@ -189,12 +195,14 @@ static String getContainerVolumeMountPath(Config config) {
return config.getStringValue(KUBERNETES_CONTAINER_VOLUME_MOUNT_PATH);
}

public static String getPodTemplateConfigMapName(Config config) {
return config.getStringValue(KUBERNETES_POD_TEMPLATE_CONFIGMAP_NAME);
public static String getPodTemplateConfigMapName(Config config, boolean isExecutor) {
final String key = String.format(KUBERNETES_POD_TEMPLATE_LOCATION,
isExecutor ? KubernetesConstants.EXECUTOR_NAME : KubernetesConstants.MANAGER_NAME);
return config.getStringValue(key);
}

public static boolean getPodTemplateConfigMapDisabled(Config config) {
final String disabled = config.getStringValue(KUBERNETES_POD_TEMPLATE_CONFIGMAP_DISABLED);
public static boolean getPodTemplateDisabled(Config config) {
final String disabled = config.getStringValue(KUBERNETES_POD_TEMPLATE_DISABLED);
return "true".equalsIgnoreCase(disabled);
}

Expand Down Expand Up @@ -222,6 +230,18 @@ public static Map<String, String> getPodSecretKeyRefs(Config config) {
return getConfigItemsByPrefix(config, KUBERNETES_POD_SECRET_KEY_REF_PREFIX);
}

public static Map<String, String> getResourceLimits(Config config, boolean isExecutor) {
final String key = String.format(KUBERNETES_RESOURCE_LIMITS_PREFIX,
isExecutor ? KubernetesConstants.EXECUTOR_NAME : KubernetesConstants.MANAGER_NAME);
return getConfigItemsByPrefix(config, key);
}

public static Map<String, String> getResourceRequests(Config config, boolean isExecutor) {
final String key = String.format(KUBERNETES_RESOURCE_REQUESTS_PREFIX,
isExecutor ? KubernetesConstants.EXECUTOR_NAME : KubernetesConstants.MANAGER_NAME);
return getConfigItemsByPrefix(config, key);
}

public static boolean getPersistentVolumeClaimDisabled(Config config) {
final String disabled = config.getStringValue(KUBERNETES_PERSISTENT_VOLUME_CLAIMS_CLI_DISABLED);
return "true".equalsIgnoreCase(disabled);
Expand All @@ -231,15 +251,18 @@ public static boolean getPersistentVolumeClaimDisabled(Config config) {
* Collects parameters form the <code>CLI</code> and generates a mapping between <code>Volumes</code>
* and their configuration <code>key-value</code> pairs.
* @param config Contains the configuration options collected from the <code>CLI</code>.
* @param isExecutor Flag used to collect CLI commands for the <code>executor</code> and <code>manager</code>.
* @return A mapping between <code>Volumes</code> and their configuration <code>key-value</code> pairs.
* Will return an empty list if there are no Volume Claim Templates to be generated.
*/
public static Map<String, Map<KubernetesConstants.VolumeClaimTemplateConfigKeys, String>>
getVolumeClaimTemplates(Config config) {
getVolumeClaimTemplates(Config config, boolean isExecutor) {
final Logger LOG = Logger.getLogger(V1Controller.class.getName());

final Set<String> completeConfigParam = getConfigKeys(config, KUBERNETES_VOLUME_CLAIM_PREFIX);
final int prefixLength = KUBERNETES_VOLUME_CLAIM_PREFIX.length();
final String prefixKey = String.format(KUBERNETES_VOLUME_CLAIM_PREFIX,
isExecutor ? KubernetesConstants.EXECUTOR_NAME : KubernetesConstants.MANAGER_NAME);
final Set<String> completeConfigParam = getConfigKeys(config, prefixKey);
final int prefixLength = prefixKey.length();
final int volumeNameIdx = 0;
final int optionIdx = 1;
final Matcher matcher = KubernetesConstants.VALID_LOWERCASE_RFC_1123_REGEX.matcher("");
Expand Down
Loading