<commit_before># oc adm policy add-cluster-role-to-user cluster-admin -z default
#
# oc process -f squonk-app.yaml | oc create -f -
# oc delete all,cm,pvc,routes,secrets --selector template=squonk-app

kind: Template
apiVersion: v1
metadata:
  name: squonk
  annotations:
    description: Squonk Application Service Definition
    tags: squonk,core,cellexecutor,chemservices,coreservices
labels:
  template: squonk-app
  app: squonk-app

parameters:

# Common (not specific to any infrastructure service)

# Nothing

# ------
# Portal
# ------

- name: PORTAL_IMAGE_TAG
  value: latest
- name: PORTAL_SERVICE_CALLBACK
  value: "http://localhost:8080/portal"

- name: PORTAL_CPU_REQUEST
  value: 500m
- name: PORTAL_CPU_LIMIT
  value: 1000m
- name: PORTAL_MEM_REQUEST
  value: 500Mi
- name: PORTAL_MEM_LIMIT
  value: 1Gi

# ------------
# ChemServices
# ------------

- name: CHEM_IMAGE_TAG
  value: latest
- name: CHEM_STRUCTURE_DATABASE_TABLES
  description: Chemical search tables
  value: ""

- name: CHEM_CPU_REQUEST
  value: 100m
- name: CHEM_CPU_LIMIT
  value: 1000m
- name: CHEM_MEM_REQUEST
  value: 500Mi
- name: CHEM_MEM_LIMIT
  value: 1Gi

# ------------
# CoreServices
# ------------

- name: CORE_IMAGE_TAG
  value: latest
- name: CORE_SQUONK_BASIC_CHEM_SERVICES_URL
  value: "http://chemservices:8080"
- name: CORE_SQUONK_DOCKER_SERVICES_DIR
  value: "/var/local/squonk-docker-services"
- name: CORE_SD_PVC_SIZE
  value: 1Gi

- name: CORE_CPU_REQUEST
  value: 100m
- name: CORE_CPU_LIMIT
  value: 1000m
- name: CORE_MEM_REQUEST
  value: 500Mi
- name: CORE_MEM_LIMIT
  value: 500Mi

# ------------
# CellExecutor
# ------------

- name: CELL_IMAGE_TAG
  value: openshift
- name: CELL_CONTAINER_RUNNER_TYPE
  value: openshift
- name: CELL_SQUONK_CONTAINER_WORK_DIR
  value: "/squonk/work/docker"
- name: CELL_WORK_PVC_SIZE
  value: 20Gi

- name: CELL_CPU_REQUEST
  value: 100m
- name: CELL_CPU_LIMIT
  value: 1000m
- name: CELL_MEM_REQUEST
  value: 500Mi
- name: CELL_MEM_LIMIT
  value: 500Mi


objects:

# -----------------------------------------------------------------------------
# Postgres Migration (Job)
# -----------------------------------------------------------------------------

- kind: Job
  apiVersion: batch/v1
  metadata:
    name: postgres-migrate
  spec:
    replicas: 1
    selector:
      name: postgres-migrate
    template:
      metadata:
        labels:
          name: postgres-migrate
      spec:
        initContainers:
        - image: yauritux/busybox-curl
          name: wait-for-postgres-before-migration
          command: ['sh', '-c',
            'until (( curl http://postgres:5432/ --connect-timeout 5 2>&1 | grep 52 )); do sleep 2; done']
        containers:
        - image: squonk/flyway
          name: postgres-migrate
          env:
          - name: POSTGRES_PASSWORD
            valueFrom:
              secretKeyRef:
                name: squonk-secrets
                key: POSTGRES_PASSWORD
        restartPolicy: OnFailure

# -----------------------------------------------------------------------------
# ChemServices
# -----------------------------------------------------------------------------

