Fix yaql related issues in Docker apps

Partially-Implements: bp refactor-apps-scripts

Change-Id: Iaf75ec38b133d45778bb1c0f3328e939a9a54bda
This commit is contained in:
Dmytro Dovbii 2016-03-28 16:28:03 +03:00
parent 7144c14372
commit b46d49af09
28 changed files with 51 additions and 51 deletions

View File

@ -31,7 +31,7 @@ Methods:
.init:
Body:
- $._environment: $.find(std:Environment).require()
- $._scope: switch($.publish, $ => public, not $ => internal)
- $._scope: switch($.publish => public, true => internal)
getContainer:
@ -59,6 +59,6 @@ Methods:
where($.scope = $this._scope and $.containerPort = 4200).
select(format('http://{0}:{1}', $.address, $.port))
- $._environment.reporter.report($this, 'Application {0} is available at {1}'.format($.name, join(', ', $endpoints)))
- $._environment.reporter.report($this, 'Application {0} is available at {1}'.format($.name, $endpoints.join(', ')))
Else:
- $._environment.reporter.report($this, 'Application {0} has deployed but is not accessible from outside'.format($.name))

View File

@ -39,7 +39,7 @@ Methods:
.init:
Body:
- $._environment: $.find(std:Environment).require()
- $._scope: switch($.publish, $ => public, not $ => internal)
- $._scope: switch($.publish => public, true => internal)
- $._appPorts: $.ports.split(',').select(int($))
@ -65,7 +65,7 @@ Methods:
select(format('{0}:{1}', $.address, $.port))
- $._environment.reporter.report($this, 'Application {0} is available at {1}'.format(
$.name, join(', ', $endpoints)))
$.name, $endpoints.join(', ')))
Else:
- $._environment.reporter.report($this, 'Application {0} has deployed but is not accessible from outside'.format($.name))

View File

@ -37,7 +37,7 @@ Methods:
.init:
Body:
- $._environment: $.find(std:Environment).require()
- $._scope: switch($.publish, $ => public, not $ => internal)
- $._scope: switch($.publish => public, true => internal)
getContainer:
@ -63,6 +63,6 @@ Methods:
- If: $.publish
Then:
- $endpoints: $.applicationEndpoints.where($.scope = $this._scope).select(format('http://{0}:{1}', $.address, $.port))
- $._environment.reporter.report($this, 'Elasticsearch {0} is available at {1}'.format($.name, join(', ', $endpoints)))
- $._environment.reporter.report($this, 'Elasticsearch {0} is available at {1}'.format($.name, $endpoints.join(', ')))
Else:
- $._environment.reporter.report($this, 'Elasticsearch {0} has deployed but is not accessible from outside'.format($.name))

View File

@ -34,7 +34,7 @@ Methods:
.init:
Body:
- $._environment: $.find(std:Environment).require()
- $._scope: switch($.publish, $ => public, not $ => internal)
- $._scope: switch($.publish => public, true => internal)
getContainer:

View File

@ -43,7 +43,7 @@ Methods:
.init:
Body:
- $._environment: $.find(std:Environment).require()
- $._scope: switch($.publish, $ => public, not $ => internal)
- $._scope: switch($.publish => public, true => internal)
deploy:
@ -82,6 +82,6 @@ Methods:
Then:
- $endpoints: $.applicationEndpoints.where($.scope = $this._scope).
select(format('http://{0}:{1}', $.address, $.port))
- $._environment.reporter.report($this, 'Grafana {0} is available at {1}'.format($.name, join(', ', $endpoints)))
- $._environment.reporter.report($this, 'Grafana {0} is available at {1}'.format($.name, $endpoints.join(', ')))
Else:
- $._environment.reporter.report($this, 'Grafana {0} has deployed but is not accessible from outside'.format($.name))

View File

