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

Multiple engines #3958

Merged
merged 304 commits into from
May 22, 2023
Merged

Multiple engines #3958

merged 304 commits into from
May 22, 2023

Conversation

waghanza
Copy link
Collaborator

@waghanza waghanza commented Feb 14, 2021

Hi,

This PR allows to test each frameworks on various setups.

Actual

All frameworks are tested once. For example, ruby framework are tested with puma (since widely spread in ruby communities)

Purpose

Test framework with multiple engines (for the sake of this feature we keep focus on engines, not compilation options, vms, ...). The idea the is to test frameworks with various engines, when accurate indeed.


List of engines


@waghanza waghanza changed the title introduce variants Introduce variants Feb 14, 2021
@ahopkins
Copy link
Member

Great idea. You can also add uvicorn for Python (ASGI).

@waghanza
Copy link
Collaborator Author

Is uvicorn suitable for production now ? I mean we are using gunicorn (with uvicorn workers), but perhaps this is outdated @ahopkins

@ahopkins
Copy link
Member

That pattern is valid and mainly used because gunicorn has a rich feature set. For the ASGI frameworks, I would suggest variants:

  • hypercorn
  • Daphne
  • uvicorn
  • gunicorn + uvicorn

As you can see, I imagine having all these variants across all the languages is likely to lead to a long list. Sanic (for example) can be run directly by gunicorn, by any of the above methods, and also using its own internal server.

Have you had any thoughts of how to present all this data without being too verbose? Maybe the variants list is displayed only by language?

@waghanza
Copy link
Collaborator Author

Maybe a discussion should be a great place to collect ideas

@dominikzogg
Copy link
Member

dominikzogg commented Feb 15, 2021

@waghanza would be cool if those variants are structured like php/chubbyhp/php-fpm, php/chubbyphp/swoole... would be easier to maintain

@waghanza
Copy link
Collaborator Author

@waghanza would be cool if those variants are structured like php/chubbyhp/php-fpm, php/chubbyphp/swoole... would be easier to maintain

Yep. This is what I opted for

Example, for rails

|
-- ruby
           |
           --- rails
                        |
                        --- all files for implementation
                        |
                        .falcon <- specific file for `falcon` variant
                        |
                        .iodine <- specific file for `iodine` variant

The idea is too keep the basics, and change file if required (composer.json, as long as source code, extensions could differs)

And also, some variant requires custom docker images (graalvm in java)

@waghanza waghanza force-pushed the variants branch 10 times, most recently from 93eec29 to 1c997af Compare February 24, 2021 07:45
@waghanza waghanza force-pushed the variants branch 4 times, most recently from 0675ba8 to 1ffd708 Compare March 1, 2021 06:41
@waghanza
Copy link
Collaborator Author

waghanza commented Mar 1, 2021

@the-benchmarker/web-frameworks I have successfully enable variants for ruby. The implementation is not ideal, but can work as a MVP.

If you have time to try it, I'll be glad to review any PR (and have some feedbacks) ❤️

The idea is :

  • define glob patterns to list files at language level
  • define variants at framework level
    You can see any config.yaml im ruby folder

@bung87
Copy link
Contributor

bung87 commented May 20, 2023

give a another try, I just maked a bug fix for Chronos yesterday.

@waghanza
Copy link
Collaborator Author

same using devel @bung87

@bung87
Copy link
Contributor

bung87 commented May 20, 2023

same using devel @bung87

have you clear the chronos-3.1.0? chronos has no git tag, so it need download newest.

@waghanza
Copy link
Collaborator Author

yes @bung87. the compilation is made inside the container, and all caches are removed

Step 7/14 : RUN nimble install -y
 ---> Running in b04e7d61b960
  Verifying dependencies for server@0.1.0
    Prompt: No local packages.json found, download it from internet? -> [forced yes]
Downloading Official package list
    Success Package list downloaded.
 Installing scorper@#devel
Downloading https://github.com/bung87/scorper using git
  Verifying dependencies for scorper@#devel
 Installing chronos@>= 3.0.2
Downloading https://github.com/status-im/nim-chronos using git
  Verifying dependencies for chronos@3.1.0
 Installing stew@any version
Downloading https://github.com/status-im/nim-stew using git
  Verifying dependencies for stew@0.1.0
 Installing unittest2@any version
Downloading https://github.com/status-im/nim-unittest2 using git
  Verifying dependencies for unittest2@0.0.6
 Installing unittest2@0.0.6
   Success: unittest2 installed successfully.
 Installing stew@0.1.0
   Success: stew installed successfully.
 Installing bearssl@any version
Downloading https://github.com/status-im/nim-bearssl using git
  Verifying dependencies for bearssl@0.2.0
      Info: Dependency on unittest2@any version already satisfied
  Verifying dependencies for unittest2@0.0.6
 Installing bearssl@0.2.0
   Success: bearssl installed successfully.
 Installing httputils@any version
Downloading https://github.com/status-im/nim-http-utils using git
  Verifying dependencies for httputils@0.3.0
      Info: Dependency on stew@any version already satisfied
  Verifying dependencies for stew@0.1.0
      Info: Dependency on unittest2@any version already satisfied
  Verifying dependencies for unittest2@0.0.6
      Info: Dependency on unittest2@any version already satisfied
  Verifying dependencies for unittest2@0.0.6
 Installing httputils@0.3.0
   Success: httputils installed successfully.
      Info: Dependency on unittest2@any version already satisfied
  Verifying dependencies for unittest2@0.0.6
 Installing chronos@3.1.0
   Success: chronos installed successfully.
 Installing npeg@any version
Downloading https://github.com/zevv/npeg using git
  Verifying dependencies for npeg@1.2.1
 Installing npeg@1.2.1
   Success: npeg installed successfully.
 Installing zippy@any version
