Skip to content

Commit a898713

Browse files
authored
Merge pull request #587 from boozallen/141-fix-s3-local-suppressed-manual-action
#141 enable default s3-local deploy template value
2 parents 78684fe + 65f0f0c commit a898713

File tree

6 files changed

+65
-4
lines changed

6 files changed

+65
-4
lines changed

foundation/foundation-mda/src/main/java/com/boozallen/aiops/mda/generator/KubernetesGenerator.java

-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ public class KubernetesGenerator extends AbstractKubernetesGenerator {
122122
* | lineageHttpConsumerValuesFile | deployment/lineage-http-consumer/v2/lineage.http.consumer.values.yaml.vm | apps/${appName}/values.yaml |
123123
* | s3LocalChartFileV2 | deployment/localstack/localstack.chart.yaml.vm | apps/${appName}/Chart.yaml |
124124
* | s3LocalValuesDevFileV2 | deployment/localstack/localstack.values.dev.yaml.vm | apps/${appName}/values-dev.yaml |
125-
* | s3LocalValuesFileV2 | deployment/localstack/localstack.values.yaml.vm | apps/${appName}/values.yaml |
126125
* | metadataValuesDevFile | deployment/metadata/metadata.values-dev.yaml.vm | apps/${appName}/values-dev.yaml |
127126
* | metadataValuesFile | deployment/metadata/metadata.values.yaml.vm | apps/${appName}/values.yaml |
128127
* | metadataHelmChartFileV2 | deployment/metadata/v2/metadata.chart.yaml.vm | apps/${appName}/Chart.yaml |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
package com.boozallen.aiops.mda.generator;
2+
3+
/*-
4+
* #%L
5+
* AIOps Foundation::AIOps MDA
6+
* %%
7+
* Copyright (C) 2021 Booz Allen
8+
* %%
9+
* This software package is licensed under the Booz Allen Public License. All Rights Reserved.
10+
* #L%
11+
*/
12+
13+
import com.boozallen.aiops.mda.generator.common.PipelineEnum;
14+
import com.boozallen.aiops.mda.generator.common.VelocityProperty;
15+
import com.boozallen.aiops.mda.metamodel.AissembleModelInstanceRepository;
16+
import com.boozallen.aiops.mda.metamodel.element.Pipeline;
17+
import com.boozallen.aiops.mda.metamodel.element.python.MachineLearningPipeline;
18+
import org.apache.velocity.VelocityContext;
19+
import org.technologybrewery.fermenter.mda.generator.GenerationContext;
20+
21+
import java.util.Map;
22+
23+
public class S3LocalValuesKubernetesGenerator extends AbstractKubernetesGenerator {
24+
/*--~-~-~~
25+
* Usages:
26+
* | Target | Template | Generated File |
27+
* |----------------------|--------------------------------------------------|------------------------------|
28+
* | s3LocalValuesFileV2 | deployment/localstack/localstack.values.yaml.vm | apps/${appName}/values.yaml |
29+
*/
30+
31+
@Override
32+
public void generate(GenerationContext context) {
33+
VelocityContext vc = this.configureWithoutGeneration(context);
34+
AissembleModelInstanceRepository metamodelRepository = (AissembleModelInstanceRepository) context.getModelInstanceRepository();
35+
Map<String, Pipeline> pipelineMap = metamodelRepository.getPipelinesByContext(metadataContext);
36+
for (Pipeline pipeline: pipelineMap.values()) {
37+
String pipelineType = pipeline.getType().getName();
38+
if (PipelineEnum.DATA_FLOW.equalsIgnoreCase(pipelineType)) {
39+
// pyspark/spark pipelines
40+
vc.put(VelocityProperty.DATAFLOW_PIPELINES, true);
41+
} else if (PipelineEnum.MACHINE_LEARNING.equalsIgnoreCase(pipelineType)) {
42+
// training/inference pipelines
43+
vc.put(VelocityProperty.MACHINE_LEARNING_PIPELINES, true);
44+
}
45+
}
46+
47+
48+
generateFile(context, vc);
49+
}
50+
51+
}

foundation/foundation-mda/src/main/java/com/boozallen/aiops/mda/generator/common/VelocityProperty.java

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ public final class VelocityProperty {
2222
public static final String SPARK_PIPELINES = "sparkPipelines";
2323
public static final String PYSPARK_PIPELINES = "pysparkPipelines";
2424
public static final String DATAFLOW_PIPELINES = "dataFlowPipelines";
25+
public static final String MACHINE_LEARNING_PIPELINES = "machineLearningPipelines";
2526
public static final String TRAINING_PIPELINE = "trainingPipeline";
2627
public static final String TRAINING_PIPELINES = "trainingPipelines";
2728
public static final String INFERENCE_PIPELINE = "inferencePipeline";

foundation/foundation-mda/src/main/resources/targets.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2929,7 +2929,7 @@
29292929
"name": "s3LocalValuesFileV2",
29302930
"templateName": "templates/deployment/localstack/localstack.values.yaml.vm",
29312931
"outputFile": "apps/${appName}/values.yaml",
2932-
"generator": "com.boozallen.aiops.mda.generator.KubernetesGenerator",
2932+
"generator": "com.boozallen.aiops.mda.generator.S3LocalValuesKubernetesGenerator",
29332933
"metadataContext": "targeted",
29342934
"overwritable": false
29352935
},

foundation/foundation-mda/src/main/resources/templates/deployment/localstack/localstack.values.yaml.vm

+11-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,14 @@
55
################################################################################]]##
66

77
aissemble-localstack-chart:
8-
buckets: []
8+
buckets:
9+
#if (${dataFlowPipelines})
10+
- name: spark-infrastructure
11+
keys:
12+
- warehouse/
13+
#end
14+
#if (${machineLearningPipelines})
15+
- name: mlflow-models
16+
keys:
17+
- mlflow-storage/
18+
#end

foundation/foundation-mda/src/main/resources/templates/notifications/notification.s3.local.buckets.vm

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
In ${rootPath}:
3-
Remove the empty "[]" from "buckets: []" and include the following content to the list:
3+
Append the following content to the bucket list:
44

55
- name: ${bucketName}
66
keys:

0 commit comments

Comments
 (0)