Repository: incubator-slider Updated Branches: refs/heads/feature/SLIDER-809-tomcat-app-package [created] 975c2f644
SLIDER-809 Pulling in initial tomcat app package in main tree. What is, hopefully, a working maven module that will build the app package for us. These files were enough to get a dynamically assigned port from slider and a generated server.xml to put that port in! Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/975c2f64 Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/975c2f64 Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/975c2f64 Branch: refs/heads/feature/SLIDER-809-tomcat-app-package Commit: 975c2f644050821b18b164bc0d2cf4489bdfa3aa Parents: 3fbfca9 Author: Josh Elser <[email protected]> Authored: Mon Mar 16 00:31:27 2015 -0400 Committer: Josh Elser <[email protected]> Committed: Mon Mar 16 00:31:27 2015 -0400 ---------------------------------------------------------------------- app-packages/pom.xml | 2 + app-packages/tomcat/LICENSE.txt | 206 +++++++++++++++++++ app-packages/tomcat/NOTICE.txt | 45 ++++ app-packages/tomcat/appConfig-default.json | 20 ++ app-packages/tomcat/metainfo.xml | 54 +++++ app-packages/tomcat/package/scripts/params.py | 31 +++ app-packages/tomcat/package/scripts/tomcat.py | 67 ++++++ .../tomcat/package/templates/server.xml.j2 | 142 +++++++++++++ app-packages/tomcat/pom.xml | 196 ++++++++++++++++++ app-packages/tomcat/resources-default.json | 16 ++ app-packages/tomcat/src/assembly/tomcat.xml | 78 +++++++ .../tomcat/src/license/THIRD-PARTY.properties | 35 ++++ .../tomcat/StubToForceGroovyTestsToCompile.java | 22 ++ 13 files changed, 914 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/975c2f64/app-packages/pom.xml ---------------------------------------------------------------------- diff --git a/app-packages/pom.xml b/app-packages/pom.xml index 05d7daa..f7f6619 100644 --- a/app-packages/pom.xml +++ b/app-packages/pom.xml @@ -53,6 +53,7 @@ <module>accumulo</module> <module>hbase</module> <module>storm</module> + <module>tomcat</module> </modules> </profile> @@ -85,6 +86,7 @@ <module>storm</module> <module>hbase-win</module> <module>storm-win</module> + <module>tomcat</module> </modules> </profile> http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/975c2f64/app-packages/tomcat/LICENSE.txt ---------------------------------------------------------------------- diff --git a/app-packages/tomcat/LICENSE.txt b/app-packages/tomcat/LICENSE.txt new file mode 100644 index 0000000..2491100 --- /dev/null +++ b/app-packages/tomcat/LICENSE.txt @@ -0,0 +1,206 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. + + +The binary distribution of the Apache Slider App Package for Apache Tomcat +bundles a binary distribution of Apache Tomcat 8.0.20. http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/975c2f64/app-packages/tomcat/NOTICE.txt ---------------------------------------------------------------------- diff --git a/app-packages/tomcat/NOTICE.txt b/app-packages/tomcat/NOTICE.txt new file mode 100644 index 0000000..4285cd7 --- /dev/null +++ b/app-packages/tomcat/NOTICE.txt @@ -0,0 +1,45 @@ +Apache Slider (incubating) -- Apache Tomcat App Package +Copyright 2001-2015 The Apache Software Foundation + +This product includes software developed at +The Apache Software Foundation (http://www.apache.org/). + +The Windows Installer is built with the Nullsoft +Scriptable Install System (NSIS), which is +open source software. The original software and +related information is available at +http://nsis.sourceforge.net. + +Java compilation software for JSP pages is provided by Eclipse, +which is open source software. The original software and +related information is available at +http://www.eclipse.org. + +For the bayeux implementation +The org.apache.cometd.bayeux API is derivative work originating at the Dojo Foundation +* Copyright 2007-2008 Guy Molinari +* Copyright 2007-2008 Filip Hanik +* Copyright 2007 Dojo Foundation +* Copyright 2007 Mort Bay Consulting Pty. Ltd. + +The original XML Schemas for Java EE Deployment Descriptors: + - javaee_5.xsd + - javaee_web_services_1_2.xsd + - javaee_web_services_client_1_2.xsd + - javaee_6.xsd + - javaee_web_services_1_3.xsd + - javaee_web_services_client_1_3.xsd + - jsp_2_2.xsd + - web-app_3_0.xsd + - web-common_3_0.xsd + - web-fragment_3_0.xsd + - javaee_7.xsd + - javaee_web_services_1_4.xsd + - javaee_web_services_client_1_4.xsd + - jsp_2_3.xsd + - web-app_3_1.xsd + - web-common_3_1.xsd + - web-fragment_3_1.xsd + +may be obtained from: +http://www.oracle.com/webfolder/technetwork/jsc/xml/ns/javaee/index.html http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/975c2f64/app-packages/tomcat/appConfig-default.json ---------------------------------------------------------------------- diff --git a/app-packages/tomcat/appConfig-default.json b/app-packages/tomcat/appConfig-default.json new file mode 100644 index 0000000..8ee9e49 --- /dev/null +++ b/app-packages/tomcat/appConfig-default.json @@ -0,0 +1,20 @@ +{ + "schema": "http://example.org/specification/v2.0.0", + "metadata": { + }, + "global": { + "application.def": ".slider/package/tomcat/slider-tomcat-app-package.zip", + "java_home": "/usr/jdk64/jdk1.7.0_67", + + "site.global.xmx_val": "1g", + "site.global.xms_val": "128m", + "site.global.memory_val": "200M", + "site.server-xml.http.port":"${TOMCAT.ALLOCATED_PORT}", + "site.server-xml.connection.timeout":"20000" + }, + "components": { + "slider-appmaster": { + "jvm.heapsize": "128M" + } + } +} http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/975c2f64/app-packages/tomcat/metainfo.xml ---------------------------------------------------------------------- diff --git a/app-packages/tomcat/metainfo.xml b/app-packages/tomcat/metainfo.xml new file mode 100644 index 0000000..6710ef1 --- /dev/null +++ b/app-packages/tomcat/metainfo.xml @@ -0,0 +1,54 @@ +<metainfo> + <schemaVersion>2.0</schemaVersion> + <application> + <name>TOMCAT</name> + <comment>Apache Tomcat</comment> + <version>0.0.1</version> + <exportedConfigs>None</exportedConfigs> + <exportGroups> + <exportGroup> + <name>Servers</name> + <exports> + <export> + <name>host_port</name> + <value>${TOMCAT_HOST}:${site.global.listen_port}</value> + </export> + </exports> + </exportGroup> + </exportGroups> + <components> + <component> + <name>TOMCAT</name> + <category>MASTER</category> + <compExports>Servers-host_port</compExports> + <commandScript> + <script>scripts/tomcat.py</script> + <scriptType>PYTHON</scriptType> + </commandScript> + </component> + </components> + <osSpecifics> + <osSpecific> + <osType>any</osType> + <packages> + <package> + <type>tarball</type> + <name>files/apache-tomcat.tar.gz</name> + </package> + </packages> + </osSpecific> + </osSpecifics> + + <exportGroups> + <exportGroup> + <name>QuickLinks</name> + <exports> + <export> + <name>HTTP</name> + <value>http://${TOMCAT_HOST}:${site.global.listen_port}</value> + </export> + </exports> + </exportGroup> + </exportGroups> + </application> +</metainfo> http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/975c2f64/app-packages/tomcat/package/scripts/params.py ---------------------------------------------------------------------- diff --git a/app-packages/tomcat/package/scripts/params.py b/app-packages/tomcat/package/scripts/params.py new file mode 100644 index 0000000..a1943d5 --- /dev/null +++ b/app-packages/tomcat/package/scripts/params.py @@ -0,0 +1,31 @@ +#!/usr/bin/env python +""" +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you 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. + +""" + +from resource_management import * + +# server configurations +config = Script.get_config() + +app_root = config['configurations']['global']['app_root'] +java64_home = config['hostLevelParams']['java_home'] +pid_file = config['configurations']['global']['pid_file'] + +http_port = config['configurations']['server-xml']['http.port'] +connection_timeout = config['configurations']['server-xml']['connection.timeout'] http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/975c2f64/app-packages/tomcat/package/scripts/tomcat.py ---------------------------------------------------------------------- diff --git a/app-packages/tomcat/package/scripts/tomcat.py b/app-packages/tomcat/package/scripts/tomcat.py new file mode 100644 index 0000000..35599a9 --- /dev/null +++ b/app-packages/tomcat/package/scripts/tomcat.py @@ -0,0 +1,67 @@ +#!/usr/bin/env python +""" +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you 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. + +""" + +import sys +from resource_management import * + +class Tomcat(Script): + def install(self, env): + self.install_packages(env) + pass + + def configure(self, env): + import params + env.set_params(params) + File(format("{conf_dir}/server.xml"), content=Template("server.xml.j2")) + + def start(self, env): + import params + self.configure(env) + tomcat_pid = format('{app_root}/catalina.pid') + process_cmd = format('env JAVA_HOME={java64_home} CATALINA_PID=' + tomcat_pid + ' {app_root}/apache-tomcat-*/bin/catalina.sh start') + + Execute(process_cmd, + logoutput=False, + wait_for_finish=True, + pid_file=tomcat_pid, + poll_after = 15 + ) + + def stop(self, env): + import params + self.configure(env) + tomcat_pid = format('{app_root}/catalina.pid') + process_cmd = format('env JAVA_HOME={java64_home} CATALINA_PID=' + tomcat_pid + ' {app_root}/apache-tomcat-*/bin/catalina.sh stop') + + Execute(process_cmd, + logoutput=True, + wait_for_finish=True, + pid_file=tomcat_pid, + poll_after = 15 + ) + + def status(self, env): + import params + self.configure(env) + tomcat_pid = format('{app_root}/catalina.pid') + check_process_status(tomcat_pid) + +if __name__ == "__main__": + Tomcat().execute() http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/975c2f64/app-packages/tomcat/package/templates/server.xml.j2 ---------------------------------------------------------------------- diff --git a/app-packages/tomcat/package/templates/server.xml.j2 b/app-packages/tomcat/package/templates/server.xml.j2 new file mode 100644 index 0000000..54f50d5 --- /dev/null +++ b/app-packages/tomcat/package/templates/server.xml.j2 @@ -0,0 +1,142 @@ +<?xml version='1.0' encoding='utf-8'?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You 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. +--> +<!-- Note: A "Server" is not itself a "Container", so you may not + define subcomponents such as "Valves" at this level. + Documentation at /docs/config/server.html + --> +<!-- Disable the shutdown port --> +<Server port="-1" shutdown="SHUTDOWN"> + <Listener className="org.apache.catalina.startup.VersionLoggerListener" /> + <!-- Security listener. Documentation at /docs/config/listeners.html + <Listener className="org.apache.catalina.security.SecurityListener" /> + --> + <!--APR library loader. Documentation at /docs/apr.html --> + <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" /> + <!-- Prevent memory leaks due to use of particular java/javax APIs--> + <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" /> + <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" /> + <Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" /> + + <!-- Global JNDI resources + Documentation at /docs/jndi-resources-howto.html + --> + <GlobalNamingResources> + <!-- Editable user database that can also be used by + UserDatabaseRealm to authenticate users + --> + <Resource name="UserDatabase" auth="Container" + type="org.apache.catalina.UserDatabase" + description="User database that can be updated and saved" + factory="org.apache.catalina.users.MemoryUserDatabaseFactory" + pathname="conf/tomcat-users.xml" /> + </GlobalNamingResources> + + <!-- A "Service" is a collection of one or more "Connectors" that share + a single "Container" Note: A "Service" is not itself a "Container", + so you may not define subcomponents such as "Valves" at this level. + Documentation at /docs/config/service.html + --> + <Service name="Catalina"> + + <!--The connectors can use a shared executor, you can define one or more named thread pools--> + <!-- + <Executor name="tomcatThreadPool" namePrefix="catalina-exec-" + maxThreads="150" minSpareThreads="4"/> + --> + + + <!-- A "Connector" represents an endpoint by which requests are received + and responses are returned. Documentation at : + Java HTTP Connector: /docs/config/http.html (blocking & non-blocking) + Java AJP Connector: /docs/config/ajp.html + APR (HTTP/AJP) Connector: /docs/apr.html + Define a non-SSL HTTP/1.1 Connector on port 8080 + --> + <Connector port="{{http_port}}" protocol="HTTP/1.1" + connectionTimeout="{{connection_timeout}}" /> + <!-- A "Connector" using the shared thread pool--> + <!-- + <Connector executor="tomcatThreadPool" + port="8080" protocol="HTTP/1.1" + connectionTimeout="20000" + redirectPort="8443" /> + --> + <!-- Define a SSL HTTP/1.1 Connector on port 8443 + This connector uses the NIO implementation that requires the JSSE + style configuration. When using the APR/native implementation, the + OpenSSL style configuration is required as described in the APR/native + documentation --> + <!-- + <Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol" + maxThreads="150" SSLEnabled="true" scheme="https" secure="true" + clientAuth="false" sslProtocol="TLS" /> + --> + + <!-- Define an AJP 1.3 Connector on port 8009 --> + <!--Connector port="8009" protocol="AJP/1.3" redirectPort="8443" /--> + + + <!-- An Engine represents the entry point (within Catalina) that processes + every request. The Engine implementation for Tomcat stand alone + analyzes the HTTP headers included with the request, and passes them + on to the appropriate Host (virtual host). + Documentation at /docs/config/engine.html --> + + <!-- You should set jvmRoute to support load-balancing via AJP ie : + <Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm1"> + --> + <Engine name="Catalina" defaultHost="localhost"> + + <!--For clustering, please take a look at documentation at: + /docs/cluster-howto.html (simple how to) + /docs/config/cluster.html (reference documentation) --> + <!-- + <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/> + --> + + <!-- Use the LockOutRealm to prevent attempts to guess user passwords + via a brute-force attack --> + <Realm className="org.apache.catalina.realm.LockOutRealm"> + <!-- This Realm uses the UserDatabase configured in the global JNDI + resources under the key "UserDatabase". Any edits + that are performed against this UserDatabase are immediately + available for use by the Realm. --> + <Realm className="org.apache.catalina.realm.UserDatabaseRealm" + resourceName="UserDatabase"/> + </Realm> + + <Host name="localhost" appBase="webapps" + unpackWARs="true" autoDeploy="true"> + + <!-- SingleSignOn valve, share authentication between web applications + Documentation at: /docs/config/valve.html --> + <!-- + <Valve className="org.apache.catalina.authenticator.SingleSignOn" /> + --> + + <!-- Access log processes all example. + Documentation at: /docs/config/valve.html + Note: The pattern used is equivalent to using pattern="common" --> + <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" + prefix="localhost_access_log" suffix=".txt" + pattern="%h %l %u %t "%r" %s %b" /> + + </Host> + </Engine> + </Service> +</Server> http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/975c2f64/app-packages/tomcat/pom.xml ---------------------------------------------------------------------- diff --git a/app-packages/tomcat/pom.xml b/app-packages/tomcat/pom.xml new file mode 100644 index 0000000..a991316 --- /dev/null +++ b/app-packages/tomcat/pom.xml @@ -0,0 +1,196 @@ +<?xml version="1.0"?> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You 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. +--> + <parent> + <groupId>org.apache.slider.packages</groupId> + <artifactId>slider-app-packages</artifactId> + <version>0.72.0-incubating-SNAPSHOT</version> + <relativePath>../pom.xml</relativePath> + </parent> + <modelVersion>4.0.0</modelVersion> + <artifactId>slider-tomcat-app-package</artifactId> + <packaging>jar</packaging> + <name>Slider Tomcat App Package</name> + <description>Slider Tomcat App Package</description> + + <properties> + <work.dir>package-tmp</work.dir> + <app.package.name>${project.artifactId}-${pkg.version}</app.package.name> + <pkg.src>${project.build.directory}/${work.dir}</pkg.src> + <pkg.version>${project.version}</pkg.version> + <pkg.name>tomcat-${tomcat.version}.tar.gz</pkg.name> + <!-- the following properties are used for testing --> + <slider.bin.dir>../../slider-assembly/target/slider-${project.version}-all/slider-${project.version}</slider.bin.dir> + <test.app.pkg.dir>${project.build.directory}</test.app.pkg.dir> + <test.app.resources.dir>${project.build.directory}/test-config</test.app.resources.dir> + <test.client.install.dir>${project.build.directory}/${work.dir}</test.client.install.dir> + <!-- these properties are used in the default and the test appConfigs --> + <hadoop.dir>/usr/lib/hadoop</hadoop.dir> + <hdfs.dir>/usr/lib/hadoop-hdfs</hdfs.dir> + <yarn.dir>/usr/lib/hadoop-yarn</yarn.dir> + <mapred.dir>/usr/lib/hadoop-mapred</mapred.dir> + <zk.dir>/usr/lib/zookeeper</zk.dir> + <app.java.home>${java.home}</app.java.home> + <app.user>yarn</app.user> + <app.user.group>hadoop</app.user.group> + + <tomcat.version>8.0.20</tomcat.version> + </properties> + + <profiles> + <profile> + <id>hdp</id> + <properties> + <hadoop.dir>/usr/hdp/current/hadoop-client</hadoop.dir> + <hdfs.dir>/usr/hdp/current/hadoop-hdfs-client</hdfs.dir> + <yarn.dir>/usr/hdp/current/hadoop-yarn-client</yarn.dir> + <mapred.dir>/usr/hdp/current/hadoop-mapreduce-client</mapred.dir> + <zk.dir>/usr/hdp/current/zookeeper-client</zk.dir> + <slider.dir>/usr/hdp/current/slider-client</slider.dir> + </properties> + </profile> + <profile> + <id>tomcat-app-package</id> + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-assembly-plugin</artifactId> + <version>${maven-assembly-plugin.version}</version> + <configuration> + <descriptor>src/assembly/tomcat.xml</descriptor> + <appendAssemblyId>false</appendAssemblyId> + <finalName>${app.package.name}</finalName> + </configuration> + <executions> + <execution> + <id>build-app-package</id> + <phase>package</phase> + <goals> + <goal>single</goal> + </goals> + </execution> + </executions> + </plugin> + + <!--plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-antrun-plugin</artifactId> + <version>${maven-antrun-plugin.version}</version> + <executions> + <execution> + <id>copy</id> + <phase>validate</phase> + <configuration> + <target name="copy and rename file"> + <copy file="${pkg.src}/${pkg.name}" tofile="${project.build.directory}/${work.dir}/${pkg.name}" /> + </target> + </configuration> + <goals> + <goal>run</goal> + </goals> + </execution> + </executions> + </plugin--> + </plugins> + </build> + </profile> + </profiles> + + <build> + <!-- resources are filtered for dynamic updates. This gets build info in--> + <resources> + <resource> + <directory>src/test/resources</directory> + <filtering>true</filtering> + <targetPath>${test.app.resources.dir}</targetPath> + </resource> + <resource> + <directory>.</directory> + <filtering>true</filtering> + <targetPath>${test.app.resources.dir}</targetPath> + <includes> + <include>appConfig-default.json</include> + <include>resources-default.json</include> + </includes> + </resource> + </resources> + <plugins> + <plugin> + <artifactId>maven-compiler-plugin</artifactId> + <version>${maven-compiler-plugin.version}</version> + <dependencies> + <dependency> + <groupId>org.codehaus.groovy</groupId> + <artifactId>groovy-eclipse-compiler</artifactId> + <version>${groovy-eclipse-compiler.version}</version> + </dependency> + <dependency> + <groupId>org.codehaus.groovy</groupId> + <artifactId>groovy-eclipse-batch</artifactId> + <version>${groovy-eclipse-batch.version}</version> + </dependency> + </dependencies> + </plugin> + </plugins> + </build> + <dependencies> + <dependency> + <groupId>org.apache.tomcat</groupId> + <artifactId>tomcat</artifactId> + <version>${tomcat.version}</version> + <type>tar.gz</type> + </dependency> + <dependency> + <groupId>org.apache.hadoop</groupId> + <artifactId>hadoop-client</artifactId> + <version>${hadoop.version}</version> + </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.apache.slider</groupId> + <artifactId>slider-core</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.apache.slider</groupId> + <artifactId>slider-core</artifactId> + <type>test-jar</type> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.apache.slider</groupId> + <artifactId>slider-funtest</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.codehaus.groovy</groupId> + <artifactId>groovy-all</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-api</artifactId> + <scope>test</scope> + </dependency> + </dependencies> +</project> http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/975c2f64/app-packages/tomcat/resources-default.json ---------------------------------------------------------------------- diff --git a/app-packages/tomcat/resources-default.json b/app-packages/tomcat/resources-default.json new file mode 100644 index 0000000..fde881c --- /dev/null +++ b/app-packages/tomcat/resources-default.json @@ -0,0 +1,16 @@ +{ + "schema" : "http://example.org/specification/v2.0.0", + "metadata" : { + }, + "global" : { + }, + "components": { + "slider-appmaster": { + }, + "TOMCAT": { + "yarn.role.priority": "1", + "yarn.component.instances": "1", + "yarn.memory": "512" + } + } +} http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/975c2f64/app-packages/tomcat/src/assembly/tomcat.xml ---------------------------------------------------------------------- diff --git a/app-packages/tomcat/src/assembly/tomcat.xml b/app-packages/tomcat/src/assembly/tomcat.xml new file mode 100644 index 0000000..e3f0e72 --- /dev/null +++ b/app-packages/tomcat/src/assembly/tomcat.xml @@ -0,0 +1,78 @@ +<!-- + ~ Licensed to the Apache Software Foundation (ASF) under one + ~ or more contributor license agreements. See the NOTICE file + ~ distributed with this work for additional information + ~ regarding copyright ownership. The ASF licenses this file + ~ to you 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. + --> + + +<assembly + xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd"> + <id>tomcat_v${tomcat.version}</id> + <formats> + <format>zip</format> + <format>dir</format> + </formats> + <includeBaseDirectory>false</includeBaseDirectory> + + <files> + <file> + <source>appConfig-default.json</source> + <outputDirectory>/</outputDirectory> + <filtered>true</filtered> + <fileMode>0644</fileMode> + </file> + <file> + <source>metainfo.xml</source> + <outputDirectory>/</outputDirectory> + <filtered>true</filtered> + <fileMode>0644</fileMode> + </file> + <file> + <source>resources-default.json</source> + <outputDirectory>/</outputDirectory> + <filtered>true</filtered> + <fileMode>0644</fileMode> + </file> + </files> + + <dependencySets> + <dependencySet> + <outputDirectory>package/files</outputDirectory> + <directoryMode>0755</directoryMode> + <fileMode>0644</fileMode> + <includes> + <include>org.apache.tomcat:tomcat:tar.gz</include> + </includes> + </dependencySet> + </dependencySets> + + <fileSets> + <fileSet> + <directory>${project.basedir}</directory> + <outputDirectory>/</outputDirectory> + <excludes> + <exclude>pom.xml</exclude> + <exclude>src/**</exclude> + <exclude>target/**</exclude> + <exclude>appConfig-default.json</exclude> + <exclude>metainfo.xml</exclude> + </excludes> + <fileMode>0755</fileMode> + <directoryMode>0755</directoryMode> + </fileSet> + </fileSets> +</assembly> http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/975c2f64/app-packages/tomcat/src/license/THIRD-PARTY.properties ---------------------------------------------------------------------- diff --git a/app-packages/tomcat/src/license/THIRD-PARTY.properties b/app-packages/tomcat/src/license/THIRD-PARTY.properties new file mode 100644 index 0000000..9322b8f --- /dev/null +++ b/app-packages/tomcat/src/license/THIRD-PARTY.properties @@ -0,0 +1,35 @@ +# Generated by org.codehaus.mojo.license.AddThirdPartyMojo +#------------------------------------------------------------------------------- +# Already used licenses in project : +# - Apache License +# - Apache License 2.0 +# - Apache License Version 2 +# - Apache License, Version 2.0 +# - Apache Software License - Version 2.0 +# - BSD +# - CDDL + GPLv2 with classpath exception +# - CDDL 1.1 +# - CDDL License +# - Common Public License Version 1.0 +# - Eclipse Public License - Version 1.0 +# - GNU Lesser General Public License (LGPL), Version 2.1 +# - GPL2 w/ CPE +# - MIT License +# - New BSD License +# - New BSD license +# - Public Domain +# - Revised BSD +# - The Apache Software License, Version 2.0 +# - The BSD 3-Clause License +# - The BSD License +#------------------------------------------------------------------------------- +# Please fill the missing licenses for dependencies : +# +# +#Mon Jan 26 16:00:07 GMT 2015 +asm--asm--3.1=The BSD 3-Clause License +commons-beanutils--commons-beanutils--1.7.0=The Apache Software License, Version 2.0 +javax.servlet--servlet-api--2.5=CDDL License +javax.servlet.jsp--jsp-api--2.1=CDDL License +org.apache.zookeeper--zookeeper--3.4.6=The Apache Software License, Version 2.0 +org.codehaus.jettison--jettison--1.1=The Apache Software License, Version 2.0 http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/975c2f64/app-packages/tomcat/src/test/java/org/apache/slider/funtest/tomcat/StubToForceGroovyTestsToCompile.java ---------------------------------------------------------------------- diff --git a/app-packages/tomcat/src/test/java/org/apache/slider/funtest/tomcat/StubToForceGroovyTestsToCompile.java b/app-packages/tomcat/src/test/java/org/apache/slider/funtest/tomcat/StubToForceGroovyTestsToCompile.java new file mode 100644 index 0000000..7d289e0 --- /dev/null +++ b/app-packages/tomcat/src/test/java/org/apache/slider/funtest/tomcat/StubToForceGroovyTestsToCompile.java @@ -0,0 +1,22 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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. + */ + +package org.apache.slider.funtest.accumulo; + +public class StubToForceGroovyTestsToCompile { +}
