Git Product home page Git Product logo

Comments (7)

LamaAni avatar LamaAni commented on June 23, 2024

Hi, Thank you for posting!

Would love to help but I would need an example dag, with minimal configuration if you can.

This seems like an error where a pod has multiple containers. Is that correct?

I'm not sure about the timeline, but I'm pretty confident we can resolve this issue.

from kubernetesjoboperator.

LamaAni avatar LamaAni commented on June 23, 2024

Hi, I was able to reproduce your error with (testpod.py),

from airflow import DAG
from airflow_kubernetes_job_operator import KubernetesJobOperator
from airflow.utils.dates import days_ago

default_args = {
    "depends_on_past": False,
    "start_date": days_ago(1),
}

dag = DAG(dag_id="test_multi_container", default_args=default_args, schedule_interval=None)

with dag:
    KubernetesJobOperator(
        task_id="test-multi-container",
        body_filepath="./testdag.yaml",
    )

if __name__ == "__main__":
    dag.schedule_interval = None
    dag.clear()
    dag.run()

Job configuration (testpod.yaml):

apiVersion: v1
kind: Pod
metadata:
  name: 'multi-container-test'
  labels:
    app: 'multi-container-test'
spec:
  restartPolicy: Never
  containers:
    - name: container1
      image: 'alpine:latest'
      command:
        - sh
        - -c
        - |
          echo starting sleep...
          sleep 10
          echo end
      resources:
        limits:
          cpu: 200m
          memory: 500Mi
        requests:
          cpu: 100m
          memory: 200Mi
    - name: container2
      image: 'alpine:latest'
      command:
        - sh
        - -c
        - |
          echo starting sleep...
          sleep 10
          echo end
      resources:
        limits:
          cpu: 200m
          memory: 500Mi
        requests:
          cpu: 100m
          memory: 200Mi

from kubernetesjoboperator.

LamaAni avatar LamaAni commented on June 23, 2024

It may be a few days before I can get to this, apologies for that. The error lies in the Kuberentes api call, where it dose not specify to load the logs from all executing containers inside a pod. This of course can be changed. Error location is here:

Log reader needs to be able to define a container here:

Watcher needs to define a reader for each container here:

This is a nice catch. Thank you.

from kubernetesjoboperator.

LamaAni avatar LamaAni commented on June 23, 2024

Please see resolution PR here:
#39

from kubernetesjoboperator.

LamaAni avatar LamaAni commented on June 23, 2024

Please see resolution version:
https://github.com/LamaAni/KubernetesJobOperator/releases/tag/1.0.19

Please close this issue once validated. Thank you!

from kubernetesjoboperator.

etorres avatar etorres commented on June 23, 2024

I'm so very grateful for your time. We switch to the new version and it works like a charm. I'm closing the issue.

from kubernetesjoboperator.

LamaAni avatar LamaAni commented on June 23, 2024

Awesome, if you can add a testimonial, that would be fantastic. Here: #40

from kubernetesjoboperator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.