How to FTP files from the FNKITS repository

(or from other upd server nodes)

In the old ups/upd, KITS contained one tarfile per product. If anything in the product changed, an entire new release would need to be cut, and a brand new tarfile of the whole product would be added to KITS.

One of the features of the new ups/upd is the ability to update certain portions of a product without cutting an entire new release of the product. Specifically, a product maintainer can update any file within the ups directory of a product, and/or the product's table file, without needing to cut an entire new release.

The files that are commonly found within a product's ups directory include:

A copy of [some version of] the product's table file may also sometimes be found in the product's ups directory; but this copy may not be up-to-date.

Therefore, you need to ftp three separate files, and unwind them in the proper order, in order to obtain a complete product from a upd repository. (If you are using upd, it already knows how to obtain and unwind all three files).

The naming conventions and file hierarchy on FNKITS have been set to make this procedure relatively easy. We show the example of obtaining and unwinding a product named "sister", version "v0_1", for flavor Linux+2.

  1. Ftp to the machine. Log in as user "anonymous", using your username@nodename as the password. (You must be a registered user to obtain most products from fnkits. You do not need to be a registered user to obtain the Fermitools products; these are located under the /pub directory).
            cd /usr/tmp
    
            ftp fnkits.fnal.gov
            Username: anonymous
            Password: registered-user@registered.node
    

  2. Find the product you're interested in. If you know the name, version, and flavor, you can just cd to the appropriate directory. Otherwise, you may need to browse a bit.

    Products are arranged (via symlinks) in several different file hierarchies for your convenience in browsing. The /products directory contains products organized product name and version. The /KITS hierarchy contains products organized by operating system. The /pub hierarchy contains the publically available Fermitools products; you do not need to be a registered user in order to ftp the Fermitools products.

            cd /products/sister/v1_0/Linux+2
            ls -l
            drwxr-xr-x   4 100      kits         512 Sep 10 19:53 sister_v0_1_Linux+2
            -rw-rw-r-x   1 100      kits        1538 Sep 10 19:53 sister_v0_1_Linux+2.table
            -rw-r--r-x   1 100      kits     9687040 Aug 19 21:05 sister_v0_1_Linux+2.tar
            -rw-rw-r-x   1 100      kits       60928 Sep 10 19:53 sister_v0_1_Linux+2.ups.tar
    
    The directory sister_v0_1_Linux+2 contains the unwound ups directory files; you are free to browse and look at any of these files. In particular, you will frequently find the product README and assocated documentation in the unwound ups directory.

  3. Get the two tar files. Make sure you're in "binary" mode.
            binary
            get sister_v0_1_Linux+2.tar
            get sister_v0_1_Linux+2.ups.tar
    

  4. Get the table file. Make sure you're in "ascii" mode.
            ascii
            get sister_v0_1_Linux+2.table
    

  5. Unwind the product files on your local node. The order is very important! You want to unwind the tarfiles (and move the table file) so that the table file you just ftp'd takes precedence over any previously existing table file, and so that the product's ups.tar file contents take precedence over any ups directory contents that may have been contained within the product tarfile.

    Note: since you are manually doing the ftp of the product files, you are free to put the files anywhere you like. You do not need to follow any file naming conventions that may be laid out in your system's updconfig file.

            #
            # make the product root directory:
            #
            cd /fnal/ups/products
            mkdir -p sister/v0_1/Linux+2
    
            #
            # cd to the product root directory and
            #  unwind the product tarfile
            cd sister/v0_1/Linux+2
            tar xvf /usr/tmp/sister_v0_1_Linux+2.tar
            ...
    
            #
            # cd to the product's ups directory (or
            #  make it if it doesn't exist) and
            #  unwind the product's ups.tar tarfile
            cd ups
            tar xvf /usr/tmp/sister_v0_1_Linux+2.ups.tar
            ...
    
            #
            # cd to the location where you want the
            #  table file (most likely the product's ups
            #  directory, or in the ups database for the
            #  product)
            #
            cp /usr/tmp/sister_v0_1_Linux+2.table ./sister.table
    

  6. Declare the product to your ups database (if you're using ups on your local node). Make sure that you use the correct path to each element on the ups declare command!
            ups declare -z /fnal/ups/db \                        # use the appropriate db
                    -r /fnal/ups/products/sister/v0_1/Linux+2 \  # the path to where you unwound the product tarfile
                    -m sister.table \                            # name you gave to the product table file
                    -f Linux+2 \                                 # the flavor of the product
                    -U ups_dir \                                 # see Special Note #1 below
                    -M table_file_dir \                          # see Special Note #2 below
               sister v0_1                                       # product name and version number
    
    Special Note #1: If you unwound the product's ups directory tarfile in the default location ($PRODUCT_DIR/ups), then you do not need to include the "-U ups_dir" on your ups declare. You only need to specify the name and/or location of the ups directory if it is not named "ups" and located under the product root.

    Special Note #2: If you placed the product's table file in either one of the two default locations (in the ups database for this product, or in the product's ups directory), then you should not include the "-M table_file_dir" on the ups declare command. You should only use the -M option if you have moved the table file to a separate location where ups won't otherwise find it.


What about other upd repository nodes?

The procedure is quite similar; the only complication is that it may not be quite so easy to find the table file and/or ups directory tarfile for each product. Each upd repository can have its own file configuration. The most reliable way to determine where the necessary files are is via the upd list command:

	upd list -h special.upd.host \
		-K+:@prod_dir:@ups_dir:@table_file \
	    sister v0_1 -f Linux+2
	"/P/tar/sisterv0_1Linux+2.tar" "/P/ups/sisterv0_1Linux+2.ups.tar" "/P/table/sisterv0_1Linux+2.table"
In this example, it appears that product tarfiles are stored under the /P/tar hierarchy; product ups directory tarfiles are all stored under the /P/ups hierarchy; and table files are stored under the /P/table directory. To ftp the product files in this case:
	ftp special.upd.host
	Username: anonymous
	Password: registered-user@registered.node

	binary
	cd /P/tar
	get sisterv0_1Linux+2.tar
	cd /P/ups
	get sisterv0_1Linux+2.ups.tar

	ascii
	cd /P/table
	get sisterv0_1Linux+2.table
Then unwind the tarfiles as shown in the first example.
Comments? Suggestions? Please send them to uas-group@fnal.gov.
This document was initially released on 17 September 1998 by llc.