Artifactory as Training Labs Provisioning Platform
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:
- 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.
- 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?
- Customer Requirements
- Two simple installs, every Training Administrator and/or Sysadmin can manage:
- Create .m2 directory under user home for Maven user settings.
- Permission to connect your notebook to the class' Intranet. It is isolated, the machines revert themselves, shouldn't be a problem.
- Exercises development
- Develop the exercises on your notebook with all the Maven goodies - pom.xml, dependencies, superb IntelliJ-Maven integration (or Eclipse?).
- 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)
- Import your local repository to Artifactory (can't do it in Nexus #1) - zip it and make half-dozen of clicks in Artifactory UI.
- 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.
- Take the Artifactory down. You are ready to go to class.
- Exercises delivery
- "Good morning, students!" - deliver the hell of the course, get to the hands-on part.
- Connect your notebook to the class' Intranet, get dynamic IP (yap, dynamic is good enough).
- Get Artifactory up and running.
- 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.
- 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.
(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)