Custom Installer for Unix Platform to install Python, Java, MySQL - bash

We need to distribute a tool which is developed using Python, Java and MySQL as database in a distributable format.
So if end user is installing our tool, we check for Python, and if it not exists then we would install Python from the disk and not from apt-get. The process repeats for Java and MySQL which are run as sub-process, so that everything happens in sequence.
We could have used Docker images, but it runs in a container and we would not like our application to run within a restricted environment. Is this understanding correct that we would not have complete access to 100% of the resources in case of Docker?
What should be our approach and if anybody can share their experience in creating such distributable would be highly appreciated.

Related

Build models in h2o flow in windows, use on an AIX server? Help for a non-programmer

I'm hoping someone can give me some advise for taking models built in h2o flow on a windows machine and exporting/using them on an AIX server.
I've been able to use the flow graphical interface to build some models. I'm not a java coder / programmer so have some trouble understanding the instructions on the pojo/mojo files in the documentation and really looking for some step-by-step help on using them.
I have h2o running on a windows desktop machine. The place I want to use it is within SAS programs running on an AIX server. The AIX server has java.
I'm assuming I can do something like:
build model in h2o on my windows desktop
download the pojo or mojo files
do something????
put resulting file(s) from step 3 on the AIX server
use SAS to write out a CSV file in the same format I used to build the model in h2o
use SAS to issue unix command line statements that feed the .csv file into the exported files from step 3 using java and generate a new output .csv file with scored records
read the scores back into my SAS program and continue on my way
Is this do-able?
If not, can someone give me a "for dummies" explanation of how I might do something similar? I don't have admin rights on the AIX server so can't install software.
Thanks for your help.
AIX is big endian and windows (intel) is little endian. So as far as I know the H2O model generated on windows will not directly work on AIX, I think there is some work needed in H2O to make that work. But you can host that model on a PowerVM linux box next to AIX on same power system if that helps. Because you can have a little endian Linux.
https://www.ibm.com/developerworks/community/wikis/home?lang=en#!/wiki/Power%20Systems/page/H2O%20Driverless%20AI%20for%20Data%20on%20IBM%20AIX

Running postgres on osx using nix package manager

I'm using nix as a package manager on OSX. I've installed postgres. Now I'd like to start and stop the postgres server (and other related utilities). I can write a script to do this manually, and edit my config. But, is there a "best practice" way to do this on OSX? E.g. I found postgres configs under ~/.nix-profile/share, are there startup scrips for OSX somewhere?
I've not come across anything related to the nix project for running services in the nixpkgs repo directly on OS X.
If you just have a few services you want to run I believe you'd have to put the scripts together yourself as you suggest.
Alternatively disnix should do what you're after but it might be a bit overkill just for one machine.
Another option would be to deploy a nixos configuration into a (optionally headless) virtualbox instance with nixops.
I'm using this setup myself for a different use case, but it should certainly also support yours.
disnix, nixos and nixops are documented together with nix/nixpkgs on the nixos.org page.

How can I run Win32OLE calls from ubuntu?

I have some simple sinatra apps that make use of the OTA COM dll for talking to Quality Center.
I want to move those sites into docker images, so I can host them on my docker server.
It occurred to me that theoretically I should be able to get this working with strategic use of wine.
Hint: I remember reading somewhere that to get Win32OLE working in Ruby from linux you can install the windows version of ruby using wine, then run your scripts through the windows version of ruby.
https://www.ruby-forum.com/topic/88576 says
i've managed this before. i installed the one-click installer under
crossover office and the used that. another option is installing
msys, compiling ruby under that, and then using that ruby. in any
case you need to install/build another ruby under the crossover environment.
and later
In the end I installed office 2000 with Crossover, then I used the
windows installer to install windows ruby into the same bottle as
office. Finally I put the following bash script in my /usr/bin directory
so I can run my ruby files with '#> wruby some_script.rb'
==/usr/bin/wruby
#!/usr/bin/env ruby
`/opt/cxofficebeta/bin/wine --bottle myBottle --cx-app ruby.exe #{ARGV.join(" ")}`
I know nothing about Wine or crossover or bottles(?), so I'm out of my depth.
How would I do this? What would a Dockerfile I could use as a base image look like?
Note: I found some docker images that claim to install wine (which may make a good starting point)
https://registry.hub.docker.com/u/ambakshi/wine-x11-vcpython27/
https://registry.hub.docker.com/u/monokrome/wine/
https://registry.hub.docker.com/u/yantis/wine/
http://www.perlmonks.org/?node_id=430194 talks about getting Win32::OLE working under ubuntu.
Don't forget to use a USER xx in your Dockerfile as it is important to use a non privileged user in wine. You will find in registry.hub.docker.com several examples of wine with such a user.

