apiVersion: v1
kind: Pod
metadata:
  name: <NAME>
spec:
  containers:
    - name: server
      image: aistore/runtime_python:2
      imagePullPolicy: IfNotPresent
      ports:
        - name: default
          containerPort: 80
      command: ['sh', '-c', 'python /server.py']
      env:
        - name: MOD_NAME
          value: code
        - name: FUNC_HANDLER
          value: transform
        - name: PYTHONPATH
          value: /runtime
      readinessProbe:
        httpGet:
          path: /health
          port: default
      volumeMounts:
        - name: code
          mountPath: "/code"
        - name: runtime
          mountPath: "/runtime"
  initContainers:
    - name: server-deps
      image: aistore/runtime_python:2
      imagePullPolicy: IfNotPresent
      command:
        - 'sh'
        - '-c'
        - |
          echo "${AISTORE_CODE}" > /dst/code.py
          echo "${AISTORE_DEPS}" > /dst/requirements.txt
          pip install --target="/runtime" -r /dst/requirements.txt
      volumeMounts:
        - name: code
          mountPath: "/dst"
        - name: runtime
          mountPath: "/runtime"
  volumes:
    - name: code
      emptyDir: {}
    - name: runtime
      emptyDir: {}