@ -41,7 +41,7 @@ Methods:
.init:
Body:
- $._environment: $.find(std:Environment).require()
- $._scope: switch($.publish, $ => public, not $ => internal)
- $._scope: switch($.publish => public, true => internal)
deploy:
@ -86,6 +86,6 @@ Methods:
Then:
- $endpoints: $.applicationEndpoints.where($.scope = $this._scope).
select(format('{0}:{1}', $.address, $.port))
- $._environment.reporter.report($this, 'GuestBook {0} is available at {1}'.format($.name, join(', ', $endpoints)))
- $._environment.reporter.report($this, 'GuestBook {0} is available at {1}'.format($.name, $endpoints.join(', ')))
Else:
- $._environment.reporter.report($this, 'GuestBook {0} has deployed but is not accessible from outside'.format($.name))

View File

@ -42,4 +42,4 @@ Methods:
REDIS_MASTER_SERVICE_PORT: $redisMasterLink.port
ports:
- port: 6379
scope: switch($.publish, $ => public, not $ => internal)
scope: switch($.publish => public, true => internal)

View File

@ -31,7 +31,7 @@ Methods:
.init:
Body:
- $._environment: $.find(std:Environment).require()
- $._scope: switch($.publish, $ => public, not $ => internal)
- $._scope: switch($.publish => public, true => internal)
getContainer:
@ -54,6 +54,6 @@ Methods:
- If: $.publish
Then:
- $endpoints: $.applicationEndpoints.where($.scope = $this._scope).select(format('http://{0}:{1}', $.address, $.port))
- $._environment.reporter.report($this, 'HTTPd {0} is available at {1}'.format($.name, join(', ', $endpoints)))
- $._environment.reporter.report($this, 'HTTPd {0} is available at {1}'.format($.name, $endpoints.join(', ')))
Else:
- $._environment.reporter.report($this, 'HTTPd {0} has deployed but is not accessible from outside'.format($.name))

View File

@ -34,7 +34,7 @@ Methods:
.init:
Body:
- $._environment: $.find(std:Environment).require()
- $._scope: switch($.publish, $ => public, not $ => internal)
- $._scope: switch($.publish => public, true => internal)
getContainer:
@ -59,6 +59,6 @@ Methods:
- If: $.publish
Then:
- $endpoints: $.applicationEndpoints.where($.scope = $this._scope).select(format('http://{0}:{1}', $.address, $.port))
- $._environment.reporter.report($this, 'HTTPd application {0} is available at {1}'.format($.name, join(', ', $endpoints)))
- $._environment.reporter.report($this, 'HTTPd application {0} is available at {1}'.format($.name, $endpoints.join(', ')))
Else:
- $._environment.reporter.report($this, 'HTTPD application {0} has deployed but is not accessible from outside'.format($.name))

View File

@ -34,7 +34,7 @@ Methods:
.init:
Body:
- $._environment: $.find(std:Environment).require()
- $._scope: switch($.publish, $ => public, not $ => internal)
- $._scope: switch($.publish => public, true => internal)
getContainer:
@ -68,6 +68,6 @@ Methods:
where($.scope = $this._scope and $.containerPort = 8083).
select(format('http://{0}:{1}', $.address, $.port))
- $._environment.reporter.report($this, 'InfluxDB {0} is available at {1}'.format($.name, join(', ', $endpoints)))
- $._environment.reporter.report($this, 'InfluxDB {0} is available at {1}'.format($.name, $endpoints.join(', ')))
Else:
- $._environment.reporter.report($this, 'InfluxDB {0} has deployed but is not accessible from outside'.format($.name))

View File

@ -34,7 +34,7 @@ Methods:
.init:
Body:
- $._environment: $.find(std:Environment).require()
- $._scope: switch($.publish, $ => public, not $ => internal)
- $._scope: switch($.publish => public, true => internal)
getContainer:

View File

