FSL/MD Advanced Developmentlocaldev Inter-Operability setupfor the Modernization and
|
This document is one of a series that describes in detail how to set up
the localdev development environment for use at FSL. This page,
in particular, shows how to set up an account to be able to run
localdev versions 1.x and 2.x simultaneously. This is a capability
required only for AWIPS-related development. Even then, only developers
planning to run nwscm commands (like This is just a specialized summary of the procedure needed for FSL MD/SDD folks to set up their accounts. See the tutorial for a more general and complete description of localdev setup. Refer to http://www-md.fsl.noaa.gov/localdev/ for a complete index of available localdev documentation. |
The localdev development environment consists of a set of scripts that are used to manage source files within an arbitrary number of related production areas. This page shows how a localdev 1.x production area can be made to look like a localdev 2.x source area. This is done by configuring a localdev 2.x source area with a special interop option. Figure 1 shows what this looks like.
awipsHub
and awipsHub2
).base
' and 'stage
'
directories, beneath which lie top-level baseline and staging area
directories (or links to them).This setup is identical to the normal 2.x setup, except that it includes additional steps for making existing baselines and staging areas accessible as 2.x source and build areas. You can create and use 2.x-only source and build areas in addition to inter-operable ones after completing this setup.
~fxa/localdev2/etc
directory. Use of these standard setup
files will ensure your account's compatible with future
localdev releases..cshrc
file at a point
AFTER you set your command path variable:
if ($?LDEV2 == 1) then # Access localdev 2.x if (-e ~fxa/localdev2/etc/csh_setup2) \ source ~fxa/localdev2/etc/csh_setup2 else # Access localdev 1.x if (-e ~fxa/localdev2/etc/csh_setup) \ source ~fxa/localdev2/etc/csh_setup endif alias ldev2 'setenv LDEV2 1' alias ldev1 'unsetenv LDEV2'
.profile
file at a point
AFTER you set your command path variable:
if [[ $LDEV2 = 1 ]] then # Access localdev 2.x if [[ -e ~fxa/localdev2/etc/ksh_setup2 ]] then . ~fxa/localdev2/etc/ksh_setup2 fi else # Access localdev 1.x if [[ -e ~fxa/localdev2/etc/ksh_setup ]] then . ~fxa/localdev2/etc/ksh_setup fi fi alias ldev2='export LDEV2=1' alias ldev1='export LDEV2='
.cshrc
, .profile
,
and anything they source).
You can leave in any mechanisms you have for setting LOCALDEV_TASK
to switch between development areas. It's just the PATH manipulation that
is being replaced.
source ~fxa/localdev/setup-localdevor something like:
set newpath = ( ~fxa/localdev/access/nwscm/bin ) set newpath = ( ~fxa/localdev/bin $newpath ) foreach dir ($path) if ($dir !~ */nwscm/bin && $dir !~ */localdev/bin) then set newpath = ( $newpath $dir ) endif end set path = ( $newpath )
ldev1
or
ldev2
, and then sourcing your setup file
(source ~/.cshrc
or . ~/.profile
).
source ~/.cshrc
or . ~/.profile
),
and then run ' dv-help -V
' to
see which version you're running. You should get either
version 2.0 or version 1.10.> dv-scope -m
. You will be prompted to
take the following actions: a) Specify an Email address that can be used to notify you when and if one of your file locks have been severed. b) Indicate which localdev hubs you want to be held within your localdev scope. This will affect how may localdev mode values you can select from. -- include awipsHub2
newgrp fxalpha
to set it.awips5.2.1
and RSA5.1.2
source areas
are used as an example below. Replace 'awips5.2.1
'
and 'RSA5.1.2
' wherever they appear with
other appropriate names if linking to a different source areas.
setenv LDEV_MODE SOURCE_awips5.2.1
).
dv-buildarea -I spokepath/awips5.2.1/stage/stagename stagename
dv-buildarea -Ispokepath/awips5.2.1/stage/stagename
stagepath stagename
dv-buildarea
to do so, as follows:
setenv LDEV_MODE SOURCE_RSA5.1.2
).
dv-buildarea path/buildname modename
will create a private build area having name buildname at location
path/buildname with a mode named modename. You can put
your build areas wherever you want. You may want to place
these build areas on local disks -- they typically give better build
performance. setenv LDEV_MODE modename
),
change your current directory
(CWD) to the top-level directory of the build area, and then run
dv-sync -R .
to synchronize the entire
area.dv-sourcearea
or dv-buildarea
.
You can run
dv-scope
to list available
source area mode names. They all begin with "SOURCE_
".
dv-scope
to get a summary of your defined modes.
Whenever you want to use a window for localdev development, you will
need to select a current development area to work in. You do this by
setting the environment variable LDEV_MODE to a mode name. You can
either do this in several ways:
setenv LDEV_MODE modename
in
csh
; export LDEV_MODE modename
incsh
)
dv-select
.
These settings apply to all development areas that you are working in.
Customize these as desired using dv-select
. The defaults
work well. Leaving quiet-output-mode-toggle set to the default
'on
' value, in particular, is recommended.awips5.2.1
and RSA5.1.2
source areas
(and awipsHub hub) are used as examples below. Replace 'awips5.2.1
'
and 'RSA5.1.2
' (and 'awipsHub
')wherever they
appear with other appropriate names if working with different source areas.
awipsHub
), if you need it. Then
either create a fresh copy an existing baseline into it. If you do copy,
make sure that you use the archive option, and that you set umask to 0
before running it. Go ahead and create some master staging areas for
the new baseline. Doing this now will allow you to make them
inter-operable in step 5, below.
ldev1; source ~/.cshrc
cp ~/.localdev_###-linux ~/.localdev_5.2.1-linux
awips5.2.1
, and clearing
settings for currentBaseline and currentStaging by
removing everything to the right of the '=')
cp ~/.localdev_###-hp ~/.localdev_5.2.1-hp
awips5.2.1
, and clearing
settings for currentBaseline and currentStaging by
removing everything to the right of the '=')
dv-mkarea -t awips ~fxa/awipsHub awips5.2.1
/home/eagle14/awips_build/awips5.2.1
)
dv-select -P awips5.2.1
dv-mkbase -s awips
umask 0
cp -af /home/eagle14/awips_build/awips###/base/awips \
/home/eagle14/awips_build/awips5.2.1/base/awips
umask 002
dv-mkstaging -N 5.2.1-hp awips
/mstage/awips/5.2.1-hp
)
setenv LOCALDEV_TASK 5.2.1-linux
dv-mkstaging -N 5.2.1-linux awips
ldev2
' alias and 'source ~/.cshrc
'
to make 2.x accessible. The ldev2
alias was created in the
fxa account as a simple way of setting an LDEV2 variable appropriately.
awipsHub2
,
then use dv-hub
to create one, as follows:
dv-hub path/hubname
will create a hub having name hubname located at
path path/hubname. You'll want to make hubs accessible across
your local area network. setenv LDEV_MODE HUB_hubname
) so that
you can create a source area within it.dv-sourcearea
, as follows:
setenv LDEV_MODE HUB_awipsHub2
) if you have not done
done so already. Running
dv-sourcearea -I ~fxa/awipsHub/awips5.2.1/base/awips awips5.2.1
ls -ld ~fxa/awipsHub/awips5.2.1/base/awips
chmod 0775 ~fxa/awipsHub/awips5.2.1/base/awips
dv-scope -m
in order to make the source area's
mode accessible to this account.
setenv LDEV_MODE SOURCE_awips5.2.1
)
so that you can create a master build area within it. dv-repair awips5.2.1
to
update the baseline so that it can be functional
as a source area in localdev 2.x. Depending on how clean
the 1.x baseline is,
this may take several iterations. If you change your CWD to be within the
source area, you can repair the baseline a chunk at a time by specifying
a directory name (as in
dv-repair awips5.2.1 src/D-2D
,
where src/D-2D is the relative path to the directory defining
the subset.
~fxa/awipsHub/awips5.2.1
/home/eagle14/awips_build/awips5.2.1
5.2.1-hp:
/mstage/awips/5.2.1-linux
(linked to production area)
5.2.1-linux:
/home/eagle14/awips_build/awips5.2.1/stage/5.2.1-linux
gcc-hp --> 5.x.x-hp
linux --> 5.x.x-linux
dv-buildarea
, as follows:
setenv LDEV_MODE SOURCE_awips5.2.1
) if you have not done
so already.
dv-buildarea -I /home/d-2d/fx-alpha/awipsHub/awips5.2.1/stage/5.2.1-linux
dv-buildarea -I/home/d-2d/fx-alpha/awipsHub/awips5.2.1/stage/5.2.1-hp /mstage/awips/5.2.1-hp
dv-config -sa awips
'.
setenv LDEV_MODE MASTER_stagename
),
change your current directory
(CWD) to the top-level directory of the build area, and then run
dv-sync -R .
to synchronize the entire
area.dv-state
. Refer to the tutorial for information about
supported states. It is common to set a new source area to open
state, allowing developers complete access to it, with
dv-state open
.