Skip to content

Conversation

@ilyesBen
Copy link
Contributor

@ilyesBen ilyesBen commented Aug 10, 2024

What did you implement:

Closes #1884

Ignoring the handlers with the the image.name property the same way the ones with image.uri are ignored as they are lambda containers.

How did you implement it:

How can we verify it:

Create a serverless template with both a lambda handler and a lambda container. The lambda container should have the image.name property poiting to an ecr image defined in the same template. The following example can be used:

service: converter

frameworkVersion: '3'

plugins:
  - serverless-webpack

custom:
  webpack:
    packager: yarn

package:
  individually: true

provider:
  name: aws
  ecr:
    images:
      image-test:
        path: ./

functions:
  functionHandler:
    handler: src/functions/funcionHandler.handler
    name: functionHandler-${sls:stage}
  
  functionContainer:
    name: functionContainer-${sls:stage}
    image:
      name:  image-test
      command:
        - 'functionContainer.handler'

Run serverless package

serverless package

The packager should not throw any error. It should package functionHandler and build the image test-image for the function functionContainer (you would need to make sure you have a valid Dockerfile in the root folder for the image to build).

output in master

Screenshot 2024-08-10 at 13 48 30

output in this branch

Screenshot 2024-08-10 at 13 49 54

Todos:

  • Write tests
  • Write documentation
  • Fix linting errors
  • Make sure code coverage hasn't dropped
  • Provide verification config / commands / resources
  • Enable "Allow edits from maintainers" for this PR
  • Update the messages below

Is this ready for review?: YES
Is it a breaking change?: NO

@j0k3r j0k3r changed the title refactor: ignore handlers with image.name property (fixes #1884) refactor: ignore handlers with image.name property Aug 14, 2024
@j0k3r j0k3r changed the title refactor: ignore handlers with image.name property refactor: ignore handlers with image.name property Aug 14, 2024
@j0k3r
Copy link
Member

j0k3r commented Aug 20, 2024

Could you fix failing tests? Thanks

@ilyesBen
Copy link
Contributor Author

Could you fix failing tests? Thanks

Sure, I will look into it.

@j0k3r j0k3r added the awaiting reply Awaiting for a reply from the OP label Aug 26, 2024
@ilyesBen
Copy link
Contributor Author

ilyesBen commented Oct 12, 2024

Could you fix failing tests? Thanks

@j0k3r I have fixed test. I have removed all the checks around docker based functions as serverless-webpack should not attempt to compile them IMO. I hope it makes sense.

@j0k3r j0k3r removed the awaiting reply Awaiting for a reply from the OP label Oct 14, 2024
Copy link
Member

@j0k3r j0k3r left a comment

Choose a reason for hiding this comment

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

Sorry totally forgot about this one, thanks for your work!

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.

serverless-webpack running webpack on lambda containers with image.name property

2 participants