Quickly deploying Artifactory using Docker and NetApp
It is no secret that I love to automate everything. I also get a kick out of being able to deploy anywhere and anytime in a repeatable fashion. Recently, I had a need to deploy JFrog Artifactory as part of a project. In our case, the client is leveraging Artifactory to manage their packages and binaries. The big issue is that we also have to test and validate our Chef code for systems with no internet access. This means that we needed to ensure that all the code could pull directly from Artifactory as it would be the source of truth for binaries and some configuration scripts. As is my standard, I decided that if it worth deploying, then it is worth automating.
The first thing that I do when deploying a new application is to see if there is a Docker version. I am excited to report that Artifactory can be deployed as a container and in fact, they offer a fully supported version. I love seeing companies embrace the change which is microservices. This has been a huge disrupter in our industry and really alters how companies can get started quickly with new technology. Within five minutes, I had requested an evaluation license and deployed my first artifactory container. It is easy and very little configuration is required. In fact, there wasn’t really anything to do other than to forward port 8081 and then launch the container. Once the system fully started, I added my evaluation license.
Preserving my container data
Containers are awesome and their portability is what makes them so powerful. Applications like Artifactory contain a load of data and configurations that need to be preserved. The data (binaries, repositories, users, etc) is the life blood of the software and therefore must be available to the system regardless of where I go. Fortunately, the official container includes support for Docker Volumes and therefore, I can create a directory on the host to redirect these writes. But why stop there? I recently introduced some new integrations with NetApp ONTAP Cloud for AWS and NetApp Docker Volume Plug-in (nDVP) that will fit perfectly into this model. By leveraging the nDVP solution, I can store all of my data on an ONTAP Cloud system and never worry about those pesky servers again. The other added benefit is that my data is deduplicated in-realtime and backed up instantly, multiple times a day.
Integration with ONTAP Cloud and NetApp Docker Volume Plug-in
I don’t think that the folks at NetApp could have made this easier if they tried. Installation of the plugin takes mere minutes and configuring the Docker host to communicate to the NetApp array is super easy. A few months ago, I introduced a solution to help you get started by using Terraform+Chef to deploy ONTAP Cloud into AWS. Later, I added a new cookbook to manage the NetApp Docker Volume Plug-in and together, we have an awesome and easy to manage solution for Docker data integrity and portability. I mean moving data around is the challenge that Docker can’t solve but NetApp makes this just a piece of cake.
So what is required to make this work?
- NetApp ONTAP Cloud
- A linux host running Docker
- Artifactory evaluation license (or a full license if you choose)
- A text editor (I suggest either Sublime Text or Atom)
- A cup of coffee or tea
Deploying a new ONTAP Cloud system
I won’t go into much detail on how to deploy as I cover this in an earlier article about Terraform + ONTAP Cloud. In my case, I went ahead and terraformed a new ONTAP Cloud system for this project. If I had already had an ONTAP Cloud system up, then I could just leverage it for this process. I wanted to see how things would work in a net-new solution so I created a whole new AWS VPC and ONTAP Cloud system. This process takes about 20-30 minutes to complete and once done, the machine is up and ready to start taking connections.
Artifactory + Docker with the NetApp Docker Volume Plug-in
Now that we have an ONTAP system available, we need to deploy a machine to run Docker and ultimately our Artifactory server. If you already have Docker installed on a server, then you can use that machine but in my case, I am testing from the ground-up. Since I have the ability to Terraform and can leverage a Chef cookbook, I will generate a new Chef cookbook and set my dependency on the NetApp Docker Volume Plug-in cookbook. The process is pretty straightforward. Here are the items that I need to include in my cookbook:
- Deploy the nDVP resource which installs Docker and pulls the NetApp configuration from NetApp OnCommand Cloud Manager
- Create a new docker volume to be used by Artifactory and set the driver as netapp
- Pull the current Artifactory docker image from the official repository
- Deploy the Artifactory docker container and link the volume to our brand new NetApp volume
Up and running in minutes
Once the new server is terraformed and the chef client is run, my new Artifactory server is up and running. Now, I can add my evaluation license and start adding repositories and binaries. In my specific use case, I needed to add a Rubygems clone so that my non-internet accessible systems could install the gem files for Chef deployments. I leveraged the Virtual Repository option and selected RubyGems as the type. Now, I can point my chef client configurations on those hosts to Artifactory. After I added this, I created a generic local repository called standard-software and uploaded all of my packages and installers. I didn’t have a lot of data to upload yet but what I find interesting is the immediate savings from deduplication. I provisioned about 4GB of data with a Deduplication Space savings of over 800MB. Considering this small sample set, I still saw a 20% reduction in storage usage on top of the native deduplication in Artifactory.
Check out these links and start testing for yourself
- An Introduction to Artifactory
- Install Artifactory with Docker
- Terraform + Chef + ONTAP Cloud
- GitHub: netapp_ontap_cloud_terraform
- GitHub: netapp_ontap_cloud
- GitHub: netapp_docker
I will write a new article showing how I created the cookbook and integration with ONTAP and share the code to get you started.