apiVersion: v1
kind: Pod
metadata:
  name: enexa-extraction-debug
  namespace: default
spec:
  containers:
  - name: debug
    image: hub.cs.upb.de/enexa/images/enexa-extraction-module:2.0.11
    command:
      - /bin/bash
      - -c
      - |
        echo "Checking PyTorch + CUDA:" && \
        python3 -c "import torch; import platform; print('Host:',platform.uname()); print('Torch:',torch.__version__); print('Torch CUDA:',torch.version.cuda); print('CUDA available:',torch.cuda.is_available()); print('CUDA device:',torch.cuda.device_count()); print('CUDA name:',torch.cuda.get_device_name(0) if torch.cuda.is_available() else '-')" || \
        python -c "import torch; import platform; print('Host:',platform.uname()); print('Torch:',torch.__version__); print('Torch CUDA:',torch.version.cuda); print('CUDA available:',torch.cuda.is_available()); print('CUDA device:',torch.cuda.device_count()); print('CUDA name:',torch.cuda.get_device_name(0) if torch.cuda.is_available() else '-')" || \
        echo "PyTorch not found"; \
        sleep infinity
    env: # Copy your envs as needed
      - name: ENEXA_EXPERIMENT_IRI
        value: http://example.org/resource/c0ead301-10a7-43dc-9032-30ec75555f19
      - name: ENEXA_META_DATA_ENDPOINT
        value: http://fuseki-devwd-service:3030/enexa/
      - name: ENEXA_META_DATA_GRAPH
        value: http://example.org/meta-data
      - name: ENEXA_MODULE_IRI
        value: http://example.org/resource/6673a1bb-6480-4a56-b10a-843db2b2bef5
      - name: ENEXA_MODULE_INSTANCE_IRI
        value: http://example.org/resource/6673a1bb-6480-4a56-b10a-843db2b2bef5
      - name: ENEXA_SERVICE_URL
        value: http://enexa-service:8081/
      - name: ENEXA_SHARED_DIRECTORY
        value: /enexa
      - name: ENEXA_MODULE_INSTANCE_DIRECTORY
        value: /enexa/app3/c0ead301-10a7-43dc-9032-30ec75555f19/80abaa69-16b7-47bb-b6b7-bc1e0202cccb
      - name: ENEXA_WRITEABLE_DIRECTORY
        value: /enexa/app3/c0ead301-10a7-43dc-9032-30ec75555f19
      # Add others as needed
    resources:
      limits:
        nvidia.com/gpu: "1"
      requests:
        nvidia.com/gpu: "1"
    volumeMounts:
      - mountPath: /enexa
        name: enexa-shared-dir
      - mountPath: /var/run/secrets/kubernetes.io/serviceaccount
        name: kube-api-access-kg5rq
        readOnly: true
  restartPolicy: Never
  nodeName: enexa-test-data1
  volumes:
    - name: enexa-shared-dir
      persistentVolumeClaim:
        claimName: enexa-shared-dir-claim
    - name: kube-api-access-kg5rq
      projected:
        defaultMode: 420
        sources:
          - serviceAccountToken:
              expirationSeconds: 3607
              path: token
          - configMap:
              items:
              - key: ca.crt
                path: ca.crt
              name: kube-root-ca.crt
          - downwardAPI:
              items:
              - fieldRef:
                  apiVersion: v1
                  fieldPath: metadata.namespace
                path: namespace