- kind: DeploymentConfig
  apiVersion: v1
  metadata:
    name: chem-services-basic
  spec:
    replicas: 1
    selector:
      name: chem-services-basic
    template:
      metadata:
        labels:
          name: chem-services-basic
      spec:
        initContainers:
        - image: yauritux/busybox-curl
          name: wait-for-postgres-before-chem
          command: ['sh', '-c',
            'until (( curl http://postgres:5432/ --connect-timeout 5 2>&1 | grep 52 )); do sleep 2; done']
        - image: yauritux/busybox-curl
          name: wait-for-rabbitmq-before-chem
          command: ['sh', '-c',
            'until nslookup rabbitmq; do sleep 4; done;']
        containers:
        - image: squonk/chem-services-basic:${CHEM_IMAGE_TAG}
          name: chem-services-basic
          env:
          - name: POSTGRES_SQUONK_PASSWORD
            valueFrom:
              secretKeyRef:
                name: squonk-secrets
                key: POSTGRES_SQUONK_PASSWORD
          - name: RABBITMQ_SQUONK_PASSWORD
            valueFrom:
              secretKeyRef:
                name: squonk-secrets
                key: RABBITMQ_SQUONK_PASSWORD
          - name: STRUCTURE_DATABASE_TABLES
            value: ${CHEM_STRUCTURE_DATABASE_TABLES}
          ports:
          - containerPort: 8080
          readinessProbe:
            httpGet:
              path: /chem-services-cdk-basic/rest/ping
              port: 8080
            initialDelaySeconds: 60
            timeoutSeconds: 1
            periodSeconds: 20
          livenessProbe:
            httpGet:
              path: /chem-services-cdk-basic/rest/ping
              port: 8080
            initialDelaySeconds: 30
            timeoutSeconds: 1
            periodSeconds: 30
#          resources:
#            limits:
#              cpu: ${CHEM_CPU_LIMIT}
#              memory: ${CHEM_MEM_LIMIT}
#            requests:
#              cpu: ${CHEM_CPU_REQUEST}
#              memory: ${CHEM_MEM_REQUEST}

- kind: Service
  apiVersion: v1
  metadata:
    name: chemservices
  spec:
    ports:
    - name: http
      port: 8080
      targetPort: 8080
    selector:
      name: chem-services-basic

# -----------------------------------------------------------------------------
# CoreServices
# -----------------------------------------------------------------------------

- kind: PersistentVolumeClaim
  apiVersion: v1
  metadata:
    name: core-service-descriptors-pvc
  spec:
    accessModes:
    - ReadWriteMany
    resources:
      requests:
        storage: ${CORE_SD_PVC_SIZE}

- kind: DeploymentConfig
  apiVersion: v1
  metadata:
    name: coreservices
  spec:
    replicas: 1
    selector:
      name: coreservices
    template:
      metadata:
        labels:
          name: coreservices
      spec:
        initContainers:
        - image: yauritux/busybox-curl
          name: wait-for-chem-before-core
          command: ['sh', '-c',
            'until (( curl http://chemservices:8080/rest/ping --connect-timeout 5 )); do sleep 2; done']
        - image: yauritux/busybox-curl
          name: wait-for-cell-before-core
          command: ['sh', '-c',
            'until nslookup cellexecutor; do sleep 4; done;']
        containers:
        - image: squonk/core-services-server:${CORE_IMAGE_TAG}
          name: coreservices
          env:
          - name: RABBITMQ_SQUONK_PASSWORD
            valueFrom:
              secretKeyRef:
                name: squonk-secrets
                key: RABBITMQ_SQUONK_PASSWORD
          - name: POSTGRES_SQUONK_PASSWORD
            valueFrom:
              secretKeyRef:
                name: squonk-secrets
                key: POSTGRES_SQUONK_PASSWORD
          - name: SQUONK_BASIC_CHEM_SERVICES_URL
            value: ${CORE_SQUONK_BASIC_CHEM_SERVICES_URL}
          - name: SQUONK_DOCKER_SERVICES_DIR
            value: ${CORE_SQUONK_DOCKER_SERVICES_DIR}
          ports:
          - containerPort: 8080
          livenessProbe:
            httpGet:
              path: /coreservices/rest/ping
              port: 8080
            initialDelaySeconds: 30
            timeoutSeconds: 5
            periodSeconds: 30
