From b2d20c8beaa0dfbdba850d6287d9f78ee4798c1d Mon Sep 17 00:00:00 2001 From: ucar-tmeyer Date: Wed, 21 Sep 2022 15:14:18 -0700 Subject: [PATCH] Couple more localization updates ------------------------------------- setup.env - added new variable EXT_ADDR and turned off ignite usage rsync.dirs - updated localization path, removed python-awips, awips2-drawing, and awips2-data-delivery Installer.edex-configuration - removed this since we don't need it deploy.builder/build.sh - removed call to build the edex-configuration RPM Installer.gfe/component.spec - removed awips2-edex-configuration requirement Installer.localization/component.spec - removed the copying of common_static/site since we don't have any files to copy here build.edex/build.xml - removed the com.raytheon.uf.edex.foss.org.owasp.esapi.feature rpms/build/x86_64/build.sh - updated the buildLocalizationRPMs to buildLocalization --- build/deploy.edex.awips2/esb/bin/setup.env | 9 +- build/rsync.dirs | 9 +- rpms/awips2.core/Installer.gfe/component.spec | 1 - .../Installer.localization/component.spec | 5 - .../component.spec | 302 ------------------ rpms/awips2.edex/deploy.builder/build.sh | 1 - rpms/build/x86_64/build.sh | 2 +- 7 files changed, 8 insertions(+), 321 deletions(-) delete mode 100644 rpms/awips2.edex/Installer.edex-configuration/component.spec diff --git a/build/deploy.edex.awips2/esb/bin/setup.env b/build/deploy.edex.awips2/esb/bin/setup.env index 70eb21edc4..61d5b406c8 100644 --- a/build/deploy.edex.awips2/esb/bin/setup.env +++ b/build/deploy.edex.awips2/esb/bin/setup.env @@ -2,6 +2,8 @@ export AW_SITE_IDENTIFIER=OAX ## Cluster id can be set to the cluster's id (example:tbw for dv1-tbwo) ## it will be autogenerated if not set +export EXT_ADDR=external.fqdn + export CLUSTER_ID= # database names @@ -29,7 +31,8 @@ export BROKER_PORT=5672 export BROKER_HTTP=8180 # setup ignite -export DATASTORE_PROVIDER=${DATASTORE_PROVIDER:-ignite} +#export DATASTORE_PROVIDER=${DATASTORE_PROVIDER:-ignite} +export DATASTORE_PROVIDER=pypies # Server that redirects PYPIES http requests to ignite export PYPIES_COMPATIBILITY_HOST=localhost export PYPIES_COMPATIBILITY_PORT=9586 @@ -45,13 +48,13 @@ export LOCAL_ADDRESS=127.0.0.1 export IGNITE_SSL_CERT_DB=/awips2/edex/conf/ignite/auth # setup hdf5 connection -export PYPIES_HOST=localhost +export PYPIES_HOST=${EXT_ADDR} export PYPIES_PORT=9582 export PYPIES_SERVER=http://${PYPIES_HOST}:${PYPIES_PORT} # moved here from environment.xml # these values are returned to clients that contact the localization service -export HTTP_HOST=localhost +export HTTP_HOST=${EXT_ADDR} export HTTP_PORT=9581 export HTTP_SERVER_PATH=services export HTTP_SERVER=http://${HTTP_HOST}:${HTTP_PORT}/${HTTP_SERVER_PATH} diff --git a/build/rsync.dirs b/build/rsync.dirs index c3d7e430a8..e1d7ffb55d 100644 --- a/build/rsync.dirs +++ b/build/rsync.dirs @@ -1,4 +1,4 @@ -edexOsgi/* cave/* localization/* +edexOsgi/* cave/* localization javaUtilities/* rpms pythonPackages build/deploy.edex build/deploy.edex.awips2 @@ -27,13 +27,6 @@ build/deploy.ignite.awips2 ../awips2-nws/viz/* ../awips2-goesr/edexOsgi/* ../awips2-goesr/cave/* -../python-awips -../awips2-data-delivery/common/* -../awips2-data-delivery/edex/* -../awips2-data-delivery/features/* -../awips2-data-delivery/viz/* -../awips2-drawing/viz/* -../awips2-drawing/features/* ../awips2-gsd/viz/* ../awips2-gsd/features/* ../awips2-ogc/foss/* diff --git a/rpms/awips2.core/Installer.gfe/component.spec b/rpms/awips2.core/Installer.gfe/component.spec index e210afa02a..953c762e2f 100644 --- a/rpms/awips2.core/Installer.gfe/component.spec +++ b/rpms/awips2.core/Installer.gfe/component.spec @@ -19,7 +19,6 @@ Packager: %{_build_site} AutoReq: no Provides: awips2-data.gfe Requires: awips2-edex -Requires: awips2-edex-configuration %description AWIPS II gfe Distribution - Contains the AWIPS II gfe netcdf files. diff --git a/rpms/awips2.core/Installer.localization/component.spec b/rpms/awips2.core/Installer.localization/component.spec index 28760a4586..7fd00c0305 100644 --- a/rpms/awips2.core/Installer.localization/component.spec +++ b/rpms/awips2.core/Installer.localization/component.spec @@ -101,11 +101,6 @@ do grep -rl 'LATITUDE' $CAVE_DIR | xargs sed -i 's/LATITUDE/'$lat'/g' grep -rl 'LONGITUDE' $CAVE_DIR | xargs sed -i 's/LONGITUDE/'$lon'/g' - # EDEX - SITE_DIR=$COMMON_DIR/site/$site - mkdir -p $SITE_DIR - cp -R $UTIL/siteconfig/* $SITE_DIR/ - grep -rl 'XXX' $SITE_DIR | xargs sed -i 's/XXX/'$site'/g' done ls -la $BUILD_DIR/utility/cave_static find $BUILD_DIR/utility/cave_static diff --git a/rpms/awips2.edex/Installer.edex-configuration/component.spec b/rpms/awips2.edex/Installer.edex-configuration/component.spec deleted file mode 100644 index 1cb0f0e7d6..0000000000 --- a/rpms/awips2.edex/Installer.edex-configuration/component.spec +++ /dev/null @@ -1,302 +0,0 @@ -# -# AWIPS II edex-configuration Spec File -# -Name: awips2-edex-configuration -Summary: AWIPS II Edex -Version: %{_component_version} -Release: %{_component_release} -Group: AWIPSII -BuildRoot: %{_build_root} -#BuildArch: noarch -URL: N/A -License: N/A -Distribution: N/A -Vendor: Raytheon -Packager: %{_build_site} - -AutoReq: no -provides: awips2-edex-configuration -requires: awips2 -requires: awips2-edex-base -requires: sed - -%description -AWIPS II Edex Configuration - the edex setup.env file. - -%prep -# Verify That The User Has Specified A BuildRoot. -if [ "%{_build_root}" = "" ] -then - echo "ERROR: The RPM Build Root has not been specified." - exit 1 -fi - -if [ -d %{_build_root} ]; then - rm -rf %{_build_root} -fi - -%build - -%install -mkdir -p %{_build_root}/awips2/edex -if [ $? -ne 0 ]; then - exit 1 -fi -mkdir -p %{_build_root}/awips2/edex/logs -if [ $? -ne 0 ]; then - exit 1 -fi -mkdir -p %{_build_root}/awips2/edex/webapps -if [ $? -ne 0 ]; then - exit 1 -fi -mkdir -p %{_build_root}/awips2/edex/data/share -if [ $? -ne 0 ]; then - exit 1 -fi - -DEPLOY_SCRIPT="deploy.edex.awips2/deploy/deploy-esb-configuration.xml" - -# use deploy-install to deploy edex-configuration. -pushd . > /dev/null -cd %{_baseline_workspace} -/awips2/ant/bin/ant -f ${DEPLOY_SCRIPT} \ - -Desb.overwrite=true \ - -Desb.directory=%{_baseline_workspace}/deploy.edex.awips2/esb \ - -Dedex.root.directory=${RPM_BUILD_ROOT}/awips2/edex -if [ $? -ne 0 ]; then - exit 1 -fi -popd > /dev/null - -DEPLOY_SCRIPT="deploy.edex.awips2/deploy/deploy-esb.xml" - -# use deploy-install to deploy edex. -pushd . > /dev/null -cd %{_baseline_workspace} -/awips2/ant/bin/ant -f ${DEPLOY_SCRIPT} \ - -Ddeploy.data=true -Ddeploy.web=true \ - -Desb.overwrite=true \ - -Desb.directory=%{_baseline_workspace}/deploy.edex.awips2/esb \ - -Dedex.root.directory=${RPM_BUILD_ROOT}/awips2/edex \ - -Dbasedir=%{_baseline_workspace}/deploy.edex.awips2 -if [ $? -ne 0 ]; then - exit 1 -fi -popd > /dev/null - -# remove any .gitignore files -# currently, the ebxml webapp includes a .gitignore file -/usr/bin/find ${RPM_BUILD_ROOT}/awips2/edex -name .gitignore -exec rm -f {} \; -if [ $? -ne 0 ]; then - exit 1 -fi - -# remove the test logback configuration used for development -rm -f ${RPM_BUILD_ROOT}/awips2/edex/conf/logback-test.xml -if [ $? -ne 0 ]; then - exit 1 -fi - -%pre - -%post - -SETUP_ENV="/awips2/edex/bin/setup.env" -SETUP_ENV_NEW="/awips2/edex/bin/setup.env.rpmnew" - -function updateNewSetupEnv() -{ - # Use this method when we are setting auto-configured variables in a brand - # new setup.env. This simply updates a variable to a given value, without - # having to worry about if the variable was previously configured to - # something else (like updateSetupEnv below does). - # - # Arguments: - # 1) name of the variable to change. - # 2) default value of the variable. - # 3) value to set variable to. - - local VARIABLE="${1}" - local DEFAULT="${2}" - local VALUE="${3}" - - VALUE=$(echo "${VALUE}" | sed 's|/|\\/|g') - DEFAULT=$(echo "${DEFAULT}" | sed 's|/|\\/|g') - - sed -i -e "s/export ${VARIABLE}=${DEFAULT}/export ${VARIABLE}=${VALUE}/g" "${SETUP_ENV}" -} - -function updateSetupEnv() -{ - # Use this method when we are updating an already existing setup.env. This - # updates a variable in setup.env.rpmnew with the previously configured value - # from setup.env, and optionally is given an auto-configured value to use if - # the variable was not previously configured. - # - # Arguments: - # 1) name of the variable to change. - # 2) default value of the variable. - # 3) optional - value to set variable to if previously unset or default. - - local VARIABLE="${1}" - local DEFAULT="${2}" - local VALUE="${!VARIABLE}" - - if [[ ! -v "${VARIABLE}" || "${VALUE}" = "${DEFAULT}" ]]; then - # previously unset or default - if [[ "$#" -gt 2 ]]; then - VALUE="${3}" - else - return - fi - fi - - VALUE=$(echo "${VALUE}" | sed 's|/|\\/|g') - DEFAULT=$(echo "${DEFAULT}" | sed 's|/|\\/|g') - - sed -i -e "s/export ${VARIABLE}=${DEFAULT}/export ${VARIABLE}=${VALUE}/g" "${SETUP_ENV_NEW}" -} - -function isAnyReachable() -{ - # Return 0/true if any of the given hostnames are reachable, otherwise - # return 1/false. - # - # Arguments: - # any number of hostnames to attempt to reach - for server in "$@"; do - if ping -c 1 -W 3 "${server}" >/dev/null 2>&1; then - return 0 - fi - done - return 1 -} - -# Determine ignite cluster values to use in setup.env -if isAnyReachable cache4 cache5 cache6; then - clusterServers1=cache1,cache2,cache3 - clusterServers2=cache4,cache5,cache6 - localAddress="$(hostname -I | cut -d' ' -f1)" - pypiesCompatibilityHost=ev -elif isAnyReachable cache1 cache2 cache3; then - clusterServers1=cache1,cache2,cache3 - clusterServers2= - localAddress="$(hostname -I | cut -d' ' -f1)" - pypiesCompatibilityHost=ev -else - clusterServers1=localhost - clusterServers2= - localAddress=127.0.0.1 - pypiesCompatibilityHost=localhost -fi - -if [[ -f "${SETUP_ENV_NEW}" ]]; then - # Rewrite the new setup.env with the existing - # configuration - provided as a convenience. - source "${SETUP_ENV}" - - # setup.env variables to only attempt to reuse previous values for. - # Update when a variable is added to or removed from setup.env. - updateSetupEnv "AW_SITE_IDENTIFIER" "OAX" - updateSetupEnv "CLUSTER_ID" "" - - updateSetupEnv "DC_DB_NAME" "dc_ob7oax" - updateSetupEnv "FXA_DB_NAME" "fxatext" - updateSetupEnv "HM_DB_NAME" "hmdb" - updateSetupEnv "IH_DB_NAME" "hd_ob92oax" - updateSetupEnv "CLIMATE_DB_NAME" "climate" - - updateSetupEnv "PREFERRED_AFOS_FIRST_LETTER" "\"KCPTXM\"" - - updateSetupEnv "DATA_ARCHIVE_ROOT" "/tmp/sbn" - - updateSetupEnv "DB_HOST" "localhost" - updateSetupEnv "DB_PORT" "5432" - updateSetupEnv "DB_SSLMODE" "verify-ca" - - updateSetupEnv "BROKER_HOST" "localhost" - updateSetupEnv "BROKER_PORT" "5672" - updateSetupEnv "BROKER_HTTP" "8180" - - # skip DATASTORE_PROVIDER since it should only be modified via local profile entries - updateSetupEnv "PYPIES_COMPATIBILITY_HOST" "localhost" - updateSetupEnv "PYPIES_COMPATIBILITY_PORT" "9586" - updateSetupEnv "IGNITE_SSL_CERT_DB" "/awips2/edex/conf/ignite/auth" - - updateSetupEnv "PYPIES_HOST" "localhost" - updateSetupEnv "PYPIES_PORT" "9582" - - updateSetupEnv "HTTP_HOST" "localhost" - updateSetupEnv "HTTP_PORT" "9581" - updateSetupEnv "HTTP_SERVER_PATH" "services" - updateSetupEnv "JMS_VIRTUALHOST" "edex" - updateSetupEnv "JMS_SSL_ENABLED" "true" - updateSetupEnv "QPID_SSL_CERT_DB" "/awips2/edex/conf/jms/auth" - updateSetupEnv "QPID_SSL_CERT_NAME" "guest" - updateSetupEnv "RADAR_HOST" "localhost" - updateSetupEnv "RADAR_PORT" "8813" - - updateSetupEnv "SHARE_DIR" "/awips2/edex/data/share" - - updateSetupEnv "TEMP_DIR" "/awips2/edex/data/tmp" - - updateSetupEnv "LDAD_EXTERNAL_HOME" "/ldad" - updateSetupEnv "LDAD_EXTERNAL_PUBLIC" "/data/ldad/public" - updateSetupEnv "AWIPS2_TEMP" "/awips2/tmp" - - # setup.env variables to auto-configure if previously unset/default. - if [[ ! -v IGNITE_CLUSTER_1_SERVERS || "${IGNITE_CLUSTER_1_SERVERS}" = localhost ]] && [[ "${IGNITE_CLUSTER_2_SERVERS}" == "" ]]; then - # Auto-configure ignite cluster values if both were unset or default values before - updateSetupEnv "IGNITE_CLUSTER_1_SERVERS" "localhost" "${clusterServers1}" - updateSetupEnv "IGNITE_CLUSTER_2_SERVERS" "" "${clusterServers2}" - else - # Otherwise use values from previous config - updateSetupEnv "IGNITE_CLUSTER_1_SERVERS" "localhost" - updateSetupEnv "IGNITE_CLUSTER_2_SERVERS" "" - fi - updateSetupEnv "LOCAL_ADDRESS" "127.0.0.1" "${localAddress}" - updateSetupEnv "PYPIES_COMPATIBILITY_HOST" "localhost" "${pypiesCompatibilityHost}" - - # Remove the existing setup.env. - rm -f "${SETUP_ENV}" - - # Rename setup.env.rpmnew to setup.env. - mv "${SETUP_ENV_NEW}" "${SETUP_ENV}" -else - # New setup.env, auto-configure ignite cluster values - updateNewSetupEnv "IGNITE_CLUSTER_1_SERVERS" "localhost" "${clusterServers1}" - updateNewSetupEnv "IGNITE_CLUSTER_2_SERVERS" "" "${clusterServers2}" - updateNewSetupEnv "LOCAL_ADDRESS" "127.0.0.1" "${localAddress}" - updateNewSetupEnv "PYPIES_COMPATIBILITY_HOST" "localhost" "${pypiesCompatibilityHost}" -fi - -%clean -rm -rf ${RPM_BUILD_ROOT} - -%files -%defattr(644,awips,fxalpha,755) -%dir /awips2/edex/conf -/awips2/edex/conf/* -%dir /awips2/edex/data -/awips2/edex/data/* -%dir /awips2/edex/data/share -%dir /awips2/edex/etc -/awips2/edex/etc/* -%dir /awips2/edex/lib -/awips2/edex/lib/* -%dir /awips2/edex/logs -%dir /awips2/edex/webapps -%config(noreplace) /awips2/edex/bin/setup.env -%defattr(755,awips,fxalpha,755) -/awips2/edex/bin/*.sh -/awips2/edex/bin/scriptLauncher -%config(noreplace) /awips2/edex/conf/db/auth/*.crt -%defattr(600,awips,fxalpha,755) -%config(noreplace) /awips2/edex/conf/db/auth/*.key -%config(noreplace) /awips2/edex/conf/db/auth/*.pk8 -%config(noreplace) /awips2/edex/conf/jms/auth/*.crt -%config(noreplace) /awips2/edex/conf/jms/auth/*.key -%config(noreplace) /awips2/edex/conf/ignite/auth/*.crt -%config(noreplace) /awips2/edex/conf/ignite/auth/*.key -%config(noreplace) /awips2/edex/conf/ignite/auth/passwords.properties diff --git a/rpms/awips2.edex/deploy.builder/build.sh b/rpms/awips2.edex/deploy.builder/build.sh index 6320ff09c5..ce16275505 100644 --- a/rpms/awips2.edex/deploy.builder/build.sh +++ b/rpms/awips2.edex/deploy.builder/build.sh @@ -107,7 +107,6 @@ popd cd ../ buildRPM "Installer.edex" -buildRPM "Installer.edex-configuration" DIST="${WORKSPACE}/build.edex/edex/dist" for edex_zip in `cd ${DIST}; ls -1;`; diff --git a/rpms/build/x86_64/build.sh b/rpms/build/x86_64/build.sh index d2ea9c1315..82cf425943 100644 --- a/rpms/build/x86_64/build.sh +++ b/rpms/build/x86_64/build.sh @@ -163,7 +163,7 @@ function build_server(){ # buildRPM "awips2-tools buildRPM "awips2-gfesuite" build_pypies - buildLocalizationRPMs + buildLocalization buildRPM "awips2-alertviz" buildRPM "awips2-aviation-shared"