= [wiki:GENIExperimenter/Tutorials/GENIExperimentEngine Get to Know the GENI Experiment Engine] = {{{ #!html
Hello GENI index Hello GENI index Hello GENI index
}}} = STEPS FOR SETTING UP = == 1. Get a GEE Slicelet and download GEE helper files == Visit http://gee-project.org and login. Once logged in, click on ''Get a slicelet''. Reload the dashboard every few seconds until the slice is in state ''Running'' -- this should take about 30 seconds. Then click on ''Download Slicelet File'' to download the GEE helper files. Unpack the tarball and take a look at '''README.txt'''. == 2. Learn about GEE networking == Pick a node from your '''ssh-config''' file and log in to it with SSH. For example: {{{ $ ssh -i id_rsa -F ssh-config slice338.pcvm3-1.instageni.metrodatacenter.com }}} Type '''ifconfig'''. You should see an eth0 interface with an IP address in the 10.0.0.0/8 range, a ''private'' IP address. From within a slicelet, you connect to the public Internet via NAT. The nodes in your '''ssh-config''' file are Docker containers running on (virtual) hosts. These hosts have ''public'' IP addresses that are routable from the commodity Internet, that's why you can login to the Docker containers of your slicelet. A port on the public IP address (e.g., 49155) is forwarded to the SSH port (22) on the container's private IP address. The '''ssh-config''' file contains the names of the virtual hosts and the port forwarding information. When you run a server on a node in your slicelet, it will listen on the private address. By default it will only be visible to other nodes in your slicelet. Docker provides facilities for exposing ports to the public Internet, but this topic is outside the scope of this tutorial. ''Note that, to complete this lab, you will later need to find both the ''public'' and ''private'' IP addresses for each node in the slicelet.'' == 3. Learn basic concepts of Ansible == Ansible (http://docs.ansible.com) is a free, open-source, intuitive IT automation tool that is well-suited to the tasks in this tutorial. Ansible commands can be run from the command line or put in a YAML file called a ''playbook''. We will be creating an Ansible playbook to run the parameterized HTTP query described earlier. Two basic concepts in Ansible are ''inventories'' and ''modules''. An inventory is a list of hosts to be managed by Ansible, organized into groups. When you run Ansible commands, either from the command-line or in a playbook, you specify the host group that the command should operate on. In this way Ansible commands can operate on many hosts in parallel. Take a look at the Ansible inventory in your '''ansible-hosts''' file. This is basically the equivalent of the '''ssh-config''' except its specialized for Ansible. A command consists of a module and some arguments for the module. A module provides a declarative abstraction on top of standard shell commands. So for example, in the shell on an Ubuntu machine you might install package “foo” like this: {{{ $ sudo apt-get update $ sudo apt-get install foo }}} An equivalent Ansible command in a playbook would look like: {{{ apt: name=foo state=latest update_cache=yes }}} Or the same Ansible command could be invoked directly on the command line like this: {{{ $ ansible remote-machine -m apt -a "name=foo state=latest update_cache=yes" }}} The command uses the '''apt''' module, and tells Ansible: “Make sure the latest version of package foo is installed”. There are many other modules which are well-documented at http://docs.ansible.com. == 4. Configure the Ansible controller for your slicelet == If you already have Ansible installed on your laptop, then you can use it as the controller for this experiment. Otherwise, you will use one of the nodes in your slicelet as the Ansible controller. Pick one, log into it, and install ansible using apt-get: {{{ $ apt-get update $ apt-get install ansible }}} Then upload your slicelet helper files to that node. || [[Image(wiki:GENIExperimenter/Tutorials/Graphics:tip.png, nolink, 50px, bottom)]] || '''Pro Tip:''' remove your controller node from the '''ansible_hosts''' file after you’ve uploaded. || = [wiki:GENIExperimenter/Tutorials/GENIExperimentEngine/Execute Next: Run Experiment] =