volumes:
- name: srpm-data
  persistentVolumeClaim:
    claimName: "languages-storage{{ '-stg' if env == 'staging' else '' }}"
restartPolicy: Never
initContainers:
- name: clean-tmp
  image: "image-registry.openshift-image-registry.svc:5000/languages/builder:latest"
  imagePullPolicy: Always
  env:
  - name: RELEASEVER
    value: "{{ release }}"
  - name: TMPDIR
    value: /src/results/f$(RELEASEVER)/tmp
  command: ["/bin/sh", "-c"]
  args:
  - >
    [ -d ${TMPDIR} ] && rm -Rf ${TMPDIR} ;
    mkdir -p ${TMPDIR}
  volumeMounts:
  - name: srpm-data
    readOnly: false
    mountPath: /src/results
- name: extract
  image: "image-registry.openshift-image-registry.svc:5000/languages/builder:latest"
  imagePullPolicy: Always
  command:
  - ./build.py
  - "--results"
  - f$(RELEASEVER)
  - "--store-srpms-in-results"
{% if env == 'staging' %}
  - blue.*
{% endif %}
  env:
  - name: RELEASEVER
    value: "{{ release }}"
  - name: DNF_CONF
    value: "dnf_$(RELEASEVER).conf"
  - name: TMPDIR
    value: /src/results/f$(RELEASEVER)/tmp
  - name: THREAD_MAX_CONN
    value: "3"
  - name: THREAD_MAX_EXTR
    value: "3"
  - name: THREAD_MAX
    value: "8"
  volumeMounts:
  - name: srpm-data
    readOnly: false
    mountPath: /src/results
  resources:
    limits:
      cpu: 2000m
      memory: 5Gi
    requests:
      cpu: '0'
      memory: 2Gi
containers:
- name: stats
  image: "image-registry.openshift-image-registry.svc:5000/languages/builder:latest"
  imagePullPolicy: Always
  command: ["/bin/sh", "-c"]
  args:
  - >
    ./build_language_list.py --results f$(RELEASEVER) --refresh &&
    ./build_stats.py --results f$(RELEASEVER) &&
    ./build_tm.py --results f$(RELEASEVER) --compress
  env:
  - name: RELEASEVER
    value: "{{ release }}"
  - name: TMPDIR
    value: /src/results/f$(RELEASEVER)/tmp
  volumeMounts:
  - name: srpm-data
    readOnly: false
    mountPath: /src/results
  resources:
    limits:
      cpu: 2000m
      memory: 8Gi
    requests:
      cpu: '0'
      memory: 4Gi

