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

dockerfile updated #15

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

dockerfile updated #15

wants to merge 4 commits into from

Conversation

bmblb
Copy link
Collaborator

@bmblb bmblb commented Sep 18, 2023

  • platform locked
  • node upgraded
  • hummus replaces with muhammara

Inspired by this PR: #11 which we cannot accept for several reasons:

  1. SIGTERM listener is not called (I tried various ways to kill a process on windows fruitlessly).
  2. We do not need a node instance watching over FS.
  3. Volume usage. This one could be a valuable addition to a container, allowing to mount resources folder. Further investigation required.

docs/building.md Outdated Show resolved Hide resolved
docs/building.md Outdated Show resolved Hide resolved
docs/building.md Outdated Show resolved Hide resolved
docs/building.md Outdated Show resolved Hide resolved
docs/building.md Outdated Show resolved Hide resolved
docs/building.md Outdated Show resolved Hide resolved
docs/building.md Outdated Show resolved Hide resolved
@bmblb
Copy link
Collaborator Author

bmblb commented Sep 25, 2023

new dockerized version hangs on macbook with m2 chip, need to investigate

@knobel-dk
Copy link

@bmblb I have an M2. How can I help? I'll be glad to share my laptop with you for a few hours over several days on Teams if helpful?

@bmblb
Copy link
Collaborator Author

bmblb commented Nov 13, 2023

@knobel-dk Thank you for a generous offer. Remote debugging could help determining if it is an export server code which hangs the system, if it is smth related to OS/puppeteer internals it would be up to you to figure this out because I simply don't have means to. Do you wish to spend your time on it? If so, we can probably arrange smth in coming weeks

@knobel-dk
Copy link

@bmblb Let us do it. Write me on jk@datapult about details.

I could, as an example, start by reproducing without you and do some initial troubleshooting. Just tell me where to start and when you want to chat.

@bmblb
Copy link
Collaborator Author

bmblb commented Nov 13, 2023

@knobel-dk you can start by testing the image:

  1. check out branch
  2. build docker image
  3. use image with grid/scheduler/gantt export demo and try to export

@knobel-dk
Copy link

knobel-dk commented Nov 13, 2023

@bmblb

When cloning the repo and checking out the branch, I do DOCKER_BUILDKIT=1 docker build -t pdf-export -f ./Dockerfile . in the root.

When I use it in my repo I get a info (just info):
bryntum_pdfexport_server The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested 0.0s

I then proceed to press the Export in my scheduler (see the setup here: https://forum.bryntum.com/viewtopic.php?t=25692)

It sends a request to the pdf export server but it remains pending, see these two screenshots showing that this request remains pending (even if the preflight request returns a OK):

image image

@knobel-dk
Copy link

@bmblb Let me know what I can do from here.

@knobel-dk
Copy link

@bmblb I am currently not doing more on this issue but would be glad to. Also, I have a Mac M2 that you can get remote access to for the next two weeks.

@bmblb
Copy link
Collaborator Author

bmblb commented Dec 4, 2023

@knobel-dk Try running server in verbose mode and attaching log here. Log would contain detailed description and we could probably learn smth from it.

@knobel-dk
Copy link

@bmblb

Here is the output and I waited 3 minutes (with no further output) and the request still being pending like in the screenshot above:

2023-12-04T14:49:34.996Z info: Access-Control-Allow-Origin: *
Access-Control-Allow-Origin: *
2023-12-04T14:49:35.300Z info: Http server started on port 8080
Http server started on port 8080
2023-12-04T14:49:35.302Z info: Https server started on port 8081
Https server started on port 8081
2023-12-04T14:52:00.743Z info: POST request 79636561-906b-445e-aa49-52fb8948d260
2023-12-04T14:52:00.749Z info: [Queue@pcsrmoifkcfhy08zg45ku] Added 1 to the queue, current length is 1
2023-12-04T14:52:00.750Z info: [Queue@pcsrmoifkcfhy08zg45ku] Queue is running

If I then submit new requests, it looks like this:

2023-12-04T14:49:34.996Z info: Access-Control-Allow-Origin: *
Access-Control-Allow-Origin: *
2023-12-04T14:49:35.300Z info: Http server started on port 8080
Http server started on port 8080
2023-12-04T14:49:35.302Z info: Https server started on port 8081
Https server started on port 8081
2023-12-04T14:52:00.743Z info: POST request 79636561-906b-445e-aa49-52fb8948d260
2023-12-04T14:52:00.749Z info: [Queue@pcsrmoifkcfhy08zg45ku] Added 1 to the queue, current length is 1
2023-12-04T14:52:00.750Z info: [Queue@pcsrmoifkcfhy08zg45ku] Queue is running
2023-12-04T14:55:07.836Z info: POST request 42afbcac-33e3-4ccb-a0aa-04596640144b
2023-12-04T14:55:07.842Z info: [Queue@pcsrmoifkcfhy08zg45ku] Added 1 to the queue, current length is 1
2023-12-04T14:57:00.813Z info: POST request e9dbcf70-b51e-45f3-bc42-b981723f95e6
2023-12-04T14:57:00.816Z info: [Queue@pcsrmoifkcfhy08zg45ku] Added 1 to the queue, current length is 1

The scheduler components that I am sending over is a small 30 resources by 7 days with no more than 5 events in all.

@bmblb
Copy link
Collaborator Author

bmblb commented Dec 6, 2023

@knobel-dk This log does not look complete and verbose. Verbose should contain info about incoming request too:

2023-12-06T10:49:29.319Z info: POST request a9998854-cd0e-4709-8d58-b372336905e6
2023-12-06T10:49:29.320Z verbose: POST request a9998854-cd0e-4709-8d58-b372336905e6 headers: {"host":"localhost:8080",...
2023-12-06T10:49:29.320Z info: [Queue@lh9a0xe169c52k3du0r3r] Added 1 to the queue, current length is 1
2023-12-06T10:49:29.320Z info: [Queue@lh9a0xe169c52k3du0r3r] Queue is running
2023-12-06T10:49:29.321Z verbose: [Worker@qjcn4mby8cly7poc5bdjm] New worker created

@knobel-dk
Copy link

@bmblb Just tell me how to configure. This is the second time you ask for verbose logging without describing how you want. it done Here the current git diff. Just tell me what I need to do.

Screenshot 2023-12-06 at 11 52 10
Screenshot 2023-12-06 at 11 52 00

@bmblb
Copy link
Collaborator Author

bmblb commented Dec 6, 2023

Changing log level in app.config.js should've been enough:

"level" : "info",
Or adding --verbose to start script. When log is verbose you should see a note about receiving a request in the log file. If you do not see that line but see queue running, it means your server is not running in verbose mode. Make sure you rebuilt your docker image.

@knobel-dk
Copy link

@bmblb I did rebuild the image, and indeed you will notice that this output is "fuller" than the image I originally posted:

2023-12-04T14:49:34.996Z info: Access-Control-Allow-Origin: *
Access-Control-Allow-Origin: *
2023-12-04T14:49:35.300Z info: Http server started on port 8080
Http server started on port 8080
2023-12-04T14:49:35.302Z info: Https server started on port 8081
Https server started on port 8081
2023-12-04T14:52:00.743Z info: POST request 79636561-906b-445e-aa49-52fb8948d260
2023-12-04T14:52:00.749Z info: [Queue@pcsrmoifkcfhy08zg45ku] Added 1 to the queue, current length is 1
2023-12-04T14:52:00.750Z info: [Queue@pcsrmoifkcfhy08zg45ku] Queue is running

image

@bmblb
Copy link
Collaborator Author

bmblb commented Dec 6, 2023

Logs you paste here suggest mode is not verbose. Verbose message should've appeared right below info message about an incoming request:

me.logger.log('verbose', `POST request ${req.id} headers: ${JSON.stringify(req.headers)}`);

Is there a chance you're looking into wrong log file? Each time you start the server new log file is created. Please check entire contents of the log folder.
If you still see no verbose messages, rollback your changes and start server with --verbose flag in CLI

@knobel-dk
Copy link

@bmblb I see now. It does not log to stdout despite me setting "logger": false in app.config.js

The log

2023-12-06T16:22:21.670Z info: POST request d9c6e8f6-550a-45ad-bf4f-38d91e3b71f7
2023-12-06T16:22:21.674Z verbose: POST request d9c6e8f6-550a-45ad-bf4f-38d91e3b71f7 headers: {"host":"localhost:8080","connection":"keep-alive","content-length":"250250","sec-ch-ua":"\"Google Chrome\";v=\"119\", \"Chromium\";v=\"119\", \"Not?A_Brand\";v=\"24\"","sec-ch-ua-platform":"\"macOS\"","dnt":"1","sec-ch-ua-mobile":"?0","user-agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36","content-type":"application/json","accept":"*/*","origin":"http://localhost","sec-fetch-site":"same-site","sec-fetch-mode":"cors","sec-fetch-dest":"empty","referer":"http://localhost/","accept-encoding":"gzip, deflate, br","accept-language":"en-GB,en;q=0.9,en-US;q=0.8,da;q=0.7"}
2023-12-06T16:22:21.675Z info: [Queue@hiv7h6wi7ol099fjolz9n] Added 1 to the queue, current length is 1
2023-12-06T16:22:21.677Z verbose: [Worker@0psbak55kkrjvia6tvtv7] New worker created
2023-12-06T16:22:21.680Z verbose: [Queue@hiv7h6wi7ol099fjolz9n] Starting job 1/1 for request d9c6e8f6-550a-45ad-bf4f-38d91e3b71f7
2023-12-06T16:22:21.681Z verbose: [Queue@hiv7h6wi7ol099fjolz9n] 0 items still in queue
2023-12-06T16:22:21.681Z verbose: [Worker@0psbak55kkrjvia6tvtv7] Started job 1/1
2023-12-06T16:22:23.934Z verbose: [Worker@0psbak55kkrjvia6tvtv7] Browser started

@bmblb
Copy link
Collaborator Author

bmblb commented Dec 6, 2023

If this log is complete, it means await browser.newPage() never gets resolved. Try adding more log points there and checking that assumption.
I suggest searching internet on the subject newPage does not resolve on macos. You may find options like this: puppeteer/puppeteer#4039 (comment)

From this point you are on your own. Problem has to be in newPage() promise and solving would take experiments on your end.

@knobel-dk
Copy link

@bmblb Okay, guess it won't be possible for OSX users to work with this locally. Could you then merge it into main so we can start working on staging where we also run ARM?

@bmblb
Copy link
Collaborator Author

bmblb commented Dec 11, 2023

@knobel-dk I would prefer to look into M2 issue. Can you not use this branch for your purposes?

@knobel-dk
Copy link

@bmblb

I am confused:

In the previous message:

From this point you are on your own.

And now:

I would prefer to look into M2 issue.

You want to borrow my M2 or not?

@bmblb
Copy link
Collaborator Author

bmblb commented Dec 11, 2023

I meant to say that you took a shot and couldn't find a problem is reasonable time. Means we will have to, eventually. I am overloaded at the moment so I will ask our team to look into that, some people have M2 machines, but not me.

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.

3 participants