You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2020/06/03 13:47:12 UTC

[GitHub] [airflow] kaxil commented on a change in pull request #8777: Add Production Helm chart support

kaxil commented on a change in pull request #8777:
URL: https://github.com/apache/airflow/pull/8777#discussion_r434571993



##########
File path: chart/templates/configmap.yaml
##########
@@ -0,0 +1,122 @@
+# 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.
+
+################################
+## Airflow ConfigMap
+#################################
+apiVersion: v1
+kind: ConfigMap
+metadata:
+  name: {{ template "airflow_config" . }}
+  labels:
+    tier: airflow
+    component: config
+    release: {{ .Release.Name }}
+    chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
+    heritage: {{ .Release.Service }}
+{{- with .Values.labels }}
+{{ toYaml . | indent 4 }}
+{{- end }}
+data:
+  # These are system-specified config overrides.
+  airflow.cfg: |
+    [core]
+    load_examples = False
+    colored_console_log = False
+    executor = {{ .Values.executor }}
+{{- if .Values.elasticsearch.enabled }}
+    remote_logging = True
+{{- end }}

Review comment:
       We need to fix this to allow GCS/S3 other remote logging bits

##########
File path: chart/templates/configmap.yaml
##########
@@ -0,0 +1,122 @@
+# 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.
+
+################################
+## Airflow ConfigMap
+#################################
+apiVersion: v1
+kind: ConfigMap
+metadata:
+  name: {{ template "airflow_config" . }}
+  labels:
+    tier: airflow
+    component: config
+    release: {{ .Release.Name }}
+    chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
+    heritage: {{ .Release.Service }}
+{{- with .Values.labels }}
+{{ toYaml . | indent 4 }}
+{{- end }}
+data:
+  # These are system-specified config overrides.
+  airflow.cfg: |
+    [core]
+    load_examples = False
+    colored_console_log = False
+    executor = {{ .Values.executor }}
+{{- if .Values.elasticsearch.enabled }}
+    remote_logging = True
+{{- end }}
+
+    [webserver]
+    enable_proxy_fix = True
+    expose_config = True
+    rbac = True
+
+{{- if eq .Values.executor "CeleryExecutor" }}
+    [celery]
+    default_queue = celery
+{{- end }}
+
+    [scheduler]
+    scheduler_heartbeat_sec = 5
+{{- if .Values.statsd.enabled }}
+    statsd_on = True
+    statsd_port = 9125
+    statsd_prefix = airflow
+    statsd_host = {{ printf "%s-statsd" .Release.Name }}
+{{- end }}
+    # Restart Scheduler every 41460 seconds (11 hours 31 minutes)
+    # The odd time is chosen so it is not always restarting on the same "hour" boundary
+    run_duration = 41460
+
+{{- if .Values.elasticsearch.enabled }}
+    [elasticsearch]
+    # The elasticsearch variables were updated to the shorter names in v1.10.4
+    write_stdout = True
+    json_format = True
+    log_id_template = {dag_id}_{task_id}_{execution_date}_{try_number}

Review comment:
       We need to mention though the something external needs to collect logs and attached log_id to each record.
   
   https://github.com/astronomer/astronomer/blob/master/charts/fluentd/templates/fluentd-configmap.yaml#L163-L171

##########
File path: chart/templates/configmap.yaml
##########
@@ -0,0 +1,122 @@
+# 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.
+
+################################
+## Airflow ConfigMap
+#################################
+apiVersion: v1
+kind: ConfigMap
+metadata:
+  name: {{ template "airflow_config" . }}
+  labels:
+    tier: airflow
+    component: config
+    release: {{ .Release.Name }}
+    chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
+    heritage: {{ .Release.Service }}
+{{- with .Values.labels }}
+{{ toYaml . | indent 4 }}
+{{- end }}
+data:
+  # These are system-specified config overrides.
+  airflow.cfg: |
+    [core]
+    load_examples = False
+    colored_console_log = False
+    executor = {{ .Values.executor }}
+{{- if .Values.elasticsearch.enabled }}
+    remote_logging = True
+{{- end }}
+
+    [webserver]
+    enable_proxy_fix = True
+    expose_config = True
+    rbac = True
+
+{{- if eq .Values.executor "CeleryExecutor" }}
+    [celery]
+    default_queue = celery

Review comment:
       I think we need to make the default_queue configurable with the default being "celery"

##########
File path: chart/templates/configmap.yaml
##########
@@ -0,0 +1,122 @@
+# 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.
+
+################################
+## Airflow ConfigMap
+#################################
+apiVersion: v1
+kind: ConfigMap
+metadata:
+  name: {{ template "airflow_config" . }}
+  labels:
+    tier: airflow
+    component: config
+    release: {{ .Release.Name }}
+    chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
+    heritage: {{ .Release.Service }}
+{{- with .Values.labels }}
+{{ toYaml . | indent 4 }}
+{{- end }}
+data:
+  # These are system-specified config overrides.
+  airflow.cfg: |
+    [core]
+    load_examples = False
+    colored_console_log = False
+    executor = {{ .Values.executor }}
+{{- if .Values.elasticsearch.enabled }}
+    remote_logging = True
+{{- end }}
+
+    [webserver]
+    enable_proxy_fix = True
+    expose_config = True
+    rbac = True
+
+{{- if eq .Values.executor "CeleryExecutor" }}
+    [celery]
+    default_queue = celery
+{{- end }}
+
+    [scheduler]
+    scheduler_heartbeat_sec = 5
+{{- if .Values.statsd.enabled }}
+    statsd_on = True
+    statsd_port = 9125
+    statsd_prefix = airflow
+    statsd_host = {{ printf "%s-statsd" .Release.Name }}
+{{- end }}
+    # Restart Scheduler every 41460 seconds (11 hours 31 minutes)
+    # The odd time is chosen so it is not always restarting on the same "hour" boundary
+    run_duration = 41460
+
+{{- if .Values.elasticsearch.enabled }}
+    [elasticsearch]
+    # The elasticsearch variables were updated to the shorter names in v1.10.4
+    write_stdout = True
+    json_format = True
+    log_id_template = {dag_id}_{task_id}_{execution_date}_{try_number}
+
+    # This is the older format for these variable names, kept here for backward compatibility
+    elasticsearch_write_stdout = True
+    elasticsearch_json_format = True
+    elasticsearch_log_id_template = {dag_id}_{task_id}_{execution_date}_{try_number}

Review comment:
       This can be removed, this is handled by Airflow:
   
   https://github.com/apache/airflow/blob/1.10.10/airflow/configuration.py#L163-L170




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org