Install-LESS Sitecore Installation

It was not long ago when you need to mention Docker at least once during your presentation to make it cool and trendy. And actually, there is a good reason for that. Containerization provides a way to make environments portable and immutable.
Immutable infrastructure for Sitecore would be much desired, but containers are on Windows are not so cool yet.
It doesn’t mean that you cannot get it but we will need to bake it a bit different. Let me show you how…

Containers for Windows

While Microsoft did an awesome job supporting containers API in Windows, its architecture is whey to different from Unix. For example, there is no concept of cgroups in Windows, to provide isolation for processes or layers in a file system. As a result, you have quite fat images 6-10GB that uses hyper-v and uses tons of symlinks. It is also important to mention that you could not run both Windows and Linux on the same machine and you might want to for SOLR.
To my taste, they are not so far from average VM created with VirtualBox or Hyper-V.

Virtual Machines

In my practice, many developers coming from SharePoint development are used to work on VMs. However, in most of the cases, the used it to completely isolate whole dev environment from the host machine. Which resulted in gigantic machines that are barely movable.
On the other hand, VirtualBox will work on any host OS and you do not need to move you front-end developers from MAC that they like so much.

So what if …

… we take development approach that is used with containers and apply it to virtual machines.
Containers are usually used as a hosting for your app, and it is definitely possible to do the same with VM. Just install everything you need in one VM, configure port forwarding or host-only network and you are ready to deploy your code to the VM.
If you want to share this VM you can export it to .ova/.ovf format.

One part that is different from container approach if “Just install everything” as in case of Docker this installation step is automated and repeatable via Dockerfile.

Sitecore ♥ Packer + Vagrant + Chef

Sitecore-packer-vagrant-chef

This is where Packer + Vagrant + Chef comes into a play.

  • PACKER – provides functionality to build VM images for a large set of providers. You can separate process in many steps, e.g. you create the first image with Windows only, then you install some basic dependencies like dotNET, IIS, MS SQL and on top of that you create an image that handles installation of Sitecore.
  • CHEF – is one of the options that you can use to automate provisioning. You can replace it with just PowerShell or Ansible or whatever is supported by Packer now. In this case, I found an awesome repository was the significant part of automation was done already and it was done in Chef.
  • VAGRANT – you can compare vagrant to docker CLI. It allows you to create a file with a configuration to start your VM, an infrastructure to download shared images and commands to start/stop VMs. Depending on your virtualization provider, vagrant will connect to it and do all configuration once you write “vagrant up”.

I’ve many a first pass and cover all plumbing required for Sitecore 9.0 installation in one box.

Github

https://github.com/asmagin/sitecore-packer
README.MD in the repo has a detailed description of build and installation processes.
* The first thought was to call it similar to Sitecore+Docker repository, but that analogy didn’t sound right 🙂

SUMMARY

Images created with Packer allow you to do “docker-like” development, configure your local development environment once and share it with colleagues and unify process for local and remote deployments.

Also it will save you from “works on my computer” or “cannot install on my computer because I have/do not have #{place reason here}“.


Follow me on twitter @true_shoorik. Would be glad to discuss ideas above in comments.

Install-LESS Sitecore Installation

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s