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

memory limit parameter for newer docker versions #1611

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

egandro
Copy link

@egandro egandro commented Feb 2, 2025

  • Link to issue this resolves

This error when running a very recent version of docker with fn's default image.

Error invoking function. status: 500 message: internal server error

Log from the fnproject/fnserver

API error (400): You should always set the Memory limit when using Memoryswap limit, see usage
  • What I did

Added a required config option to api/agent/drivers/docker/cookie.go - configureMem

This project needs some love. Until that happens, you can mitigate this by doing the following steps:

git clone https://github.com/egandro/fn.git
# or use https://github.com/fnproject/fn.git add apply the patch from here to cookie.go
cd fn
docker rmi fnproject/fnserver:latest || true
docker build -t fnproject/fnserver:latest .
fn start

@yufeifly
Copy link

yufeifly commented Feb 2, 2025 via email

@@ -108,6 +108,7 @@ func (c *cookie) configureMem(log logrus.FieldLogger) {
c.opts.Config.Memory = mem
c.opts.Config.MemorySwap = mem // disables swap
c.opts.Config.KernelMemory = mem
c.opts.HostConfig.Memory = mem

Choose a reason for hiding this comment

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

:)

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.

3 participants