Skip to content
This repository was archived by the owner on Dec 9, 2024. It is now read-only.
This repository was archived by the owner on Dec 9, 2024. It is now read-only.

Invoke local using Docker to support any runtime #119

Closed
@alexkli

Description

@alexkli

Problem

Currently, serverless invoke local is implemented for nodejs and python runtimes by simply running a local Node or Python with the right script. It does not replicate the actual container environment nor does it work for other runtimes or custom images (blackboxes).

Idea

Add a new option to invoke local that relies on a local Docker and would act like an OpenWhisk invoker:

  1. identify the right image - either explicit image in serverless.yml or lookup based on runtime (kind in wsk)
  2. start the container using Docker
  3. post the packaged action to /init on the server on port 8080
  4. execute it via /run
  5. kill the container

In our case, we'd like to use this for unit testing of actions with custom containers, and for that we'd need volume mounting on the container to make our life a lot easier. To keep it simple, it would be good to allow passing any additional docker run options from the serverless invoke local arguments.

State

We are intending to work on this and provide this as PR if desired.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions