aviemzur commented on a change in pull request #59:
URL: https://github.com/apache/incubator-liminal/pull/59#discussion_r676394285
##########
File path: .gitignore
##########
@@ -25,7 +25,6 @@ venv
*.pyc
pip-selfcheck.json
.DS_Store
-build
Review comment:
Please change this to `/build` rather than deleting this line
##########
File path: liminal/build/image/spark/spark.py
##########
@@ -0,0 +1,45 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+import os
+
+from liminal.build.python import BasePythonImageBuilder
+
+
+class SparkImageBuilder(BasePythonImageBuilder):
+ def __init__(self, config, base_path, relative_source_path, tag):
+ super().__init__(config, base_path, relative_source_path, tag)
+
+ @staticmethod
+ def _dockerfile_path():
+ return os.path.join(os.path.dirname(__file__), 'Dockerfile')
+
+ def _additional_files_from_filename_content_pairs(self):
+ with open(self._dockerfile_path()) as original:
+ data = original.read()
+
+ data = self.__add_pip_install(data)
+ data = self._mount_pip_conf(data)
+
+ return [('Dockerfile', data)]
+
+ @staticmethod
+ def __add_pip_install(data):
+ new_data = data
+ new_data = new_data.replace('{{INSTALL_COMMANDS}}',
Review comment:
IIUC this happens always, so why not just change this in the dockerfile
instead of this replace?
##########
File path: examples/spark-app-demo/emr/configs/emr_cloudformation_template.yml
##########
@@ -0,0 +1,55 @@
+AWSTemplateFormatVersion: 2010-09-09
Review comment:
Missing license here. Make sure to run tests locally.
##########
File path: tests/runners/airflow/tasks/test_spark_task.py
##########
@@ -57,26 +154,27 @@ def test_get_runnable_command(self):
[],
trigger_rule='all_success',
liminal_config={},
- pipeline_config={},
+ pipeline_config={'pipeline': 'pipeline'},
task_config=task_config
).get_runnable_command()
self.assertEqual(actual.sort(), expected.sort())
+
def test_missing_spark_arguments(self):
task_config = {
'application_source': 'my_app.py',
'application_arguments': {
- '--query': "select * from
dlk_visitor_funnel_dwh_staging.fact_events where unified_Date_prt >= "
- "'{{yesterday_ds}}'",
+ '--query': "select * from
dlk_visitor_funnel_dwh_staging.fact_events where"
+ " unified_Date_prt >= '{{yesterday_ds}}'",
'--output': 'mytable'
}
}
expected = ['spark-submit', 'my_app.py',
'--query',
- "select * from dlk_visitor_funnel_dwh_staging.fact_events
where unified_Date_prt >="
- " '{{yesterday_ds}}'",
+ "select * from dlk_visitor_funnel_dwh_staging.fact_events
where "
Review comment:
Can we make the table/column/database names more generic? Looks like
this was lifted from a fork.
##########
File path: examples/spark-app-demo/emr/archetype/liminal.yml
##########
@@ -0,0 +1,62 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+---
+# superliminal for local development
+name: InfraSpark
+type: super
+variables:
+ region: us-east-1
+ core_count: 2
+ emr_version: 'emr-6.2.0'
+ template_url:
's3://ni-data-infra-dev/liminal-test/emr_cloudformation_template.yml'
Review comment:
Bucket name should be configurable, please take with @naturalett
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]