-
-
Notifications
You must be signed in to change notification settings - Fork 48
glot-run permissions? #12
Comments
As you are running glot-run inside a docker container you wont be able to reach the docker daemon on 127.0.0.1:2375, you would have to configure your docker daemon to listen on a ip that can be reached from inside the glot-run container and put that ip in DOCKER_API_URL. Just a sidenote on security, on glot.io I run a dedicated docker daemon (in a dedicated vm) for running the |
for dev purposes, if you run everything in containers, and want to use the same docker daemon for running snippets (not recommended in prod for security purposes), you can modify For prod options, prasmussen vm's is great and combined with #13 swarm mode (https://docs.docker.com/engine/swarm/) it would be very scalable |
Thanks a lot gentlemen, appreciate the guidance! I changed the docker api to 172.17.0.1 after I previously verified that it is accessible. Now I see another type of internal error, maybe you have a clue ?. The respons from glot-run API is still 500 Internal Server Error. I'm using SoapUI to sent a POST to /languages/python/latest and my request contains the authorization & content-type in the header why the payload has the demo json :
|
The logging when something goes wrong is very lacking at the moment. Can you confirm that you are using version 1.2.1 of glot-run? (You can get the version number by requesting the root url). Can you also paste the output of the docker version response? |
Do you have the language registered in glot-run? Glot doesn't come with preregistered languages neither pulls the image. It may be complicated to setup but allows great flexibility. |
I'm with version 1.2.0 - I pulled the package from docker hub
The output of docker api/version: Yes, I have the language registered correctly confirmed by calling /languages/ |
In 1.2.1 there is a fix that makes glot-run work with newer versions of docker, so you need to upgrade as you seem to be running the latest version of docker. Are you using |
Indeed, I am using Would be great if @javierprovecho upgrades the docker image! :) |
@cezarfloroiu @prasmussen done! https://hub.docker.com/r/javierprovecho/glot-run/builds/bmwscmozpryw4sr2wqezngt/ Tag is |
Now it worked! Thank you so much! 🥇 |
Hey @prasmussen , glot - Code Runner API
Docker API version
I have started git-run service with below command.
I am able to create token, fetch languages, create languages etc. But when try to run the code for any languages with below i am facing the issue.
Error Log
http.log
event.log
Thanks |
Hey I think, I had installed latest version of docker-ce. let me try 17.12.0 |
No Luck with below docker api version.
|
Right now facing this issue. :( |
Hi
I installed everything and all works except running a code through glot-run API which throws 500 internal server error.
I have this error and I wonder if there aren't any security settings/permissions I need to check . My error is econnrefused....
I confirmed with curl docker api is enabled and running on 2375 and that I put the right IP/PORT in the env DOCKER_API_URL settings.
The container glot/python is installed and tested standalone.
Any idea? Thanks!!
22:09:16.410 [error] Ranch listener http had connection process started with cowboy_protocol:start_link/4 at <0.639.0> exit with reason: {[{reason,{badmatch,{error,econnrefused}}},{mfa,{language_run_resource,accept_post,2}},{stacktrace,[{docker,container_create,1,[{file,"/glot-run/_build/default/lib/glot/src/docker/docker.erl"},{line,13}]},{language_run,run,3,[{file,"/glot-run/_build/default/lib/glot/src/models/language_run.erl"},{line,11}]},{language_run_resource,run_code,3,[{file,"/glot-run/_build/default/lib/glot/src/resources/language_run_resource.erl"},{line,97}]},{cowboy_rest,call,3,[{file,"/glot-run/_build/default/lib/cowboy/src/cowboy_rest.erl"},{line,976}]},{cowboy_rest,process_content_type,3,[{file,"/glot-run/_build/default/lib/cowboy/src/cowboy_rest.erl"},{line,777}]},{cowboy_protocol,execute,4,[{file,"/glot-run/_build/default/lib/cowboy/src/cowboy_protocol.erl"},{line,442}]}]},{req,[{socket,#Port<0.995>},{transport,ranch_tcp},{connection,keepalive},{pid,<0.639.0>},{method,<<"POST">>},{version,'HTTP/1.1'},{peer,{{83,199,179,80},57446}},{host,<<"ec2-52-90-7-66.compute-1.amazonaws.com">>},{host_info,undefined},{port,80},{path,<<"/languages/python/latest">>},{path_info,undefined},{qs,<<>>},{qs_vals,undefined},{bindings,[{version,<<"latest">>},{name,<<"python">>}]},{headers,[{<<"accept-encoding">>,<<"gzip,deflate">>},{<<"authorization">>,<<"Token mytoken">>},{<<"content-type">>,<<"application/json">>},{<<"content-length">>,<<"110">>},{<<"host">>,<<"ec2-1.amazonaws.com">>},{<<"connection">>,<<"Keep-Alive">>},{<<"user-agent">>,<<"Apache-HttpClient/4.1.1 (java 1.5)">>}]},{p_headers,[{<<"content-type">>,{<<"application">>,<<"json">>,[]}},{<<"if-modified-since">>,undefined},{<<"if-none-match">>,undefined},{<<"if-unmodified-since">>,undefined},{<<"if-match">>,undefined},{<<"accept">>,undefined},{<<"connection">>,[<<"keep-alive">>]}]},{cookies,undefined},{meta,[{media_type,{<<"application">>,<<"json">>,'*'}},{charset,undefined}]},{body_state,waiting},{buffer,<<"{\n \"language\": \"python\",\n \"files\": [{\n \"name\": \"main.py\",\n \"content\": \"print(\\\"Hello World!\\\")\"\n }]\n}">>},{multipart,undefined},{resp_compress,false},{resp_state,waiting},{resp_headers,[{<<"content-type">>,[<<"application">>,<<"/">>,<<"json">>,<<>>]}]},{resp_body,<<>>},{onresponse,#Fun<http_util.log_response.4>}]},{state,{state,<<"python">>,<<"latest">>}}],[{cowboy_rest,process_content_type,3,[{file,"/glot-run/_build/default/lib/cowboy/src/cowboy_rest.erl"},{line,777}]},{cowboy_protocol,execute,4,[{file,"/glot-run/_build/default/lib/cowboy/src/cowboy_protocol.erl"},{line,442}]}]}
This is the command I ran:
The text was updated successfully, but these errors were encountered: