How to run Travis-CI's trusty distribution locally - travis-ci

I am trying to migrate from the container based infrastructure due to the Arduino alike performance. Travis' support suggested I use the "new" trusty dist based on Ubuntu 14.04 but I am having lot of trouble with it.
Is there an easy way to debug their base image locally?

Turns out if you use the minimal trusty image, you are pretty much using plain Ubuntu Trusty (14.04) and you don't have most of the nice stuff that is bundled with other distributions.
Since you are not going to use most of Travis cookbooks, the simplest way to come up with a good .travis.yml manifest is install Ubuntu Trusty on a VM and try every single setup command there.

Related

Is Docker-ized dev envoirment good for maintaining legacy software?

Let's say I have old, unmaintained application that lives on a VPS (i.e. Symfony 3 PHP app that relies on PHP 5).
If some changes are needed I have to clone this app to my desktop, build it, change and re-deploy. As time goes, recreating desktop dev environment gets harder - in this example I can't simply build the app as I use PHP7 in my CLI that breaks building process.
I tried to dockerize the app, so I added Ubuntu 18 to my docker-compose file... and it doesn't work as latest Ubuntu that has PHP5 support is 14.04. 14.04 is also the oldest (official) version available on DockerHub. But will it be still available in 3 years? If not, Docker won't build a container.
So, my question is: is Docker a right tool to solve described problem at all?
If so, should I backup docker images described that my build relies on?
If not, beside proper maintenance, what tool is better?
You can install PHP5 in newer ubuntu versions, but it means adding an external repository.
You could also create your own docker image, containing only the libraries you want. If so, I'd advise to try and use alpine as a base image. There is a bit of a learning curve to adapt, but once you do it you'll have a small image tailored to your needs.
Given that containers allow you to isolate processus and conf with minimal footprint compared to a VM, I think it is the best option. Tailoring and maintaining your own image is not that expensive in terms of maintenance if you document it correctly, and it will allow you to always have a system 'maintaining' all your precise requirements.

Is Tensorflow/Docker Useful for Development, or just demo/tests?

I have been developing in Tensorflow/Python on OSX. Trying to graduate to the big leagues. Bought a big new GPU PC, installed linux, CUDA, Docker, Tensrflow. (Pulled out lots of hair in the process). I thought that Docker-Tensorflow would provide a linux VM environment with Tensorflow, in which I could run my IDE and work from the cmd line like before, but it just seems to serve Jupyter notebooks. I've found some posts with what seem like heroic measures to develop in Docker. I suspect that Docker-Tensorflow is just meant for running demos, serving Jupyter notebooks, etc., and that for development I should revert to a conventional Tensorflow installation. Can someone please confirm (or deny) this? Thanks!
Yes, I share your opinion. Instead I use Anaconda (prior pyenv and virtualenv) to maintain environments and (local) dependencies. In detail tensorflow itself has just a few dependencies.

When will Travis-CI support ubuntu 14.04 as the build OS?

To build C++ code there are various dependencies that aren't available in Ubuntu 12.04 but available in Ubuntu 14.04, for example g++-4.8, boost1.54, etc.
When will Travis-CI support 14.04? or does it already support and how to enable build on 14.04?
Travis' team recently announced that they are opening beta Ubuntu 14.04 LTS support.
To get started with 14.04 beta add the following two keys in your .travis.yml file:
sudo: required
dist: trusty
There is also a milestone category on Github with some remaining issues which need to be resolved before it goes to stable.
For further information you can read here.
There is an open issue on the Travis CI GitHub repository about getting Ubuntu 14.04 support, but there hasn't been much news on it for a long time. I suggest contacting the Travis CI team more directly, perhaps via that issue, if you want an update.

How can I preinstall software on travis-ci?

We use travis-ci for continuous integration. I'm troubled by the fact that our build process takes too long (~30 minutes). We depend on several Ubuntu packages which we fetch using apt-get, among others python-pandas.
We also have some of our own debs which we fetch over HTTPS and dpkg install. Finally, we have several pip/pypi requirements, such as Django, Flask, Werkzeug, numpy, pycrypto, selenium.
It would be nice to be able to at least pre-package some of these requirements. Does travis support something like this? How can I prepackage some of these requirements? Is it possible to build a custom travis base VM and start the build from there (perhaps using docker)? Especially the apt-get requirements from the default Ubuntu precise repository as well as the pip requirements should be easy to include.
So while this question is already answered, it's doesn't actually provide a solution path. You can use cache directives in travis to cache your built packages for future travis runs.
cache:
directories:
- $HOME/.pip-cache/
- $HOME/virtualenv/python2.7
install:
- pip install -r requirements.txt --download-cache "$HOME/.pip-cache"
Now your package content is saved for your next travis build. You can similarly store slow-to-retrieve resources in other directories and cache them.
Currently Travis-CI doesn't support such a feature. There are related issues currently open though such as custom VMs, running Docker in an OpenVz container - (Spotify seems to have a somewhat working example links in this issue), using Linux Containers (LXC), using KVM.
Some of those have workarounds mentioned in the issues, I'd give those a try until something more substantial is supported by Travis-CI. I'd also suggest reaching out to Travis-CI support and see if they have any suggestions (maybe there's something coming out soon that could help).

Creating a Ruby on Rails environment on Windows, in a VM Vagrant Box

Is Vagrant a good solutions for creating a Rails environment in windows?
I have a powerful Windows 8 64bit desktop. I recently did a project with RoR and fell in love with it. As I found out, installing RoR on windows is just bleh; so I created a dual boot to ubuntu. As a creative developer, I find it rather difficult to get any of the "creative" done in ubuntu because of the lack of my typical creative tools.
I read a bit about a tool called Vagrant; however, I'm still unsure if it meets my requirements: adobe suite, sublime text, git, rails, rails friendly OS(mac?/ubuntu)
Typical duties: edit an image in photoshop(windows), drop it to project assets in VM?
Typical duties: push/pull to git; ssh to VPS server?
Also, I hear you can install mac os in the VM do you think thats a good option? (because I want to try their new OS)
Installing osx in Vagrant is probably possible but it would likely be quite hard, and its not really what vagrant is designed for.
As for your other questions vagrant sounds like the perfect fit.
With Vagrant you could start up an ubuntu vm and get your rails setup going. Then you could just forward a port on your local machine to the vm and load the rails site as if it were running locally on your windows PC. A quick google gets this vagrant box that looks like it might work for you - https://github.com/amaia/rails-starter-box
To work with the site you can just share a folder between the vm and your local machine which will allow you to edit images and code with your windows apps (Photoshop, sublime) so you don't actually need to install these in the ubuntu vm at all, and can pretty much work as normal.
Git is much the same... I prefer to SSH into the vagrant box and use git on the command line in ubuntu but you can just as easily use gitbash or tortoisegit from windows in the repo folder... works just as well.
A good alternative is, https://github.com/fgrehm/ventriloquist
"Ventriloquist combines Vagrant and Docker to give developers the ability to configure portable and disposable development VMs with ease. It lowers the entry barrier of building a sane working environment without the need to learn tools like Puppet or Chef."

Resources