@ -31,7 +31,7 @@ Methods:
.init:
Body:
- $._environment: $.find(std:Environment).require()
- $._scope: switch($.publish, $ => public, not $ => internal)
- $._scope: switch($.publish => public, true => internal)
getContainer:
@ -56,6 +56,6 @@ Methods:
- $endpoints: $.applicationEndpoints.where($.scope = $this._scope).
select(format('http://{0}:{1}', $.address, $.port))
- $._environment.reporter.report($this, 'Jenkins {0} is available at {1}'.format($.name, join(', ', $endpoints)))
- $._environment.reporter.report($this, 'Jenkins {0} is available at {1}'.format($.name, $endpoints.join(', ')))
Else:
- $._environment.reporter.report($this, 'Jenkins {0} has deployed but is not accessible from outside'.format($.name))

View File

@ -34,7 +34,7 @@ Methods:
.init:
Body:
- $._environment: $.find(std:Environment).require()
- $._scope: switch($.publish, $ => public, not $ => internal)
- $._scope: switch($.publish => public, true => internal)
getContainer:
@ -61,6 +61,6 @@ Methods:
- $endpoints: $.applicationEndpoints.where($.scope = $this._scope).
select(format('{0}:{1}', $.address, $.port))
- $._environment.reporter.report($this, 'MariaDB {0} is available at {1}'.format($.name, join(', ', $endpoints)))
- $._environment.reporter.report($this, 'MariaDB {0} is available at {1}'.format($.name, $endpoints.join(', ')))
Else:
- $._environment.reporter.report($this, 'MariaDB {0} has deployed but is not accessible from outside'.format($.name))

View File

@ -31,7 +31,7 @@ Methods:
.init:
Body:
- $._environment: $.find(std:Environment).require()
- $._scope: switch($.publish, $ => public, not $ => internal)
- $._scope: switch($.publish => public, true => internal)
getContainer:
@ -56,6 +56,6 @@ Methods:
- $endpoints: $.applicationEndpoints.where($.scope = $this._scope).
select(format('{0}:{1}', $.address, $.port))
- $._environment.reporter.report($this, 'MongoDB {0} is available at {1}'.format($.name, join(', ', $endpoints)))
- $._environment.reporter.report($this, 'MongoDB {0} is available at {1}'.format($.name, $endpoints.join(', ')))
Else:
- $._environment.reporter.report($this, 'MongoDB {0} has deployed but is not accessible from outside'.format($.name))

View File

@ -34,7 +34,7 @@ Methods:
.init:
Body:
- $._environment: $.find(std:Environment).require()
- $._scope: switch($.publish, $ => public, not $ => internal)
- $._scope: switch($.publish => public, true => internal)
getContainer:
@ -61,6 +61,6 @@ Methods:
- $endpoints: $.applicationEndpoints.where($.scope = $this._scope).
select(format('{0}:{1}', $.address, $.port))
- $._environment.reporter.report($this, 'MySQL {0} is available at {1}'.format($.name, join(', ', $endpoints)))
- $._environment.reporter.report($this, 'MySQL {0} is available at {1}'.format($.name, $endpoints.join(', ')))
Else:
- $._environment.reporter.report($this, 'MySQL {0} has deployed but is not accessible from outside'.format($.name))

View File

@ -31,7 +31,7 @@ Methods:
.init:
Body:
- $._environment: $.find(std:Environment).require()
- $._scope: switch($.publish, $ => public, not $ => internal)
- $._scope: switch($.publish => public, true => internal)
getContainer:
@ -55,6 +55,6 @@ Methods:
Then:
- $endpoints: $.applicationEndpoints.where($.scope = $this._scope).
select(format('http://{0}:{1}', $.address, $.port))
- $._environment.reporter.report($this, 'Nginx {0} is available at {1}'.format($.name, join(', ', $endpoints)))
- $._environment.reporter.report($this, 'Nginx {0} is available at {1}'.format($.name, $endpoints.join(', ')))
Else:
- $._environment.reporter.report($this, 'Nginx {0} has deployed but is not accessible from outside'.format($.name))

