Skip to content

Commit

Permalink
GAE Sdk 1.9.15
Browse files Browse the repository at this point in the history
  • Loading branch information
jsm committed Jan 17, 2015
1 parent 4eebe9e commit 7cded65
Show file tree
Hide file tree
Showing 72 changed files with 1,873 additions and 2,063 deletions.
970 changes: 970 additions & 0 deletions MANIFEST

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
recursive-include google *
include *
global-exclude *.pyc
24 changes: 0 additions & 24 deletions RELEASE_NOTES
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,6 @@ All rights reserved.

App Engine SDK - Release Notes

Version 1.9.17

Managed VMs
==============================
- Managed VMs are now available as an open Beta feature of App Engine.
- User-defined health checks on App Engine Managed VMs no longer
require an 'ok' message body; any status 200 response is considered
healthy.

Python
==================================
- The old development appserver (old_dev_appserver.py) has been removed
from the SDK. However, old SDKs that contain old_dev_appserver.py
will continue to be available.

PHP
==================================
- Fixed the issue which prevented the ability to fseek a GCS file
beyond 524287 (=0x7FFFF).
https://code.google.com/p/googleappengine/issues/detail?id=10881
- Fixed the issue causing a value of "valid metadata with spaces" to
fail validation.
https://code.google.com/p/googleappengine/issues/detail?id=11443

Version 1.9.15

All
Expand Down
4 changes: 2 additions & 2 deletions VERSION
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
release: "1.9.17"
timestamp: 1415734244
release: "1.9.15"
timestamp: 1413915397
api_versions: ['1']
supported_api_versions:
python:
Expand Down
17 changes: 7 additions & 10 deletions google/appengine/api/app_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,13 @@






import logging

from google.appengine import runtime
from google.appengine.api import logservice
from google.appengine.runtime import features



Expand Down Expand Up @@ -69,17 +71,12 @@ def emit(self, record):
This implementation is based on the implementation of
StreamHandler.emit()."""
try:
if features.IsEnabled("LogServiceWriteRecord"):
logservice.write_record(self._AppLogsLevel(record.levelno),
record.created,
self.format(record))
else:
message = self._AppLogsMessage(record)
if isinstance(message, unicode):
message = message.encode("UTF-8")
message = self._AppLogsMessage(record)
if isinstance(message, unicode):
message = message.encode("UTF-8")


logservice.write(message)
logservice.write(message)
except (KeyboardInterrupt, SystemExit, runtime.DeadlineExceededError):
raise
except:
Expand Down
98 changes: 27 additions & 71 deletions google/appengine/api/appinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,6 @@

CPU = 'cpu'
MEMORY_GB = 'memory_gb'
DISK_SIZE_GB = 'disk_size_gb'


FORWARDED_PORTS = 'forwarded_ports'
Expand Down Expand Up @@ -531,55 +530,6 @@ def non_deprecated_versions(self):
_MAX_URL_LENGTH = 2047





_CANNED_RUNTIMES = ('contrib-dart', 'dart', 'go', 'php', 'python', 'python27',
'java', 'java7', 'vm', 'custom')
_all_runtimes = _CANNED_RUNTIMES
_vm_runtimes = _CANNED_RUNTIMES


def GetAllRuntimes():
"""Returns the list of all valid runtimes.
This can include third-party runtimes as well as canned runtimes.
Returns:
Tuple of strings.
"""
return _all_runtimes


def SetAllRuntimes(runtimes):
"""Sets the list of all valid runtimes.
Args:
runtimes: Tuple of strings defining the names of all valid runtimes.
"""
global _all_runtimes
_all_runtimes = runtimes


def GetVmRuntimes():
"""Returns the list of runtimes for the vm_runtimes field.
Returns:
Tuple of strings.
"""
return _vm_runtimes


def SetVmRuntimes(runtimes):
"""Sets the list of all runtimes valid for the vm_runtimes field.
Args:
runtimes: Tuple of strings defining all valid vm runtimes.
"""
global _vm_runtimes
_vm_runtimes = runtimes


class HandlerBase(validation.Validated):
"""Base class for URLMap and ApiConfigHandler."""
ATTRIBUTES = {
Expand Down Expand Up @@ -1474,10 +1424,6 @@ def VmSafeSetRuntime(appyaml, runtime):
appyaml.vm_settings['has_docker_image'] = True


elif runtime not in GetVmRuntimes():
runtime = 'custom'



appyaml.vm_settings['vm_runtime'] = runtime
appyaml.runtime = 'vm'
Expand Down Expand Up @@ -1549,10 +1495,13 @@ class HealthCheck(VmHealthCheck):
class Resources(validation.Validated):
"""Class representing the configuration of VM resources."""





ATTRIBUTES = {
CPU: validation.Optional(validation.TYPE_FLOAT),
MEMORY_GB: validation.Optional(validation.TYPE_FLOAT),
DISK_SIZE_GB: validation.Optional(validation.TYPE_INT)
CPU: validation.Optional(validation.TYPE_FLOAT, default=.5),
MEMORY_GB: validation.Optional(validation.TYPE_FLOAT, default=1.3)
}


Expand Down Expand Up @@ -1816,6 +1765,11 @@ class AppInfoExternal(validation.Validated):
}





_skip_runtime_checks = False

def CheckInitialized(self):
"""Performs non-regex-based validation.
Expand Down Expand Up @@ -1852,17 +1806,9 @@ def CheckInitialized(self):
'Found more than %d URLMap entries in application configuration' %
MAX_URL_MAPS)

