You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hawq.apache.org by shivzone <gi...@git.apache.org> on 2017/01/26 01:15:11 UTC

[GitHub] incubator-hawq pull request #1102: HAWQ-1297. Make PXF install ready from so...

GitHub user shivzone opened a pull request:

    https://github.com/apache/incubator-hawq/pull/1102

    HAWQ-1297. Make PXF install ready from source code

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/apache/incubator-hawq HAWQ-1297

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-hawq/pull/1102.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1102
    
----
commit 2c6f4ed5598a49ecac03341230cdcb299c43db3a
Author: Shivram Mani <sh...@gmail.com>
Date:   2017-01-26T01:13:29Z

    HAWQ-1297. Update PXF build and service scripts to make it installable from source code

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request #1102: HAWQ-1297. Make PXF install ready from so...

Posted by kavinderd <gi...@git.apache.org>.
Github user kavinderd commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/1102#discussion_r98057448
  
    --- Diff: pxf/pxf-service/src/scripts/pxf-service ---
    @@ -193,39 +210,83 @@ function doInit()
     		return 0
     	fi
     
    -	createInstance || return 1
    +    createInstance || return 1
     	configureInstance || return 1
     	deployWebapp || return 1
     }
     
    +#
    +# patchWebapp patches the webapp config files
    +# patch applied only if PXF_HOME is defined
    +#
    +function patchWebapp()
    +{
    +    if [ -z $PXF_HOME ]; then
    +        # webapp doesn't require patch
    +        return 0
    +    fi
    +    pushd $instance_root/$instance_name/webapps || return 1
    +    rm -rf pxf
    +    mkdir pxf
    +    cd pxf
    +    unzip -q ../pxf.war
    +    popd
    +
    +    context_file=$instance_root/$instance_name/webapps/pxf/META-INF/context.xml
    +    cat $context_file | \
    +    sed  -e "s:classpathFiles=\"[a-zA-Z0-9\/\;.-]*\":classpathFiles=\"$PXF_HOME\/conf\/pxf-private.classpath\":" \
    +    -e "s:secondaryClasspathFiles=\"[a-zA-Z0-9\/\;.-]*\":secondaryClasspathFiles=\"$PXF_HOME\/conf\/pxf-public.classpath\":" > context.xml.tmp
    +    mv context.xml.tmp $context_file
    +
    +    web_file=$instance_root/$instance_name/webapps/pxf/WEB-INF/web.xml
    +    cat $web_file | \
    +    sed "s:<param-value>.*pxf-log4j.properties<\/param-value>:<param-value>$PXF_HOME\/conf\/pxf-log4j.properties<\/param-value>:" > web.xml.tmp
    +    mv web.xml.tmp $web_file
    +}
    +
    +function commandWebapp()
    +{
    +    command=$1
    +    pushd $instance_root
    +    su $pxf_user -c "$instance_root/$instance_name/bin/catalina.sh $command"
    +    if [ $? -ne 0 ]; then
    +        return 1
    +    fi
    +    popd
    +}
    +
     # 
    -# doStartStop handles start/stop commands
    -# commands are executed as the user $pxf_user
    +# doStart handles start command
    +# command is executed as the user $pxf_user
     #
     # after start, uses checkWebapp to verify the PXF webapp was loaded
     # successfully
     #
    -function doStartStop()
    +function doStart()
     {
    -	command=$1
    -
     	instanceExists
     	if [ $? -ne 0 ]; then
     		echo ERROR: cant find PXF instance, maybe call init?
     		return 1
     	fi
    +	patchWebapp || return 1
    +    commandWebapp start || return 1
    +    checkWebapp 300 || return 1
    +}
     
    -	pushd $instance_root
    -	su $pxf_user -c "$instance_root/$instance_name/bin/catalina.sh $command"
    +#
    +# doStart handles stop command
    +# command is executed as the user $pxf_user
    +#
    +#
    +function doStop()
    +{
    +	instanceExists
     	if [ $? -ne 0 ]; then
    +		echo ERROR: cant find PXF instance, maybe call init?
     		return 1
    -	fi 
    -	popd
    -	
    -	if [ "$command" = "start" ]; then
    -		# try to connect for 5 minutes
    -		checkWebapp 300 || return 1
     	fi
    +    commandWebapp stop || return 1
    --- End diff --
    
    Indentation off compared to the rest of the function


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request #1102: HAWQ-1297. Make PXF install ready from so...

Posted by kavinderd <gi...@git.apache.org>.
Github user kavinderd commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/1102#discussion_r98051363
  
    --- Diff: pxf/Makefile ---
    @@ -65,3 +75,9 @@ doc:
     .PHONY: tomcat
     tomcat:
     	./gradlew tomcatRpm $(BUILD_PARAMS)
    +
    +install:
    +	./gradlew install $(BUILD_PARAMS)
    +
    +
    +
    --- End diff --
    
    Remove whitespace


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request #1102: HAWQ-1297. Make PXF install ready from so...

Posted by kavinderd <gi...@git.apache.org>.
Github user kavinderd commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/1102#discussion_r98055597
  
    --- Diff: pxf/pxf-service/src/scripts/pxf-service ---
    @@ -40,6 +34,29 @@ else
     	source $env_script
     fi
     
    +pxf_user=$PXF_USER
    +instance_port=$PXF_PORT
    +instance_name=pxf-service
    +
    +if [ -z $PXF_HOME ]; then
    +    # RPM based setup
    +    pxf_root=/usr/lib/pxf
    +    tomcat_root=/opt/apache-tomcat
    +    tomcat_templates=/opt/pxf/tomcat-templates
    +    instance_root=/var/pxf
    +    instance_owner=$pxf_user:$pxf_user
    +else
    +    # OSS/Source code based setup
    +    pxf_root=$PXF_HOME/lib
    +    tomcat_root=$PXF_HOME/apache-tomcat
    +    tomcat_templates=$PXF_HOME/tomcat-templates
    +    instance_root=$PXF_HOME
    +    instance_owner=$pxf_user
    +fi
    +
    +curl=`which curl`
    --- End diff --
    
    Maybe check that this command returns a non-null value


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request #1102: HAWQ-1297. Make PXF install ready from so...

Posted by kavinderd <gi...@git.apache.org>.
Github user kavinderd commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/1102#discussion_r98058834
  
    --- Diff: pxf/pxf-service/src/scripts/pxf-service ---
    @@ -193,39 +210,83 @@ function doInit()
     		return 0
     	fi
     
    -	createInstance || return 1
    +    createInstance || return 1
     	configureInstance || return 1
     	deployWebapp || return 1
     }
     
    +#
    +# patchWebapp patches the webapp config files
    +# patch applied only if PXF_HOME is defined
    +#
    +function patchWebapp()
    +{
    +    if [ -z $PXF_HOME ]; then
    +        # webapp doesn't require patch
    +        return 0
    +    fi
    +    pushd $instance_root/$instance_name/webapps || return 1
    +    rm -rf pxf
    +    mkdir pxf
    +    cd pxf
    +    unzip -q ../pxf.war
    +    popd
    +
    +    context_file=$instance_root/$instance_name/webapps/pxf/META-INF/context.xml
    +    cat $context_file | \
    +    sed  -e "s:classpathFiles=\"[a-zA-Z0-9\/\;.-]*\":classpathFiles=\"$PXF_HOME\/conf\/pxf-private.classpath\":" \
    +    -e "s:secondaryClasspathFiles=\"[a-zA-Z0-9\/\;.-]*\":secondaryClasspathFiles=\"$PXF_HOME\/conf\/pxf-public.classpath\":" > context.xml.tmp
    +    mv context.xml.tmp $context_file
    +
    +    web_file=$instance_root/$instance_name/webapps/pxf/WEB-INF/web.xml
    +    cat $web_file | \
    +    sed "s:<param-value>.*pxf-log4j.properties<\/param-value>:<param-value>$PXF_HOME\/conf\/pxf-log4j.properties<\/param-value>:" > web.xml.tmp
    +    mv web.xml.tmp $web_file
    +}
    +
    +function commandWebapp()
    +{
    +    command=$1
    +    pushd $instance_root
    +    su $pxf_user -c "$instance_root/$instance_name/bin/catalina.sh $command"
    +    if [ $? -ne 0 ]; then
    +        return 1
    +    fi
    +    popd
    +}
    +
     # 
    -# doStartStop handles start/stop commands
    -# commands are executed as the user $pxf_user
    +# doStart handles start command
    +# command is executed as the user $pxf_user
     #
     # after start, uses checkWebapp to verify the PXF webapp was loaded
     # successfully
     #
    -function doStartStop()
    +function doStart()
     {
    -	command=$1
    -
     	instanceExists
     	if [ $? -ne 0 ]; then
     		echo ERROR: cant find PXF instance, maybe call init?
     		return 1
     	fi
    +	patchWebapp || return 1
    +    commandWebapp start || return 1
    +    checkWebapp 300 || return 1
    +}
     
    -	pushd $instance_root
    -	su $pxf_user -c "$instance_root/$instance_name/bin/catalina.sh $command"
    +#
    +# doStart handles stop command
    +# command is executed as the user $pxf_user
    +#
    +#
    +function doStop()
    +{
    +	instanceExists
     	if [ $? -ne 0 ]; then
    +		echo ERROR: cant find PXF instance, maybe call init?
    --- End diff --
    
    quote the string just to be safe


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq issue #1102: HAWQ-1297. Make PXF install ready from source co...

Posted by shivzone <gi...@git.apache.org>.
Github user shivzone commented on the issue:

    https://github.com/apache/incubator-hawq/pull/1102
  
    https://issues.apache.org/jira/browse/HAWQ-1297


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request #1102: HAWQ-1297. Make PXF install ready from so...

Posted by kavinderd <gi...@git.apache.org>.
Github user kavinderd commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/1102#discussion_r98056223
  
    --- Diff: pxf/pxf-service/src/scripts/pxf-service ---
    @@ -193,39 +210,83 @@ function doInit()
     		return 0
     	fi
     
    -	createInstance || return 1
    +    createInstance || return 1
     	configureInstance || return 1
     	deployWebapp || return 1
     }
     
    +#
    +# patchWebapp patches the webapp config files
    +# patch applied only if PXF_HOME is defined
    +#
    +function patchWebapp()
    +{
    +    if [ -z $PXF_HOME ]; then
    +        # webapp doesn't require patch
    +        return 0
    +    fi
    +    pushd $instance_root/$instance_name/webapps || return 1
    +    rm -rf pxf
    +    mkdir pxf
    +    cd pxf
    +    unzip -q ../pxf.war
    +    popd
    +
    +    context_file=$instance_root/$instance_name/webapps/pxf/META-INF/context.xml
    +    cat $context_file | \
    +    sed  -e "s:classpathFiles=\"[a-zA-Z0-9\/\;.-]*\":classpathFiles=\"$PXF_HOME\/conf\/pxf-private.classpath\":" \
    +    -e "s:secondaryClasspathFiles=\"[a-zA-Z0-9\/\;.-]*\":secondaryClasspathFiles=\"$PXF_HOME\/conf\/pxf-public.classpath\":" > context.xml.tmp
    +    mv context.xml.tmp $context_file
    +
    +    web_file=$instance_root/$instance_name/webapps/pxf/WEB-INF/web.xml
    +    cat $web_file | \
    +    sed "s:<param-value>.*pxf-log4j.properties<\/param-value>:<param-value>$PXF_HOME\/conf\/pxf-log4j.properties<\/param-value>:" > web.xml.tmp
    +    mv web.xml.tmp $web_file
    +}
    +
    +function commandWebapp()
    +{
    +    command=$1
    +    pushd $instance_root
    +    su $pxf_user -c "$instance_root/$instance_name/bin/catalina.sh $command"
    +    if [ $? -ne 0 ]; then
    +        return 1
    +    fi
    +    popd
    +}
    +
     # 
    -# doStartStop handles start/stop commands
    -# commands are executed as the user $pxf_user
    +# doStart handles start command
    +# command is executed as the user $pxf_user
     #
     # after start, uses checkWebapp to verify the PXF webapp was loaded
     # successfully
     #
    -function doStartStop()
    +function doStart()
     {
    -	command=$1
    -
     	instanceExists
     	if [ $? -ne 0 ]; then
     		echo ERROR: cant find PXF instance, maybe call init?
     		return 1
     	fi
    +	patchWebapp || return 1
    +    commandWebapp start || return 1
    +    checkWebapp 300 || return 1
    --- End diff --
    
    Indentation of line 273, 274 doesn't match rest of the function


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request #1102: HAWQ-1297. Make PXF install ready from so...

Posted by shivzone <gi...@git.apache.org>.
Github user shivzone closed the pull request at:

    https://github.com/apache/incubator-hawq/pull/1102


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request #1102: HAWQ-1297. Make PXF install ready from so...

Posted by sansanichfb <gi...@git.apache.org>.
Github user sansanichfb commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/1102#discussion_r97922847
  
    --- Diff: pxf/pxf-service/src/main/resources/pxf-private.classpath ---
    @@ -0,0 +1,67 @@
    +##################################################################
    --- End diff --
    
    Would RAT complain about absence of Apache header?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request #1102: HAWQ-1297. Make PXF install ready from so...

Posted by kavinderd <gi...@git.apache.org>.
Github user kavinderd commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/1102#discussion_r98055816
  
    --- Diff: pxf/pxf-service/src/scripts/pxf-service ---
    @@ -193,39 +210,83 @@ function doInit()
     		return 0
     	fi
     
    -	createInstance || return 1
    +    createInstance || return 1
    --- End diff --
    
    indentation


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request #1102: HAWQ-1297. Make PXF install ready from so...

Posted by sansanichfb <gi...@git.apache.org>.
Github user sansanichfb commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/1102#discussion_r97922731
  
    --- Diff: pxf/pxf-service/src/scripts/pxf-service ---
    @@ -193,39 +210,83 @@ function doInit()
     		return 0
     	fi
     
    -	createInstance || return 1
    +    createInstance || return 1
     	configureInstance || return 1
     	deployWebapp || return 1
     }
     
    +#
    +# patchWebapp patches the webapp config files
    +# patch applied only if PXF_HOME is defined
    +#
    +function patchWebapp()
    +{
    +    if [ -z $PXF_HOME ]; then
    +        # webapp doesn't require patch
    +        return 0
    +    fi
    +    pushd $instance_root/$instance_name/webapps || return 1
    +    rm -rf pxf
    +    mkdir pxf
    +    cd pxf
    +    unzip -q ../pxf.war
    +    popd
    +
    +    context_file=$instance_root/$instance_name/webapps/pxf/META-INF/context.xml
    +    cat $context_file | \
    +    sed  -e "s:classpathFiles=\"[a-zA-Z0-9\/\;.-]*\":classpathFiles=\"$PXF_HOME\/conf\/pxf-private.classpath\":" \
    --- End diff --
    
    Why not combine two steps into one?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---