Comments (9)
I actually meant something different but then realised that it's not possible to have ambiguous module names.
So @ac000 's original example looks ideal.
from unit.
The language modules and versions are handily stored in the languages
array member of the nxt_runtime_t
structure...
We have access to the following information
typedef struct {
nxt_app_type_t type;
u_char *version;
char *file;
nxt_app_module_t *module;
nxt_array_t *mounts; /* of nxt_fs_mount_t */
} nxt_app_lang_module_t;
Would showing the path (e.g /opt/unit/modules/python.unit.so
) to the module be useful? Might be handy for debugging to make sure it's loading the modules you expect it to...
from unit.
Would showing the path (e.g /opt/unit/modules/python.unit.so) to the module be useful?
I have wished for this information several times in fact! :)
I think having this will better enable our users to roll their own docker images and to compile Unit for themselves.
from unit.
Given that we have the type
and version
as separate entities in the struct, it makes sense to have an array of objects instead of the simple naive array I was envisaging.
I wasn't sure about the information disclosure of the path. And I didn't have a use case for it. But now I think about it, knowing exactly which module is loaded seems like a good idea.
from unit.
I have an initial version that will return something like
{
"modules": {
"python": {
"version": "3.12.2",
"lib": "/opt/unit/modules/python.unit.so"
},
"wasm": {
"version": "0.1",
"lib": "/opt/unit/modules/wasm.unit.so"
},
"wasm-wasi-component": {
"version": "0.1",
"lib": "/opt/unit/modules/wasm_wasi_component.unit.so"
}
},
...
}
from unit.
I look forward to trying it :)
I suggested an array of objects because we may find multiple versions of the same language module installed (especially for PHP and Python).
from unit.
Are you saying you want the JSON formatted differently?
Currently it's modelled on the "applications" section
"applications": {
"luw-echo-request": {
"processes": {
"running": 1,
"starting": 0,
"idle": 1
},
"requests": {
"active": 0
}
},
"luw-upload-reflector": {
"processes": {
"running": 1,
"starting": 0,
"idle": 1
},
"requests": {
"active": 0
}
},
"echo-request-raw": {
"processes": {
"running": 1,
"starting": 0,
"idle": 1
},
"requests": {
"active": 0
}
},
"rust-echo-request": {
"processes": {
"running": 1,
"starting": 0,
"idle": 1
},
"requests": {
"active": 0
}
},
"rust-upload-reflector": {
"processes": {
"running": 1,
"starting": 0,
"idle": 1
},
"requests": {
"active": 0
}
},
"rust-hello-world": {
"processes": {
"running": 1,
"starting": 0,
"idle": 1
},
"requests": {
"active": 0
}
},
"sc-test": {
"processes": {
"running": 1,
"starting": 0,
"idle": 1
},
"requests": {
"active": 0
}
},
"large-upload": {
"processes": {
"running": 1,
"starting": 0,
"idle": 1
},
"requests": {
"active": 0
}
},
"rust-large-upload": {
"processes": {
"running": 1,
"starting": 0,
"idle": 1
},
"requests": {
"active": 0
}
}
}
from unit.
I think Liam probably means:
{
"modules": {
"python": [
{
"version": "3.12.2",
"lib": "/opt/unit/modules/python3.12.unit.so"
},
{
"version": "3.11.0",
"lib": "/opt/unit/modules/python3.11.unit.so"
}
],
"wasm": [ ... ]
}
from unit.
Excellent! Well done @ac000
from unit.
Related Issues (20)
- Badge colors don't match NGINX colors
- nginx unit php server stops responding when using supervisor HOT 2
- BUG: Environment Variables not passed to Wasm Applications HOT 4
- Error: Cannot find module 'unit-http/loader' HOT 3
- Error 503, PHP HOT 8
- [Feature Request] Basic Authentication for Control Socket HOT 3
- CLI: subcommand for saving configuration HOT 3
- CLI: deploy configuration to many instances HOT 3
- CLI: SSH Support HOT 4
- Unit is not compiled with php, njs and wasm-wasi-component HOT 5
- Node.js: Unable to run due to Server this.on is not a function HOT 4
- "Waiting for Server Response" time consistently different depending on POST DATA Length? HOT 9
- http2 on; doesnt work as expected HOT 2
- RHEL Packages: GPG check fails when explicitly enabled HOT 9
- Change server name header HOT 1
- Add error code and error message as variables at error page HOT 1
- Docker: for python based images, use the -slim version HOT 13
- Building Containers for amd64 on ARM instances fails HOT 5
- Crypto HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from unit.