Downloading https://github.com/guzba/zippy using git
  Verifying dependencies for zippy@0.10.9
 Installing zippy@0.10.9
   Success: zippy installed successfully.
 Installing jsony@any version
Downloading https://github.com/treeform/jsony using git
  Verifying dependencies for jsony@1.1.5
 Installing jsony@1.1.5
   Success: jsony installed successfully.
      Info: Dependency on stew@any version already satisfied
  Verifying dependencies for stew@0.1.0
      Info: Dependency on unittest2@any version already satisfied
  Verifying dependencies for unittest2@0.0.6
 Installing urlly@>= 0.2.0 & < 0.3.0
Downloading https://github.com/treeform/urlly using git
  Verifying dependencies for urlly@0.2.0
 Installing urlly@0.2.0
   Success: urlly installed successfully.
 Installing scorper@#devel
   Success: scorper installed successfully.
 Installing server@0.1.0
   Success: server installed successfully.
Removing intermediate container b04e7d61b960

@bung87
Copy link
Contributor

bung87 commented May 20, 2023

weird, can't reproduce, I just cloned this repository , switch to Nim Compiler Version 1.6.12 [MacOSX: amd64] use the command upper, and I also checked the chronos source files that installed, it does have the bugfix I fixed yesterday.

@waghanza
Copy link
Collaborator Author

probably due to alpine then

@waghanza
Copy link
Collaborator Author

I have the same error with Nim Compiler Version 1.6.12 [Linux: amd64] @bung87
seems related to https://github.com/status-im/nim-chronos/blob/f748387462b2472a941e916285f04fc14fd1180a/chronos/selectors2.nim#L298

@bung87
Copy link
Contributor

bung87 commented May 20, 2023

I have the same error with Nim Compiler Version 1.6.12 [Linux: amd64] @bung87
seems related to https://github.com/status-im/nim-chronos/blob/f748387462b2472a941e916285f04fc14fd1180a/chronos/selectors2.nim#L298

but I've fixed yesterday , see status-im/nim-chronos@38cc233

@waghanza
Copy link
Collaborator Author

yes, but not sure however

# Package

version = "0.1.0"
author = "bung87"
description = "scorper implementation"
license = "MIT"

# Dependencies

requires "nim >= 1.3.1"
requires "scorper >= 1.1 & < 1.2"

include this patch

how can I use latest chronos master ?

@bung87
Copy link
Contributor

bung87 commented May 20, 2023

requires "chronos#head"
or
nimble install chronos@#head

@waghanza
Copy link
Collaborator Author

same issue with

# Package

version = "0.1.0"
author = "bung87"
description = "scorper implementation"
license = "MIT"

# Dependencies

requires "nim >= 1.3.1"
requires "scorper#develop"
requires  "chronos#head"

maybe a bump is required, either on scorper or chronos side @bung87

@bung87
Copy link
Contributor

bung87 commented May 21, 2023

published v1.1.2 with dependency requires "chronos", please try again!

@waghanza
Copy link
Collaborator Author

same @bung87

@bung87
Copy link
Contributor

bung87 commented May 21, 2023

pretty weird , the CI shows Installing scorper@1.1.1 :(

@bung87
Copy link
Contributor

bung87 commented May 21, 2023

hard to track the issue for now , I think simply put server.nim.cfg with --threads:on like other frameworks will do the trigger.

@waghanza
Copy link
Collaborator Author

on my side I have

Installing scorper@>= 1.1 & < 1.2
Downloading https://github.com/bung87/scorper using git
  Verifying dependencies for scorper@1.1.2
 Installing chronos@any version
Downloading https://github.com/status-im/nim-chronos using git
  Verifying dependencies for chronos@3.1.0

but still

Step 8/14 : RUN nim c      --excessiveStackTrace:off     -d:release     --opt:speed     --passC:-flto     --passL:-flto     server.nim
 ---> Running in 32b37e6f3bfb
Hint: used config file '/nim/config/nim.cfg' [Conf]
Hint: used config file '/nim/config/config.nims' [Conf]
...........................................................................................................
/root/.nimble/pkgs/chronos-3.1.0/chronos/selectors2.nim(298, 12) Error: undeclared identifier: 'sigprocmask'
candidates (edit distance, scope distance); see '--spellSuggest':
 (6, 6): 'EINPROGRESS' [const declared in /root/.nimble/pkgs/chronos-3.1.0/chronos/oserrno.nim(1274, 5)]
 (6, 6): 'EINPROGRESS' [const declared in /root/.nimble/pkgs/chronos-3.1.0/chronos/oserrno.nim(1274, 5)]
 (6, 6): 'EINPROGRESS' [const declared in /root/.nimble/pkgs/chronos-3.1.0/chronos/oserrno.nim(1274, 5)]
 (6, 6): 'SIG_BLOCK' [const declared in /nim/lib/posix/posix_linux_amd64_consts.nim(403, 7)]
 (6, 6): 'SIG_BLOCK' [const declared in /nim/lib/posix/posix_linux_amd64_consts.nim(403, 7)]
 (6, 6): 'procCall' [proc declared in /nim/lib/system.nim(2965, 6)]

@waghanza waghanza closed this May 21, 2023
@waghanza waghanza deleted the variants branch May 21, 2023 13:10
@waghanza waghanza reopened this May 21, 2023
@waghanza waghanza restored the variants branch May 21, 2023 13:11
@waghanza
Copy link
Collaborator Author

Seems that not all nim frameworks use --threads:on.

Maybe using a compilation option instead of a file could be 👍🏻

@waghanza waghanza merged commit dcec3c6 into master May 22, 2023
249 of 257 checks passed
@waghanza waghanza deleted the variants branch May 22, 2023 07:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants