Artifactory as Training Labs Provisioning Platform

DZone 's Guide to

Artifactory as Training Labs Provisioning Platform

· Java Zone ·
Free Resource

As AlphaCSP's training guy I deliver a lot of training. They come in different flavors, on different topics, and in different companies. What is common in all companies is the problem I encounter on labs setups. First, the problem definition: Let's take, for example, some serious global financial company, which needs training in Spring, Hibernate and JAX-RS. My contact point is a nice Training Activities Administrator. She just organized "Micro-Expressions Training for HR" and her next task is to organize my Java course. What do you say, will she be able to install IntelliJ IDEA (or Eclipse?), Spring 3 bundles, Hibernate dependencies and Jersey? And yes, the classroom network is detached from both Intranet and Internet (BIG financial company, remember?). Oh, I almost forgot a bonus - the training workstations rollback all changes after every restart.

Now, here are two possible provisioning solutions:

  1. Come over day before for installs. Well, probably the classroom is occupied with another course. If not, the guy that should let me in the classroom, the network, and the computers is busy, sick or in Thailand, but probably all three in the same time. Ah, and I have another work to do on this day! And the customer won't pay for it anyway. You got the point - bad idea.
  2. Prepare the labs on CDs. Well, it generally works, most of the software courses delivered that way, one successful example is SpringSource trainings. You get nicely branded CD full of all you need - The IDE, the dependencies, and the labs source code. Good stuff, really. It works for SpringSource because of the high volume of catalog courses they deliver. They have a stock of identical CDs they use during every single training, worldwide. When it comes to tailor-made courses, things are different. No course is similar to any other course, the topics, installs, dependencies and exercises are unique set each time. That rather complicates the CDs craft - composing, burning, labeling. I don't say it's impossible - I did it for each and every course, but it's a real PITA. And thanks to the reverting workstations, students will have to copy, extract, setup, define variables every day from scratch over and over again. Did I mention PITA?
And there is a third solution. The best one. You can use Enterprise Repository Manager to recreate students environment in a couple of minutes in any given time. Now, it rocks. It really is. Watch the steps:
  1. Customer Requirements
    1. Two simple installs, every Training Administrator and/or Sysadmin can manage:
      1. IntelliJ IDEA (next-next-next) from JetBrains site. Or Eclipse?
      2. Maven2 (unzip) from Apache site.
    2. Create .m2 directory under user home for Maven user settings.
    3. Permission to connect your notebook to the class' Intranet. It is isolated, the machines revert themselves, shouldn't be a problem.
  2. Exercises development
    1. Develop the exercises on your notebook with all the Maven goodies - pom.xml, dependencies, superb IntelliJ-Maven integration (or Eclipse?).
    2. Install Artifactory locally (you'll see why Artifactory and not Nexus in the following steps). I mean - download and unzip, heh. Run it (not even as a service)
    3. Import your local repository to Artifactory (can't do it in Nexus #1) - zip it and make half-dozen of clicks in Artifactory UI.
    4. Deploy the exercises to the local repository. They probably won't compile - they are exercises, right? Then just zip them and deploy from UI. Students will download them through Artifactory UI.
    5. Take the Artifactory down. You are ready to go to class.
  3. Exercises delivery
    1. "Good morning, students!" - deliver the hell of the course, get to the hands-on part.
    2. Connect your notebook to the class' Intranet, get dynamic IP (yap, dynamic is good enough).
    3. Get Artifactory up and running.
    4. Let the students browse to Artifactory's homepage. There they will found Maven Settings Generator (can't do it in Nexus #2), which will generate settings.xml to work with your instance of Artifactory from their machines. All they need to do is check "Mirror-Any", select "repo" and save the generated file under .m2 directory. That's all, their machines are fully configured to get all the dependencies needed for Spring, Hibernate, Jersey, and whatever you need for your training.
    5. Let the students browse the repository to download the exercises zip, unzip it, export Maven project into IntelliJ IDEA (or Eclipse?) and just start working!

As you saw, using Artifactory as labs provisioning platform dramatically simplifies both lecturer's and student's life, enabling rapid exercises development and rollout without any preparation from student's part and minimal preparation from training organizer's part, all those thanks to Maven2 dependency management capabilities, good IDE Maven integration, and, of course, Artifactory's ease of use. And frankly, there is nothing I love more than ease of use. Maybe only chocolate ice-cream.

 From http://jbaruch.wordpress.com/2010/01/18/artifactory-as-training-labs-delivery-platform/


Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}