Adding PostgreSQL installer to my own application installer

I created a Visual Studio 2010 installer project and added the postgresql-9.2.401-windows.exe file to it. In the "Commit" custom action, I added that file, removed any arguments and set InstallerClass to False.
Now, when I run my application's installer, the PostgreSQL setup starts up, shows its splash screen and then jumps to 100% CPU usage and starts leaking memory for a long time (certainly longer than a few minutes), after which it bails out. Running the .exe on that computer works just fine.
How should I package PostgreSQL in my installer?
Personally I don't like programs that silently install the standard PostgreSQL for Windows. It's deeply annoying to get mailing list posts from people who're asking "What's this PostgreSQL thing and why is it using 88 bajillion megabytes of RAM, I didn't ask for it, remove it now!".
(Yes, I'm mostly talking about a certain annoying gambling card-counting program with the initials PT whose name I will not mention directly).
If you're going to bundle PostgreSQL it'd be great if you could use a non-default port and non-default data directory. If you install a service to auto-start it, don't use the default service name postgresql-[version] but something like myapp-database or myapp-postgres.
This is all done much more easily if you just bundle the PostgreSQL binaries in your installer then create the service yourself with your installer tools or via sc.exe. You may choose to simply pg_ctl start/stop the server from within your program, though this requires some thought about access permissions to the data directory.
The downside is that when there are PostgreSQL updates you need to update your installer. On the other hand, you probably don't want people upgrading PostgreSQL independently of your software updates.
I suggest using the .zip binaries from here and bundling them into your installer directly.
If you really must use the executable installer the documentation contains instructions on silent installation.

How do you compile an Erlang program into a standalone windows executable?

Richard of Last.fm over at metabrew has ported his apps to Erlang. It was also done by riak, couchdb and others. He mentions extracting the needed parts, or including the whole VM into the distribution. Main trait here is: the program does not require Erlang to be installed on the target machine.
So the question is, how do you, step by step, package an Erlang program into a windows (and, less important, linux) executable?
P.S. I've seen the SAE project, and I've read all the relevant questions here. None answer my question.
Create a portable version of Erlang (for example using method from this discussion group: Erlang on Windows from USB). The most important part in this exercise is the creation of the erl.ini file with correct paths which can be used to start Erlang from any desired location.
Create an Erlang release of your application and the release boot script. For instructions see Erlang documentation about releases.
Create a Windows command line script to boot your application. This will simply run Erlang with your boot script as the parameter (e.g. erl -boot someapp). Erlang will read the erl.ini file to load your application and system libraries from correct locations.
Create a Windows setup application with all the relevant parts packaged in:
the Erlang distribution
the erl.ini file with all the paths as variables to be filled in by the setup application
the release of your application (all the beam files and the boot script)
the command line script to boot the application using the boot script
How it should work from the Windows installer point of view:
Ask user where to install the application (or use some default location in Program Files)
Copy the Erlang distribution, your application and the boot script to the correct location
Update erl.ini and the command line script to use the chosen location
Create icons or autostart entries that will execute the command line script
Now when user clicks the icon or executes the command line script in another way they will in fact run Erlang from the custom location, which in turn will boot your application according to the Erlang boot script. This is just a general idea because the command line script should for example check if Erlang isn't already running when user starts the application for the second time, or it may need to be able to uninstall it.

Resources