config_info_service_<node-type>

Note: PATCH:1278 is now certified. You can start implementing the information provider in new services.

A new function is needed for all services that publish themselves in the information system. The new function will configure the service information provider written by Stephen Burke, which will generate information in a dynamic way and will substitute the static ldif file created by config_gip_<node-type> functions.

The steps to implement this function are:

  • Implement config_info_service_<node-type>
    • Install the glite-info-provider-service rpm
    • Use the template given below to write the function for your service
    • Include the new function in the function list
    • If it's the first time a configuration is written for the service to be published, add config_bdii_only and config_gip_only in the node function list to configure a resource BDII. In this case you would also need to add certain rpms in your metapackage. See Laurence Field Resource BDII wiki for more details.
    • Modify config_gip_<node-type>, if it exists, to remove the LDIF file creation
  • Open a patch in Savannah including the corresponding yaim module rpm and the glite-info-provider-service rpm

For more details, keep on reading...

In order to better understand the configuration of the new info service provider written by Stephen Burke, please read the configuration changes of patch #1278.

The glite-info-provider-service rpm can be downloaded from ETICS.

When you install the rpm, the following files will be installed:

In /opt/glite/etc/:

/opt/glite/etc/glite-info-service-bdii.conf.template      
/opt/glite/etc/glite-info-service-gridice.conf.template   
/opt/glite/etc/glite-info-service-gsirfio.conf.template   
/opt/glite/etc/glite-info-service-lbserver.conf.template  
/opt/glite/etc/glite-info-service-myproxy.conf.template
/opt/glite/etc/glite-info-service-srm-dcache-v1.conf.template
/opt/glite/etc/glite-info-service-srm-dcache-v2.conf.template
/opt/glite/etc/glite-info-service-srm-dpm-v1.conf.template
/opt/glite/etc/glite-info-service-srm-dpm-v2.conf.template
/opt/glite/etc/glite-info-service-vobox.conf.template
/opt/glite/etc/glite-info-service-wmproxy.conf.template

and in /opt/glite/libexec:

/opt/glite/libexec/glite-info-service           
/opt/glite/libexec/glite-info-service-bdii
/opt/glite/libexec/glite-info-service-dcache  
/opt/glite/libexec/glite-info-service-dpm
/opt/glite/libexec/glite-info-service-lbserver     
/opt/glite/libexec/glite-info-service-gridice       
/opt/glite/libexec/glite-info-service-myproxy
/opt/glite/libexec/glite-info-service-test
/opt/glite/libexec/glite-info-service-vobox
/opt/glite/libexec/glite-info-service-wmproxy

The list of files in the rpm will increase as services are added.

The following template can be used to create the config_info_service_<node-type> for your node:

##############################################################################
# Copyright (c) Members of the EGEE Collaboration. 2004.
# See http://www.eu-egee.org/partners/ for details on the copyright
# holders.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
##############################################################################
#
# NAME :        config_info_service_<node_type>
#
# DESCRIPTION : This function configures the dynamic service publisher
#                        for the node type <node_type>.
#
# AUTHORS :     your mail
#
# NOTES :
#
# YAIM MODULE:  glite-yaim-<node-type>
#
##############################################################################

config_info_service_node_type_check () {
        requires $1 SITE_NAME INSTALL_ROOT
}

config_info_service_node_type_setenv () {
        yaimlog DEBUG "This function currently doesn't set any environment variables."
}

config_info_service_node_type () {

INFO_SERVICE_CONFIG=${INFO_SERVICE_CONFIG:-${INSTALL_ROOT}/glite/etc}
INFO_SERVICE_SCRIPT=${INFO_SERVICE_SCRIPT:-${INSTALL_ROOT}/glite/libexec}
INFO_PROVIDER_PATH=${INFO_PROVIDER_PATH:-${INSTALL_ROOT}/glite/etc/gip/provider}

SERVICE=NODE_TYPE                          # In upper case
SERVICE_HOST=${NODETYPE_HOST}   # YAIM variable

SERVICE_LC=`echo ${SERVICE} | tr '[:upper:]' '[:lower:]'`

if [ ! -f ${INFO_SERVICE_CONFIG}/glite-info-service-${SERVICE_LC}.conf.template ]; then
  yaimlog ERROR "The template file for glite-info-service-${SERVICE_LC}.conf.template was not found in ${INFO_SERVICE_CONFIG}."
  exit 1
fi

if [ ! -f ${INFO_SERVICE_SCRIPT}/glite-info-service ]; then
  yaimlog ERROR "The script file for glite-info-service was not found in ${INFO_SERVICE_SCRIPT}."
  exit 1
fi

yaimlog DEBUG "Delete a previous version of the glite-info-service-${SERVICE_LC}.conf if it exists"
rm -rf ${INFO_SERVICE_CONFIG}/glite-info-service-${SERVICE_LC}.conf

yaimlog DEBUG "Create the glite-info-service-${SERVICE_LC}.conf file out of the template file"
cp ${INFO_SERVICE_CONFIG}/glite-info-service-${SERVICE_LC}.conf.template ${INFO_SERVICE_CONFIG}/glite-info-service-${SERVICE_LC}.conf

# Note: the configuration file may need to be altered if non standard values have been used.

yaimlog DEBUG "Delete a previous version of the glite-info-provider-service-${SERVICE_LC}-wrapper if it exists"
rm -rf ${INFO_PROVIDER_PATH}/glite-info-provider-service-${SERVICE_LC}-wrapper

yaimlog DEBUG "Create the ${INFO_PROVIDER_PATH} in case it doesn't exist"
mkdir -p ${INFO_PROVIDER_PATH}

yaimlog DEBUG "Create the glite-info-provider-service-${SERVICE_LC}-wrapper file"
cat << EOF > ${INFO_PROVIDER_PATH}/glite-info-provider-service-${SERVICE_LC}-wrapper
#!/bin/sh
export PATH=$PATH:${INFO_SERVICE_SCRIPT}
export ${SERVICE}_HOST=${SERVICE_HOST}
${INFO_SERVICE_SCRIPT}/glite-info-service ${INFO_SERVICE_CONFIG}/glite-info-service-${SERVICE_LC}.conf $SITE_NAME
EOF

chmod +x ${INFO_PROVIDER_PATH}/glite-info-provider-service-${SERVICE_LC}-wrapper


return 0

}

For each service, you have to check in the libexec configuration file whether the name of the variables used there are coherent with the name of the glue service used to name the template files. Otherwise you would need to modify the previous template accordingly. In case of doubt, please contact Stephen Burke.

Bear in mind that there might be other variables different from SERVICE_HOST that are currently defined in YAIM and therefore should be used in the template. For instance, a port may also be configurable via YAIM and used by the provider and therefore it's desirable to export the YAIM value in the wrapper. You can check all the variables used by the provider in /opt/glite/libexec files. The variables declared there have nothing to do with YAIM variables and that's why we want to export them in the wrapper pointing to YAIM variables if they are defined.

You may also want to replace some values directly in the configuration files, but I would recommend to talk to Stephen first, since we should try to be independent from the info provider and do the less modifications we can.

You also need to modify config_gip_<node-type> so that the LDIF file is no longer created there. You can substitute that part of the code with some lines removing the previous conf and ldif files generated in /opt/glite/var/tmp/gip and /opt/glite/etc/gip/ldif for cleaning purposes.

-- MariaALANDESPRADILLO - 05 Mar 2008

Edit | Attach | Watch | Print version | History: r8 < r7 < r6 < r5 < r4 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r8 - 2010-01-29 - LaurenceField
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    EGEE All webs login

This site is powered by the TWiki collaboration platform Powered by Perl This site is powered by the TWiki collaboration platformCopyright & by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Ask a support question or Send feedback