-
Notifications
You must be signed in to change notification settings - Fork 2k
[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
NateBrady23
merged 4 commits into
TechEmpower:master
from
ndortega:feature/julia/add-framework/oxygen-jl
Jul 8, 2024
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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": [] | ||
} | ||
} | ||
] | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
FROM julia:latest | ||
|
||
WORKDIR /app | ||
COPY ./src ./ | ||
RUN julia --project -e 'using Pkg; Pkg.instantiate()' | ||
|
||
EXPOSE 8080 | ||
CMD julia -t 2 --project server.jl |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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)