#          resources:
#            limits:
#              cpu: ${CORE_CPU_LIMIT}
#              memory: ${CORE_MEM_LIMIT}
#            requests:
#              cpu: ${CORE_CPU_REQUEST}
#              memory: ${CORE_MEM_REQUEST}
          volumeMounts:
          - mountPath: ${CORE_SQUONK_DOCKER_SERVICES_DIR}
            name: squonk-docker-services
        volumes:
        - name: squonk-docker-services
          persistentVolumeClaim:
            claimName: core-service-descriptors-pvc

- kind: Service
  apiVersion: v1
  metadata:
    name: coreservices
  spec:
    selector:
      name: coreservices
    ports:
    - name: http
      port: 8080
      targetPort: 8080

# -----------------------------------------------------------------------------
# Squonk Docker-Services Loader
# -----------------------------------------------------------------------------

# This 'Job' populates the Core's Service Descriptor directory PVC
# with the current set of service descriptors.

- kind: Job
  apiVersion: batch/v1
  metadata:
    name: service-descriptor-loader
  spec:
    replicas: 1
    selector:
      name: service-descriptor-loader
    template:
      metadata:
        labels:
          name: service-descriptor-loader
      spec:
        containers:
        - image: squonk/pipelines-servicedescriptor-loader:latest
          name: service-descriptor-loader
          volumeMounts:
          - mountPath: /sd-dst
            name: loader-volume
        volumes:
        - name: loader-volume
          persistentVolumeClaim:
            claimName: core-service-descriptors-pvc
        restartPolicy: Never

# -----------------------------------------------------------------------------
# CellExecutor
# -----------------------------------------------------------------------------

# IMPORTANT NOTE
#
# This template is a just a 'shell' at the moment.
# It creates the cellexecutor service but the template
# is incomplete as a number of mounts and comms issues
# still need to be resolved. It is present here simply
# to act as the starting point for the finished article.

- kind: PersistentVolumeClaim
  apiVersion: v1
  metadata:
    name: squonk-work-dir-pvc
  spec:
    accessModes:
    - ReadWriteMany
    resources:
      requests:
        storage: ${CELL_WORK_PVC_SIZE}

- kind: DeploymentConfig
  apiVersion: v1
  metadata:
    name: cellexecutor
  spec:
    replicas: 1
    selector:
      name: cellexecutor
    template:
      metadata:
        labels:
          name: cellexecutor
      spec:
        containers:
        - image: squonk/cellexecutor:${CELL_IMAGE_TAG}
          name: cellexecutor
          env:
          - name: RABBITMQ_SQUONK_PASSWORD
            valueFrom:
              secretKeyRef:
                name: squonk-secrets
                key: RABBITMQ_SQUONK_PASSWORD
          - name: SQUONK_CONTAINER_RUNNER_TYPE
            value: ${CELL_CONTAINER_RUNNER_TYPE}
          - name: SQUONK_DOCKER_WORK_DIR
            value: ${CELL_SQUONK_CONTAINER_WORK_DIR}
#          - name: DOCKER_HOST
#            value: ${CELL_DOCKER_HOST}
#          - name: JAVA_OPTS
#            value: '"-Djava.util.logging.config.file=/logging.properties"'
#          resources:
#            limits:
#              cpu: ${CELL_CPU_LIMIT}
#              memory: ${CELL_MEM_LIMIT}
#            requests:
#              cpu: ${CELL_CPU_REQUEST}
#              memory: ${CELL_MEM_REQUEST}
          volumeMounts:
          - mountPath: ${CELL_SQUONK_CONTAINER_WORK_DIR}
            name: squonk-work-dir
        volumes:
        - name: squonk-work-dir
          persistentVolumeClaim:
            claimName: squonk-work-dir-pvc

- kind: Service
  apiVersion: v1
  metadata:
    name: cellexecutor
  spec:
    selector:
      name: cellexecutor
    ports:
    - name: http
      port: 8080
      targetPort: 8080