vm_runtime_python27 = (
self.runtime == 'vm' and
(hasattr(self, 'vm_settings') and
self.vm_settings and
self.vm_settings.get('vm_runtime') == 'python27') or
(hasattr(self, 'beta_settings') and
self.beta_settings and
self.beta_settings.get('vm_runtime') == 'python27'))

if (self.threadsafe is None and
(self.runtime == 'python27' or vm_runtime_python27)):
self.runtime == 'python27' and
not self._skip_runtime_checks):
raise appinfo_errors.MissingThreadsafe(
'threadsafe must be present and set to either "yes" or "no"')

Expand All @@ -1881,7 +1827,16 @@ def CheckInitialized(self):
+ datastore_auto_ids_url + '\n' + appcfg_auto_ids_url + '\n')

if self.libraries:
if not (vm_runtime_python27 or self.runtime == 'python27'):
vm_runtime_python27 = (
self.runtime == 'vm' and
(hasattr(self, 'vm_settings') and
self.vm_settings and
self.vm_settings['vm_runtime'] == 'python27') or
(hasattr(self, 'beta_settings') and
self.beta_settings and
self.beta_settings['vm_runtime'] == 'python27'))
if not self._skip_runtime_checks and not (
vm_runtime_python27 or self.runtime == 'python27'):
raise appinfo_errors.RuntimeDoesNotSupportLibraries(
'libraries entries are only supported by the "python27" runtime')

Expand All @@ -1907,9 +1862,9 @@ def CheckInitialized(self):
raise appinfo_errors.MissingApiConfig(
'An api_endpoint handler was specified, but the required '
'api_config stanza was not configured.')
if self.threadsafe and self.runtime == 'python27':


if (self.threadsafe and
self.runtime == 'python27' and
not self._skip_runtime_checks):
for handler in self.handlers:
if (handler.script and (handler.script.endswith('.py') or
'/' in handler.script)):
Expand All @@ -1923,6 +1878,7 @@ def CheckInitialized(self):
"There may be only one of 'automatic_scaling', 'manual_scaling', "
"or 'basic_scaling'.")


def GetAllLibraries(self):
"""Returns a list of all Library instances active for this configuration.
Expand Down
Loading

0 comments on commit 7cded65

Please sign in to comment.