CodeCatalyst: pip install failed on Lambda using Active images

0

Hi,

We use test action aws/managed-test@v1 as part of our workflow in CodeCatalyst.

To test our Python Lambda's code, we installed some extra package using pip install before running pytest. Recently we add iceberg in our stack, so we need to test our Lambda's code using the package pyiceberg.

But the action failed to run when we try to do pip install pyiceberg with the error: ERROR: Cannot set --home and --prefix together

This is similar to the issue mentioned in https://github.com/pypa/pip/issues/11129

In fact, when I tried to do pip config debug on the Compute.Type Lambda, it was:

env_var:
env:
global:
/etc/xdg/pip/pip.conf, exists: False
/etc/pip.conf, exists: True
global.target: /tmp/opt/python/site-packages
site:
/usr/local/pip.conf, exists: False

When I did the same thing on the Compute.Type EC2, it doesn't have global.target as part of the config. But since we can't use sudo to run a command in Steps, I can't remove the global.target from pip config. My currently workaround is running our test on Compute.Type EC2 instead of Lambda.

Should this be considered as a bug to be fix ? Any other recommendation to fix the issue so that we can continue to run our tests on the Compyte.Type Lambda?

Thanks in advance for your help.

Vu Hai
asked 5 months ago151 views
1 Answer
0

Nothing in CodeCatalyst stopping you from running sudo afaik Also consider, you can use your own image see https://docs.aws.amazon.com/codecatalyst/latest/userguide/build-images.html#workflows-working-custom-image-ex-ecr-node18

A good starting point is to use public.ecr.aws/amazonlinux/amazonlinux:2023 FROM public.ecr.aws/amazonlinux/amazonlinux:2023

answered 4 months ago
  • Thanks for your suggestion, but I tried sudo before in Steps of Lambda fleet and got permission error. Lambda fleet only supports CodeCatalyst image, not custom one. My current workaround is running our workflow on EC2 instead, so the idea of using custom image doesn't help here since we still prefer Lambda usage for faster spinning up time. And so far I can only pull image from public repo, for private one I got the same error mentioned in this thread https://repost.aws/questions/QUlEet2tjcSXKhGCBmAv19SA/amazon-codecatalyst-not-pulling-ecr-image even though I also set up the permission role for CodeCatalyst, but that's a different story

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions