-
Notifications
You must be signed in to change notification settings - Fork 680
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
New release #8113
base: master
Are you sure you want to change the base?
New release #8113
Conversation
Starting in Axum 0.8 path variables went from being declared like :user to being declared like {user} |
Yes, sorry for the ping. I've noticed it in tokio-rs/axum#2645 |
Thanks, it's working @trikko |
When I try to compile
Any idea @karlseguin @Kayden1412 @zigster64 ? I'm on aarch64 using web-frameworks/zig/httpz/src/main.zig Line 1 in aedc5b0
|
I wonder how bun make for being compiled on ARM then ;-) @Kayden1412 |
@kpicaza any plan to support 8.4 ? |
@snowbldr The version of |
@mimiMonads for root@b05a5df00cca:/usr/src/app# bun run app.ts
1 | const app = await import('./server.ts')
2 |
3 | Bun.serve({
4 | fetch: await app.compose(),
^
TypeError: app.compose is not a function. (In 'app.compose()', 'app.compose' is undefined)
at /usr/src/app/app.ts:4:20
Bun v1.1.42 (Linux arm64) |
I have switch to
Seems like reuse-port is enabled by default for those libs, and then pm2 could not run 😛 If you know how to disable this ... any help is ❤️ appreciated As for now, I use the old cluster.ts way (exec ditsmod that use a custom solution) cc @mario-huang @mcollina @SaltyAom @aquapi @KostyaTretyak @mimiMonads |
I would not recommend using pm2 in any benchmarks, as it monkeypatches some things inside core, making the benchmark about pm2. |
What do you recommend then @mcollina ? The idea is to mimic production use, and mainly to spread on all cores |
@waghanza, I also think you don't need to use You also using for Node.js: import cluster from 'node:cluster';
import { availableParallelism } from 'node:os';
const numCpus = availableParallelism();
if (numCpus > 1 && cluster.isPrimary) {
for (let i = 0; i < numCpus; i++) {
cluster.fork();
}
} else {
// here past your code to create the app and webserver
app.server.listen(3000, '0.0.0.0');
} for Bun.js: import { availableParallelism } from 'node:os';
const numCpus = availableParallelism();
for (let i = 0; i < numCpus; i++) {
Bun.spawn(['bun', 'app.ts'], { // here may be replace it with "*.js"
stdio: ['inherit', 'inherit', 'inherit'],
env: { ...process.env },
});
} |
I understand your points @KostyaTretyak @mcollina. The idea is to mimic production usage, mainly with pm2 (or alternative), but we do not need them here, because :
Agree. It's better to stick to native solution. Let's use native solution for durian.js then @mario-huang |
Thanks - will have a look, although looking through your code + build config + dockerfile, I dont see anything obvious :( I do have 1 situation where I get this exact same error, and haven't had time to go through a solution yet (just worked around it in the interim) The situation where I can reproduce the same "panic during panic" error is :
Only differences I can think of between the Drone CI instance that fails with this error, and my own docker server is
Will have to double check which linux kernel version is on the failing machine - I think it's the previous Ubuntu LTS version 20.x or something. Will have to double check that I know that I spun up a quick vultr Ubuntu server on the same old kernel version, and tried zig build from there - that worked fine I also tried spinning up a vultr Alpine based server and tried zig build of the project from there - that worked fine as well, although it was running the newer kernel compared to the Drone CI linux kernel that was failing So yeah - not a solution, but some more clues towards a solution maybe. The error Im getting during compile happens pretty quickly in the build process (about 5 seconds in), and is the exact same error that you are seeing "Panic during panic" I put it down to some weird combination of linux kernel + musl + zig version for the time being, with a note to look deeper into it in the new year. Its now the new year :) Another red herring is that my repo also uses a C library to write XLSX files - so I was thinking that might be part of my problem as well. Not sure yet |
Thanks @zigster64 for heads up. You provide some meaningful insights. If this project could help any community, The dockefile is use is FROM debian:bullseye-slim AS build
# Set a non-root user for added security
RUN useradd -m ziguser
# Install dependencies (update to latest secure versions)
RUN apt-get update && \
apt-get install -y --no-install-recommends \
wget xz-utils \
ca-certificates && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Download the latest stable Zig binary from the official website
ARG ZIG_VERSION=0.13.0
RUN wget https://ziglang.org/download/0.13.0/zig-linux-aarch64-0.13.0.tar.xz
RUN tar -xvf zig-linux-aarch64-0.13.0.tar.xz
RUN mv zig-linux-aarch64-0.13.0 /usr/local/zig
# Add Zig to the PATH
ENV PATH="/usr/local/zig:$PATH"
WORKDIR /home/ziguser
COPY 'build.zig' 'build.zig'
RUN chown ziguser build.zig
COPY 'src/main.zig' 'src/main.zig'
RUN chown ziguser src/main.zig
COPY 'build.zig.zon' 'build.zig.zon'
RUN chown ziguser build.zig.zon
RUN chown -R ziguser src
# Switch to the non-root user
USER ziguser
RUN zig build -Doptimize=ReleaseFast
FROM debian
RUN apt-get -qq update
RUN apt-get -qy install ca-certificates curl
COPY --from=build /app/zig-out/bin/httpz /server
ENTRYPOINT ["/home/ziguser/server"]
HEALTHCHECK CMD curl --fail http://0.0.0.0:3000 || exit |
After taking a closer look, the debian version in use is different : 11 for compilation step and 12 to run. I have change this for FROM debian:12-slim AS build
# Set a non-root user for added security
RUN useradd -m ziguser
# Install dependencies (update to latest secure versions)
RUN apt-get update && \
apt-get install -y --no-install-recommends \
wget xz-utils \
ca-certificates && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Download the latest stable Zig binary from the official website
ARG ZIG_VERSION=0.13.0
RUN wget https://ziglang.org/download/0.13.0/zig-linux-aarch64-0.13.0.tar.xz
RUN tar -xvf zig-linux-aarch64-0.13.0.tar.xz
RUN mv zig-linux-aarch64-0.13.0 /usr/local/zig
# Add Zig to the PATH
ENV PATH="/usr/local/zig:$PATH"
WORKDIR /home/ziguser
COPY 'build.zig' 'build.zig'
RUN chown ziguser build.zig
COPY 'src/main.zig' 'src/main.zig'
RUN chown ziguser src/main.zig
COPY 'build.zig.zon' 'build.zig.zon'
RUN chown ziguser build.zig.zon
RUN chown -R ziguser src
# Switch to the non-root user
USER ziguser
RUN zig build -Doptimize=ReleaseFast
FROM debian:12-slim
RUN apt-get -qq update
RUN apt-get -qy install ca-certificates curl
COPY --from=build /app/zig-out/bin/httpz /server
ENTRYPOINT ["/home/ziguser/server"]
HEALTHCHECK CMD curl --fail http://0.0.0.0:3000 || exit but no change |
Seems to compile on CI (x86_64) |
You accidentally downgraded serverino. Last version is 0.7.15, not 0.7.4. |
@enghitalo With web, I have
|
@msmakouz @butschster @wolfy-j I have => ERROR [30/31] RUN php public/index.php configure 0.2s
------
> [30/31] RUN php public/index.php configure:
0.124
0.124 Deprecated: Constant E_STRICT is deprecated in /usr/src/app/public/index.php on line 13
0.135 [ErrorException]
0.135 Spiral\YiiErrorHandler\HtmlRenderer::render(): Implicitly marking parameter $format as nullable is deprecated, the explicit nullable type must be used instead in vendor/spiral-packages/yii-error-handler-bridge/src/HtmlRenderer.php:25
0.135 [ErrorException]
0.135 Constant E_STRICT is deprecated in public/index.php:13
------
.Dockerfile.road-runner:47
--------------------
45 | RUN composer install --no-dev --prefer-dist --classmap-authoritative
46 | RUN composer dumpautoload -o
47 | >>> RUN php public/index.php configure
48 | RUN vendor/bin/rr get-binary
49 |
--------------------
ERROR: failed to solve: process "/bin/sh -c php public/index.php configure" did not complete successfully: exit code: 255
make: *** [php/spiral//.Makefile:2: build] Error 1 for |
@waghanza Wrong serverino version update? |
I've set 0.7.16 in dub.json @trikko , but anyway 0.7.x is taken so ... last one |
Just because you have no cache luckily 🙂 |
@jim-king-2000 @danteissaias how can I run import fast from "https://deno.land/x/[email protected]/mod.ts";
// Create the Fast app
const app = fast();
// Define routes
app.get("/", (req, res) => {
res.text("Welcome to Fast with Deno Serve!");
});
app.get("/json", (req, res) => {
res.json({ message: "This is a JSON response from Fast!" });
});
app.get("/hello/:name", (req, res) => {
const name = req.params.name;
res.text(`Hello, ${name}!`);
});
export default fetch ; but without success |
Hmm, I’ll probably have to release an update to expose the fetch handler. |
@waghanza V fixed on current master |
@waghanza Can you add this as a Bun framework?
Code: import { router, jitc } from '@mapl/app';
const app = router()
.build('/', () => '')
.post('/user', () => '')
.get('/user/*', (params) => params[0]);
// Port 3000
export default await jitc(app, { exposeStatic: true }); |
Could you make an external PR to have a clear separation. Will be a mess, otherwise Also, may you ping the author ? |
@waghanza I'm the author XD |
Make a PR not from master, I'll push cluster thing it ⭐ |
Have you tried out of interest? import fast from "https://deno.land/x/[email protected]/mod.ts";
// Create the Fast app
const app = fast();
// Define routes
app.get("/", (req, res) => {
res.text("Welcome to Fast with Deno Serve!");
});
app.get("/json", (req, res) => {
res.json({ message: "This is a JSON response from Fast!" });
});
app.get("/hello/:name", (req, res) => {
const name = req.params.name;
res.text(`Hello, ${name}!`);
});
export default { fetch: app.handle } |
Yes @danteissaias , but without sucess For info, I'm running it in FROM denoland/deno:2.1.5
WORKDIR /usr/src/app
COPY 'app.ts' 'app.ts'
RUN deno install
RUN apt-get -qq update
RUN apt-get -qy install curl
HEALTHCHECK CMD curl --fail http://0.0.0.0:3000 || exit 1
ENTRYPOINT deno serve --parallel --port 3000 --allow-net --allow-read=. --allow-env app.ts |
@yusukebe @SaltyAom is clustering enabled by default with Bun v1.1.45 (Linux arm64)
7 | if (typeof entryNamespace?.default?.fetch === 'function') {
8 | const server = Bun.serve(entryNamespace.default);
9 | console.debug(`Started ${server.development ? 'development ' : ''}server: ${server.protocol}://${server.hostname}:${server.port}`);
10 | }
11 | }, reportError);
12 | const server = Bun.serve(entryNamespace.default);
^
error: Failed to start server. Is port 3000 in use?
syscall: "listen",
errno: 0,
code: "EADDRINUSE"
at bun:main:12:28 EDIT : SOLVED |
Hi,
This PR will update release.
I have however an issue with
axum
, with version 0.8cc @wyatt-herkamp @krishnaTORQUE @davidpdrsn @jplatte