Nanobox: Local development done right
desktop.nanobox.io
desktop.nanobox.io
Even an experienced developer could benefit from this if they don't want to take the time to configure environments.
I don't think people want to take time to configure environments. It's just that we've all been bitten by environment configuration and sometimes configuring it in a specific way matters.
However, I really appreciate you open sourcing it under a permissive license, as I can see myself using some of your shell and go scripts in the future.
Thanks.
I haven't set up an environment manually in a few years: I simply have my own recipes for the types of apps I'm developing in Chef (most of them just minor tweaks or config changes over existing recipes), my own vagrant boxes (I like different flavors of linux for different types of apps) and so on.
Starting a new project implies choosing the necessary recipes, adding them to a vagrant file, 'vagrant up' and wait a few minutes until everything is set up. Done.
On the positive side, I guess it is better odds than a state lottery.
In order to give me confidence that I won't have to look underneath the surface too much, I'd want to know that the abstraction is very airtight, but all appearances say otherwise. Like another commentator said, I'd rather have an app with well-defined boundaries.
Previously we used to write hundreds of lines of puppet/chef/whatever scripts just to set things up. Its all already boiled down to just a few lines of configuration files. With tools like this or otto, its getting further hidden into nothing, seeming to look almost like magic. I'd rather stick with the few lines that I can control.
1- Explicitly define your app's environment with the Boxfile (https://docs.nanobox.io/getting-started/boxfile/)
2- Write your own engine that will actually setup the environment (https://desktop.nanobox.io/engine-dev/).
>Nanobox detects your app type and automatically configures the environment and installs everything your app needs to run
and
>Each Engine sniffs the code looking for a positive match to determine which language / framework your app is written in
and lastly:
>The matched Engine generates a Boxfile defining the services your app needs to run and how each should be configured
This sound quite fragile imo. No specs or configuration, it just guesses what all my deps are, and how to configure redis,mysql, and "other data-specific services" etc.
So an enourmous abstraction over everything except my source code with no configuration and a promise to "take care of everything" and forcing me to use their pipeline. Hm...
Yeah, that's gonna be a bit hard for it to do with our Clojure web app. Well, maybe. If it knows to install openjdk-7 and nginx because it sees a project.clj, then perhaps it really is as smart as it thinks it is.
_Ars_ addressed this issue in the FAQ for their 2004 redesign:
http://arstechnica.com/uncategorized/2004/10/redesign/
> Q. Why the white? Oh my eyes!
> A. Believe it or not, many people cannot read the "black" version of the site. This has been the #1 complaint Ars has received since day one. We thought it unwise to continue to use a default color scheme that was driving so many users away. Once it was clear that we could support both, we did, but white will be the default. The black design was also unfavorable to readers in corporate environments, and other places where the scheme sent the wrong signals to bosses and cubicle neighbors.
1. Nanobox embraces Docker and the philosophy of containers. Every component and process of your app is housed inside of an isolated container. The VM only runs the Docker deamon and the Nanobox deamon. In contrast, otto leverages Docker, but is built more to conform to Hashicorp's existing toolset.
2. Extensibility in Nanobox is accomplished through engines, which are inspired by and very similar to Heroku buildpacks. As noted above, engines run inside of isolated containers inside the VM. Otto's extensibility is accomplished through Go plugins that run on the host machine.
3. Nanobox caters to the dev workflow. We'll automatically suspend and save the VM state when it's not in use. Nanobox doesn't require the VM to always be running.
On every modern Ubuntu (even previous/old LTS) Docker works out of the box, without any issue.
Why add another virtualization layer on top?
Is there anything I can use to build a local dev environment quickly using the Dockerfile. Obviously I can use docker, but quite often new developers have trouble with docker.
I know I'm nitpicking here, but it would be great to have an abstraction on top of Dockerfiles that make it possible to develop in a near-production environment.
Looks fancy, but boy is it bad on the eyes. I've since switched away from it to harlequin ( https://github.com/nielsmadan/harlequin ).
Note — I know many might disagree, because of very valid points, but for me personally, deployment is a nightmare. I really have no clue how that works. I didn't know SQLite3 (being file-based) needed special permissions on the .db file to be able to avoid an OSError, and the folder containing the file needed other permissions. The whole absolute-path-in-server-but-relative-will-work-locally, blah blah — This is really a irritating business for me.
Deployment ideally should be like —
$ sometool deploy myAwesomeApp
$ Enter <some-sort-of-username-for-server> — myServer
$ Enter <some-sort-of-password-or pem key location> — ••••••••••
$ Deploying...done!
$ Your app is live on YOUR-SERVER-IP
Too far off for many. Many might hate it, but trust me I personally know atleast 50 other developers who would benefit from a setup like this. Mostly people learning how to code, who just want to put their simple apps out there.
With a traditional distro, you need to use a handful of additional tools like Vagrant, Docker, Ansible, etc. as well as several additional package managers to get everything setup. With Nix and Guix, you use a single package manager and single suite of tools to provision local environments, with or without virtualization. Those environments are declarative, reproducible, can be rolled back, etc. It's a much cleaner way to work.
Guix:
Specializes in providing exclusively free software.
Based on Nix [2].
Implementation differences, quoted from section 2.3 in [3]:
"Our main contribution with GNU Guix is the use of Scheme for both the composition and description of build processes, and the implementation of build scripts. In other words, Guix builds upon the build and deployment primitives of Nix, but replaces the Nix language by Scheme with embedded domain-specific languages (EDSLs), and promotes Scheme as a replacement for Bash in build scripts. Guix is implemented using GNU Guile 2.0 2 , a rich implementation of Scheme based on a compiler and bytecode interpreter that supports the R5RS and R6RS standards. It reuses the build primitives of Nix by making remote procedure calls (RPCs) to the Nix build daemon.
We claim that using an embedded DSL has numerous practical benefits over an independent DSL: tooling (use of Guile’s compiler, debugger, and REPL, Unicode support, etc.), libraries (SRFIs, internationalization support, etc.), and seamless integration in larger programs. To illustrate this last point, consider an application that traverses the list of available packages and processes it—for instance to filter packages whose name matches a pattern, or to render it as HTML. A Scheme program can readily and efficiently do it with Guix, where packages are first-class Scheme objects; conversely, writing such an implementation with an external DSL such as Nix requires either extending the language implementa- tion with the necessary functionality, or interfacing with it via an external representation such as XML, which is often inefficient and lossy.
We show that use of Scheme in build scripts is natural, andcan achieve conciseness comparable to that of shell scripts, but with improved expressivity and clearer semantics."From my limited view, Nix has a very strong theoretical base. Do you expect any developments at that level, and do you think these hypothetical developments will be integrated by the developers of Guix, or might it at some point start ignoring improvements in the theory?
[1] http://nixos.org/~eelco/pubs/phd-thesis.pdf
I don't anticipate any major changes in the theory, but if there were improvements made, Guix would surely want to implement them. In general, we take things like build reproducibility further than Nix does. There are many packages in nixpkgs that use pre-built binaries rather than building from source. Guix also has tools to allow users to publish their own binaries for others, and also provides a tool to compare locally built binaries to remote binaries to detect non-determinism or security compromise.
- ruby 1.9, 2.0, 2.1, 2.2 / jruby 1.6, 1.7, 9.0
- node 0.8, 0.10, 0.12 / iojs 2.3
- python 2.7, 3.4
- php 5.3, 5.4, 5.5, 5.6
- wordpress (version unknown)
- java openjdk 7, 8 / sunjdk 6, 7, 8 (no minor version information available)
The actual content on the "Engines" page is aspirational, to say the least. One of the first question I ask of a tech product is "is it usable today for any current projects?" - why make this question challenging for site visitors?If they're targeting novice web developers who should follow best practices, no rails support and out-of-date node support seems like a bad place to start.
---
We (I work for Nanobox) listed all the languages we hope to support mainly as an invitation to collaborate. We admittedly do not specialize in all programming languages. Engines are open-source and those who do specialize are invited to create engines for each language. We'll even create the engine for you. We just need to know what the engine should look for and how the environment needs to be configured.
---
The library of engines is in its infancy and we're working to expand it. You're absolutely right in saying that the list of engines is "aspirational". Anybody can build and publish new engines. Any help you can provide would be greatly appreciated.
build:
runtime: python27
js_runtime: nodejs-0.12
app_module: ''On page https://engines.nanobox.io/languages/nodejs the link for Create Custom Engine leads to a 404 on https://nanobox.io/engine-dev
Looks like it never got added as an issue on the nanobox project. I'll do that now.