mdneuzerling / lambdr

Run R containers on AWS Lambda
https://lambdr.mdneuzerling.com
Other
131 stars 12 forks source link

yum commands need replacing. #27

Closed sebsilas closed 11 months ago

sebsilas commented 11 months ago

Hi there,

Thanks for this great package.

It seems that yum is not working any more (it's being deprecated). Thus your Dockerfile example has stopped building for me. I'm not sure how to update it yet (e.g., with dnf). If I figure it out, I will send a PR, but thought I'd like you know in case you want to update it yourself more quickly.

All the best, Seb

mdneuzerling commented 11 months ago

Hi Seb,

Thanks for raising this! I had no idea that yum was being deprecated.

I’m travelling at the moment so I won’t be able to look at this right away. If you cannot find a solution over the next week or two I’ll give it a go when I get back.

Regards, David

aavanesy commented 11 months ago

Does anyone have a solution to this? My solution was to find an existing image and build it on top of it. No luck to replace yum...

sebsilas commented 11 months ago

Yes, sorry. The quick (perhaps hacky) fix is to version the Lambda environment. So place the following at the beginning of the Dockerfile:

FROM public.ecr.aws/lambda/provided:al2.2023.11.01.17

We also struggled to find a way of replacing it (e.g., with dnf).

If anyone else comes up with some other alternatives, I'd be interested to know.

All the best, Seb

aavanesy commented 11 months ago

FROM public.ecr.aws/lambda/provided:al2.2023.11.01.17 This is actually the best solution. I have both the R version and the package versions locked in. This would be perfect, as I expect my lambda's to run the next 10 years....

mdneuzerling commented 11 months ago

I had no idea this package was being used so widely!

I promise I’ll take a look at this when I return home.

sebsilas commented 11 months ago

I had no idea this package was being used so widely!

I promise I’ll take a look at this when I return home.

I've used it in both industry and academic settings, it's a very useful package, thank you!

mdneuzerling commented 11 months ago

I've only had a chance to take a quick look, but it seems like using the "al2" tag (eg. FROM public.ecr.aws/lambda/provided:al2) without changing anything else seems to work. I'm actually not sure why --- I thought the base image was Amazon Linux 2. I'll look into this further tomorrow since I'd like to understand what's going on here.

For production uses you're better off using a versioned tag also to prevent breaking changes like this. When I update the docs I'll make a note of that.

aavanesy commented 11 months ago

FROM public.ecr.aws/lambda/provided:al2 worked just perfectly!

mdneuzerling commented 11 months ago

For now I'm going to update the docs to include the al2 tag, and also a recommendation that the tag should be changed to a specific version for any production use.

I'm a little bit scared that this is a temporary fix. But if so I'll deal with that when the time comes. I have some idea of how to replace yum anyway.