# -----------------------------------------------------------------------------
# Portal
# -----------------------------------------------------------------------------

- kind: DeploymentConfig
  apiVersion: v1
  metadata:
    name: portal
  spec:
    replicas: 1
    selector:
      name: portal
    template:
      metadata:
        labels:
          name: portal
      spec:
        initContainers:
        - image: yauritux/busybox-curl
          name: wait-for-chem-before-core
          command: ['sh', '-c',
            'until (( curl http://coreservices:8080/rest/ping --connect-timeout 5 )); do sleep 2; done']
        containers:
        - image: squonk/portal:${PORTAL_IMAGE_TAG}
          name: portal
          env:
          - name: POSTGRES_SQUONK_PASSWORD
            valueFrom:
              secretKeyRef:
                name: squonk-secrets
                key: POSTGRES_SQUONK_PASSWORD
          - name: SERVICE_CALLBACK
            value: ${PORTAL_SERVICE_CALLBACK}
#          readinessProbe:
#            httpGet:
#              path: /portal
#              port: 8080
#            initialDelaySeconds: 30
#            timeoutSeconds: 5
#          livenessProbe:
#            httpGet:
#              path: /portal
#              port: 8080
#            initialDelaySeconds: 30
#            timeoutSeconds: 5
#          resources:
#            limits:
#              cpu: ${PORTAL_CPU_LIMIT}
#              memory: ${PORTAL_MEM_LIMIT}
#            requests:
#              cpu: ${PORTAL_CPU_REQUEST}
#              memory: ${PORTAL_MEM_REQUEST}

- kind: Service
  apiVersion: v1
  metadata:
    name: portal
  spec:
    selector:
      name: portal
    ports:
    - name: http
      port: 8080
      targetPort: 8080

- kind: Route
  apiVersion: v1
  metadata:
    name: portal
  spec:
    path: /portal
    to:
      kind: Service
      name: portal
<commit_msg>- CellExecutor label back to latest<commit_after># oc adm policy add-cluster-role-to-user cluster-admin -z default
#
# oc process -f squonk-app.yaml | oc create -f -
# oc delete all,cm,pvc,routes,secrets --selector template=squonk-app

kind: Template
apiVersion: v1
metadata:
  name: squonk
  annotations:
    description: Squonk Application Service Definition
    tags: squonk,core,cellexecutor,chemservices,coreservices
labels:
  template: squonk-app
  app: squonk-app

parameters:

# Common (not specific to any infrastructure service)

# Nothing

# ------
# Portal
# ------

- name: PORTAL_IMAGE_TAG
  value: latest
- name: PORTAL_SERVICE_CALLBACK
  value: "http://localhost:8080/portal"

- name: PORTAL_CPU_REQUEST
  value: 500m
- name: PORTAL_CPU_LIMIT
  value: 1000m
- name: PORTAL_MEM_REQUEST
  value: 500Mi
- name: PORTAL_MEM_LIMIT
  value: 1Gi

# ------------
# ChemServices
# ------------

- name: CHEM_IMAGE_TAG
  value: latest
- name: CHEM_STRUCTURE_DATABASE_TABLES
  description: Chemical search tables
  value: ""

- name: CHEM_CPU_REQUEST
  value: 100m
- name: CHEM_CPU_LIMIT
  value: 1000m
- name: CHEM_MEM_REQUEST
  value: 500Mi
- name: CHEM_MEM_LIMIT
  value: 1Gi

# ------------
# CoreServices
# ------------

- name: CORE_IMAGE_TAG
  value: latest
- name: CORE_SQUONK_BASIC_CHEM_SERVICES_URL
  value: "http://chemservices:8080"
- name: CORE_SQUONK_DOCKER_SERVICES_DIR
  value: "/var/local/squonk-docker-services"
- name: CORE_SD_PVC_SIZE
  value: 1Gi

- name: CORE_CPU_REQUEST
  value: 100m
- name: CORE_CPU_LIMIT
  value: 1000m
- name: CORE_MEM_REQUEST
  value: 500Mi
- name: CORE_MEM_LIMIT
  value: 500Mi

# ------------
# CellExecutor
# ------------

- name: CELL_IMAGE_TAG
  value: latest
- name: CELL_CONTAINER_RUNNER_TYPE
  value: openshift
- name: CELL_SQUONK_CONTAINER_WORK_DIR
  value: "/squonk/work/docker"
- name: CELL_WORK_PVC_SIZE
  value: 20Gi

- name: CELL_CPU_REQUEST
  value: 100m
- name: CELL_CPU_LIMIT
  value: 1000m
- name: CELL_MEM_REQUEST
  value: 500Mi
- name: CELL_MEM_LIMIT
  value: 500Mi


objects:

# -----------------------------------------------------------------------------
# Postgres Migration (Job)
# -----------------------------------------------------------------------------

- kind: Job
  apiVersion: batch/v1
  metadata:
    name: postgres-migrate
  spec:
    replicas: 1
    selector:
      name: postgres-migrate
    template:
      metadata:
        labels:
          name: postgres-migrate
      spec:
        initContainers:
        - image: yauritux/busybox-curl
          name: wait-for-postgres-before-migration
          command: ['sh', '-c',
            'until (( curl http://postgres:5432/ --connect-timeout 5 2>&1 | grep 52 )); do sleep 2; done']
        containers:
        - image: squonk/flyway
          name: postgres-migrate
          env:
          - name: POSTGRES_PASSWORD
            valueFrom:
              secretKeyRef:
                name: squonk-secrets
                key: POSTGRES_PASSWORD
        restartPolicy: OnFailure

# -----------------------------------------------------------------------------
# ChemServices
# -----------------------------------------------------------------------------

- kind: DeploymentConfig
  apiVersion: v1
  metadata:
    name: chem-services-basic
  spec:
    replicas: 1
    selector:
      name: chem-services-basic
    template:
      metadata:
        labels:
          name: chem-services-basic
      spec:
        initContainers:
        - image: yauritux/busybox-curl
          name: wait-for-postgres-before-chem
          command: ['sh', '-c',
            'until (( curl http://postgres:5432/ --connect-timeout 5 2>&1 | grep 52 )); do sleep 2; done']
        - image: yauritux/busybox-curl
          name: wait-for-rabbitmq-before-chem
          command: ['sh', '-c',
            'until nslookup rabbitmq; do sleep 4; done;']
        containers:
        - image: squonk/chem-services-basic:${CHEM_IMAGE_TAG}
          name: chem-services-basic
          env:
          - name: POSTGRES_SQUONK_PASSWORD
            valueFrom:
              secretKeyRef:
                name: squonk-secrets
                key: POSTGRES_SQUONK_PASSWORD
          - name: RABBITMQ_SQUONK_PASSWORD
            valueFrom:
              secretKeyRef:
                name: squonk-secrets
                key: RABBITMQ_SQUONK_PASSWORD
          - name: STRUCTURE_DATABASE_TABLES
            value: ${CHEM_STRUCTURE_DATABASE_TABLES}
          ports:
          - containerPort: 8080
          readinessProbe:
            httpGet:
              path: /chem-services-cdk-basic/rest/ping
              port: 8080
            initialDelaySeconds: 60
            timeoutSeconds: 1
            periodSeconds: 20
          livenessProbe:
            httpGet:
              path: /chem-services-cdk-basic/rest/ping
              port: 8080
            initialDelaySeconds: 30
            timeoutSeconds: 1
            periodSeconds: 30
#          resources:
#            limits:
#              cpu: ${CHEM_CPU_LIMIT}
#              memory: ${CHEM_MEM_LIMIT}
#            requests:
#              cpu: ${CHEM_CPU_REQUEST}
#              memory: ${CHEM_MEM_REQUEST}

- kind: Service
  apiVersion: v1
  metadata:
    name: chemservices
  spec:
    ports:
    - name: http
      port: 8080
      targetPort: 8080
    selector:
      name: chem-services-basic

# -----------------------------------------------------------------------------
# CoreServices
# -----------------------------------------------------------------------------

