-
Notifications
You must be signed in to change notification settings - Fork 277
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dispatch Routing from yaml #3136
Conversation
…atch rules from zookeeper
…o have more specific handlers first
addition of regexes used by gcloud command to validate URLs change AdminServer endpoint for dispatch rules
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I love the simplification in nginx config file generation.
project_id=name, | ||
services=service_ids) | ||
|
||
dispatch_node = '/'.join(['/appscale', 'projects', name, 'dispatch']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dispatch_node = '/'.join(['/appscale', 'projects', name, 'dispatch']) | |
dispatch_node = '/appscale/projects/{}/dispatch'.format(name) |
'field(s): [{}]'.format(', '.join(supported_fields))) | ||
raise CustomHTTPError(HTTPCodes.BAD_REQUEST, message=message) | ||
|
||
project_node = '/'.join(['/appscale', 'projects', name]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
project_node = '/'.join(['/appscale', 'projects', name]) | |
project_node = '/appscale/projects/{}'.format(name) |
raise CustomHTTPError(HTTPCodes.BAD_REQUEST, message=message) | ||
|
||
project_node = '/'.join(['/appscale', 'projects', name]) | ||
services_node = '/'.join([project_node, 'services']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
services_node = '/'.join([project_node, 'services']) | |
services_node = '{}/services'.format(project_node) |
AdminServer/appscale/admin/utils.py
Outdated
raise InvalidDispatchConfiguration( | ||
'Invalid host pattern {}'.format(domain)) | ||
matcher = _URL_IP_V4_ADDR_RE.match(domain) | ||
if matcher and sum(1 for x in matcher.groups() if int(x) <= 255) == 4: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we decide to keep this regex match:
if matcher and sum(1 for x in matcher.groups() if int(x) <= 255) == 4: | |
if matcher and all(int(x) <= 255 for x in matcher.groups()): |
If we use a more accurate regex, this becomes:
if matcher is not None:
template of nginx config is: 👍 |
remove unused regexes and imports
AdminServer accepts dispatchRules in the format described here sent from the appscale-tools. The rules are modified to be "nginx friendly" by replacing * with .* and filling out the service name as gae_project_service_version. These rules are then put into zookeeper and picked up during the duty cycle where it regenerates routing config. They are used in the new template file application_nginx.erb
Known Issues:
Build:
http://ocd.appscale.net:8080/job/Daily%20Build/6607/