<commit_before># 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 Flower Deployment
#################################
{{- if or (eq .Values.executor "CeleryExecutor") (eq .Values.executor "CeleryKubernetesExecutor") }}
kind: Deployment
apiVersion: apps/v1
metadata:
  name: {{ .Release.Name }}-flower
  labels:
    tier: airflow
    component: flower
    release: {{ .Release.Name }}
    chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
    heritage: {{ .Release.Service }}
{{- with .Values.labels }}
{{ toYaml . | indent 4 }}
{{- end }}
  annotations:
    checksum/airflow-config: {{ include (print $.Template.BasePath "/configmaps/configmap.yaml") . | sha256sum }}
spec:
  replicas: 1
  selector:
    matchLabels:
      tier: airflow
      component: flower
      release: {{ .Release.Name }}
  template:
    metadata:
      labels:
        tier: airflow
        component: flower
        release: {{ .Release.Name }}
{{- with .Values.labels }}
{{ toYaml . | indent 8 }}
{{- end }}
    spec:
      nodeSelector:
{{ toYaml .Values.nodeSelector | indent 8 }}
      affinity:
{{ toYaml .Values.affinity | indent 8 }}
      tolerations:
{{ toYaml .Values.tolerations | indent 8 }}
      restartPolicy: Always
      securityContext:
        runAsUser: {{ .Values.uid }}
      {{- if or .Values.registry.secretName .Values.registry.connection }}
      imagePullSecrets:
        - name: {{ template "registry_secret" . }}
      {{- end }}
      containers:
        - name: flower
          image: {{ template "flower_image" . }}
          imagePullPolicy: {{ .Values.images.flower.pullPolicy }}
          args: ["bash", "-c", "airflow celery flower || airflow flower"]
          resources:
{{ toYaml .Values.flower.resources | indent 12 }}
          volumeMounts:
            - name: config
              mountPath: {{ template "airflow_config_path" . }}
              subPath: airflow.cfg
              readOnly: true
          ports:
            - name: flower-ui
              containerPort: {{ .Values.ports.flowerUI }}
          livenessProbe:
            failureThreshold: 10
            exec:
              command:
                - curl
                {{- if (or .Values.flower.secretName (and .Values.flower.username .Values.flower.password))}}
                - "--user"
                - $AIRFLOW__CELERY__FLOWER_BASIC_AUTH
                {{- end }}
                - {{ printf "localhost:%s" (.Values.ports.flowerUI | toString) }}
            initialDelaySeconds: 10
            periodSeconds: 5
          readinessProbe:
            failureThreshold: 10
            exec:
              command:
                - curl
                {{- if (or .Values.flower.secretName (and .Values.flower.username .Values.flower.password))}}
                - "--user"
                - $AIRFLOW__CELERY__FLOWER_BASIC_AUTH
                {{- end }}
                - {{ printf "localhost:%s" (.Values.ports.flowerUI | toString) }}
            initialDelaySeconds: 10
            periodSeconds: 5
          env:
            {{- if (or .Values.flower.secretName (and .Values.flower.username .Values.flower.password))}}
            - name: AIRFLOW__CELERY__FLOWER_BASIC_AUTH
              valueFrom:
                secretKeyRef:
                  name: {{ template "flower_secret" . }}
                  key: basicAuth
            {{- end }}
          {{- include "standard_airflow_environment" . | indent 10 }}
      volumes:
        - name: config
          configMap:
            name: {{ template "airflow_config" . }}
{{- end }}
<commit_msg>Chart: Add custom_airflow_environment to flower container (#12630)<commit_after># 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 Flower Deployment
#################################
{{- if or (eq .Values.executor "CeleryExecutor") (eq .Values.executor "CeleryKubernetesExecutor") }}
kind: Deployment
apiVersion: apps/v1
metadata:
  name: {{ .Release.Name }}-flower
  labels:
    tier: airflow
    component: flower
    release: {{ .Release.Name }}
    chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
    heritage: {{ .Release.Service }}
{{- with .Values.labels }}
{{ toYaml . | indent 4 }}
{{- end }}
  annotations:
    checksum/airflow-config: {{ include (print $.Template.BasePath "/configmaps/configmap.yaml") . | sha256sum }}
spec:
  replicas: 1
  selector:
    matchLabels:
      tier: airflow
      component: flower
      release: {{ .Release.Name }}
  template:
    metadata:
      labels:
        tier: airflow
        component: flower
        release: {{ .Release.Name }}
{{- with .Values.labels }}
{{ toYaml . | indent 8 }}
{{- end }}
    spec:
      nodeSelector:
{{ toYaml .Values.nodeSelector | indent 8 }}
      affinity:
{{ toYaml .Values.affinity | indent 8 }}
      tolerations:
{{ toYaml .Values.tolerations | indent 8 }}
      restartPolicy: Always
      securityContext:
        runAsUser: {{ .Values.uid }}
      {{- if or .Values.registry.secretName .Values.registry.connection }}
      imagePullSecrets:
        - name: {{ template "registry_secret" . }}
      {{- end }}
      containers:
        - name: flower
          image: {{ template "flower_image" . }}
          imagePullPolicy: {{ .Values.images.flower.pullPolicy }}
          args: ["bash", "-c", "airflow celery flower || airflow flower"]
          resources:
{{ toYaml .Values.flower.resources | indent 12 }}
          volumeMounts:
            - name: config
              mountPath: {{ template "airflow_config_path" . }}
              subPath: airflow.cfg
              readOnly: true
          ports:
            - name: flower-ui
              containerPort: {{ .Values.ports.flowerUI }}
          livenessProbe:
            failureThreshold: 10
            exec:
              command:
                - curl
                {{- if (or .Values.flower.secretName (and .Values.flower.username .Values.flower.password))}}
                - "--user"
                - $AIRFLOW__CELERY__FLOWER_BASIC_AUTH
                {{- end }}
                - {{ printf "localhost:%s" (.Values.ports.flowerUI | toString) }}
            initialDelaySeconds: 10
            periodSeconds: 5
          readinessProbe:
            failureThreshold: 10
            exec:
              command:
                - curl
                {{- if (or .Values.flower.secretName (and .Values.flower.username .Values.flower.password))}}
                - "--user"
                - $AIRFLOW__CELERY__FLOWER_BASIC_AUTH
                {{- end }}
                - {{ printf "localhost:%s" (.Values.ports.flowerUI | toString) }}
            initialDelaySeconds: 10
            periodSeconds: 5
          env:
            {{- if (or .Values.flower.secretName (and .Values.flower.username .Values.flower.password))}}
            - name: AIRFLOW__CELERY__FLOWER_BASIC_AUTH
              valueFrom:
                secretKeyRef:
                  name: {{ template "flower_secret" . }}
                  key: basicAuth
            {{- end }}
          {{- include "standard_airflow_environment" . | indent 10 }}
          {{- include "custom_airflow_environment" . | indent 10 }}
      volumes:
        - name: config
          configMap:
            name: {{ template "airflow_config" . }}
{{- end }}

{'fraction_non_alphanumeric': 0.12772514553133205, 'fraction_numerical': 0.007190959936080356, 'mean_word_length': 2.0733076113644335, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2046', 'n_tokens_mistral': 2472, 'n_tokens_neox': 2332, 'n_words': 658}