Running AngularDart in docker container - memory use - docker

I am running an AngularDart project in a Docker Container google/dart and install webdev.
It is running very slow, so I have tried to add more cpu - do you know how to optimise and make it faster and is it good practice to run AngularDart in google/dart?
docker container run --name webdev -it --rm -p 8080:8080 -v $(pwd):/usr/src/app --cpu-shares=2 google/dart
The first time, it builds ok, but after making changes - the second build is very slow.
You can see the build log here:
webdev serve --hostname 0.0.0.0
Creating build script, took 22350ms
[INFO] Setting up file watchers completed, took 135ms
[INFO] Waiting for all file watchers to be ready completed, took 5.6s
[INFO] Reading cached asset graph completed, took 2.9s
[INFO] Checking for updates since last build completed, took 4.3s
[INFO] Running build completed, took 1.9s
[INFO] Caching finalized dependency graph completed, took 1.5s
[INFO] Succeeded after 3.5s with 0 outputs (0 actions)
Serving `web` on http://0.0.0.0:8080
Serving `test` on http://0.0.0.0:8081
[INFO] ------------------------------------------------------------------------
[INFO] Starting Build
[INFO] Updating asset graph completed, took 57ms
[WARNING] No actions completed for 32.6s, waiting on:
- angular on lib/app_component.dart
[WARNING] No actions completed for 15.0s, waiting on:
- build_web_compilers|ddc on lib/app_component.template.dartdevc.module
[WARNING] No actions completed for 15.1s, waiting on:
- build_web_compilers|ddc on lib/app_component.template.dartdevc.module
[WARNING] No actions completed for 20.6s, waiting on:
- build_modules|dartdevc on lib/app_component.template.dartdevc.module
[WARNING] No actions completed for 31.2s, waiting on:
- build_modules|dartdevc on lib/app_component.template.dartdevc.module
[INFO] Running build completed, took 2m 28s
[INFO] Caching finalized dependency graph completed, took 3.1s
[INFO] Succeeded after 2m 31s with 12 outputs (10 actions)

Related

builder is not exiting when successful

The builder has no error but is not exiting after execution.
I restarted my machine and it stopped, but after a few runs it is back to the behavior.
[INFO] Build:Caching finalized dependency graph...
[INFO] Build:Caching finalized dependency graph completed, took 150ms
[INFO] Build:Succeeded after 23.8s with 143 outputs (499 actions)

build (mvn install) of new application takes forever

