From 1aeae8cec7dcfe214643f43c16376aa454b9e26a Mon Sep 17 00:00:00 2001 From: ludovic Champenois Date: Thu, 28 Apr 2016 16:25:06 -0700 Subject: [PATCH 01/16] Upgrading to use the 1.9.36 GAE API. --- appengine-java-logging/pom.xml | 2 +- appengine-managed-runtime/pom.xml | 4 ++-- jetty9-base/pom.xml | 2 +- jetty9-compat-base/pom.xml | 2 +- jetty9-compat/pom.xml | 2 +- jetty9/pom.xml | 2 +- openjdk8/pom.xml | 2 +- pom.xml | 7 +++++-- testwebapp/pom.xml | 2 +- 9 files changed, 14 insertions(+), 11 deletions(-) diff --git a/appengine-java-logging/pom.xml b/appengine-java-logging/pom.xml index 585a7ea..37b193c 100644 --- a/appengine-java-logging/pom.xml +++ b/appengine-java-logging/pom.xml @@ -21,7 +21,7 @@ com.google.appengine appengine-java-vm-runtime - 1.9.34-SNAPSHOT + 1.9.36-SNAPSHOT ../pom.xml Google App Engine Logging Support diff --git a/appengine-managed-runtime/pom.xml b/appengine-managed-runtime/pom.xml index 024aa42..061f419 100644 --- a/appengine-managed-runtime/pom.xml +++ b/appengine-managed-runtime/pom.xml @@ -21,7 +21,7 @@ com.google.appengine appengine-java-vm-runtime - 1.9.34-SNAPSHOT + 1.9.36-SNAPSHOT ../pom.xml Google App Engine Runtime Utilities @@ -36,7 +36,7 @@ com.google.appengine appengine-java-logging - 1.9.34-SNAPSHOT + 1.9.36-SNAPSHOT com.google.appengine diff --git a/jetty9-base/pom.xml b/jetty9-base/pom.xml index c50bddb..a6a8ed3 100644 --- a/jetty9-base/pom.xml +++ b/jetty9-base/pom.xml @@ -21,7 +21,7 @@ com.google.appengine appengine-java-vm-runtime - 1.9.34-SNAPSHOT + 1.9.36-SNAPSHOT ../pom.xml Google App Engine Image Jetty (jetty9-base) diff --git a/jetty9-compat-base/pom.xml b/jetty9-compat-base/pom.xml index 44acea9..c3357f2 100644 --- a/jetty9-compat-base/pom.xml +++ b/jetty9-compat-base/pom.xml @@ -21,7 +21,7 @@ com.google.appengine appengine-java-vm-runtime - 1.9.34-SNAPSHOT + 1.9.36-SNAPSHOT ../pom.xml Google App Engine Container with GAE Compatibility (jetty9-compat-base) diff --git a/jetty9-compat/pom.xml b/jetty9-compat/pom.xml index 7fed28a..94099bc 100644 --- a/jetty9-compat/pom.xml +++ b/jetty9-compat/pom.xml @@ -21,7 +21,7 @@ com.google.appengine appengine-java-vm-runtime - 1.9.34-SNAPSHOT + 1.9.36-SNAPSHOT ../pom.xml Google App Engine Image with GAE Compatibility (jetty9-compat) diff --git a/jetty9/pom.xml b/jetty9/pom.xml index 54f16cf..766e146 100644 --- a/jetty9/pom.xml +++ b/jetty9/pom.xml @@ -13,7 +13,7 @@ com.google.appengine appengine-java-vm-runtime - 1.9.34-SNAPSHOT + 1.9.36-SNAPSHOT ../pom.xml Google App Engine Image Jetty (jetty9) diff --git a/openjdk8/pom.xml b/openjdk8/pom.xml index dcc0bec..a562a35 100644 --- a/openjdk8/pom.xml +++ b/openjdk8/pom.xml @@ -21,7 +21,7 @@ com.google.appengine appengine-java-vm-runtime - 1.9.34-SNAPSHOT + 1.9.36-SNAPSHOT ../pom.xml Google App Engine Image for OpenJDK (openjdk8) diff --git a/pom.xml b/pom.xml index b034f7d..fb5cfa3 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ com.google.appengine appengine-java-vm-runtime - 1.9.34-SNAPSHOT + 1.9.36-SNAPSHOT pom Google App Engine Runtime Parent @@ -33,7 +33,7 @@ UTF-8 yyyyMMddHHmm 9.3.8.v20160314 - 1.9.34 + 1.9.36 async- @@ -126,6 +126,9 @@ com.spotify docker-maven-plugin 0.3.2 + + unix:///var/run/docker.sock + diff --git a/testwebapp/pom.xml b/testwebapp/pom.xml index 99daf56..9c0baac 100644 --- a/testwebapp/pom.xml +++ b/testwebapp/pom.xml @@ -21,7 +21,7 @@ com.google.appengine appengine-java-vm-runtime - 1.9.34-SNAPSHOT + 1.9.36-SNAPSHOT ../pom.xml Compatibility test application From 7033234b4e7c6e31a0a7e9260e26abe9c854af1f Mon Sep 17 00:00:00 2001 From: ludovic Champenois Date: Thu, 28 Apr 2016 16:37:39 -0700 Subject: [PATCH 02/16] remove Docker Beta for mac settings. --- openjdk8/src/main/docker/Dockerfile | 2 +- pom.xml | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/openjdk8/src/main/docker/Dockerfile b/openjdk8/src/main/docker/Dockerfile index fabe17a..1c9be36 100644 --- a/openjdk8/src/main/docker/Dockerfile +++ b/openjdk8/src/main/docker/Dockerfile @@ -28,7 +28,7 @@ RUN echo 'deb http://httpredir.debian.org/debian jessie-backports main' > /etc/a && rm /var/lib/apt/lists/*_* # workaround for https://bugs.debian.org/775775 -RUN /var/lib/dpkg/info/ca-certificates-java.postinst configure +#RUN /var/lib/dpkg/info/ca-certificates-java.postinst configure # Upgrade to OpenSSL 1.0.2 (via sid) ADD sid.list /etc/apt/sources.list.d/ diff --git a/pom.xml b/pom.xml index fb5cfa3..81a8771 100644 --- a/pom.xml +++ b/pom.xml @@ -126,9 +126,6 @@ com.spotify docker-maven-plugin 0.3.2 - - unix:///var/run/docker.sock - From 065ec09a6bac0be5286a28f7aee2a013e371f1ee Mon Sep 17 00:00:00 2001 From: ludovic Champenois Date: Thu, 28 Apr 2016 16:43:32 -0700 Subject: [PATCH 03/16] Revert temp change.. Sorry. --- openjdk8/src/main/docker/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openjdk8/src/main/docker/Dockerfile b/openjdk8/src/main/docker/Dockerfile index 1c9be36..fabe17a 100644 --- a/openjdk8/src/main/docker/Dockerfile +++ b/openjdk8/src/main/docker/Dockerfile @@ -28,7 +28,7 @@ RUN echo 'deb http://httpredir.debian.org/debian jessie-backports main' > /etc/a && rm /var/lib/apt/lists/*_* # workaround for https://bugs.debian.org/775775 -#RUN /var/lib/dpkg/info/ca-certificates-java.postinst configure +RUN /var/lib/dpkg/info/ca-certificates-java.postinst configure # Upgrade to OpenSSL 1.0.2 (via sid) ADD sid.list /etc/apt/sources.list.d/ From 1d8f77d735aa4039870f5ed850a663efba255d77 Mon Sep 17 00:00:00 2001 From: ludovic Champenois Date: Wed, 4 May 2016 17:21:12 -0700 Subject: [PATCH 04/16] Upgrading to use the 1.9.37 GAE APIs. --- appengine-managed-runtime/pom.xml | 4 ++-- jetty9-base/pom.xml | 2 +- jetty9-compat-base/pom.xml | 2 +- jetty9-compat/pom.xml | 2 +- jetty9/pom.xml | 2 +- openjdk8/pom.xml | 2 +- pom.xml | 2 +- testwebapp/pom.xml | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/appengine-managed-runtime/pom.xml b/appengine-managed-runtime/pom.xml index 061f419..1543bd6 100644 --- a/appengine-managed-runtime/pom.xml +++ b/appengine-managed-runtime/pom.xml @@ -21,7 +21,7 @@ com.google.appengine appengine-java-vm-runtime - 1.9.36-SNAPSHOT + 1.9.37-SNAPSHOT ../pom.xml Google App Engine Runtime Utilities @@ -36,7 +36,7 @@ com.google.appengine appengine-java-logging - 1.9.36-SNAPSHOT + 1.9.37-SNAPSHOT com.google.appengine diff --git a/jetty9-base/pom.xml b/jetty9-base/pom.xml index a6a8ed3..e4645ba 100644 --- a/jetty9-base/pom.xml +++ b/jetty9-base/pom.xml @@ -21,7 +21,7 @@ com.google.appengine appengine-java-vm-runtime - 1.9.36-SNAPSHOT + 1.9.37-SNAPSHOT ../pom.xml Google App Engine Image Jetty (jetty9-base) diff --git a/jetty9-compat-base/pom.xml b/jetty9-compat-base/pom.xml index c3357f2..61b9aab 100644 --- a/jetty9-compat-base/pom.xml +++ b/jetty9-compat-base/pom.xml @@ -21,7 +21,7 @@ com.google.appengine appengine-java-vm-runtime - 1.9.36-SNAPSHOT + 1.9.37-SNAPSHOT ../pom.xml Google App Engine Container with GAE Compatibility (jetty9-compat-base) diff --git a/jetty9-compat/pom.xml b/jetty9-compat/pom.xml index 94099bc..b8e70de 100644 --- a/jetty9-compat/pom.xml +++ b/jetty9-compat/pom.xml @@ -21,7 +21,7 @@ com.google.appengine appengine-java-vm-runtime - 1.9.36-SNAPSHOT + 1.9.37-SNAPSHOT ../pom.xml Google App Engine Image with GAE Compatibility (jetty9-compat) diff --git a/jetty9/pom.xml b/jetty9/pom.xml index 766e146..4e487dd 100644 --- a/jetty9/pom.xml +++ b/jetty9/pom.xml @@ -13,7 +13,7 @@ com.google.appengine appengine-java-vm-runtime - 1.9.36-SNAPSHOT + 1.9.37-SNAPSHOT ../pom.xml Google App Engine Image Jetty (jetty9) diff --git a/openjdk8/pom.xml b/openjdk8/pom.xml index a562a35..18e005b 100644 --- a/openjdk8/pom.xml +++ b/openjdk8/pom.xml @@ -21,7 +21,7 @@ com.google.appengine appengine-java-vm-runtime - 1.9.36-SNAPSHOT + 1.9.37-SNAPSHOT ../pom.xml Google App Engine Image for OpenJDK (openjdk8) diff --git a/pom.xml b/pom.xml index 81a8771..d416c7c 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,7 @@ UTF-8 yyyyMMddHHmm 9.3.8.v20160314 - 1.9.36 + 1.9.37 async- diff --git a/testwebapp/pom.xml b/testwebapp/pom.xml index 9c0baac..bc7d106 100644 --- a/testwebapp/pom.xml +++ b/testwebapp/pom.xml @@ -21,7 +21,7 @@ com.google.appengine appengine-java-vm-runtime - 1.9.36-SNAPSHOT + 1.9.37-SNAPSHOT ../pom.xml Compatibility test application From 1e12b0d184765e1683f4c802f20efccb4ee1bb8d Mon Sep 17 00:00:00 2001 From: ludovic Champenois Date: Wed, 4 May 2016 17:31:28 -0700 Subject: [PATCH 05/16] Upgrading to use the 1.9.37 GAE APIs. --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d416c7c..beae874 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ com.google.appengine appengine-java-vm-runtime - 1.9.36-SNAPSHOT + 1.9.37-SNAPSHOT pom Google App Engine Runtime Parent From 076199cbc2fdf538f0e53f6b6beffb0adfc0f0f1 Mon Sep 17 00:00:00 2001 From: ludovic Champenois Date: Wed, 4 May 2016 17:39:43 -0700 Subject: [PATCH 06/16] Upgrading to use the 1.9.37 GAE APIs. --- appengine-java-logging/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appengine-java-logging/pom.xml b/appengine-java-logging/pom.xml index 37b193c..4afea12 100644 --- a/appengine-java-logging/pom.xml +++ b/appengine-java-logging/pom.xml @@ -21,7 +21,7 @@ com.google.appengine appengine-java-vm-runtime - 1.9.36-SNAPSHOT + 1.9.37-SNAPSHOT ../pom.xml Google App Engine Logging Support From 053f5a44f6a19369dee1cc5883b9b67e2d1a00de Mon Sep 17 00:00:00 2001 From: ludovic Champenois Date: Wed, 25 May 2016 11:26:44 -0700 Subject: [PATCH 07/16] 1.9.38 upgrade. --- appengine-java-logging/pom.xml | 2 +- appengine-managed-runtime/pom.xml | 4 ++-- jetty9-base/pom.xml | 2 +- jetty9-compat-base/pom.xml | 2 +- jetty9-compat/pom.xml | 2 +- jetty9/pom.xml | 2 +- openjdk8/pom.xml | 2 +- pom.xml | 5 ++--- testwebapp/pom.xml | 2 +- 9 files changed, 11 insertions(+), 12 deletions(-) diff --git a/appengine-java-logging/pom.xml b/appengine-java-logging/pom.xml index e53260e..136e6d8 100644 --- a/appengine-java-logging/pom.xml +++ b/appengine-java-logging/pom.xml @@ -21,7 +21,7 @@ com.google.appengine appengine-java-vm-runtime - 1.9.37-SNAPSHOT + 1.9.38-SNAPSHOT ../pom.xml Google App Engine Logging Support diff --git a/appengine-managed-runtime/pom.xml b/appengine-managed-runtime/pom.xml index 01e177c..4b022a1 100644 --- a/appengine-managed-runtime/pom.xml +++ b/appengine-managed-runtime/pom.xml @@ -21,7 +21,7 @@ com.google.appengine appengine-java-vm-runtime - 1.9.37-SNAPSHOT + 1.9.38-SNAPSHOT ../pom.xml Google App Engine Runtime Utilities @@ -36,7 +36,7 @@ com.google.appengine appengine-java-logging - 1.9.37-SNAPSHOT + 1.9.38-SNAPSHOT com.google.appengine diff --git a/jetty9-base/pom.xml b/jetty9-base/pom.xml index fe83ee7..90441c4 100644 --- a/jetty9-base/pom.xml +++ b/jetty9-base/pom.xml @@ -21,7 +21,7 @@ com.google.appengine appengine-java-vm-runtime - 1.9.37-SNAPSHOT + 1.9.38-SNAPSHOT ../pom.xml Google App Engine Image Jetty (jetty9-base) diff --git a/jetty9-compat-base/pom.xml b/jetty9-compat-base/pom.xml index aab758f..e3f7698 100644 --- a/jetty9-compat-base/pom.xml +++ b/jetty9-compat-base/pom.xml @@ -21,7 +21,7 @@ com.google.appengine appengine-java-vm-runtime - 1.9.37-SNAPSHOT + 1.9.38-SNAPSHOT ../pom.xml Google App Engine Container with GAE Compatibility (jetty9-compat-base) diff --git a/jetty9-compat/pom.xml b/jetty9-compat/pom.xml index 8331d1e..bb31eb3 100644 --- a/jetty9-compat/pom.xml +++ b/jetty9-compat/pom.xml @@ -21,7 +21,7 @@ com.google.appengine appengine-java-vm-runtime - 1.9.37-SNAPSHOT + 1.9.38-SNAPSHOT ../pom.xml Google App Engine Image with GAE Compatibility (jetty9-compat) diff --git a/jetty9/pom.xml b/jetty9/pom.xml index a118d4b..a2ae674 100644 --- a/jetty9/pom.xml +++ b/jetty9/pom.xml @@ -21,7 +21,7 @@ com.google.appengine appengine-java-vm-runtime - 1.9.37-SNAPSHOT + 1.9.38-SNAPSHOT ../pom.xml Google App Engine Image Jetty (jetty9) diff --git a/openjdk8/pom.xml b/openjdk8/pom.xml index 155a075..7e45f9d 100644 --- a/openjdk8/pom.xml +++ b/openjdk8/pom.xml @@ -21,7 +21,7 @@ com.google.appengine appengine-java-vm-runtime - 1.9.37-SNAPSHOT + 1.9.38-SNAPSHOT ../pom.xml Google App Engine Image for OpenJDK (openjdk8) diff --git a/pom.xml b/pom.xml index 1753317..131325a 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ com.google.appengine appengine-java-vm-runtime - 1.9.37-SNAPSHOT + 1.9.38-SNAPSHOT pom Google App Engine Runtime Parent @@ -33,7 +33,7 @@ UTF-8 yyyyMMddHHmm 9.3.8.v20160314 - 1.9.37 + 1.9.38 async- @@ -151,7 +151,6 @@ docker-maven-plugin 0.3.2 - org.apache.maven.plugins maven-surefire-plugin diff --git a/testwebapp/pom.xml b/testwebapp/pom.xml index 53b1dd7..0c5da8e 100644 --- a/testwebapp/pom.xml +++ b/testwebapp/pom.xml @@ -21,7 +21,7 @@ com.google.appengine appengine-java-vm-runtime - 1.9.37-SNAPSHOT + 1.9.38-SNAPSHOT ../pom.xml Compatibility test application From 7756b3ba05685f688711dcca5bad0db511881e96 Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Wed, 13 Jul 2016 15:57:20 +1000 Subject: [PATCH 08/16] Issue #259 revert to prior class visibility, but with updated mechanism --- .../jetty9/AppengineApiConfiguration.java | 129 +++--------------- 1 file changed, 21 insertions(+), 108 deletions(-) diff --git a/jetty9-compat-base/src/main/java/com/google/apphosting/vmruntime/jetty9/AppengineApiConfiguration.java b/jetty9-compat-base/src/main/java/com/google/apphosting/vmruntime/jetty9/AppengineApiConfiguration.java index b2d5217..13b7b86 100644 --- a/jetty9-compat-base/src/main/java/com/google/apphosting/vmruntime/jetty9/AppengineApiConfiguration.java +++ b/jetty9-compat-base/src/main/java/com/google/apphosting/vmruntime/jetty9/AppengineApiConfiguration.java @@ -16,133 +16,46 @@ package com.google.apphosting.vmruntime.jetty9; -import org.eclipse.jetty.util.URIUtil; -import org.eclipse.jetty.util.resource.Resource; import org.eclipse.jetty.webapp.AbstractConfiguration; -import org.eclipse.jetty.webapp.WebAppClassLoader; import org.eclipse.jetty.webapp.WebAppContext; -import java.util.logging.Level; - public class AppengineApiConfiguration extends AbstractConfiguration { // A class to check if the GAE API is available. public static final String GAE_CHECK_CLASS = "com.google.appengine.api.ThreadManager"; - // Hide the all container classes from the webapplication - // TODO update to use '.' when supported by Jetty - private static final String[] SERVER_CLASSES = { - "com.", - "javax.", - "org.", - "mozilla." + // It's undesirable to have the user app override classes provided by us. + // So we mark them as Jetty system classes, which cannot be overridden. + private static final String[] SYSTEM_CLASSES = { + "com.google.appengine.api.", + "com.google.appengine.tools.", + "com.google.apphosting.", + "com.google.cloud.sql.jdbc.", + "com.google.protos.cloud.sql.", + "com.google.storage.onestore.", }; - - // Classes & Packages to be shared from the containers classloader - // to the webapp. Classes included here will be marked both as - // exclusions from serverclasses (not hidden from webapp) and inclusion - // to the systemclasses (cannot be overriden by the webapp) - private static final String[] SHARED_CLASSES = { - // Expose the GAE API classes - "com.google.appengine.api.LifecycleManager", - "com.google.apphosting.api.ApiProxy", - "com.google.apphosting.api.ApiStats", - "com.google.apphosting.api.CloudTrace", - "com.google.apphosting.api.CloudTraceContext", - "com.google.apphosting.api.DeadlineExceededException", - "com.google.apphosting.runtime.SessionData", - "com.google.apphosting.runtime.UncatchableError", - - // Expose the standard APIs that are provided by the container - "javax.servlet.", - "javax.el.", - "javax.mail.", // TODO Review - - // Expose the standard APIs that are provided by the JVM - "com.oracle.", - "com.sun.", - "javax.accessibility.", - "javax.activation.", - "javax.activity.", - "javax.annotation.", - "javax.imageio.", - "javax.jws.", - "javax.lang.model.", - "javax.management.", - "javax.naming.", - "javax.net.", - "javax.print.", - "javax.rmi.", - "javax.script.", - "javax.security.", - "javax.smartcardio.", - "javax.sound.", - "javax.sql.", - "javax.swing.", - "javax.tools.", - "javax.transaction.", - "javax.xml.", - "jdk.", - "org.ietf.jgss.", - "org.jcp.xml.dsig.internal.", - "org.omg.", - "org.w3c.dom.", - "org.xml.", - "sun.", - - // Expose classes needed for JSP and JSTL - "org.apache.jasper.runtime.", - "org.apache.jasper.JasperException", - "org.apache.el.ExpressionFactoryImpl", - "org.apache.tomcat.InstanceManager", - "org.apache.taglibs.", + + // Hide the container classes from the webapplication + private static final String[] SERVER_CLASSES = { + "org.apache.commons.codec.", + "org.apache.commons.logging.", + "org.apache.http.", + "com.google.gson." }; @Override public void preConfigure(WebAppContext context) { + for (String systemClass : SYSTEM_CLASSES) { + context.addSystemClass(systemClass); + } for (String systemClass : SERVER_CLASSES) { context.addServerClass(systemClass); } - for (String gaeClass : SHARED_CLASSES) { - // Don't hide shared classes - context.prependServerClass("-" + gaeClass); - // Don't allow shared classes to be replaced by webapp - context.addSystemClass(gaeClass); - } } public void configure(WebAppContext context) throws Exception { ClassLoader loader = context.getClassLoader(); - try { - // Test if the appengine api is available - loader.loadClass(GAE_CHECK_CLASS); - } catch (Exception ex) { - if (VmRuntimeWebAppContext.logger.isLoggable(Level.FINE)) { - VmRuntimeWebAppContext.logger.log(Level.WARNING, - "No appengine API jar included in WEB-INF/lib! Please update your SDK!", ex); - } else { - VmRuntimeWebAppContext.logger.log(Level.WARNING, - "No appengine API jar included in WEB-INF/lib! Please update your SDK!"); - } - - // The appengine API is not available so we will add it and it's dependencies - Resource providedApi = - Resource.newResource( - URIUtil.addPaths(System.getProperty("jetty.base"), "/lib/gae/provided-api/")); - - if (providedApi != null) { - String[] list = providedApi.list(); - if (list != null) { - WebAppClassLoader wloader = (WebAppClassLoader) loader; - for (String jar : list) { - wloader.addClassPath(providedApi.addPath(jar)); - VmRuntimeWebAppContext.logger.log(Level.INFO, "Added " + jar + " to webapp classpath"); - } - } - } - - // Ensure the API can now be loaded - loader.loadClass(GAE_CHECK_CLASS); - } + // Ensure the API can be loaded + loader.loadClass(GAE_CHECK_CLASS); } } From e1a0eb5a7191b2a7069e1840c3c05adf2cb51a18 Mon Sep 17 00:00:00 2001 From: ludovic Champenois Date: Thu, 21 Jul 2016 09:02:54 -0700 Subject: [PATCH 09/16] Fix typo and usage for latest Docker Beta on Mac. --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c8d7d5a..4bf3c84 100644 --- a/README.md +++ b/README.md @@ -27,10 +27,11 @@ To use custom build docker image as the basis for a Java Web Application Archive First, build custom docker image of jetty9-compat, push to google cloud repo. mvn clean install + # For latest docker beta on Mac, use mvn install -DdockerHost=unix:///var/run/docker.sock docker tag -f jetty9-compat gcr.io//jetty9-compat: gcloud docker push gcr.io//jetty9-compat: -Then, use your custom docker image in the Dcokerfile, and run the App Engine flexible environment container via the Cloud SDK. +Then, use your custom docker image in the Dockerfile, and run the App Engine flexible environment container via the Cloud SDK. FROM gcr.io//jetty9-compat: ADD . /app From d8753eb1d85390a8a79e11b94bf6412ba436d8f0 Mon Sep 17 00:00:00 2001 From: ludovic Champenois Date: Thu, 21 Jul 2016 09:03:57 -0700 Subject: [PATCH 10/16] Update to 1.9.40 --- appengine-java-logging/pom.xml | 2 +- appengine-managed-runtime/pom.xml | 4 ++-- jetty9-base/pom.xml | 2 +- jetty9-compat-base/pom.xml | 2 +- jetty9-compat/pom.xml | 2 +- jetty9/pom.xml | 2 +- openjdk8/pom.xml | 2 +- pom.xml | 4 ++-- testwebapp/pom.xml | 2 +- 9 files changed, 11 insertions(+), 11 deletions(-) diff --git a/appengine-java-logging/pom.xml b/appengine-java-logging/pom.xml index 136e6d8..2a4db97 100644 --- a/appengine-java-logging/pom.xml +++ b/appengine-java-logging/pom.xml @@ -21,7 +21,7 @@ com.google.appengine appengine-java-vm-runtime - 1.9.38-SNAPSHOT + 1.9.40-SNAPSHOT ../pom.xml Google App Engine Logging Support diff --git a/appengine-managed-runtime/pom.xml b/appengine-managed-runtime/pom.xml index 4b022a1..aa857c9 100644 --- a/appengine-managed-runtime/pom.xml +++ b/appengine-managed-runtime/pom.xml @@ -21,7 +21,7 @@ com.google.appengine appengine-java-vm-runtime - 1.9.38-SNAPSHOT + 1.9.40-SNAPSHOT ../pom.xml Google App Engine Runtime Utilities @@ -36,7 +36,7 @@ com.google.appengine appengine-java-logging - 1.9.38-SNAPSHOT + 1.9.40-SNAPSHOT com.google.appengine diff --git a/jetty9-base/pom.xml b/jetty9-base/pom.xml index 5e0d0cd..834155e 100644 --- a/jetty9-base/pom.xml +++ b/jetty9-base/pom.xml @@ -21,7 +21,7 @@ com.google.appengine appengine-java-vm-runtime - 1.9.38-SNAPSHOT + 1.9.40-SNAPSHOT ../pom.xml Google App Engine Image Jetty (jetty9-base) diff --git a/jetty9-compat-base/pom.xml b/jetty9-compat-base/pom.xml index 44ad539..cf85a9a 100644 --- a/jetty9-compat-base/pom.xml +++ b/jetty9-compat-base/pom.xml @@ -21,7 +21,7 @@ com.google.appengine appengine-java-vm-runtime - 1.9.38-SNAPSHOT + 1.9.40-SNAPSHOT ../pom.xml Google App Engine Container with GAE Compatibility (jetty9-compat-base) diff --git a/jetty9-compat/pom.xml b/jetty9-compat/pom.xml index 44355df..e2984c5 100644 --- a/jetty9-compat/pom.xml +++ b/jetty9-compat/pom.xml @@ -21,7 +21,7 @@ com.google.appengine appengine-java-vm-runtime - 1.9.38-SNAPSHOT + 1.9.40-SNAPSHOT ../pom.xml Google App Engine Image with GAE Compatibility (jetty9-compat) diff --git a/jetty9/pom.xml b/jetty9/pom.xml index a2ae674..ff27e63 100644 --- a/jetty9/pom.xml +++ b/jetty9/pom.xml @@ -21,7 +21,7 @@ com.google.appengine appengine-java-vm-runtime - 1.9.38-SNAPSHOT + 1.9.40-SNAPSHOT ../pom.xml Google App Engine Image Jetty (jetty9) diff --git a/openjdk8/pom.xml b/openjdk8/pom.xml index df762a5..29fd6da 100644 --- a/openjdk8/pom.xml +++ b/openjdk8/pom.xml @@ -21,7 +21,7 @@ com.google.appengine appengine-java-vm-runtime - 1.9.38-SNAPSHOT + 1.9.40-SNAPSHOT ../pom.xml Google App Engine Image for OpenJDK (openjdk8) diff --git a/pom.xml b/pom.xml index be620d4..b43e8c7 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ com.google.appengine appengine-java-vm-runtime - 1.9.38-SNAPSHOT + 1.9.40-SNAPSHOT pom Google App Engine Runtime Parent @@ -34,7 +34,7 @@ UTF-8 yyyyMMddHHmm 9.3.8.v20160314 - 1.9.38 + 1.9.40 async- diff --git a/testwebapp/pom.xml b/testwebapp/pom.xml index 0c5da8e..6f63575 100644 --- a/testwebapp/pom.xml +++ b/testwebapp/pom.xml @@ -21,7 +21,7 @@ com.google.appengine appengine-java-vm-runtime - 1.9.38-SNAPSHOT + 1.9.40-SNAPSHOT ../pom.xml Compatibility test application From 7f330458c25a348e2f7bc09e5dce530edcef66a4 Mon Sep 17 00:00:00 2001 From: ludovic Champenois Date: Thu, 21 Jul 2016 09:20:08 -0700 Subject: [PATCH 11/16] Catch up with latest internal repository changes with 1.9.40. --- .../utils/config/AppEngineWebXml.java | 39 +++++++++++++------ .../config/AppEngineWebXmlProcessor.java | 9 +++-- 2 files changed, 34 insertions(+), 14 deletions(-) diff --git a/appengine-managed-runtime/src/main/java/com/google/apphosting/utils/config/AppEngineWebXml.java b/appengine-managed-runtime/src/main/java/com/google/apphosting/utils/config/AppEngineWebXml.java index 59819ac..a8ce9e1 100644 --- a/appengine-managed-runtime/src/main/java/com/google/apphosting/utils/config/AppEngineWebXml.java +++ b/appengine-managed-runtime/src/main/java/com/google/apphosting/utils/config/AppEngineWebXml.java @@ -72,6 +72,14 @@ public static enum ScalingType { public static final String URL_HANDLER_URLFETCH = "urlfetch"; public static final String URL_HANDLER_NATIVE = "native"; + // Runtime ids. + private static final String JAVA_7_RUNTIME_ID = "java7"; + // Should accept java8* for multiple variations of Java8. + private static final String JAVA_8_RUNTIME_ID = "java8"; + // This was used for Java6, but now is used only for Managed VMs, + // not for standard editiom. + private static final String JAVA_RUNTIME_ID = "java"; + private String appId; private String majorVersionId; @@ -85,7 +93,7 @@ public static enum ScalingType { private final ManualScaling manualScaling; private final BasicScaling basicScaling; - private String sourceLanguage; + private String runtime; private boolean sslEnabled = true; private boolean useSessions = false; private boolean asyncSessionPersistence = false; @@ -235,12 +243,21 @@ public void setMajorVersionId(String majorVersionId) { this.majorVersionId = majorVersionId; } - public String getSourceLanguage() { - return this.sourceLanguage; + public String getRuntime() { + if (runtime != null) { + return runtime; + } + // The new env:flex means java, not java7: + if (isFlexible()) { + runtime = JAVA_RUNTIME_ID; + } else { + runtime = JAVA_7_RUNTIME_ID; + } + return runtime; } - public void setSourceLanguage(String sourceLanguage) { - this.sourceLanguage = sourceLanguage; + public void setRuntime(String runtime) { + this.runtime = runtime; } public String getModule() { @@ -573,8 +590,8 @@ public String toString() { + ", majorVersionId='" + majorVersionId + '\'' - + ", sourceLanguage='" - + sourceLanguage + + ", runtime='" + + runtime + '\'' + ", service='" + service @@ -749,9 +766,9 @@ public boolean equals(Object o) { : that.majorVersionId != null) { return false; } - if (sourceLanguage != null - ? !sourceLanguage.equals(that.sourceLanguage) - : that.sourceLanguage != null) { + if (runtime != null + ? !runtime.equals(that.runtime) + : that.runtime != null) { return false; } if (publicRoot != null ? !publicRoot.equals(that.publicRoot) : that.publicRoot != null) { @@ -853,7 +870,7 @@ public int hashCode() { result = 31 * result + (userPermissions != null ? userPermissions.hashCode() : 0); result = 31 * result + (appId != null ? appId.hashCode() : 0); result = 31 * result + (majorVersionId != null ? majorVersionId.hashCode() : 0); - result = 31 * result + (sourceLanguage != null ? sourceLanguage.hashCode() : 0); + result = 31 * result + (runtime != null ? runtime.hashCode() : 0); result = 31 * result + (service != null ? service.hashCode() : 0); result = 31 * result + (instanceClass != null ? instanceClass.hashCode() : 0); result = 31 * result + automaticScaling.hashCode(); diff --git a/appengine-managed-runtime/src/main/java/com/google/apphosting/utils/config/AppEngineWebXmlProcessor.java b/appengine-managed-runtime/src/main/java/com/google/apphosting/utils/config/AppEngineWebXmlProcessor.java index 290847d..3a4de0b 100644 --- a/appengine-managed-runtime/src/main/java/com/google/apphosting/utils/config/AppEngineWebXmlProcessor.java +++ b/appengine-managed-runtime/src/main/java/com/google/apphosting/utils/config/AppEngineWebXmlProcessor.java @@ -136,11 +136,14 @@ private void processSecondLevelNode(Element elt, AppEngineWebXml appEngineWebXml case "application": processApplicationNode(elt, appEngineWebXml); break; + case "runtime": + processRuntimeNode(elt, appEngineWebXml); + break; case "version": processVersionNode(elt, appEngineWebXml); break; case "source-language": - processSourceLanguageNode(elt, appEngineWebXml); + // Obsolete, ignore. break; case "module": moduleNodeFound = true; @@ -242,8 +245,8 @@ private void processVersionNode(Element node, AppEngineWebXml appEngineWebXml) { appEngineWebXml.setMajorVersionId(XmlUtils.getText(node)); } - private void processSourceLanguageNode(Element node, AppEngineWebXml appEngineWebXml) { - appEngineWebXml.setSourceLanguage(XmlUtils.getText(node)); + private void processRuntimeNode(Element node, AppEngineWebXml appEngineWebXml) { + appEngineWebXml.setRuntime(XmlUtils.getText(node)); } private void processModuleNode(Element node, AppEngineWebXml appEngineWebXml) { From ef87bbaa86b31609059c6f1576f5b69fd30a8a65 Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Wed, 27 Jul 2016 15:13:36 +1000 Subject: [PATCH 12/16] Configurable stop time #302 Temporary fix for #302 until parameter added to jetty release --- jetty9-base/src/main/jetty-base/etc/gae.xml | 4 ++++ jetty9-base/src/main/jetty-base/modules/gae.mod | 2 ++ jetty9-compat-base/src/main/jetty-base/etc/gae.xml | 4 ++++ jetty9-compat-base/src/main/jetty-base/modules/gae.mod | 1 + 4 files changed, 11 insertions(+) diff --git a/jetty9-base/src/main/jetty-base/etc/gae.xml b/jetty9-base/src/main/jetty-base/etc/gae.xml index e704edb..1406a2f 100644 --- a/jetty9-base/src/main/jetty-base/etc/gae.xml +++ b/jetty9-base/src/main/jetty-base/etc/gae.xml @@ -71,4 +71,8 @@ + + + + diff --git a/jetty9-base/src/main/jetty-base/modules/gae.mod b/jetty9-base/src/main/jetty-base/modules/gae.mod index 7d7dde2..64802d0 100644 --- a/jetty9-base/src/main/jetty-base/modules/gae.mod +++ b/jetty9-base/src/main/jetty-base/modules/gae.mod @@ -25,3 +25,5 @@ jetty.httpConfig.sendDateHeader=false #gae.httpPort=80 #gae.httpsPort=443 + +#jetty.server.stopTimeout=30000 diff --git a/jetty9-compat-base/src/main/jetty-base/etc/gae.xml b/jetty9-compat-base/src/main/jetty-base/etc/gae.xml index 7e23932..c2265e0 100644 --- a/jetty9-compat-base/src/main/jetty-base/etc/gae.xml +++ b/jetty9-compat-base/src/main/jetty-base/etc/gae.xml @@ -103,4 +103,8 @@ + + + + diff --git a/jetty9-compat-base/src/main/jetty-base/modules/gae.mod b/jetty9-compat-base/src/main/jetty-base/modules/gae.mod index 0d2f7ba..fe4cdb6 100644 --- a/jetty9-compat-base/src/main/jetty-base/modules/gae.mod +++ b/jetty9-compat-base/src/main/jetty-base/modules/gae.mod @@ -39,6 +39,7 @@ jetty.httpConfig.requestHeaderSize=8192 jetty.httpConfig.responseHeaderSize=8192 jetty.httpConfig.sendServerVersion=true jetty.httpConfig.sendDateHeader=false +jetty.server.stopTimeout=30000 jetty.server.dumpAfterStart=false jetty.server.dumpBeforeStop=false jetty.httpConfig.delayDispatchUntilContent=false From 97bd3cc62621f3b6c5bd7c87d7f2a510a0a68e8b Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Thu, 28 Jul 2016 16:19:42 +1000 Subject: [PATCH 13/16] Hide app.yaml #306 --- jetty9-base/pom.xml | 2 +- jetty9-base/src/main/jetty-base/etc/gae-web.xml | 16 ++++++++++++++++ jetty9-base/src/main/jetty-base/etc/gae.xml | 10 ++++++++++ jetty9-base/src/main/jetty-base/modules/gae.mod | 1 + .../vmruntime/jetty9/VmRuntimeWebAppContext.java | 3 +++ .../jetty9/VmRuntimeJettyKitchenSinkIT.java | 9 +++++++++ testwebapp/src/main/webapp/app.yaml | 1 + 7 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 jetty9-base/src/main/jetty-base/etc/gae-web.xml create mode 100644 testwebapp/src/main/webapp/app.yaml diff --git a/jetty9-base/pom.xml b/jetty9-base/pom.xml index 834155e..5cdd3c3 100644 --- a/jetty9-base/pom.xml +++ b/jetty9-base/pom.xml @@ -122,7 +122,7 @@ -jar ../jetty-distribution-${jetty.version}/start.jar - --add-to-startd=gae,http,deploy,jsp,jstl + --add-to-startd=gae,http,jsp,jstl diff --git a/jetty9-base/src/main/jetty-base/etc/gae-web.xml b/jetty9-base/src/main/jetty-base/etc/gae-web.xml new file mode 100644 index 0000000..47215c6 --- /dev/null +++ b/jetty9-base/src/main/jetty-base/etc/gae-web.xml @@ -0,0 +1,16 @@ + + + + + + + + + + /app.yaml + + + + + + diff --git a/jetty9-base/src/main/jetty-base/etc/gae.xml b/jetty9-base/src/main/jetty-base/etc/gae.xml index 1406a2f..8f88e3f 100644 --- a/jetty9-base/src/main/jetty-base/etc/gae.xml +++ b/jetty9-base/src/main/jetty-base/etc/gae.xml @@ -72,6 +72,16 @@ + + + + + /etc/gae-web.xml + + + + + diff --git a/jetty9-base/src/main/jetty-base/modules/gae.mod b/jetty9-base/src/main/jetty-base/modules/gae.mod index 64802d0..b74164b 100644 --- a/jetty9-base/src/main/jetty-base/modules/gae.mod +++ b/jetty9-base/src/main/jetty-base/modules/gae.mod @@ -5,6 +5,7 @@ [depend] resources server +deploy [optional] diff --git a/jetty9-compat-base/src/main/java/com/google/apphosting/vmruntime/jetty9/VmRuntimeWebAppContext.java b/jetty9-compat-base/src/main/java/com/google/apphosting/vmruntime/jetty9/VmRuntimeWebAppContext.java index d984acd..a4bac17 100644 --- a/jetty9-compat-base/src/main/java/com/google/apphosting/vmruntime/jetty9/VmRuntimeWebAppContext.java +++ b/jetty9-compat-base/src/main/java/com/google/apphosting/vmruntime/jetty9/VmRuntimeWebAppContext.java @@ -49,6 +49,7 @@ import org.eclipse.jetty.server.HttpOutput; import org.eclipse.jetty.server.Request; import org.eclipse.jetty.server.handler.ContextHandler; +import org.eclipse.jetty.util.ArrayUtil; import org.eclipse.jetty.util.URIUtil; import org.eclipse.jetty.util.log.JavaUtilLog; import org.eclipse.jetty.util.resource.Resource; @@ -342,6 +343,8 @@ public void init(String appengineWebXmlFile) throws AppEngineConfigException, IO getSessionHandler().setSessionManager(sessionManager); VmRuntimeInterceptor.init(appEngineWebXml); + + setProtectedTargets(ArrayUtil.addToArray(getProtectedTargets(), "/app.yaml", String.class)); } @Override diff --git a/jetty9-compat-base/src/test/java/com/google/apphosting/vmruntime/jetty9/VmRuntimeJettyKitchenSinkIT.java b/jetty9-compat-base/src/test/java/com/google/apphosting/vmruntime/jetty9/VmRuntimeJettyKitchenSinkIT.java index 34006e8..b2c80b7 100644 --- a/jetty9-compat-base/src/test/java/com/google/apphosting/vmruntime/jetty9/VmRuntimeJettyKitchenSinkIT.java +++ b/jetty9-compat-base/src/test/java/com/google/apphosting/vmruntime/jetty9/VmRuntimeJettyKitchenSinkIT.java @@ -90,6 +90,15 @@ public void testWelcomeServlet() throws Exception { assertTrue(Arrays.asList(lines).contains("Hello, World!")); } + /** + * Tests that app.yaml is protected + */ + public void testAppYamlHidden() throws Exception { + HttpURLConnection connection = (HttpURLConnection) createUrl("/app.yaml").openConnection(); + connection.connect(); + assertEquals(404, connection.getResponseCode()); + } + /** * Test that the API Proxy was configured by the VmRuntimeFilter. */ diff --git a/testwebapp/src/main/webapp/app.yaml b/testwebapp/src/main/webapp/app.yaml new file mode 100644 index 0000000..27d5598 --- /dev/null +++ b/testwebapp/src/main/webapp/app.yaml @@ -0,0 +1 @@ +# dummy app.yaml \ No newline at end of file From 4d3232e273a78785132d25616582ccbd9e8d8394 Mon Sep 17 00:00:00 2001 From: ludovic Champenois Date: Fri, 29 Jul 2016 13:28:44 -0700 Subject: [PATCH 14/16] Fix https://github.com/GoogleCloudPlatform/appengine-java-vm-runtime/issues/308 --- jetty9-compat/src/main/docker/jetty_run.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/jetty9-compat/src/main/docker/jetty_run.sh b/jetty9-compat/src/main/docker/jetty_run.sh index 3bc64ac..821c89e 100755 --- a/jetty9-compat/src/main/docker/jetty_run.sh +++ b/jetty9-compat/src/main/docker/jetty_run.sh @@ -17,4 +17,6 @@ source /setup-env.bash # use generated fast cli: cd /var/lib/jetty +# TODO remove when we upgrade to a newer GAE staging phase, see issue #308 +sed -i -e '/^ "jar:file:/d' /app/WEB-INF/quickstart-web.xml source /var/lib/jetty/jetty_cmd.sh From 761012d4e67a24dde3629c819edc18a1a5bd0efc Mon Sep 17 00:00:00 2001 From: Ludovic Champenois Date: Mon, 1 Aug 2016 18:05:16 -0700 Subject: [PATCH 15/16] remove workaround. The latest Maven plugin now does the right thing. --- jetty9-compat/src/main/docker/jetty_run.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/jetty9-compat/src/main/docker/jetty_run.sh b/jetty9-compat/src/main/docker/jetty_run.sh index 821c89e..3bc64ac 100755 --- a/jetty9-compat/src/main/docker/jetty_run.sh +++ b/jetty9-compat/src/main/docker/jetty_run.sh @@ -17,6 +17,4 @@ source /setup-env.bash # use generated fast cli: cd /var/lib/jetty -# TODO remove when we upgrade to a newer GAE staging phase, see issue #308 -sed -i -e '/^ "jar:file:/d' /app/WEB-INF/quickstart-web.xml source /var/lib/jetty/jetty_cmd.sh From c87997ae4f07e16b2a80b6967841b04db98f93e0 Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Thu, 4 Aug 2016 12:02:21 +1000 Subject: [PATCH 16/16] Issue #302, exec jetty_cmd.sh so that signals are passed to JVM --- jetty9-compat/src/main/docker/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jetty9-compat/src/main/docker/Dockerfile b/jetty9-compat/src/main/docker/Dockerfile index 2250108..61e7446 100644 --- a/jetty9-compat/src/main/docker/Dockerfile +++ b/jetty9-compat/src/main/docker/Dockerfile @@ -29,7 +29,7 @@ ADD jetty-base jetty_run.sh $JETTY_BASE/ WORKDIR $JETTY_BASE RUN sed -i 's/^\([a-zA-Z\.]*=\).*/#\1(see gae.ini)/' start.d/server.ini \ && java -jar $JETTY_HOME/start.jar --dry-run \ - | sed 's/^.*java /& ${JAVA_OPTS} /' > jetty_cmd.sh \ + | sed 's/^.*java /exec & ${JAVA_OPTS} /' > jetty_cmd.sh \ && chown -R jetty:jetty $JETTY_BASE \ && chmod +x $JETTY_BASE/jetty_run.sh