View File

@ -34,7 +34,7 @@ Methods:
.init:
Body:
- $._environment: $.find(std:Environment).require()
- $._scope: switch($.publish, $ => public, not $ => internal)
- $._scope: switch($.publish => public, true => internal)
getContainer:
@ -59,6 +59,6 @@ Methods:
- If: $.publish
Then:
- $endpoints: $.applicationEndpoints.where($.scope = $this._scope).select(format('http://{0}:{1}', $.address, $.port))
- $._environment.reporter.report($this, 'Nginx application {0} is available at {1}'.format($.name, join(', ', $endpoints)))
- $._environment.reporter.report($this, 'Nginx application {0} is available at {1}'.format($.name, $endpoints.join(', ')))
Else:
- $._environment.reporter.report($this, 'Nginx application {0} has deployed but is not accessible from outside'.format($.name))

View File

@ -33,7 +33,7 @@ Methods:
.init:
Body:
- $._environment: $.find(std:Environment).require()
- $._scope: switch($.publish, $ => public, not $ => internal)
- $._scope: switch($.publish => public, true => internal)
deploy:
Body:
@ -64,6 +64,6 @@ Methods:
Then:
- $endpoints: $.applicationEndpoints.where($.scope = $this._scope).
select(format('http://{0}:{1}', $.address, $.port))
- $._environment.reporter.report($this, 'Orion {0} is available at {1}'.format($.name, join(', ', $endpoints)))
- $._environment.reporter.report($this, 'Orion {0} is available at {1}'.format($.name, $endpoints.join(', ')))
Else:
- $._environment.reporter.report($this, 'Orion {0} was deployed but is not accessible from outside'.format($.name))

View File

@ -34,7 +34,7 @@ Methods:
.init:
Body:
- $._environment: $.find(std:Environment).require()
- $._scope: switch($.publish, $ => public, not $ => internal)
- $._scope: switch($.publish => public, true => internal)
getContainer:
@ -60,6 +60,6 @@ Methods:
Then:
- $endpoints: $.applicationEndpoints.where($.scope = $this._scope).
select(format('{0}:{1}', $.address, $.port))
- $._environment.reporter.report($this, 'PostgreSQL {0} is available at {1}'.format($.name, join(', ', $endpoints)))
- $._environment.reporter.report($this, 'PostgreSQL {0} is available at {1}'.format($.name, $endpoints.join(', ')))
Else:
- $._environment.reporter.report($this, 'PostgreSQL {0} has deployed but is not accessible from outside'.format($.name))

View File

@ -31,7 +31,7 @@ Methods:
.init:
Body:
- $._environment: $.find(std:Environment).require()
- $._scope: switch($.publish, $ => public, not $ => internal)
- $._scope: switch($.publish => public, true => internal)
getContainer:
@ -55,6 +55,6 @@ Methods:
Then:
- $endpoints: $.applicationEndpoints.where($.scope = $this._scope).
select(format('{0}:{1}', $.address, $.port))
- $._environment.reporter.report($this, 'Redis {0} is available at {1}'.format($.name, join(', ', $endpoints)))
- $._environment.reporter.report($this, 'Redis {0} is available at {1}'.format($.name, $endpoints.join(', ')))
Else:
- $._environment.reporter.report($this, 'Redis {0} has deployed but is not accessible from outside'.format($.name))

View File

@ -34,7 +34,7 @@ Methods:
.init:
Body:
- $._environment: $.find(std:Environment).require()
- $._scope: switch($.publish, $ => public, not $ => internal)
- $._scope: switch($.publish => public, true => internal)
getContainer:
@ -60,6 +60,6 @@ Methods:
Then:
- $endpoints: $.applicationEndpoints.where($.scope = $this._scope).
select(format('http://{0}:{1}', $.address, $.port))
- $._environment.reporter.report($this, 'Tomcat {0} is available at {1}'.format($.name, join(', ', $endpoints)))
- $._environment.reporter.report($this, 'Tomcat {0} is available at {1}'.format($.name, $endpoints.join(', ')))
Else:
- $._environment.reporter.report($this, 'Tomcat {0} has deployed but is not accessible from outside'.format($.name))

