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

[Julia] Introduce genie #1827

Closed
wants to merge 6 commits into from
Closed
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

@@ -0,0 +1,9 @@
FROM julia:1.3

WORKDIR /usr/src/app

COPY deps.jl server.jl ./

RUN julia deps.jl

CMD julia server.jl
@@ -0,0 +1,3 @@
provider:
default:
language: 1.3
@@ -0,0 +1,9 @@
FROM julia:1.3

WORKDIR /usr/src/app

COPY deps.jl server.jl ./

RUN julia deps.jl

CMD julia server.jl
@@ -0,0 +1,3 @@
framework:
website: genieframework.com
version: 0.19
@@ -0,0 +1,3 @@
import Pkg

Pkg.add("Genie")
@@ -0,0 +1,18 @@
using Genie
import Genie.Router: route, POST, @params

route("/user/:id") do
return @params(:id)
end

route("/user", method = POST) do
return ""
end

route("/") do
return ""
end

Genie.AppServer.startup(3000, "0.0.0.0")

Base.JLOptions().isinteractive==0 && wait()
@@ -3,7 +3,11 @@ require "./spec_helper"
def get_ip(name)
cid = `docker run -td #{name}`.strip
sleep 20 # due to external program usage
ip = `docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' #{cid}`.strip
if name == "genie"
ip = `docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' #{cid} && sleep 60`.strip
else
ip = `docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' #{cid}`.strip
end
ip
end

@@ -47,7 +47,11 @@ class Client < Admiral::Command

pipeline = PIPELINES[method]

command = "wrk -H 'Connection: keep-alive' --latency -d #{flags.duration}s -s #{pipeline} -c #{flags.connections} --timeout 8 -t #{flags.threads} #{url}"
if flags.language == "julia"
command = "sleep 60 && wrk -H 'Connection: keep-alive' --latency -d #{flags.duration}s -s #{pipeline} -c #{flags.connections} --timeout 8 -t #{flags.threads} #{url}"
else
command = "wrk -H 'Connection: keep-alive' --latency -d #{flags.duration}s -s #{pipeline} -c #{flags.connections} --timeout 8 -t #{flags.threads} #{url}"
end

io = IO::Memory.new
Process.run(command, shell: true, error: io)
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.