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

Blueprint #140 on serverless lambda does not run successfully #156

Open
shrutimantri opened this issue Jun 23, 2024 · 0 comments
Open

Blueprint #140 on serverless lambda does not run successfully #156

shrutimantri opened this issue Jun 23, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@shrutimantri
Copy link
Contributor

Expected Behavior

The blueprint should run successfully.

Actual Behaviour

The blueprint flow fails with an error.

Stacktrace:

2024-06-23 22:12:55.532Provided 2 input(s).
2024-06-23 22:12:55.553Starting command with pid 210 [/bin/sh -c set -e
sls deploy
sls invoke -f etl --log]
2024-06-23 22:12:55.561/bin/sh: 2: sls: not found
2024-06-23 22:12:55.567Command failed with code 127
2024-06-23 22:12:55.567io.kestra.core.models.tasks.runners.TaskException: Command failed with code 127
	at io.kestra.plugin.core.runner.Process.run(Process.java:118)
	at io.kestra.plugin.scripts.exec.scripts.runners.CommandsWrapper.run(CommandsWrapper.java:159)
	at io.kestra.plugin.scripts.node.Commands.run(Commands.java:90)
	at io.kestra.plugin.scripts.node.Commands.run(Commands.java:18)
	at io.kestra.core.runners.WorkerTaskThread.doRun(WorkerTaskThread.java:77)
	at io.kestra.core.runners.AbstractWorkerThread.run(AbstractWorkerThread.java:56)

Steps To Reproduce

Put the blueprint flow in the Kestra env, and Execute the flow.

Environment Information

  • Kestra Version: 0.17.4
  • Plugin version: 0.17.4
  • Operating System (OS / Docker / Kubernetes): Docker
  • Java Version (If not docker):

Example flow

id: lambda
namespace: company.team

tasks:
  - id: sls_commands
    type: io.kestra.plugin.scripts.node.Commands
    description: npm install -g serverless
    runner: PROCESS
    warningOnStdErr: false
    inputFiles:
      serverless.yml: |
        service: lambda
        frameworkVersion: '3'

        provider:
          name: aws
          runtime: python3.9
          region: eu-central-1
          memorySize: 512 # optional, in MB, default is 1024; can be 128, 256, 512, 1024, 2048, 4096, 5120, ...
          timeout: 10 # optional, in seconds, default is 6

        functions:
          etl:
            handler: handler.run

      handler.py: |
        import platform
        import sys

        def extract() -> int:
            print("Extracting data...")
            return 21


        def transform(x: int) -> int:
            print("Transforming data...")
            return x * 2


        def load(x: int) -> None:
            print(f"Loading {x} into destination...")


        def run(event=None, context=None):
            raw_data = extract()
            transformed = transform(raw_data)
            load(transformed)
            print("Hello from Kestra 🚀")
            print(f"Host's network name = {platform.node()}")
            print(f"Python version = {platform.python_version()}")
            print(f"Platform information (instance type) = {platform.platform()}")
            print(f"OS/Arch = {sys.platform}/{platform.machine()}")
    commands:
      - sls deploy 
      - sls invoke -f etl --log
      # - sls remove
@shrutimantri shrutimantri added the bug Something isn't working label Jun 23, 2024
@github-project-automation github-project-automation bot moved this to Backlog in Issues Jun 23, 2024
@anna-geller anna-geller self-assigned this Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Backlog
Development

No branches or pull requests

2 participants