View File

@ -39,4 +39,4 @@ Methods:
Contract:
$.string().notNull(): $.string().notNull()
Body:
- Return: join(';', $labelsMap.select(list($, $labelsMap.get($))).select(join('=', $)))
- Return: $labelsMap.select(list($, $labelsMap.get($)).join('=')).join(';')

View File

@ -114,7 +114,7 @@ Methods:
- $rule:
- ToPort: $hostPort
FromPort: $hostPort
IpProtocol: toLower($applicationPort.protocol)
IpProtocol: $applicationPort.protocol.toLower()
External: true
- $._environment.securityGroupManager.addGroupIngress($rule)
- $record:
@ -222,10 +222,10 @@ Methods:
- Return: $applicationPorts.get($key)
- $port: str($applicationPort.port)
- If: $port in $portMap
- If: $port in $portMap.keys()
Then:
- $port: '1025'
- While: $port in $portMap
- While: $port in $portMap.keys()
Do:
- $port: str(int($port) + 1)

View File

@ -252,7 +252,7 @@ Methods:
- $securityGroupIngress:
- ToPort: $port
FromPort: $port
IpProtocol: toLower($applicationPort.protocol)
IpProtocol: $applicationPort.protocol.toLower()
External: $applicationPort.scope = public
- $._environment.securityGroupManager.addGroupIngress($securityGroupIngress)

View File

@ -31,7 +31,7 @@ Methods:
- If: not $.getAttr(instanceDeployed, false)
Then:
- $._environment.reporter.report($this, 'Creating Gateway node for Kubernetes services')
- $.super($.deployInstance())
- super($, $.deployInstance())
- $.setAttr(instanceDeployed, true)
setupEtcd:

View File

@ -31,7 +31,7 @@ Methods:
- If: not $.getAttr(instanceDeployed, false)
Then:
- $._environment.reporter.report($this, 'Creating Kubernetes Master')
- $.super($.deployInstance())
- super($, $.deployInstance())
- $.setAttr(instanceDeployed, true)

View File

@ -38,7 +38,7 @@ Methods:
- If: not $.getAttr(instanceDeployed, false)
Then:
- $._environment.reporter.report($this, 'Creating Kubernetes Node {0}'.format($.instance.name))
- $.super($.deployInstance())
- super($, $.deployInstance())
- $.setAttr(instanceDeployed, true)

View File

@ -76,14 +76,14 @@ Methods:
_getPodName:
Body:
- Return: toLower($.name)
- Return: $.name.toLower()
_getPodLabels:
Arguments:
- podName:
Contract: $.string().notNull()
Body:
Return: $.labels2Map(toLower($.labels)).mergeWith(dict(id => $podName))
Return: $.labels2Map($.labels.toLower()).mergeWith(dict(id => $podName))
hostContainer:
Arguments:
@ -105,7 +105,7 @@ Methods:
- $._deleteContainer($container.name)
- $containerDef:
name: toLower($container.name)
name: $container.name.toLower()
image: $container.image
args: $container.commands
ports: $container.ports.select($this._getPortDefinition($))
@ -185,7 +185,7 @@ Methods:
Contract: $.string().notNull()
Body:
- $lenBefore: len($._podDefinition.spec.containers) + len($._podDefinition.spec.volumes)
- $containerName: toLower($name)
- $containerName: $name.toLower()
- $newContainers: $._podDefinition.spec.containers.where($.name != $containerName)
- $volumeNameMap: $.getAttr(volumeNameMap, dict())
- $newVolumeNameMap: {}