I was trying to use an existing application as starting point for a new one.
So, I copied over the src-folder, the pom and a couple of IDE-specific files config files.
I then refactored all giving it a new path and application name and then I wanted to do a first build and entered mvn install.
This process is now hanging since 1 1/2 hours in vaadin-maven-plugin:18.0.2:build-frontend (see full console output below).
Is this expected or why is this taking so long? Can I somehow figure out, why and where this is hanging?
What am I missing? Are there any files other then those mentioned that absolutely MUST exist before a new Vaadin application can (even be tried to) be built?
[INFO] Scanning for projects...
[INFO]
[INFO] --------------< ch.zh.ksta.monitoring:my_app >---------------
[INFO] Building KStA-ZH-Monitoring 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:resources (default-resources) # my_app ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] Copying 7 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) # my_app ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- vaadin-maven-plugin:18.0.2:prepare-frontend (default) # my_app ---
[INFO] writing file D:\Projects\my_app\target\flow-frontend\package.json.
[INFO] writing file D:\Projects\my_app\target\flow-frontend\form\package.json.
[INFO] writing file 'D:\Projects\my_app\target\index.html'
[INFO] writing file 'D:\Projects\my_app\target\index.ts'
[INFO] Copying frontend resources from jar files ...
[INFO] Visited 173 resources. Took 2229 ms.
[INFO]
[INFO] --- vaadin-maven-plugin:18.0.2:build-frontend (default) # my_app ---
[INFO] Scanning classes to find frontend configurations and dependencies...
[INFO] Visited 720 classes. Took 2553 ms.
[INFO] Visited 126 classes. Took 138 ms.
[INFO] writing file D:\Projects\my_app\target\flow-frontend\package.json.
[INFO] writing file D:\Projects\my_app\target\flow-frontend\form\package.json.
[INFO] writing file 'D:\Projects\my_app\target\index.html'
[INFO] writing file 'D:\Projects\my_app\target\index.ts'
[INFO] Parsing java files from [D:\Projects\my_app\src\main\java]
[INFO] There are no connect endpoints to generate.
[INFO] Running `pnpm install` to resolve and optionally download frontend dependencies. This may take a moment, please stand by...
[INFO] Generated pnpmfile hook file: 'D:\Projects\my_app\pnpmfile.js'
[INFO] installing pnpm version 4.4.0 locally
[INFO] using 'C:\Users\mmo\.vaadin\node\node.exe C:\Users\mmo\.vaadin\node_modules\pnpm\bin\pnpm.js' for frontend package installation
Later addition:
If I terminate this using ^C I get:
...
2021-05-31 18:24:40,199 ERROR [task-1] com.vaadin.flow.server.frontend.TaskRunNpmInstall: Command `C:\Program Files\nodejs\node.exe C:\Users\mmo\.vaadin\node_modules\pnpm\bin\pnpm.js --shamefully-hoist=true install` failed:
Using hooks from: D:\Projects\my_app\pnpmfile.jsreadPackage hook is declared. Manifests of dependencies might get overridden
2021-05-31 18:24:40,201 ERROR [task-1] com.vaadin.flow.server.frontend.TaskRunNpmInstall: >>> Dependency ERROR. Check that all required dependencies are deployed in pnpm repositories.
2021-05-31 18:24:40,205 DEBUG [task-1] com.vaadin.flow.server.startup.DevModeInitializer: Could not initialize dev mode handler. One of the node tasks failed
com.vaadin.flow.server.ExecutionFailedException: Pnpm install has exited with non zero status. Some dependencies are not installed. Check pnpm command output
at com.vaadin.flow.server.frontend.TaskRunNpmInstall.runNpmInstall(TaskRunNpmInstall.java:405)
at com.vaadin.flow.server.frontend.TaskRunNpmInstall.execute(TaskRunNpmInstall.java:120)
at com.vaadin.flow.server.frontend.NodeTasks.execute(NodeTasks.java:634)
at com.vaadin.flow.server.startup.DevModeInitializer.runNodeTasks(DevModeInitializer.java:471)
at com.vaadin.flow.server.startup.DevModeInitializer.lambda$initDevModeHandler$0(DevModeInitializer.java:381)
at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1736)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)
If I restart the build again it will hang again.
Gee - is this brittle... :-(
Got this same error. I deleted from my home directory:
.vaadin
.pnpm-store
... and the generated stuff from my project:
webpack.config.js
tsconfig.json
types.d.ts
webpack.config.js
webpack.generated.js
pnpm-lock.yaml
pnpmfile.js
package.json
.npmrc
target
.pnpm-debug.log
... probably overkill, but then it worked again.

jenkins: Exception when publishing, exception message [Permission denied]

when I bulid a project by using the plugin 'publish over ssh', jenkins shows me the error:
[INFO] Packaging webapp
[INFO] Assembling webapp [bc-ctq] in [/var/lib/jenkins/workspace/bc-
ctq/target/bc-ctq]
[INFO] Processing war project
[INFO] Copying webapp resources [/var/lib/jenkins/workspace/bc- ctq/src/main/webapp]
[INFO] Webapp assembled in [140 msecs]
[INFO] Building war: /var/lib/jenkins/workspace/bc-ctq/target/bc-ctq.war
[INFO] WEB-INF/web.xml already added, skipping
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.018 s
[INFO] Finished at: 2018-10-26T19:38:10+08:00
[INFO] ------------------------------------------------------------------------
SSH: Connecting from host [localhost.localdomain]
SSH: Connecting with configuration [love] ...
SSH: Disconnecting configuration [love] ...
ERROR: Exception when publishing, exception message [Permission denied]
Archiving artifacts
Finished: UNSTABLE
Send files or execute commands over SSH after the build runs
the ssh server config
I was facing similar error and it turned out to be ownership issue. The owner of your project folder should be same as the one Jenkins uses to remote SSH into your instance.
Check ownership of your folder by running ls -ltr in your parent directory.
Change ownership using sudo chown -R owner:group DirectoryName/
Check verbose output and start build, then you'll see where is the problem

Dart beginning - unable to run AngularDart Web App template

Im trying to following the instructions on https://webdev.dartlang.org/guides/get-started
I have installed 2.0.0-dev.55.0 in /usr/lib/dart.
And have Dartium installed in /home/bob/Documents/software/dartium-linux-x64-stable-1.24.2.0/chrome.
When I try 5. Run the app. I get the following:
pubspec.yaml
name: angular_app
description: A web app that uses AngularDart
version: 0.0.1
environment:
sdk: '>=2.0.0-dev.51.0 <2.0.0'
dependencies:
angular: ^5.0.0-alpha+12
dev_dependencies:
angular_test: ^2.0.0-alpha
build_runner: ^0.8.8
build_test: ^0.10.2
build_web_compilers: ^0.4.0
test: ^0.12.30
I have tried right-click pubspec.yaml and choose Pub: Get Dependencies but this didnt make any difference.
I have also tried using the sample dart project from https://github.com/angular-examples/quickstart which uses Dart 2, and NOT using Dartium. But I still get the same error.
When I run pub run build_runner serve I get
Could not find bin/build_runner.dart in package build_runner.
Building in WebStorm
When I build using Webstorm, everything looks rosie:
Working dir: /home/anton/WebstormProjects/quickstart
/usr/lib/dart/bin/pub global run webdev build --output=web:build
[INFO] Initializing inputs
[INFO] Reading cached asset graph...
[INFO] Reading cached asset graph completed, took 675ms
[INFO] Checking for updates since last build...
[INFO] Checking for updates since last build completed, took 808ms
[INFO] Running build...
[INFO] build_web_compilers|entrypoint on web/main.dart:Running dart2js with --minify --packages=.package-643dc5d58d0e8c6a495fcb24c0476818 -oweb/main.dart.js web/main.dart
[INFO] 1.5s elapsed, 3/4 actions completed.
[INFO] 2.6s elapsed, 3/4 actions completed.
[INFO] 3.7s elapsed, 3/4 actions completed.
[INFO] 4.8s elapsed, 3/4 actions completed.
[INFO] 5.9s elapsed, 3/4 actions completed.
[INFO] 7.0s elapsed, 3/4 actions completed.
[INFO] 8.1s elapsed, 3/4 actions completed.
[INFO] build_web_compilers|entrypoint on web/main.dart:Dart2Js finished with:
Compiled 9,664,399 characters Dart to 162,915 characters JavaScript in 7.72 seconds
Dart file (web/main.dart) compiled to JavaScript: web/main.dart.js
[INFO] Running build completed, took 9.2s
[INFO] Caching finalized dependency graph...
[INFO] Caching finalized dependency graph completed, took 271ms
[INFO] Creating merged output dir `build`...
[INFO] Creating merged output dir `build` completed, took 2.9s
[INFO] Writing asset manifest...
[INFO] Writing asset manifest completed, took 3ms
[INFO] Succeeded after 12.3s with 3 outputs (1859 actions)
Process finished with exit code 0
I have also tried using https://github.com/dart-lang/angular/tree/master/examples but still get the same error.

JMeter Maven Plugin - remote test machine cannot be configured

I keep getting this errors (error code bellow) when I run jmeter tests through jenkins on remote slave machines :
[INFO] -------------------------------------------------------
[INFO] P E R F O R M A N C E T E S T S
[INFO] -------------------------------------------------------
[INFO]
[INFO]
[info]
[debug] JMeter is called with the following command line arguments: -n -t C:\Performance_Framework\Project\src\test\jmeter\Example.jmx -l C:\Performance_Framework\Project\target\jmeter\results\Example.jtl -d C:\Performance_Framework\Project\target\jmeter -L DEBUG -j C:\Performance_Framework\CMS\target\jmeter\logs\Example.jmx.log -r -R 10.0.20.100,10.0.20.101 -X -Djava.rmi.server.hostname 10.0.20.200 -Dsun.net.http.allowRestrictedHeaders true
[info] Executing test: Example.jmx
[info] Creating summariser <summary>
[info] Created the tree successfully using C:\Performance_Framework\Project\src\test\jmeter\Example.jmx
[info] Configuring remote engine: 10.0.20.100
[info] error unmarshalling return; nested exception is:
[info] java.lang.ClassNotFoundException: org.apache.jmeter.engine.RemoteJMeterEngineImpl_Stub (no security manager: RMI class loader disabled)
[info] Failed to configure 10.0.20.100
[info] Configuring remote engine: 10.0.20.101
[info] error unmarshalling return; nested exception is:
[info] java.lang.ClassNotFoundException: org.apache.jmeter.engine.RemoteJMeterEngineImpl_Stub (no security manager: RMI class loader disabled)
[info] Failed to configure 10.0.20.101
[info] Stopping remote engines
[info] Remote engines have been stopped
[info] Error in NonGUIDriver java.lang.RuntimeException: Following remote engines could not be configured:[10.0.20.100, 10.0.20.101]
[info] Completed Test: Example.jmx
Now my current POM settings for the machines:
<configuration>
--------------------------------
<propertiesSystem>
<java.rmi.server.hostname>10.0.20.200</java.rmi.server.hostname>
</propertiesSystem>
<remoteConfig>
<startServersBeforeTests>true</startServersBeforeTests>
<serverList>10.0.20.100,10.0.20.101</serverList>
<stopServersAfterTests>true</stopServersAfterTests>
</remoteConfig>
</configuration>
If I run the tests from JMETER GUI everything is ok, remote host start and execute the tests successfully.
I think that everything is set correctly, jmeter-server.bat is started before tests run on each slave.
Also there's something that I don't understand from this sentence on from jmeter maven plugin wiki :
runremote command being send to JMeter which will start up any remote
servers you have defined in your jmeter.properties when your first
test starts.
Which jmeter.properties file, of the project ?If yes, then i don't know how that could be defined as always the target folder is cleaned on every test run, that resulting jmeter properties file is derived.
Later Edit: I even created the jmeter.properties file and added in src/test/jmeter dir and defined there the remote hosts, but still nothing.
So what do you suggest guys?
I resolved somehow the issue with the connection by editing the jmeter-server file by adding also the java.rmi.server.hostname.
But what I don't like is the test execution time, it's horrible , even with one thread which is supposed to be be finished in less than 1-2 sec but it's still showing that is trying to receive shutdown message.
[INFO] -------------------------------------------------------
[INFO] P E R F O R M A N C E T E S T S
[INFO] -------------------------------------------------------
[INFO]
[INFO]
[info]
[debug] JMeter is called with the following command line arguments: -n -t C:\Performance_Framework\CMS\src\test\jmeter\Example.jmx -l C:\Performance_Framework\CMS\target\jmeter\results\Example.jtl -d C:\Performance_Framework\CMS\target\jmeter -L DEBUG -q C:\Performance_Framework\CMS\src\test\jmeter\jmeter.properties -j C:\Performance_Framework\CMS\target\jmeter\logs\Example.jmx.log -r -X -Djava.rmi.server.hostname 10.0.20.200 -Dsun.net.http.allowRestrictedHeaders true
[info] Executing test: SearchForModule.jmx
[info] Creating summariser <summary>
[info] Created the tree successfully using C:\Performance_Framework\CMS\src\test\jmeter\SearchForModule.jmx
[info] Configuring remote engine: 10.0.20.100
[info] Configuring remote engine: 10.0.20.101
[info] Starting remote engines
[info] Starting the test # Thu Jul 30 13:48:23 BST 2015 (1438260503717)
[info] Remote engines have been started
[info] Waiting for possible shutdown message on port 4445
Is something that is wrong on jenkins side, tomcat webapp?
First thing you need to fix are the server addresses:
https://github.com/jmeter-maven-plugin/jmeter-maven-plugin/wiki/Remote-Server-Configuration
10.0.x.100,10.0.x.101 are not correct IP addresses. This is what you can see in your error log.

Resources