glotcode / docker-run

Api for running untrusted code in containers
MIT License
108 stars 25 forks source link

Failed while reading stream: Max execution time exceeded #3

Open shivaprasad573 opened 3 years ago

shivaprasad573 commented 3 years ago

Hello, I am planning to use this component for my use case. So started Installed the docker-run using this

My OS details are

Ubuntu: 20.04 CPU:2 Cores RAM: 4GB

Started the container using

 docker run --detach --restart=always --publish 8088:8088 --volume /var/run/docker.sock:/var/run/docker.sock --env "API_ACCESS_TOKEN=my-token" --env "RUN_MAX_EXECUTION_TIME=1000"  glot/docker-run:latest

Then ran below cURL commands to know the server status and they worked fine

root@ubuntu:/home/ec2-user# curl http://localhost:8088
{
  "name": "docker-run",
  "version": "1.3.0",
  "description": "Api for running code in transient docker containers"
}

root@ubuntu:/home/ec2-user# curl --header 'X-Access-Token: my-token' http://localhost:8088/version
{
  "docker": {
    "version": "20.10.2",
    "apiVersion": "1.41",
    "gitCommit": "20.10.2-0ubuntu1~20.04.2",
    "goVersion": "go1.13.8",
    "os": "linux",
    "arch": "amd64",
    "kernelVersion": "5.8.0-55-generic",
    "buildTime": "2021-03-29T19:10:09.000000000+00:00",
    "platform": {
      "name": ""
    },
    "components": [
      {
        "name": "Engine",
        "version": "20.10.2"
      },
      {
        "name": "containerd",
        "version": "1.4.4-0ubuntu1~20.04.2"
      },
      {
        "name": "runc",
        "version": "1.0.0~rc95-0ubuntu1~20.04.1"
      },
      {
        "name": "docker-init",
        "version": "0.19.0"
      }
    ]
  }
}

Now, when in run the python code getting timeout exception even though I increase to 1000. Am I missing any other configurations?

root@ubuntu:/home/ec2-user# curl --request POST --header 'X-Access-Token: my-token' --header 'Content-type: application/json' --data '{"image": "glot/python:latest", "payload": {"language": "python", "files": [{"name": "main.py", "content": "print(42)"}]}}' http://localhost:8088/run
{
  "error": "limits.execution_time",
  "message": "Failed while reading stream: Max execution time exceeded"
}

Please help me to run the API's.

AlexButeau commented 3 years ago

I have exactly the same issue. If someone knows why, any help would be greatly appreciated!

urosjarc commented 3 years ago

The same issue here :(

francoarendholz commented 3 years ago

Same here, any hints meanwhile?

TimstoR commented 2 years ago

+1, any updates?

matejrisek commented 2 years ago

Oh I think I have the same issue, I've managed to narrow it down to nproc causing problems, why I still don't know.

Have a look at my open issue -> https://github.com/glotcode/docker-run/issues/6

SeaCKei commented 2 years ago

Have this been resolved?, im still having the same problem

Oleg-Chubaka commented 1 year ago

I too had same issue. Even when I used recommended way of instalation. Tried stopping & starting docker-run.service, and different languages - it's all the same...

ps: problem was solved after installing gVisor and adding runsc as default-runtime.

cliffoo commented 1 month ago

i was also able to get by with the gvisor setup.

would be nice for the default recommended installation to work on its own. @prasmussen would you be able to take a look at this?