<commit_before>kind: Deployment
apiVersion: extensions/v1beta1 

metadata:
  name: blackbox-tests-integrity

spec:
  replicas: {{.Values.global.replicaCount}}
  revisionHistoryLimit: 5
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxUnavailable: 0
      maxSurge: 2
  template:
    metadata:
      labels:
        name: blackbox-tests-integrity
    spec:
      nodeSelector:
        zone: farm
      volumes:
        - name: blackbox-tests-integrity
          persistentVolumeClaim:
            claimName: blackbox-tests-integrity
        - name: blackbox-jump-key
          secret:
            secretName: blackbox-tests-integrity
            items:
              - key: jump.key
                path: authorized_keys.health
                mode: 0600
        - name: statsd-mapping-config
          configMap:
            name: blackbox-tests-integrity-statsd-mapping-config
      containers:
        - name: pytest
          resources:
            requests:
              cpu: 500m
              memory: 800M
            limits:
              cpu: 1.5
              memory: 1000M
{{- if typeIs "float64" .Values.global.image.tag  }}{{/* https://github.com/kubernetes/helm/issues/1707 */}}
          image: {{.Values.global.image.repository}}:{{.Values.global.image.tag | printf "%0.f" }}
{{- else }}
          image: {{.Values.global.image.repository}}:{{.Values.global.image.tag}}
{{- end }}
          args:
            - "iterate"
            - "pytest"
            - {{ .Values.parallel.workers | printf "-n %.0f" | quote }}
            - {{ .Values.parallel.timeout.global | printf "--timeout %.0f" | quote }}
            - "--disable-pytest-warnings"
            - "-r ap"
            - "-m integrity"
            - "tests"
          volumeMounts:
            - name: blackbox-tests-integrity
              mountPath: /opt/logs
              readOnly: false
            - name: blackbox-jump-key
              mountPath: /opt/keys
              readOnly: true
          env:
            - name: OS_AUTH_URL
              value: {{ .Values.global.openstack.auth_url | quote }}
            - name: OS_IDENTITY_API_VERSION
              value: {{ .Values.global.openstack.identity_api_version | quote }}
            - name: OS_USERNAME
              value: {{ .Values.global.openstack.users.admin.username | quote }}
            - name: OS_USER_DOMAIN_NAME
              value: {{ .Values.global.openstack.users.admin.user_domain_name | quote }}
            - name: OS_PROJECT_NAME
              value: {{ .Values.global.openstack.users.admin.project_name | quote }}
            - name: OS_PROJECT_DOMAIN_NAME
              value: {{ .Values.global.openstack.users.admin.project_domain_name | quote }}
            - name: OS_REGION_NAME
              value: {{ .Values.global.openstack.region_name | quote }}
            - name: CC_USERNAME
              value: {{ .Values.global.openstack.users.ccadmin.username | quote }}
            - name: CC_USER_DOMAIN_NAME
              value: {{ .Values.global.openstack.users.ccadmin.user_domain_name | quote }}
            - name: CC_PROJECT_NAME
              value: {{ .Values.global.openstack.users.ccadmin.project_name | quote }}
            - name: CC_PROJECT_DOMAIN_NAME
              value: {{ .Values.global.openstack.users.ccadmin.project_domain_name | quote }}
            - name: JUMP_URL
              value: {{ .Values.global.jump.url | quote }}
            - name: JUMP_USER
              value: {{ .Values.global.jump.user | quote }}
            - name: VC_USERNAME
              value: {{ .Values.global.vcenter.username | quote }}
            - name: STATSD_HOST
              value: {{ .Values.statsd.host | quote }}
            - name: STATSD_PORT
              value: {{ .Values.statsd.port | quote }}
            - name: STATSD_PREFIX
              value: {{ .Values.statsd.prefix | quote }}
            - name: TIMEOUT
              value: {{ .Values.parallel.timeout.atomic | quote }}
            - name: SLEEP_ITERATE
              value: {{ .Values.parallel.iterator.sleep | quote }}
            - name: OS_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: blackbox-tests-integrity
                  key: os.password
            - name: CC_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: blackbox-tests-integrity
                  key: cc.password
            - name: VC_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: blackbox-tests-canary
                  key: vc.password
            - name: SENTRY_DSN
              valueFrom:
                secretKeyRef:
                  name: sentry
                  key: blackbox.DSN

          livenessProbe:
            exec:
              command:
              - pytest
              - --version
            timeoutSeconds: 5
            periodSeconds: 15
            initialDelaySeconds: 15
          readinessProbe:
            exec:
              command:
              - pytest
              - --version
            timeoutSeconds: 5
            periodSeconds: 15
            initialDelaySeconds: 15

        - name: statsd
          resources:
            requests:
              cpu: 200m
              memory: 500M
            limits:
              cpu: 300m
              memory: 800M
          image: prom/statsd-exporter:v0.8.1
          imagePullPolicy: IfNotPresent
          args:
            - --statsd.mapping-config=/etc/statsd/statsd-mapping-config.yaml
          ports:
            - name: statsd
              containerPort: {{ .Values.statsd.port}}
              protocol: UDP
            - name: metrics
              containerPort: {{ .Values.global.port_metrics}}<commit_msg>Set memory quota<commit_after>kind: Deployment
apiVersion: extensions/v1beta1 

metadata:
  name: blackbox-tests-integrity

