Bokeh run service as daemon - bokeh

To deploy a bokeh application, I have a server where I run
bokeh serve --allow-websocket-origin=myurl:5006 BokehMain.py
However, I want to run bokeh as a daemon so I can close the terminal and let the app run as a service in the background.
Question
Is it necessary to set up an apache server for bokeh if I want users to connect through the webbrowser instead of an SSH tunnel. (as described in this link)
Thanks for the help!

nohup bokeh serve --allow-websocket-origin=myurl:5006 BokehMain.py
nohup, short for 'no hang up' is a command in Linux systems that keep processes running even after exiting the shell or terminal.
So, even after you close the terminal, nohup command will continue to run the bokeh server in background.

Related

Running gulp as a service

We have a project where the developers (from what I understand) use gulp to run a website locally using Vagrant. They want to deploy this website on an AWS instance.
We are trying to implement the commands using Jenkins. The website stays up while gulp serve-dev is running, but then Jenkins times out and Nginx returns a 502 error. Of course we can prevent Jenkins from timing out but then the job would need to keep running.
Is there away to run this command as a service? any other way we can go about this ?
You want to run gulp in the backgroud without stoppping when you close terminal or log out from the server.
Try using nohup(short for no hangup) which runs command with hangup ignored so that your command continue running even if you logout from the server
try running it using nohup gulp serve-dev &
& put command in background mode so that you can continue using the current shell screen.
Cheers!

Jenkins freezes on build job, unable to ssh into virtual server to restart

I'm new to Jenkins and it's hanging on a build job. I've read that a restart is in order. Unfortunately, I can't access the command line because the operation times out when I try to ssh into the virtual server. The server is running on Nginx/Ubuntu.
Is there anything I can do besides doing a hard reset of the server?
Try using SafeRestart plugin or just restart Jenkins manually as described here.

KIBANA 4 process gets stopped on closing the putty window

I am using kibana-4.0.0-beta3 version on linux machine. The process gets stopped automatically on closing the putty window. Is there any way to run the process in back-end?
Yes. As with any unix process, the basics would be to use 'nohup' and put the process in the background. You should write a startup script (e.g. /etc/init.d/kibana4) that is similar in form to other startup scripts on your system.
Here is a kibana4 startup script for debian, simply place it in /etc/init.d/kibana , then run:
/etc/init.d/kibana start
set it to start on boot:
update-rc.d kibana defaults
https://github.com/akabdog/scripts/blob/master/kibana4_init
Use a program called screen to run anything in a shell. Then detach from the terminal session but keep the processes running. When you reconnect you can reconnect to the session and interact with them.
Run with nohup
nohub ./bin/kibana
bin/kibana > abc.txt &
This will run kibana in backend and redirect its logs to abc.txt. works like a charm for me :-)

Running java based webdriver scripts in unix server

I have written webdriver+TestNG scripts in windows using java. Now there is an upcoming requirement to run the same scripts in UNIX server without much of code modification. I have heard about running tests in headless browser, but I dont know about this much. I searched a lot but there is no clear and simple response to start looking into this.
Is it possible to just change the driver instance to htmlunitdriver and run the same in unix environment? How could I create the tests as a package and move to unix environment for running the scripts?
You can run your existing script by making few changes in driver instance creation. Suppose you are using Firefox driver for your test, then you can run your script in headless mode using virtual display Xvfb (Xvfb is an X server that can run on machines with no display hardware and no physical input devices).
Below are the steps to run your tests in headless mode:
Install Xvfb
Start the Xvfb by executing this command Xvfb :99 -screen 0 1024x768x24 & Xvfb Manual
Then create a Firefox driver instance that uses virtual display started in step 2 as below:
FirefoxBinary fb = new FirefoxBinary();
fb.setEnvironmentProperty("DISPLAY", ":99");
WebDriver driver = new FirefoxDriver(fb,null);
Now your script will run in headless mode. You may need to change few other things like path of your test data or any other references that uses windows file system (like C:\)

Running a meteor.js application forever

I have a personal localhost meteor application running on my laptop which silently stops running every time the computer goes to sleep. The way I run it simply using the "meteor" command, after which i background and disown the process and close terminal.
Is there a way to prevent the app from stopping, to have it run forever on my machine unless i explicitly close it?
You need to create a server daemon for your application in the same way you'd do on a production server. There are several ways to do this, probably the easiest one is to use demeteorizer to create a plain Node.js program with your app, and then run it with forever.

Resources