- kind: PersistentVolumeClaim
  apiVersion: v1
  metadata:
    name: core-service-descriptors-pvc
  spec:
    accessModes:
    - ReadWriteMany
    resources:
      requests:
        storage: ${CORE_SD_PVC_SIZE}

- kind: DeploymentConfig
  apiVersion: v1
  metadata:
    name: coreservices
  spec:
    replicas: 1
    selector:
      name: coreservices
    template:
      metadata:
        labels:
          name: coreservices
      spec:
        initContainers:
        - image: yauritux/busybox-curl
          name: wait-for-chem-before-core
          command: ['sh', '-c',
            'until (( curl http://chemservices:8080/rest/ping --connect-timeout 5 )); do sleep 2; done']
        - image: yauritux/busybox-curl
          name: wait-for-cell-before-core
          command: ['sh', '-c',
            'until nslookup cellexecutor; do sleep 4; done;']
        containers:
        - image: squonk/core-services-server:${CORE_IMAGE_TAG}
          name: coreservices
          env:
          - name: RABBITMQ_SQUONK_PASSWORD
            valueFrom:
              secretKeyRef:
                name: squonk-secrets
                key: R<KEY>PASSWORD
          - name: POSTGRES_SQUONK_PASSWORD
            valueFrom:
              secretKeyRef:
                name: squonk-secrets
                key: POSTGRES_SQUONK_PASSWORD
          - name: SQUONK_BASIC_CHEM_SERVICES_URL
            value: ${CORE_SQUONK_BASIC_CHEM_SERVICES_URL}
          - name: SQUONK_DOCKER_SERVICES_DIR
            value: ${CORE_SQUONK_DOCKER_SERVICES_DIR}
          ports:
          - containerPort: 8080
          livenessProbe:
            httpGet:
              path: /coreservices/rest/ping
              port: 8080
            initialDelaySeconds: 30
            timeoutSeconds: 5
            periodSeconds: 30
#          resources:
#            limits:
#              cpu: ${CORE_CPU_LIMIT}
#              memory: ${CORE_MEM_LIMIT}
#            requests:
#              cpu: ${CORE_CPU_REQUEST}
#              memory: ${CORE_MEM_REQUEST}
          volumeMounts:
          - mountPath: ${CORE_SQUONK_DOCKER_SERVICES_DIR}
            name: squonk-docker-services
        volumes:
        - name: squonk-docker-services
          persistentVolumeClaim:
            claimName: core-service-descriptors-pvc

- kind: Service
  apiVersion: v1
  metadata:
    name: coreservices
  spec:
    selector:
      name: coreservices
    ports:
    - name: http
      port: 8080
      targetPort: 8080

# -----------------------------------------------------------------------------
# Squonk Docker-Services Loader
# -----------------------------------------------------------------------------

# This 'Job' populates the Core's Service Descriptor directory PVC
# with the current set of service descriptors.

- kind: Job
  apiVersion: batch/v1
  metadata:
    name: service-descriptor-loader
  spec:
    replicas: 1
    selector:
      name: service-descriptor-loader
    template:
      metadata:
        labels:
          name: service-descriptor-loader
      spec:
        containers:
        - image: squonk/pipelines-servicedescriptor-loader:latest
          name: service-descriptor-loader
          volumeMounts:
          - mountPath: /sd-dst
            name: loader-volume
        volumes:
        - name: loader-volume
          persistentVolumeClaim:
            claimName: core-service-descriptors-pvc
        restartPolicy: Never

# -----------------------------------------------------------------------------
# CellExecutor
# -----------------------------------------------------------------------------

# IMPORTANT NOTE
#
# This template is a just a 'shell' at the moment.
# It creates the cellexecutor service but the template
# is incomplete as a number of mounts and comms issues
# still need to be resolved. It is present here simply
# to act as the starting point for the finished article.

- kind: PersistentVolumeClaim
  apiVersion: v1
  metadata:
    name: squonk-work-dir-pvc
  spec:
    accessModes:
    - ReadWriteMany
    resources:
      requests:
        storage: ${CELL_WORK_PVC_SIZE}

