Skip to content

[New Framework]: Oxygen.jl #8789

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

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions frameworks/Julia/oxygen/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Oxygen.jl Benchmarking Test

Oxygen is a micro-framework built on top of the HTTP.jl library and comes with helpful utilities to quickly setup and run web applications in Julia.

### Test Type Implementation Source Code

* [JSON](Relative/Path/To/Your/Source/File)
* [PLAINTEXT](Relative/Path/To/Your/Source/File)

## Important Libraries
The tests were run with:
* [Oxygen.jl](https://github.com/OxygenFramework/Oxygen.jl)

## Test URLs
### JSON

http://localhost:8080/json

### PLAINTEXT

http://localhost:8080/plaintext
26 changes: 26 additions & 0 deletions frameworks/Julia/oxygen/benchmark_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"framework": "oxygen",
"tests": [
{
"default": {
"json_url": "/json",
"plaintext_url": "/plaintext",
"port": 8080,
"approach": "Realistic",
"classification": "None",
"database": "None",
"framework": "Oxygen.jl",
"language": "Julia",
"orm": "None",
"platform": "None",
"webserver": "Oxygen.jl",
"os": "Linux",
"database_os": "Linux",
"display_name": "Oxygen.jl",
"notes": "",
"versus": "",
"tags": []
}
}
]
}
8 changes: 8 additions & 0 deletions frameworks/Julia/oxygen/oxygen.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM julia:latest
Copy link
Member

Choose a reason for hiding this comment

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

Can you tie this down to a specific version please

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@NateBrady23
How specific are we talking? Would setting it to version 1 be specific enough or are you looking for an exact 1.x.x version?

Copy link
Member

@NateBrady23 NateBrady23 Mar 28, 2024

Choose a reason for hiding this comment

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

If their version convention is such that breaking changes can be introduced in 1.x, then 1.x.x would be best, but really it's so that you can reproduce results on other hardware from the exact versions used in any of our runs.

Choose a reason for hiding this comment

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

interactive pools in 1.9 and scheduling in 1.10 will give vastly different results.

Copy link
Contributor Author

@ndortega ndortega Mar 30, 2024

Choose a reason for hiding this comment

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

Julia is super good about backward compatibility, so setting to the latest stable version 1 should be fine.

Any breaking changes would get placed in version 2 of the language

Choose a reason for hiding this comment

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

It's not a compatibility issue. But 1.10 does different scheduling which brings different performance. It's not good enough yet, but it's significantly better (mainly because you can avoid being blocked from precompilation)


WORKDIR /app
COPY ./src ./
RUN julia --project -e 'using Pkg; Pkg.instantiate()'

EXPOSE 8080
CMD julia -t 2 --project server.jl
4 changes: 4 additions & 0 deletions frameworks/Julia/oxygen/src/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[deps]
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
HTTP = "cd3eb016-35fb-5094-929b-558a96fad6f3"
Oxygen = "df9a0d86-3283-4920-82dc-4555fc0d1d8b"
23 changes: 23 additions & 0 deletions frameworks/Julia/oxygen/src/server.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@

using Oxygen
using Dates
using HTTP

@get "/json" function()
return json(("message" => "Hello, World!"))
end

@get "/plaintext" function()
return text("Hello, World!")
end

function HeaderMiddleware(handle::Function)
function(req::HTTP.Request)
response = handle(req)
HTTP.setheader(response, "Server" => "Julia-Oxygen")
HTTP.setheader(response, "Date" => Dates.format(Dates.now(), Dates.RFC1123Format) * " GMT")
return response
end
end

serveparallel(host="0.0.0.0", port=8080, middleware=[HeaderMiddleware], access_log=nothing, metrics=false, docs=false)