I'm trying to execute a win exe file that is not from my property BrowserStackLocal.exe
https://www.browserstack.com/local-testing/automate#establishing-a-local-testing-connection
This is my Dockerfile:
FROM mcr.microsoft.com/dotnet/sdk:5.0
SHELL ["pwsh", "-Command"]
ENV BINARIES=/binaries
WORKDIR $BINARIES
RUN Invoke-WebRequest -Uri https://www.browserstack.com/browserstack-local/BrowserStackLocal-win32.zip -OutFile $env:BINARIES/BrowserStackLocal-win32.zip && \
Expand-Archive -LiteralPath $env:BINARIES/BrowserStackLocal-win32.zip -DestinationPath $env:BINARIES && \
Remove-Item $env:BINARIES/BrowserStackLocal-win32.zip
RUN ls
RUN ps
RUN ./BrowserStackLocal.exe
RUN ps
This is the output
Building qa-aut-net5
Step 1/9 : FROM mcr.microsoft.com/dotnet/sdk:5.0
---> de8b4af9de0d
Step 2/9 : SHELL ["pwsh", "-Command"]
---> Using cache
---> 8977a4b019ef
Step 3/9 : ENV BINARIES=/binaries
---> Using cache
---> 66200b6b9a18
Step 4/9 : WORKDIR $BINARIES
---> Using cache
---> 6e530b267fe4
Step 5/9 : RUN Invoke-WebRequest -Uri https://www.browserstack.com/browserstack-local/BrowserStackLocal-win32.zip -OutFile $env:BINARIES/BrowserStackLocal-win32.zip && Expand-Archive -LiteralPath $env:BINARIES/BrowserStackLocal-win32.zip -DestinationPath $env:BINARIES && Remove-Item $env:BINARIES/BrowserStackLocal-win32.zip
---> Running in 0e672adafa5b
Removing intermediate container 0e672adafa5b
---> 680bd1b4c2db
Step 6/9 : RUN ls
---> Running in 6e51157b7245
Directory: C:\binaries
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a --- 12/18/2020 9:11 AM 41220096 BrowserStackLocal.exe
Removing intermediate container 6e51157b7245
---> cb7b0be51d38
Step 7/9 : RUN ps
---> Running in ce4e5d7f7ae0
NPM(K) PM(M) WS(M) CPU(s) Id SI ProcessName
------ ----- ----- ------ -- -- -----------
6 1.00 3.77 0.00 1076 1 CExecSvc
6 1.04 2.24 0.00 976 1 csrss
0 0.06 0.01 0.00 0 0 Idle
17 2.72 9.37 0.00 328 1 lsass
49 47.79 69.54 1.31 1324 1 pwsh
9 1.63 5.04 0.00 64 1 services
4 0.49 1.16 0.00 952 0 smss
12 2.91 9.99 0.00 484 1 svchost
14 1.98 6.63 0.00 636 1 svchost
8 1.84 6.04 0.00 796 1 svchost
7 1.40 4.65 0.00 1052 1 svchost
15 5.48 10.54 0.00 1116 1 svchost
14 2.71 7.68 0.00 1204 1 svchost
15 9.45 19.04 0.00 1360 1 svchost
0 0.15 0.14 0.00 4 0 System
8 1.25 4.13 0.00 1012 1 wininit
Removing intermediate container ce4e5d7f7ae0
---> 1b7f55f0de14
Step 8/9 : RUN ./BrowserStackLocal.exe
---> Running in fd16d66e6dba
ERROR: Service 'qa-aut-net5' failed to build : The command 'pwsh -Command ./BrowserStackLocal.exe' returned a non-zero code: 1
Returns this and there are no details about the error:
ERROR: Service 'XXX' failed to build : The command 'pwsh -Command ./BrowserStackLocal.exe' returned a non-zero code: 1
You can check the BrowserStackLocal.exe was downloaded successfully in the log, also I tried executing the same file in machines in Windows and it's working fine. The problem only happened when I run inside the docker windows container.
Maybe some DLL files are missing or I need to install anything else. Do you have any idea to resolve this? or any workaround?
Thank you in advance.
Related
I have a simple docker container that is based on windows image:
FROM mcr.microsoft.com/windows:1903
WORKDIR /app1/
ENTRYPOINT powershell.exe
I run it interactively, using:
docker run -it -v c:\app1:c:\app1 test-image:1.0
There is a file called 1.txt inside app1 folder.
When I run:
.\app1\1.txt
I see no notepad.exe process, but instead I can spot OpenWith process:
Handles NPM(K) PM(K) WS(K) CPU(s) Id SI ProcessName
------- ------ ----- ----- ------ -- -- -----------
78 5 1056 4452 0.02 1940 1 CExecSvc
74 5 5360 3792 0.02 1904 1 cmd
81 5 904 1364 0.00 1844 1 CompatTelRunner
156 10 6532 6088 0.00 1728 1 conhost
97 7 1196 4980 0.05 1896 1 conhost
286 13 1836 4976 0.27 984 1 csrss
37 6 1348 3356 0.06 524 1 fontdrvhost
0 0 60 8 0 0 Idle
831 22 4748 13844 0.17 460 1 lsass
546 25 13156 28920 0.17 1952 1 OfficeClickToRun
420 24 7400 28844 0.13 2472 1 OpenWith
376 22 6732 27168 0.13 2536 1 OpenWith
I suspect that some mapping might be missing, event though assoc shows that .txt file is associated with notepad.exe:
assoc .txt
.txt=txtfile
ftype txtfile
txtfile=%SystemRoot%\system32\NOTEPAD.EXE %1
What might be the problem here? Am I missing some register value?
I am quite new in using bash to extract but I am not what search terms to look for my problem. I like to extract data for some variables from a very large log file.
Sample of logfile
temp[min,max]=[ 24.0000000000000 .. 834.230000000000 ]
CHANGE working on TEMS
RMS(TEMS)= 6.425061887244621E-002 DIFMAX: 0.896672707535103
765 1 171
CHANGE working on PHI
RMS(PHI )= 1.92403467949391 DIFMAX: 62.3113693145351
765 1 170
CHANGE working on TEMP
RMS(TEMP)= 6.425061887244621E-002 DIFMAX: 0.896672707535103
765 1 171
PMONI working
TIMSTP working
COPEQE working : INFO
DELT = 630720000.000000 sec
Courant-Number in x,y,z:
Max. : 5.05 , 0.00 , 6.93
Min. : 0.00 , 0.00 , 0.00
Avg. : 0.568E-02, 0.00 , 0.383
PROBLEM: Courant-Number(s) greater than 1 : 11.9802093558263
max. TEMP-Peclet in X: 653 1
170
max. TEMP-Peclet in Y: 653 1
170
Temperature-Peclet-Number in x,y,z:
Max. : 0.357 , 0.00 , 0.313E-01
Min. : 0.00 , 0.00 , 0.00
Avg. : 0.307E-03, 0.00 , 0.435E-03
Temperature-Neumann-Number in x,y,z:
Max.: 64.9 , 64.9 , 64.9
Min.: 0.619E-02, 0.619E-02, 0.619E-02
Avg.: 35.5 , 35.5 , 35.5
PROBLEM: Temp-Neumann-Number greater than 0.5 : 194.710793368065
(Dominating: Courant-Number)
DRUCK working
KOPPX working
#########################################################################
STRESS PERIOD: 1 1
1 of 100 <<<<<
Time Step: 50 ( 1.0% of 0.315E+13 sec )(0.631E+09 sec )
#########################################################################
### Continues on ###
I managed to extract the lines relating to the variables I am looking for using bash.
grep -A 3 'Courant-Number in x,y,z' logfile.log > courant.txt
grep -A 2 'Max.' courant.txt > courant.txt
to get this...
Max. : 0.146E+04, 0.00 , 0.169E+04
Min. : 0.00 , 0.00 , 0.00
Avg. : 1.15 , 0.00 , 0.986
--
Max. : 0.184E+04, 0.00 , 0.175E+04
Min. : 0.00 , 0.00 , 0.00
Avg. : 1.13 , 0.00 , 1.05
--
Max. : 0.163E+04, 0.00 , 0.172E+04
Min. : 0.00 , 0.00 , 0.00
Avg. : 1.13 , 0.00 , 1.17
I would like to convert this data to a CSV file with the following columns, thus making a total of 9 columns.
Max_x | Max_y | Max_z | Min_x | Min_y | Min_z | Avg_x | Avg_y | Avg_z
I would like to continue to use bash to get this data. Any inputs will be most appreciated.
Thanks!
You've got a good start. I had a much worse solution a bit earlier, but then I learned about paste -d.
grep -A 3 'Courant-Number in x,y,z' logfile.log |
grep -A 2 'Max.' |
grep -v -- '--' |
sed 's/^.*://' |
paste -d "," - - - |
sed 's/ *//g'
find courant number + 3 lines
find max + 2 following lines
get rid of lines that have '--'
get rid of min: max: avg:
join every three lines with commas
get rid of whitespace
Problems:
More and more data nodes become bad health in Cloudera Manager.
Clue1:
no any task or job, just an idle data node here,
top
-bash-4.1$ top
top - 18:27:22 up 4:59, 3 users, load average: 4.55, 3.52, 3.18
Tasks: 139 total, 1 running, 137 sleeping, 1 stopped, 0 zombie
Cpu(s): 14.8%us, 85.2%sy, 0.0%ni, 0.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 7932720k total, 1243372k used, 6689348k free, 52244k buffers
Swap: 6160376k total, 0k used, 6160376k free, 267228k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
13766 root 20 0 2664m 21m 7048 S 85.4 0.3 190:34.75 java
17688 root 20 0 2664m 19m 7048 S 75.5 0.3 1:05.97 java
12765 root 20 0 2859m 21m 7140 S 36.9 0.3 133:25.46 java
2909 mapred 20 0 1894m 113m 14m S 1.0 1.5 2:55.26 java
1850 root 20 0 1469m 62m 4436 S 0.7 0.8 2:54.53 python
1332 root 20 0 50000 3000 2424 S 0.3 0.0 0:12.04 vmtoolsd
2683 hbase 20 0 1927m 152m 18m S 0.3 2.0 0:36.64 java
Clue2:
-bash-4.1$ ps -ef|grep 13766
root 13766 1850 99 16:01 ? 03:12:54 java -classpath /usr/share/cmf/lib/agent-4.6.3.jar com.cloudera.cmon.agent.DnsTest
Clue3:
in cloudera-scm-agent.log,
[30/Aug/2013 16:01:58 +0000] 1850 Monitor-HostMonitor throttling_logger ERROR Timeout with args ['java', '-classpath', '/usr/share/cmf/lib/agent-4.6.3.jar', 'com.cloudera.cmon.agent.DnsTest']
None
[30/Aug/2013 16:01:58 +0000] 1850 Monitor-HostMonitor throttling_logger ERROR Failed to collect java-based DNS names
Traceback (most recent call last):
File "/usr/lib64/cmf/agent/src/cmf/monitor/host/dns_names.py", line 53, in collect
result, stdout, stderr = self._subprocess_with_timeout(args, self._poll_timeout)
File "/usr/lib64/cmf/agent/src/cmf/monitor/host/dns_names.py", line 42, in _subprocess_with_timeout
return SubprocessTimeout().subprocess_with_timeout(args, timeout)
File "/usr/lib64/cmf/agent/src/cmf/monitor/host/subprocess_timeout.py", line 70, in subprocess_with_timeout
raise Exception("timeout with args %s" % args)
Exception: timeout with args ['java', '-classpath', '/usr/share/cmf/lib/agent-4.6.3.jar', 'com.cloudera.cmon.agent.DnsTest']
"cloudera-scm-agent.log" line 30357 of 30357 --100%-- col 1
Backgrouds:
if I restart all nodes, then everythings are OK, but after half and hour or more, bad health is coming one by one.
Version: Cloudera Standard 4.6.3 (#192 built by jenkins on 20130812-1221 git: fa61cf8559fbefeb5af7f223fd02164d1a0adfdb)
I added all nodes in /etc/hosts
the installed CDH is 4.3.1.
in fact, these nodes are VMs with fixed IP address.
Any suggestions?
BTW, where can I download source code of com.cloudera.cmon.agent.DnsTest?
I have following result while running below powershell command,
PS C:\> Get-Process svchost
Handles NPM(K) PM(K) WS(K) VM(M) CPU(s) Id ProcessName
------- ------ ----- ----- ----- ------ -- -----------
546 34 18528 14884 136 49.76 260 svchost
357 14 4856 4396 47 18.05 600 svchost
314 17 6088 5388 42 12.62 676 svchost
329 17 10044 8780 50 12.98 764 svchost
1515 49 36104 38980 454 232.04 812 svchost
301 33 9736 6428 54 2.90 832 svchost
328 26 8844 9744 52 4.32 856 svchost
247 18 8144 9912 77 37.50 904 svchost
46 5 1504 968 14 0.02 1512 svchost
278 15 4048 5660 43 3.88 2148 svchost
98 14 2536 2460 35 0.66 2504 svchost
Here im trying to calculte the total memory size PM(K) of process(s).i've following line in my ps1 script file
get-process svchost | foreach {$mem=("{0:N2}MB " -f ($_.pm/1mb))}
It gives the output in the following format
17.58MB 4.79MB 6.05MB 9.99MB 35.29MB 9.56MB 8.64MB 7.95MB 1.47MB 3.95MB 2.48MB
but i need total size as a single value like 107.75MB
How to calculate the total used memory size of svchost process ?
Thanks
You can use the Measure-Object cmdlet
$measure = Get-Process svchost | Measure-Object PM -Sum
$mem = ("{0:N2}MB " -f ($measure.sum / 1mb))
Also, you can calculate the total size of the entire collection using the += syntax
$mem = 0
Get-Process svchost | %{$mem += $_.pm}
"{0:N2}MB " -f ($mem/1mb)
I need to add timestamp to the beginning of each line printed in the following output.
# top -b |grep -w 'db2sysc\|java'
4756 db2inst1 20 0 2525m 875m 830m S 0 11.0 1:33.57 db2sysc
4951 root 20 0 1416m 689m 7276 S 0 8.7 1:27.86 java
4756 db2inst1 20 0 2525m 875m 830m S 1 11.0 1:33.61 db2sysc
4951 root 20 0 1416m 689m 7276 S 0 8.7 1:27.87 java
would like it like this
1366138603 4756 db2inst1 20 0 2525m 875m 830m S 0 11.0 1:33.57 db2sysc
1366138603 4951 root 20 0 1416m 689m 7276 S 0 8.7 1:27.86 java
1366138692 4756 db2inst1 20 0 2525m 875m 830m S 1 11.0 1:33.61 db2sysc
1366138692 4951 root 20 0 1416m 689m 7276 S 0 8.7 1:27.87 java
Thank you for any help.
I'd suggest using awk instead of grep:
top -b | awk '/db2sysc|java/ {print systime(), $0}'