- kind: DeploymentConfig
  apiVersion: v1
  metadata:
    name: cellexecutor
  spec:
    replicas: 1
    selector:
      name: cellexecutor
    template:
      metadata:
        labels:
          name: cellexecutor
      spec:
        containers:
        - image: squonk/cellexecutor:${CELL_IMAGE_TAG}
          name: cellexecutor
          env:
          - name: RABBITMQ_SQUONK_PASSWORD
            valueFrom:
              secretKeyRef:
                name: squonk-secrets
                key: RABBITMQ_SQUONK_PASSWORD
          - name: SQUONK_CONTAINER_RUNNER_TYPE
            value: ${CELL_CONTAINER_RUNNER_TYPE}
          - name: SQUONK_DOCKER_WORK_DIR
            value: ${CELL_SQUONK_CONTAINER_WORK_DIR}
#          - name: DOCKER_HOST
#            value: ${CELL_DOCKER_HOST}
#          - name: JAVA_OPTS
#            value: '"-Djava.util.logging.config.file=/logging.properties"'
#          resources:
#            limits:
#              cpu: ${CELL_CPU_LIMIT}
#              memory: ${CELL_MEM_LIMIT}
#            requests:
#              cpu: ${CELL_CPU_REQUEST}
#              memory: ${CELL_MEM_REQUEST}
          volumeMounts:
          - mountPath: ${CELL_SQUONK_CONTAINER_WORK_DIR}
            name: squonk-work-dir
        volumes:
        - name: squonk-work-dir
          persistentVolumeClaim:
            claimName: squonk-work-dir-pvc

- kind: Service
  apiVersion: v1
  metadata:
    name: cellexecutor
  spec:
    selector:
      name: cellexecutor
    ports:
    - name: http
      port: 8080
      targetPort: 8080

# -----------------------------------------------------------------------------
# Portal
# -----------------------------------------------------------------------------

- kind: DeploymentConfig
  apiVersion: v1
  metadata:
    name: portal
  spec:
    replicas: 1
    selector:
      name: portal
    template:
      metadata:
        labels:
          name: portal
      spec:
        initContainers:
        - image: yauritux/busybox-curl
          name: wait-for-chem-before-core
          command: ['sh', '-c',
            'until (( curl http://coreservices:8080/rest/ping --connect-timeout 5 )); do sleep 2; done']
        containers:
        - image: squonk/portal:${PORTAL_IMAGE_TAG}
          name: portal
          env:
          - name: POSTGRES_SQUONK_PASSWORD
            valueFrom:
              secretKeyRef:
                name: squonk-secrets
                key: POSTGRES_SQUONK_PASSWORD
          - name: SERVICE_CALLBACK
            value: ${PORTAL_SERVICE_CALLBACK}
#          readinessProbe:
#            httpGet:
#              path: /portal
#              port: 8080
#            initialDelaySeconds: 30
#            timeoutSeconds: 5
#          livenessProbe:
#            httpGet:
#              path: /portal
#              port: 8080
#            initialDelaySeconds: 30
#            timeoutSeconds: 5
#          resources:
#            limits:
#              cpu: ${PORTAL_CPU_LIMIT}
#              memory: ${PORTAL_MEM_LIMIT}
#            requests:
#              cpu: ${PORTAL_CPU_REQUEST}
#              memory: ${PORTAL_MEM_REQUEST}

- kind: Service
  apiVersion: v1
  metadata:
    name: portal
  spec:
    selector:
      name: portal
    ports:
    - name: http
      port: 8080
      targetPort: 8080

- kind: Route
  apiVersion: v1
  metadata:
    name: portal
  spec:
    path: /portal
    to:
      kind: Service
      name: portal

{'fraction_non_alphanumeric': 0.15515323539565035, 'fraction_numerical': 0.014882436423612443, 'mean_word_length': 1.5183038732734473, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 8, 'https://': 0, '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': '1768027', 'n_tokens_mistral': 8188, 'n_tokens_neox': 7760, 'n_words': 1689}