kestra-io/kestra

Caching example from the documentation fails in the latest version

Open

#8,540 建立於 2025年4月27日

在 GitHub 查看
 (13 留言) (0 反應) (1 負責人)Java (26,854 star) (2,579 fork)batch import
area/docsgood first issue

描述

Describe the issue

The Python example from the Caching section:

id: python_cached_dependencies
namespace: company.team

tasks:
  - id: working_dir
    type: io.kestra.plugin.core.flow.WorkingDirectory
    tasks:
      - id: python_script
        type: io.kestra.plugin.scripts.python.Script
        taskRunner:
          type: io.kestra.plugin.core.runner.Process
        warningOnStdErr: false
        beforeCommands:
          - python -m venv venv
          - source venv/bin/activate
          - pip install pandas
        script: |
          import pandas as pd
          print(pd.__version__)
    cache:
      patterns:
        - venv/**
      ttl: PT24H

... fails in the latest Kestra version.

The first error is due to the source binary not being available.

ERROR /bin/sh: 3: source: not found

Replacing source with a dot doesn't seem to work, as the log starts showing a warning recommending to use a virtual environment.

ERROR WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

ERROR ModuleNotFoundError: No module named 'pandas'

Environment

  • Kestra Version: 0.22.4 (Docker)

貢獻者指南

Caching example from the documentation fails in the latest version · kestra-io/kestra#8540 | Good First Issue