spec:
  replicas: {{.Values.global.replicaCount}}
  revisionHistoryLimit: 5
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxUnavailable: 0
      maxSurge: 2
  template:
    metadata:
      labels:
        name: blackbox-tests-integrity
    spec:
      nodeSelector:
        zone: farm
      volumes:
        - name: blackbox-tests-integrity
          persistentVolumeClaim:
            claimName: blackbox-tests-integrity
        - name: blackbox-jump-key
          secret:
            secretName: blackbox-tests-integrity
            items:
              - key: jump.key
                path: authorized_keys.health
                mode: 0600
        - name: statsd-mapping-config
          configMap:
            name: blackbox-tests-integrity-statsd-mapping-config
      containers:
        - name: pytest
          resources:
            requests:
              cpu: 500m
              memory: 500M
            limits:
              cpu: 1.5
              memory: 1000M
{{- if typeIs "float64" .Values.global.image.tag  }}{{/* https://github.com/kubernetes/helm/issues/1707 */}}
          image: {{.Values.global.image.repository}}:{{.Values.global.image.tag | printf "%0.f" }}
{{- else }}
          image: {{.Values.global.image.repository}}:{{.Values.global.image.tag}}
{{- end }}
          args:
            - "iterate"
            - "pytest"
            - {{ .Values.parallel.workers | printf "-n %.0f" | quote }}
            - {{ .Values.parallel.timeout.global | printf "--timeout %.0f" | quote }}
            - "--disable-pytest-warnings"
            - "-r ap"
            - "-m integrity"
            - "tests"
          volumeMounts:
            - name: blackbox-tests-integrity
              mountPath: /opt/logs
              readOnly: false
            - name: blackbox-jump-key
              mountPath: /opt/keys
              readOnly: true
          env:
            - name: OS_AUTH_URL
              value: {{ .Values.global.openstack.auth_url | quote }}
            - name: OS_IDENTITY_API_VERSION
              value: {{ .Values.global.openstack.identity_api_version | quote }}
            - name: OS_USERNAME
              value: {{ .Values.global.openstack.users.admin.username | quote }}
            - name: OS_USER_DOMAIN_NAME
              value: {{ .Values.global.openstack.users.admin.user_domain_name | quote }}
            - name: OS_PROJECT_NAME
              value: {{ .Values.global.openstack.users.admin.project_name | quote }}
            - name: OS_PROJECT_DOMAIN_NAME
              value: {{ .Values.global.openstack.users.admin.project_domain_name | quote }}
            - name: OS_REGION_NAME
              value: {{ .Values.global.openstack.region_name | quote }}
            - name: CC_USERNAME
              value: {{ .Values.global.openstack.users.ccadmin.username | quote }}
            - name: CC_USER_DOMAIN_NAME
              value: {{ .Values.global.openstack.users.ccadmin.user_domain_name | quote }}
            - name: CC_PROJECT_NAME
              value: {{ .Values.global.openstack.users.ccadmin.project_name | quote }}
            - name: CC_PROJECT_DOMAIN_NAME
              value: {{ .Values.global.openstack.users.ccadmin.project_domain_name | quote }}
            - name: JUMP_URL
              value: {{ .Values.global.jump.url | quote }}
            - name: JUMP_USER
              value: {{ .Values.global.jump.user | quote }}
            - name: VC_USERNAME
              value: {{ .Values.global.vcenter.username | quote }}
            - name: STATSD_HOST
              value: {{ .Values.statsd.host | quote }}
            - name: STATSD_PORT
              value: {{ .Values.statsd.port | quote }}
            - name: STATSD_PREFIX
              value: {{ .Values.statsd.prefix | quote }}
            - name: TIMEOUT
              value: {{ .Values.parallel.timeout.atomic | quote }}
            - name: SLEEP_ITERATE
              value: {{ .Values.parallel.iterator.sleep | quote }}
            - name: OS_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: blackbox-tests-integrity
                  key: os.password
            - name: CC_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: blackbox-tests-integrity
                  key: cc.password
            - name: VC_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: blackbox-tests-canary
                  key: vc.password
            - name: SENTRY_DSN
              valueFrom:
                secretKeyRef:
                  name: sentry
                  key: blackbox.DSN

          livenessProbe:
            exec:
              command:
              - pytest
              - --version
            timeoutSeconds: 5
            periodSeconds: 15
            initialDelaySeconds: 15
          readinessProbe:
            exec:
              command:
              - pytest
              - --version
            timeoutSeconds: 5
            periodSeconds: 15
            initialDelaySeconds: 15

        - name: statsd
          resources:
            requests:
              cpu: 200m
              memory: 100M
            limits:
              cpu: 300m
              memory: 500M
          image: prom/statsd-exporter:v0.8.1
          imagePullPolicy: IfNotPresent
          args:
            - --statsd.mapping-config=/etc/statsd/statsd-mapping-config.yaml
          ports:
            - name: statsd
              containerPort: {{ .Values.statsd.port}}
              protocol: UDP
            - name: metrics
              containerPort: {{ .Values.global.port_metrics}}
{'fraction_non_alphanumeric': 0.10058195083818293, 'fraction_numerical': 0.009554416746286806, 'mean_word_length': 1.354119811899407, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, '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': '421332', 'n_tokens_mistral': 3202, 'n_tokens_neox': 3074, 'n_words': 583}