Chapter 2. Tutorial

The following steps walk through a new user setting up her bank account and one host account and starting to run on that host.

  1. Tycoon requires an ssh public key pair both for logging into hosts and performing bank operations. If you already have a DSA ssh public key pair without a passphrase, then skip to Step 2. It is better to have a key pair without a passphrase because it avoids the need to type a passphrase for every bank operation. To create a new ssh key, use ssh-keygen. For example, Alice Smith running on her workstation “alicehost” would enter the following and then hit return at all the prompts:

    [asmith@alicehost ~]# ssh-keygen -t dsa
    

    This outputs:

    
    Generating public/private dsa key pair.
    Enter file in which to save the key (/home/asmith/.ssh/id_dsa):
    Created directory '/home/asmith/.ssh'.
    Enter passphrase (empty for no passphrase):
    Enter same passphrase again:
    Your identification has been saved in /home/asmith/.ssh/id_dsa.
    Your public key has been saved in /home/asmith/.ssh/id_dsa.pub.
    The key fingerprint is:
    1a:5e:d6:0b:0f:5a:61:98:ed:3f:d4:26:fa:65:62:50 asmith@alicehost.hpl.hp.com
    
    
  2. Check that your key is in the OpenSSH format. If you just created your key using ssh-keygen, then it is the correct format and you can skip to the next step. If you created the key on a non-Linux platform (e.g., using PuTTY on Windows), then it is in the wrong format. Convert it using the following:

    [asmith@alicehost ~]# ssh-keygen -i -f dsa >> .ssh/authorized_keys
    
  3. Setup your tycoon configuration with your email address and the account name that you would like to use on remote machines. For example, Alice would type:

    [asmith@alicehost ~]# tycoon user setup alice.smith@hp.com asmith \
    ~/.ssh/id_dsa.pub ~/.ssh/id_dsa
    

    This outputs:

    
    Generating bank keys from SSH keypair...
    
    
    [Note]Note

    This command creates some configuration files in ~/.tycoon, so you can start over by removing that directory.

  4. You must register your account with the bank. There are two methods: have someone with a registered account register you (preferred) or register through the bank administrator (takes longer). To have a friend register you, your friend must be willing to give you some initial credits and you must email or otherwise copy your ssh public key to your friend. Your bank account public key is in ˜/.tycoon/user_name/bank_account_public_key. For example, suppose Bob already has a registered account, is willing to give Alice 1 credit, and Alice has mailed her ˜/.tycoon/alice.smith@hp.com/bank_account_public_key file to Bob, which he has saved as ˜/alice_bank_account_public_key. He would register Alice by typing:

    [bjohnson@bobhost ~]# tycoon bank create_account alice.smith@hp.com \
    1 ~/alice_bank_account_public_key
    

    The other choice is to register through the form at Online Registration Form. However, this will likely take longer than registering through a friend.

  5. Get a list of cost-efficient hosts. The cost efficiency of a particular resource for a host is the capacity of that resource divided by the current price for that resource. If Alice were interested the most CPU cost-efficient hosts, she use the following:

    [asmith@alicehost ~]# tycoon sls query_cost_efficiency CPU
    

    This outputs:

    
    IP Address       Capacity/Price  Capacity       Price
    1.2.3.4          1.079303e+25    2.799325e+09   2.593642e-16
    1.2.3.5          1.018997e+25    2.805109e+09   2.752815e-16
    1.2.3.6          1.014727e+25    2.799362e+09   2.758735e-16
    ...
    
    

    The best hosts are listed first.

  6. Create accounts on the machines you want. Alice would type the following command to create an account on host providinghost1 and transfer 10 credits:

    [asmith@alicehost ~]# tycoon host create_account providinghost1 10
    

    This outputs:

    
    Creating host account(s) (may take several minutes)...
    1.2.3.4 SSH port number: 11111
    1.2.3.4 has booted.
    1.2.3.4 created account with initial deposit of 1
    
    

    Note your SSH port number. You will use this port number to log into and copy files to your host account. This port will usually be the same across different host accounts, but this is not guaranteed.

  7. Copy programs to the new account. Alice would type the following commands to copy the directory my_program to providinghost1:

    [asmith@alicehost ~]# tycoon_scp -r my_program providinghost1:
    

    This outputs:

    
    my_program                                    100% 10660     10KB/s   00:00
    
    

    tycoon_scp automatically determines the user's ssh port number on the providing host. It is otherwise the same as the standard scp client. If you prefer to use a different scp client, then simply remember to use the port number specified when you created the host account.

  8. Log into the new new account. Alice would type the following commands to log into her account on providinghost1:

    [asmith@alicehost ~]# tycoon_ssh asmith@providinghost1
    

    This outputs:

    
    Last login: Mon May  9 14:35:33 2005 from alicehost
    [asmith@providinghost1 ~]$ 
    
    

    As with tycoon_scp, tycoon_ssh automatically determines the user's ssh port number on the providing host. It is otherwise the same as the standard ssh client.

  9. You may need to install software in your remote account. You can login and use the yum program. Alice would use this command to install gcc:

    [asmith@alicehost ~]# tycoon_ssh root@providinghost1 yum -y install gcc
    

    This outputs:

    
    Setting up Install Process
    Setting up Repos
    Reading repository metadata in from local files
    Resolving Dependencies
    ...
    Installed: gcc.i386 0:3.4.3-22.fc3
    Dependency Installed: cpp.i386 0:3.4.3-22.fc3 glibc-devel.i386
    0:2.3.5-0.fc3.1 glibc-headers.i386 0:2.3.5-0.fc3.1
    glibc-kernheaders.i386 0:2.4-9.1.87
    Complete!
    
    
    [Note]Note

    This command needs to contact Internet package repositories to download software, which it cannot do behind some firewalls.

  10. At some point, you may find that you need to run faster or have run out of money. You can add more money to your host accounts. Alice would type this to transfer 10 more credits to 1.2.3.4.

    [asmith@alicehost ~]# tycoon host fund providinghost1 10
    

    This outputs:

    
    1.2.3.4 funded 10.