null

NullPointerException, probably…

Artifactory as Training Labs Provisioning Platform

with 5 comments

As AlphaCSP‘s training guy I deliver a lot of trainings. They come in different flavors, on different topics, and in different companies. The common in all of them is the problem I encounter on labs setups.

First, 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 delivery 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.

About these ads

Written by JBaruch

18/01/2010 at 18:23

5 Responses

Subscribe to comments with RSS.

  1. Very nice, Baruch!

    Evgeny Goldin

    20/01/2010 at 01:09

  2. artifactory is getting better and better, now if only it had a plugin sdk for third-party addons like nexus it would be really complete

    magomarcelo

    20/01/2010 at 21:27

  3. magomarcelo, it will be added soon, in the upcoming versions, as I was told by Artifactory developers

    Evgeny Goldin

    21/01/2010 at 03:27

  4. great article, thanks for sharing.

    mediafire search

    14/03/2010 at 15:07

  5. Nice post with some neat tricks! IntelliJ and Artifactory make you fall in love with Nexus all over again :)
    I just didn’t like the ending… from all the ice-cream flavors in the world, why did you have to choose Chocolate?!


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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 1,066 other followers

%d bloggers like this: