Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added test for OSCAR cowsay #5

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

esparig
Copy link

@esparig esparig commented Oct 8, 2024

Added test for OSCAR integration. It checks that OSCAR can run a job through interLink, loading two files from the ConfigMap. The job is the execution of the cowsay container.

Fix: added configmap to OSCAR cowsay test

Added second file in the config map and additional check_logs
@esparig esparig requested a review from dciangot October 8, 2024 09:48
Copy link
Collaborator

@dciangot dciangot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@esparig did you, by any chance, give it a try already?

@esparig
Copy link
Author

esparig commented Oct 15, 2024

The following pod based on this test runs successfully:

apiVersion: v1
kind: Pod
metadata:
  name: oscar-cowsay-test-interlink
  namespace: oscar-svc
  annotations:
    slurm-job.vk.io/flags: --job-name=test-cowsay --time=02:30:00   --nodes=1
    slurm-job.vk.io/pre-exec: mkdir -p  /ceph/hpc/home/ciangottinid/oscar_home
    slurm-job.vk.io/singularity-mounts: --bind /ceph/hpc/home/ciangottinid/oscar_home:/ceph/hpc/home/ciangottinid
    slurm-job.vk.io/singularity-options: --no-home --no-mount /exa5
spec:
  containers:
  - name: oscar-container
    args:
    - ' echo $EVENT | /data/supervisor '
    command:
    - /bin/sh
    - -c
    env:
    - name: fprocess
      value: /oscar/bin/supervisor
    - name: max_inflight
      value: "1"
    - name: write_debug
      value: "true"
    - name: exec_timeout
      value: "0"
    - name: read_timeout
      value: "300"
    - name: write_timeout
      value: "300"
    - name: healthcheck_interval
      value: "5"
    - name: EVENT
      value: MTIzNDU2NzgK
    - name: JOB_UUID
      value: fdfc2d23-294f-43ea-bc68-4a2807fdf5f0
    - name: RESOURCE_ID
      valueFrom:
        fieldRef:
          apiVersion: v1
          fieldPath: spec.nodeName
    image: docker://ghcr.io/grycap/cowsay
    resources:
      limits:
        cpu: "1"
        memory: 1Gi
      requests:
        cpu: "1"
        memory: 1Gi
    volumeMounts:
    - mountPath: /oscar/config
      name: oscar-config
      readOnly: true
    - mountPath: /data
      name: shared-data
  initContainers:
  - name: supervisor-container
    args:
    - cp -r /supervisor/* /data
    command:
    - /bin/sh
    - -c
    env:
    - name: FAAS_SUPERVISOR_VERSION
      value: 1.5.7
    - name: WATCHDOG_VERSION
      value: 0.2.1
    image: docker://ghcr.io/grycap/faas-supervisor-kit:1.5.8
    volumeMounts:
    - mountPath: /data
      name: shared-data
  volumes:
  - configMap:
      defaultMode: 420
      name: oscar-cowsay-cm
    name: oscar-config
  - emptyDir: {}
    name: shared-data
  nodeSelector:
    kubernetes.io/hostname: vega-new-vk
  tolerations:
  - key: virtual-node.interlink/no-schedule
    operator: Exists
  - key: node.kubernetes.io/not-ready
    operator: Exists
    effect: NoExecute
    tolerationSeconds: 300
  - key: node.kubernetes.io/unreachable
    operator: Exists
    effect: NoExecute
    tolerationSeconds: 300
  restartPolicy: Never
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: oscar-cowsay-cm
  namespace: oscar-svc
data:
  script.sh: |
    #!/bin/sh

    if [ "$INPUT_TYPE" = "json" ]
    then
        jq '.message' "$INPUT_FILE_PATH" -r | /usr/games/cowsay
    else
        cat "$INPUT_FILE_PATH" | /usr/games/cowsay
    fi
    
    cat /oscar/config/signature.txt
  signature.txt: |
    99999999

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants