This commit is contained in:
@@ -2,14 +2,24 @@
|
||||
|
||||
GET WORKING MANUALLY THEN CAN DO DOCS ONCE HAVE PROCESS HERE
|
||||
(expand the instructions on stack overflow pages and link to the pg and asp.net core install pages)
|
||||
SPLIT THIS OUT INTO MULTIPLE PAGES LIKE WINDOWS
|
||||
|
||||
|
||||
|
||||
todo: for some reason user files path is blank in server settings under ops in ayanova app on linux desktop when using the single data path folder, check in windows
|
||||
todo: Docker config add path to chromium in env variable:
|
||||
lo.ExecutablePath = ServerBootConfig.AYANOVA_REPORT_RENDER_BROWSER_PATH;//"/usr/bin/chromium-browser";//this is the default path for docker based alpine dist
|
||||
|
||||
|
||||
//#################################### LINUX DESKTOP ################################
|
||||
|
||||
todo: error rendering needs fix:
|
||||
|
||||
1638924788467|API error: status=400, statusText=Bad Request, url=http://localhost:7575/api/v8.0/report/render
|
||||
1638924788636|Vue error:
|
||||
2030 - Invalid operation
|
||||
Failed to launch browser! [1207/165308.271638:ERROR:zygote_host_impl_linux.cc(90)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180.
|
||||
|
||||
It needs this command line lo.Args = new string[] { $"--disable-dev-shm-usage --no-sandbox --disable-gpu --no-zygote " };
|
||||
I think the best thing to do is make it yet another server config because it's super likely that it will need to be tweaked in future, best to make it just settable and default it to above
|
||||
|
||||
|
||||
|
||||
|
||||
Linux DESKTOP standalone ubuntu desktop
|
||||
todo: put running on desktop image at top here
|
||||
SYSTEM REQUIREMENTS NOTE: painfully slow with 1gb, probably needs 2gb to work properly
|
||||
@@ -31,20 +41,34 @@ Linux DESKTOP standalone ubuntu desktop
|
||||
|
||||
|
||||
|
||||
- Make AyaNova data folder: ~/.ayanova-data
|
||||
- Make AyaNova AYANOVA_DATA_PATH folder, default expected is: ~/.ayanova-data
|
||||
sudo mkdir ~/.ayanova-data
|
||||
Note: You don't have to use this path but if you change it then this will be required to be set in a config file in a later step
|
||||
|
||||
- download ayanova linux x64 archive
|
||||
https://www.ayanova.com/Downloads/v8/ayanova-linux-x64-desktop.zip
|
||||
- Unzip the archive into an appropriate folder (/usr/bin/ayanova)
|
||||
- edit config.json
|
||||
set postgres password
|
||||
set data folder location
|
||||
~/.ayanova-data
|
||||
- Set permissions on AyaNova:
|
||||
chmod 777 ./AyaNova
|
||||
start AyaNova:
|
||||
./AyaNova
|
||||
|
||||
- Make program folder:
|
||||
sudo mkdir /usr/bin/ayanova
|
||||
|
||||
- copy archive to program folder
|
||||
sudo cp ayanova-linux-x64-desktop.zip /usr/bin/ayanova/
|
||||
|
||||
- Unzip the archive into an appropriate folder (/usr/bin/ayanova)
|
||||
sudo unzip ayanova-linux-x64-desktop.zip
|
||||
|
||||
- Set permissions on AyaNova:
|
||||
sudo chmod 777 ./AyaNova
|
||||
|
||||
- edit config.json
|
||||
sudo nano config.json
|
||||
change "mypasswordforpostgres" in AYANOVA_DB_CONNECTION to the password set for postgres above
|
||||
set AYANOVA_DATA_PATH location if not using the default which is: ~/.ayanova-data
|
||||
|
||||
start AyaNova:
|
||||
sudo ./AyaNova
|
||||
|
||||
Verify it's working
|
||||
- open browser and navigate to http://localhost:7575/login (or whatever port was enabled)
|
||||
|
||||
|
||||
@@ -57,5 +81,10 @@ nginx lan ubuntu
|
||||
internet
|
||||
|
||||
|
||||
###############################################################
|
||||
//DOCKER
|
||||
https://www.ayanova.com/Downloads/v8/ayanova-linux-docker-x64-server.zip
|
||||
https://www.ayanova.com/Downloads/v8/ayanova-linux-docker-x64-server.zip
|
||||
|
||||
todo: Docker config add path to chromium in env variable:
|
||||
lo.ExecutablePath = ServerBootConfig.AYANOVA_REPORT_RENDER_BROWSER_PATH;//"/usr/bin/chromium-browser";//this is the default path for docker based alpine dist
|
||||
|
||||
@@ -461,79 +461,51 @@ namespace AyaNova.Biz
|
||||
var lo = new LaunchOptions { Headless = true };
|
||||
if (!AutoDownloadChromium)
|
||||
{
|
||||
lo.ExecutablePath = ServerBootConfig.AYANOVA_REPORT_RENDER_BROWSER_PATH;//"/usr/bin/chromium-browser";//this is the default path for docker based alpine dist, but maybe not others, need to make a config setting likely
|
||||
// lo.Args = new string[] { "--no-sandbox" };
|
||||
lo.ExecutablePath = ServerBootConfig.AYANOVA_REPORT_RENDER_BROWSER_PATH;
|
||||
/*
|
||||
troubleshooting links:
|
||||
https://developers.google.com/web/tools/puppeteer/troubleshooting
|
||||
|
||||
Note: plenty of zombie process issues in regular puppeteer as well
|
||||
These links might be worth looking at in future if diagnosing other issues:
|
||||
https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md#running-on-alpine
|
||||
|
||||
|
||||
|
||||
https://github.com/puppeteer/puppeteer/issues/1825
|
||||
const chromeFlags = [
|
||||
'--headless',
|
||||
'--no-sandbox',
|
||||
"--disable-gpu",
|
||||
"--single-process",
|
||||
"--no-zygote"
|
||||
]
|
||||
troubleshooting links:
|
||||
https://developers.google.com/web/tools/puppeteer/troubleshooting
|
||||
|
||||
These links might be worth looking at in future if diagnosing other issues:
|
||||
https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md#running-on-alpine
|
||||
https://github.com/puppeteer/puppeteer/issues/1825
|
||||
const chromeFlags = [
|
||||
'--headless',
|
||||
'--no-sandbox',
|
||||
"--disable-gpu",
|
||||
"--single-process",
|
||||
"--no-zygote"
|
||||
]
|
||||
*/
|
||||
//was using this for a long period of time
|
||||
//lo.Args = new string[] { "--disable-dev-shm-usage --no-sandbox --disable-gpu --single-process --no-zygote " };
|
||||
|
||||
//however chrome may be problematic on linux, I'm seeing issues under load testing where it freezes out the droplet at 100% cpu and ram and it's
|
||||
//chrome processes piling up all churning away so experimenting with resolutions
|
||||
|
||||
//this guy says single process should NOT be used as recommended by Google
|
||||
//and so far in testing I see no reason to doubt him so removed it
|
||||
//https://github.com/puppeteer/puppeteer/issues/1825#issuecomment-792817748
|
||||
//testing
|
||||
lo.Args = new string[] { $"--disable-dev-shm-usage --no-sandbox --disable-gpu --no-zygote " };
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
//WINDOWS ONLY
|
||||
log.LogDebug($"Windows: Calling browserFetcher download async now:");
|
||||
|
||||
await new BrowserFetcher().DownloadAsync(BrowserFetcher.DefaultChromiumRevision);
|
||||
|
||||
// //TRY TO FORCE LANGUAGE THROUGH STARTUP PARAMETER
|
||||
// lo.Args = new string[] { $"{LaunchParamLanguage}" };
|
||||
}
|
||||
|
||||
//Set Chromium args
|
||||
var DefaultArgs = "--disable-dev-shm-usage --no-sandbox --disable-gpu --no-zygote ";
|
||||
if (!string.IsNullOrWhiteSpace(ServerBootConfig.AYANOVA_REPORT_RENDER_BROWSER_PARAMS))
|
||||
{
|
||||
log.LogDebug($"AYANOVA_REPORT_RENDER_BROWSER_PARAMS will be used: {ServerBootConfig.AYANOVA_REPORT_RENDER_BROWSER_PARAMS}");
|
||||
lo.Args = new string[] { $"{ServerBootConfig.AYANOVA_REPORT_RENDER_BROWSER_PARAMS}" };// AYANOVA_REPORT_RENDER_BROWSER_PARAMS
|
||||
}
|
||||
else
|
||||
{
|
||||
log.LogDebug($"AYANOVA_REPORT_RENDER_BROWSER_PARAMS not set, using defaults '{DefaultArgs}'");
|
||||
lo.Args = new string[] { DefaultArgs };
|
||||
}
|
||||
System.Text.StringBuilder PageLog = new System.Text.StringBuilder();
|
||||
|
||||
|
||||
|
||||
//API DOCS http://www.puppeteersharp.com/api/index.html
|
||||
log.LogDebug($"Launching headless Browser now:");
|
||||
using (var browser = await Puppeteer.LaunchAsync(lo))
|
||||
using (var page = await browser.NewPageAsync())
|
||||
// using (var page = (await browser.PagesAsync()).First())//for language setting version
|
||||
{
|
||||
//track this process so it can be cancelled if it times out
|
||||
ReportRenderManager.AddProcess(browser.Process.Id);
|
||||
|
||||
|
||||
// //========================================
|
||||
// //TRY TO FORCE LANGUAGE ON ALL PLATFORMS
|
||||
// var JScriptOverrideLanguage = "Object.defineProperty(navigator, 'language', {get: function() {return '" + ClientLanguage + "';}});Object.defineProperty(navigator, 'languages', {get: function() {return ['" + ClientLanguage + "'];}});";
|
||||
// await page.EvaluateFunctionOnNewDocumentAsync(JScriptOverrideLanguage);
|
||||
// await page.GoToAsync("about:blank");
|
||||
// var hdrs = new Dictionary<string, string>();
|
||||
// hdrs.Add("Accept-Language", ClientLanguage);
|
||||
// await page.SetExtraHttpHeadersAsync(hdrs);
|
||||
// //=========================================
|
||||
|
||||
|
||||
|
||||
page.DefaultTimeout = 0;//infinite timeout as we are controlling how long the process can live for with the reportprocessmanager
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
|
||||
@@ -79,6 +79,9 @@ namespace AyaNova.Util
|
||||
|
||||
//REPORT RENDERING BROWSER PATH (if not set then will attempt to auto-download on first render)
|
||||
internal static string AYANOVA_REPORT_RENDER_BROWSER_PATH { get; set; }
|
||||
//REPORT RENDERING BROWSER PARAMS
|
||||
internal static string AYANOVA_REPORT_RENDER_BROWSER_PARAMS { get; set; }
|
||||
|
||||
|
||||
//LOGGING
|
||||
internal static string AYANOVA_LOG_PATH { get; set; }
|
||||
@@ -169,9 +172,12 @@ namespace AyaNova.Util
|
||||
AYANOVA_SET_SUPERUSER_PW = config.GetValue<string>("AYANOVA_SET_SUPERUSER_PW");
|
||||
|
||||
//REPORT RENDERING
|
||||
|
||||
|
||||
//RENDER ENGINE PATH
|
||||
AYANOVA_REPORT_RENDER_BROWSER_PATH = ActualFullPath(config.GetValue<string>("AYANOVA_REPORT_RENDER_BROWSER_PATH"));
|
||||
|
||||
//RENDER ENGINE PARAMS
|
||||
AYANOVA_REPORT_RENDER_BROWSER_PARAMS = config.GetValue<string>("AYANOVA_REPORT_RENDER_BROWSER_PARAMS");
|
||||
|
||||
//PROCESS CONTROL
|
||||
int? nTemp = config.GetValue<int?>("AYANOVA_REPORT_RENDERING_TIMEOUT");
|
||||
|
||||
Reference in New Issue
Block a user