Closed omartrigui closed 7 years ago
Does the curl request run for ~15 seconds before you get the 400 response?
Are you able to run the docker image manually by running the following command:
echo '{ "language": "python", "files": [{ "name": "main.py", "content": "print(\"Hello World!\")" }] }' | docker run -i --rm glot/python:latest
(Should give the following result: {"stdout":"Hello World!\n","stderr":"","error":""}
)
After executing the provided command, i've received no response ... Freezed. Maybe an issue related to the glot/python container or docker daemon ?
I just deleted the image and downloaded a fresh one from docker hub, works fine for me:
$ echo '{ "language": "python", "files": [{ "name": "main.py", "content": "print(\"Hello World!\")" }] }' | docker run -i --rm glot/python:latest
Unable to find image 'glot/python:latest' locally
latest: Pulling from glot/python
6d827a3ef358: Pull complete
2726297beaf1: Pull complete
7d27bd3d7fec: Pull complete
44ae682c18a3: Pull complete
824bd01a76a3: Pull complete
68fe59875298: Pull complete
9ca1d7ae0c4b: Pull complete
530e1718a99e: Pull complete
8d0be0e48b81: Pull complete
fcf42062c9c1: Pull complete
5ebf04eb5aa4: Pull complete
0d831d84095c: Pull complete
Digest: sha256:97c56c6e89c1656402be5d6c8bcef377ddb614af73e331854b9bdf46e04124b1
Status: Downloaded newer image for glot/python:latest
{"stdout":"Hello World!\n","stderr":"","error":""}
I see that you have a newer docker version than i have attempted with though, something might have changed in the newer versions. Or it might just be a configuration issue with your docker setup.
I see. In fact your docker daemon is configured with the flag -H fd:// , and my docker is configured with -H tcp://127.0.0.1:2375. An excerpt from my /lib/systemd/system/docker.service
ExecStart=/usr/bin/dockerd -H tcp://0.0.0.0:2375
CGroup: /system.slice/docker.service
├─11453 /usr/bin/dockerd -H tcp://0.0.0.0:2375
└─11466 docker-containerd -l unix:///var/run/docker/libcontainerd/docker-containerd.sock --metrics-interval=0 --start-timeout 2m --state-dir /var/run/docker/
If i use the flag -H fd://, glot-run will not be able to establish any connection to docker daemon over tcp.
You can give multiple -H flags to the daemon to make it listen on both tcp and unix socket (fd://)
mm i see, now the previously provided command, works fine.
echo '{ "language": "python", "files": [{ "name": "main.py", "content": "print(\"Hello World!\")" }] }' | docker run -i --rm glot/python:latest
{"stdout":"Hello World!\n","stderr":"","error":""}
After restarting the local server, the POST is still returning :
{
"message": "Code exceeded the maximum allowed running time"
}
The query :
curl -X POST \
http://127.0.0.1:9999/languages/python/latest \
-H 'authorization: Token d11088bc-a29d-4d49-a633-b1b1ae807064' \
-H 'content-type: application/json' \
-d '{
"language": "python",
"files": [
{
"name": "main.py",
"content": "print(42)"
}
]
}'
Hey @OmarTrigui, i think you have resolved issue. Can you let us know, how you resolved the issue?
The problem occurs when i POST a python sample to my local server
I receive a 400 Bad request with a message :
{"message": "Code exceeded the maximum allowed running time"}
Additional informations about my environment: Docker API :
glot-run output :
glot-run script runner :
I appreciate any support.