Restructure murano-apps repository

Change-Id: I9cdb1e4afcb9929c7b7a5437faaa25d284daefdb
Closes-Bug: #1441644
This commit is contained in:
Dmytro Dovbii 2015-04-09 10:18:33 +03:00
commit 7cb39996f0
179 changed files with 5948 additions and 0 deletions

View File

@ -0,0 +1,52 @@
Namespaces:
=: io.murano.apps.docker
std: io.murano
Name: DockerCrate
Extends: DockerApplication
Properties:
name:
Contract: $.string().notNull()
publish:
Contract: $.bool().notNull()
Default: true
Methods:
initialize:
Body:
- $._environment: $.find(std:Environment).require()
- $._scope: switch($.publish, $ => public, not $ => internal)
getContainer:
Body:
Return:
name: $.name
image: crate
ports:
- port: 4300
scope: $._scope
- port: 4200
scope: $._scope
onInstallationStart:
Body:
- $._environment.reporter.report($this, 'Installing Crate')
onInstallationFinish:
Body:
- If: $.publish
Then:
- $endpoints: $.applicationEndpoints.
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)))
Else:
- $._environment.reporter.report($this, 'Application {0} has deployed but is not accessible from outside'.format($.name))

View File

@ -0,0 +1,39 @@
Version: 2
Application:
?:
type: io.murano.apps.docker.DockerCrate
name: $.appConfiguration.name
host: $.appConfiguration.host
publish: $.appConfiguration.publish
Forms:
- appConfiguration:
fields:
- name: name
type: string
label: Application Name
initial: DockerCrate
description: >-
Enter a desired name for the application. Just A-Z, a-z, 0-9, dash and
underline are allowed
- name: host
type:
- io.murano.apps.docker.kubernetes.KubernetesPod
- io.murano.apps.docker.DockerStandaloneHost
label: Container Host
description: >-
Select an instance of Docker contaniner hosting provider to run the app
- name: ports
type: string
required: false
hidden: true
description: Select Crate ports
- name: publish
type: boolean
label: Visible from outside
initial: true
required: false
description: >-
Check if you intend to access the application from the Internet

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

View File

@ -0,0 +1,10 @@
Format: 1.0
Type: Application
FullName: io.murano.apps.docker.DockerCrate
Name: Docker Crate
Description: |
Crate is an Elastic SQL Data Store. Distributed by design, Crate makes centralized database servers obsolete. Realtime non-blocking SQL engine with full blown search. Highly available, massively scalable yet simple to use.
Author: 'Mirantis, Inc'
Tags: [docker, application, crate]
Classes:
io.murano.apps.docker.DockerCrate: DockerCrate.yaml

View File

@ -0,0 +1,68 @@
Namespaces:
=: io.murano.apps.docker
std: io.murano
Name: DockerGlassFish
Extends: DockerApplication
Properties:
name:
Contract: $.string().notNull()
publish:
Contract: $.bool().notNull()
Default: true
password:
Contract: $.string().notNull()
Methods:
initialize:
Body:
- $._environment: $.find(std:Environment).require()
- $._scope: switch($.publish, $ => public, not $ => internal)
getContainer:
Body:
Return:
name: $.name
image: 'tutum/glassfish'
env:
GLASSFISH_PASS: $.password
ports:
- port: 4848
scope: $._scope
- port: 8080
scope: $._scope
- port: 8181
scope: $._scope
onInstallationStart:
Body:
- $._environment.reporter.report($this, 'Installing GlassFish')
onInstallationFinish:
Body:
- If: $.publish
Then:
- $adminEndpoints: join(', ', $.applicationEndpoints.
where($.scope = $this._scope and $.containerPort = 4848).
select(format('http://{0}:{1}', $.address, $.port)))
- $httpEndpoints: join(', ', $.applicationEndpoints.
where($.scope = $this._scope and $.containerPort = 8080).
select(format('http://{0}:{1}', $.address, $.port)))
- $httpsEndpoints: join(', ', $.applicationEndpoints.
where($.scope = $this._scope and $.containerPort = 8181).
select(format('https://{0}:{1}', $.address, $.port)))
- $._environment.reporter.report(
$this,
'GlassFish {0} is available at {1} (admin) and {2}/{3} (apps)'.format(
$.name, $adminEndpoints, $httpEndpoints, $httpsEndpoints))
Else:
- $._environment.reporter.report($this, 'GlassFish {0} has deployed but is not accessible from outside'.format($.name))

View File

@ -0,0 +1,40 @@
Version: 2
Application:
?:
type: io.murano.apps.docker.DockerGlassFish
name: $.appConfiguration.name
host: $.appConfiguration.host
publish: $.appConfiguration.publish
password: $.appConfiguration.password
Forms:
- appConfiguration:
fields:
- name: name
type: string
label: Application Name
initial: 'DockerGlassFish'
description: >-
Enter a desired name for the application. Just A-Z, a-z, 0-9, dash and
underline are allowed
- name: password
type: password
required: true
label: GlassFish Admin Password
description: Password for admin user in GlassFish
- name: host
type:
- io.murano.apps.docker.kubernetes.KubernetesPod
- io.murano.apps.docker.DockerStandaloneHost
label: Container Host
description: >-
Select an instance of Docker contaniner hosting provider to run the app
- name: publish
type: boolean
label: Visible from outside
initial: true
required: false
description: >-
Check if you intend to access the application from the Internet

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

View File

@ -0,0 +1,10 @@
Format: 1.0
Type: Application
FullName: io.murano.apps.docker.DockerGlassFish
Name: Docker GlassFish
Description: |
Oracle GlassFish Server is the world's first implementation of the Java Platform, Enterprise Edition (Java EE) 6 specification. Built using the GlassFish Server Open Source Edition, Oracle GlassFish Server delivers a flexible, lightweight, and production-ready Java EE 6 application server.
Author: 'Mirantis, Inc'
Tags: [docker, application, GlassFish]
Classes:
io.murano.apps.docker.DockerGlassFish: DockerGlassFish.yaml

View File

@ -0,0 +1,69 @@
Namespaces:
=: io.murano.apps.docker
std: io.murano
Name: DockerGrafana
Extends: DockerApplication
Properties:
name:
Contract: $.string().notNull()
publish:
Contract: $.bool().notNull()
Default: true
influxDB:
Contract: $.class(DockerInfluxDB).notNull()
grafanaUser:
Contract: $.string().notNull()
grafanaPassword:
Contract: $.string().notNull()
dbName:
Contract: $.string().notNull()
Methods:
initialize:
Body:
- $._environment: $.find(std:Environment).require()
- $._scope: switch($.publish, $ => public, not $ => internal)
getContainer:
Body:
- $influxDbLink: $.getConnectionTo($.influxDB, 8086)
- Return:
name: $.name
image: 'tutum/grafana'
env:
HTTP_USER: $.grafanaUser
HTTP_PASS: $.grafanaPassword
INFLUXDB_HOST: $influxDbLink.host
INFLUXDB_PORT: $influxDbLink.port
INFLUXDB_NAME: $.dbName
INFLUXDB_USER: root
INFLUXDB_PASS: root
ports:
- port: 80
scope: $._scope
onInstallationStart:
Body:
- $._environment.reporter.report($this, 'Installing Grafana')
onInstallationFinish:
Body:
- If: $.publish
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)))
Else:
- $._environment.reporter.report($this, 'Grafana {0} has deployed but is not accessible from outside'.format($.name))

View File

@ -0,0 +1,70 @@
Version: 2
Application:
?:
type: io.murano.apps.docker.DockerGrafana
name: $.appConfiguration.name
host: $.appConfiguration.host
publish: $.appConfiguration.publish
influxDB: $.grafanaConfig.influxDB
dbName: $.grafanaConfig.dbName
grafanaUser: $.grafanaConfig.grafanaUser
grafanaPassword: $.grafanaConfig.grafanaPassword
Forms:
- appConfiguration:
fields:
- name: name
type: string
label: Application Name
initial: 'DockerGrafana'
description: >-
Enter a desired name for the application. Just A-Z, a-z, 0-9, dash and
underline are allowed
- name: host
type:
- io.murano.apps.docker.kubernetes.KubernetesPod
- io.murano.apps.docker.DockerStandaloneHost
label: Container Host
description: >-
Select an instance of Docker contaniner hosting provider to run the app
- name: publish
type: boolean
label: Visible from outside
initial: false
required: true
description: >-
Check if you intend to access the application from the Internet
- grafanaConfig:
fields:
- name: influxDB
type: io.murano.apps.docker.DockerInfluxDB
label: InfluxDB instance
required: true
description: >-
Please select existing InfluxDB instance or add a new one
- name: dbName
type: string
label: InfluxDB database
required: true
description: >-
Please specify an InfluxDB database name to connect to
- name: grafanaUser
type: string
label: Grafana user name
initial: admin
required: true
description: >-
User name that will be configured for Grafana access
- name: grafanaPassword
type: password
label: Grafana user password
required: true
description: >-
User password that will be configured for Grafana access

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

View File

@ -0,0 +1,10 @@
Format: 1.0
Type: Application
FullName: io.murano.apps.docker.DockerGrafana
Name: Docker Grafana
Description: |
Grafana is a frontend for Graphite, InfluxDB and OpenTSDB with powerfull visualization features for time series data. You will need either a Graphite, InfluxDB or OpenTSDB server for Grafana to be of any use.
Author: 'Mirantis, Inc'
Tags: [docker, application, Grafana]
Classes:
io.murano.apps.docker.DockerGrafana: DockerGrafana.yaml

View File

@ -0,0 +1,63 @@
Namespaces:
=: io.murano.apps.docker
std: io.murano
Name: DockerGuestBook
Extends: DockerApplication
Properties:
name:
Contract: $.string().notNull()
publish:
Contract: $.bool().notNull()
Default: true
redisMaster:
Contract: $.class(DockerRedis).notNull()
redisSlave:
Contract: $.class(DockerRedisSlave).notNull()
Methods:
initialize:
Body:
- $._environment: $.find(std:Environment).require()
- $._scope: switch($.publish, $ => public, not $ => internal)
getContainer:
Body:
- $.redisMaster.deploy()
- $.redisSlave.deploy()
- $redisMasterLink: $.getConnectionTo($.redisMaster, 6379)
- $redisSlaveLink: $.getConnectionTo($.redisSlave, 6379)
- Return:
name: $.name
image: 'brendanburns/php-redis'
env:
REDIS_MASTER_SERVICE_HOST: $.redisMaster.host
REDIS_MASTER_SERVICE_PORT: $.redisMaster.port
REDISSLAVE_SERVICE_HOST: $.redisSlave.host
REDISSLAVE_SERVICE_PORT: $.redisSlave.port
ports:
- port: 80
scope: $._scope
onInstallationStart:
Body:
- $._environment.reporter.report($this, 'Installing Redis Slave')
onInstallationFinish:
Body:
- If: $.publish
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)))
Else:
- $._environment.reporter.report($this, 'GuestBook {0} has deployed but is not accessible from outside'.format($.name))

View File

@ -0,0 +1,55 @@
Namespaces:
=: io.murano.apps.docker
std: io.murano
Name: DockerRedisSlave
Extends: DockerApplication
Properties:
name:
Contract: $.string().notNull()
publish:
Contract: $.bool().notNull()
Default: true
redisMaster:
Contract: $.class(DockerRedis).notNull()
Methods:
initialize:
Body:
- $._environment: $.find(std:Environment).require()
- $._scope: switch($.publish, $ => public, not $ => internal)
getContainer:
Body:
- $redisMasterLink: $.getConnectionTo($.redisMaster, 6379)
- Return:
name: $.name
image: 'brendanburns/redis-slave'
env:
REDIS_MASTER_SERVICE_HOST: $redisMaster.host
REDIS_MASTER_SERVICE_PORT: $redisMaster.port
ports:
- port: 6379
scope: $._scope
onInstallationStart:
Body:
- $._environment.reporter.report($this, 'Installing RedisSlave')
onInstallationFinish:
Body:
- If: $.publish
Then:
- $endpoints: $.applicationEndpoints.where($.scope = $this._scope).
select(format('{0}:{1}', $.address, $.port))
- $._environment.reporter.report($this, 'Redis Slave {0} is available at {1}'.format($.name, join(', ', $endpoints)))
Else:
- $._environment.reporter.report($this, 'Redis Slave {0} has deployed but is not accessible from outside'.format($.name))

View File

@ -0,0 +1,70 @@
Version: 2
Templates:
guestBookHost:
?:
type: io.murano.apps.docker.kubernetes.KubernetesPod
name: frontend
labels: 'name=frontend,app=frontend,uses=redis-slave-or-redis-master'
kubernetesCluster: $.appConfiguration.kubernetesCluster
replicas: 3
redisMaster:
?:
type: io.murano.apps.docker.DockerRedis
name: RedisMaster
host:
?:
type: io.murano.apps.docker.kubernetes.KubernetesPod
name: 'redis-master'
labels: 'name=redis-master,app=redis'
kubernetesCluster: $.appConfiguration.kubernetesCluster
replicas: 1
publish: false
redisSlave:
?:
type: io.murano.apps.docker.DockerRedisSlave
name: RedisSlave
host:
?:
type: io.murano.apps.docker.kubernetes.KubernetesPod
name: 'redis-slave'
labels: 'name=redis-slave,app=redis,uses=redis-master'
kubernetesCluster: $.appConfiguration.kubernetesCluster
replicas: 2
publish: false
redisMaster: $redisMaster
Application:
?:
type: io.murano.apps.docker.DockerGuestBook
name: $.appConfiguration.name
host: $guestBookHost
redisMaster: $redisMaster
redisSlave: $redisSlave
publish: $.appConfiguration.publish
Forms:
- appConfiguration:
fields:
- name: name
type: string
label: Application Name
initial: 'GuestBook'
description: >-
Enter a desired name for the application. Just A-Z, a-z, 0-9, dash and
underline are allowed
- name: kubernetesCluster
type: io.murano.apps.docker.kubernetes.KubernetesCluster
label: Kubernetes cluster
required: true
description: >-
Kubernetes service
- name: publish
type: boolean
label: Visible from outside
initial: true
required: false
description: >-
Check if you intend to access application from the Internet

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

View File

@ -0,0 +1,12 @@
Format: 1.0
Type: Application
FullName: io.murano.apps.docker.GuestBook
Name: Docker GuestBook
Description: |
Simple demo application using Kubernetes Cluster for deployment
Author: 'Mirantis, Inc'
Tags: [Docker, Kubernetes, guestbook]
Classes:
io.murano.apps.docker.DockerRedisSlave: RedisSlave.yaml
io.murano.apps.docker.DockerGuestBook: GuestBook.yaml

View File

@ -0,0 +1,47 @@
Namespaces:
=: io.murano.apps.docker
std: io.murano
Name: DockerHTTPd
Extends: DockerApplication
Properties:
name:
Contract: $.string().notNull()
publish:
Contract: $.bool().notNull()
Default: true
Methods:
initialize:
Body:
- $._environment: $.find(std:Environment).require()
- $._scope: switch($.publish, $ => public, not $ => internal)
getContainer:
Body:
Return:
name: $.name
image: httpd
ports:
- port: 80
scope: $._scope
onInstallationStart:
Body:
- $._environment.reporter.report($this, 'Installing HTTPd')
onInstallationFinish:
Body:
- 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)))
Else:
- $._environment.reporter.report($this, 'HTTPd {0} has deployed but is not accessible from outside'.format($.name))

View File

@ -0,0 +1,34 @@
Version: 2
Application:
?:
type: io.murano.apps.docker.DockerHTTPd
name: $.appConfiguration.name
host: $.appConfiguration.host
publish: $.appConfiguration.publish
Forms:
- appConfiguration:
fields:
- name: name
type: string
label: Application Name
initial: DockerHTTPd
description: >-
Enter a desired name for the application. Just A-Z, a-z, 0-9, dash and
underline are allowed
- name: host
type:
- io.murano.apps.docker.kubernetes.KubernetesPod
- io.murano.apps.docker.DockerStandaloneHost
label: Container Host
description: >-
Select an instance of Docker contaniner hosting provider to run the app
- name: publish
type: boolean
label: Visible from outside
initial: true
required: false
description: >-
Check if you intend to access application from the Internet

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

View File

@ -0,0 +1,10 @@
Format: 1.0
Type: Application
FullName: io.murano.apps.docker.DockerHTTPd
Name: Docker HTTPd
Description: |
The Apache HTTP Server, colloquially called Apache, is a Web server application notable for playing a key role in the initial growth of the World Wide Web.
Author: 'Mirantis, Inc'
Tags: [docker, application, httpd]
Classes:
io.murano.apps.docker.DockerHTTPd: DockerHTTPd.yaml

View File

@ -0,0 +1,52 @@
Namespaces:
=: io.murano.apps.docker
std: io.murano
Name: DockerHTTPdSite
Extends: DockerApplication
Properties:
name:
Contract: $.string().notNull()
publish:
Contract: $.bool().notNull()
Default: true
siteRepo:
Contract: $.string().notNull()
Methods:
initialize:
Body:
- $._environment: $.find(std:Environment).require()
- $._scope: switch($.publish, $ => public, not $ => internal)
getContainer:
Body:
Return:
name: $.name
image: 'stanlagun/httpdgitsite'
env:
APP_URL: $.siteRepo
ports:
- port: 80
scope: $._scope
onInstallationStart:
Body:
- $._environment.reporter.report($this, 'Installing HTTPd and site from ' + $.siteRepo)
onInstallationFinish:
Body:
- 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)))
Else:
- $._environment.reporter.report($this, 'HTTPD application {0} has deployed but is not accessible from outside'.format($.name))

View File

@ -0,0 +1,40 @@
Version: 2
Application:
?:
type: io.murano.apps.docker.DockerHTTPdSite
name: $.appConfiguration.name
host: $.appConfiguration.host
publish: $.appConfiguration.publish
siteRepo: $.appConfiguration.url
Forms:
- appConfiguration:
fields:
- name: name
type: string
label: Application Name
initial: DockerHTTPdSite
description: >-
Enter a desired name for the application. Just A-Z, a-z, 0-9, dash and
underline are allowed
- name: url
type: string
required: true
label: Repository URL
description: Enter an URL to git repository with site content
- name: host
type:
- io.murano.apps.docker.kubernetes.KubernetesPod
- io.murano.apps.docker.DockerStandaloneHost
label: Container Host
description: >-
Select an instance of Docker contaniner hosting provider to run the app
- name: publish
type: boolean
label: Visible from outside
initial: true
required: false
description: >-
Check if you intend to access application from the Internet

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

View File

@ -0,0 +1,10 @@
Format: 1.0
Type: Application
FullName: io.murano.apps.docker.DockerHTTPdSite
Name: Docker HTTPd Site
Description: |
Deploys a site from a git URL using Apache HTTPd as the web server.
Author: 'Mirantis, Inc'
Tags: [docker, application, httpd]
Classes:
io.murano.apps.docker.DockerHTTPdSite: DockerHTTPdSite.yaml

View File

@ -0,0 +1,61 @@
Namespaces:
=: io.murano.apps.docker
std: io.murano
Name: DockerInfluxDB
Extends: DockerApplication
Properties:
name:
Contract: $.string().notNull()
publish:
Contract: $.bool().notNull()
Default: true
preCreateDB:
Contract: $.string()
Methods:
initialize:
Body:
- $._environment: $.find(std:Environment).require()
- $._scope: switch($.publish, $ => public, not $ => internal)
getContainer:
Body:
Return:
name: $.name
image: 'tutum/influxdb'
env:
PRE_CREATE_DB: $.preCreateDB
ports:
- port: 8083
scope: $._scope
- port: 8086
scope: $._scope
- port: 8090
scope: internal
- port: 8099
scope: internal
onInstallationStart:
Body:
- $._environment.reporter.report($this, 'Installing InfluxDB')
onInstallationFinish:
Body:
- If: $.publish
Then:
- $endpoints: $.applicationEndpoints.
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)))
Else:
- $._environment.reporter.report($this, 'InfluxDB {0} has deployed but is not accessible from outside'.format($.name))

View File

@ -0,0 +1,42 @@
Version: 2
Application:
?:
type: io.murano.apps.docker.DockerInfluxDB
name: $.appConfiguration.name
host: $.appConfiguration.host
publish: $.appConfiguration.publish
preCreateDB: $.appConfiguration.preCreateDB
Forms:
- appConfiguration:
fields:
- name: name
type: string
label: Application Name
initial: 'DockerInfluxDB'
description: >-
Enter a desired name for the application. Just A-Z, a-z, 0-9, dash and
underline are allowed
- name: host
type:
- io.murano.apps.docker.kubernetes.KubernetesPod
- io.murano.apps.docker.DockerStandaloneHost
label: Container Host
description: >-
Select an instance of Docker contaniner hosting provider to run the app
- name: preCreateDB
type: string
label: DB list to pre-create
initial: 'db1;db2'
required: false
description: >-
Enter a semicolon separated list of databases. These databases will be pre-created on a container start
- name: publish
type: boolean
label: Visible from outside
initial: true
required: false
description: >-
Check if you intend to access application from the Internet

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

View File

@ -0,0 +1,10 @@
Format: 1.0
Type: Application
FullName: io.murano.apps.docker.DockerInfluxDB
Name: Docker InfluxDB
Description: |
InfluxDB is a time series, events, and metrics database. Its written in Go and has no external dependencies. That means once you install it theres nothing else to manage (like Redis, HBase, or whatever).
Author: 'Mirantis, Inc'
Tags: [docker, application, InfluxDB]
Classes:
io.murano.apps.docker.DockerInfluxDB: DockerInfluxDB.yaml

View File

@ -0,0 +1,49 @@
Namespaces:
=: io.murano.apps.docker
std: io.murano
Name: DockerJenkins
Extends: DockerApplication
Properties:
name:
Contract: $.string().notNull()
publish:
Contract: $.bool().notNull()
Default: true
Methods:
initialize:
Body:
- $._environment: $.find(std:Environment).require()
- $._scope: switch($.publish, $ => public, not $ => internal)
getContainer:
Body:
Return:
name: $.name
image: jenkins
ports:
- port: 8080
scope: $._scope
onInstallationStart:
Body:
- $._environment.reporter.report($this, 'Installing Jenkins')
onInstallationFinish:
Body:
- If: $.publish
Then:
- $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)))
Else:
- $._environment.reporter.report($this, 'Jenkins {0} has deployed but is not accessible from outside'.format($.name))

View File

@ -0,0 +1,34 @@
Version: 2
Application:
?:
type: io.murano.apps.docker.DockerJenkins
name: $.appConfiguration.name
host: $.appConfiguration.host
publish: $.appConfiguration.publish
Forms:
- appConfiguration:
fields:
- name: name
type: string
label: Application Name
initial: 'DockerJenkins'
description: >-
Enter a desired name for the application. Just A-Z, a-z, 0-9, dash and
underline are allowed
- name: host
type:
- io.murano.apps.docker.kubernetes.KubernetesPod
- io.murano.apps.docker.DockerStandaloneHost
label: Container Host
description: >-
Select an instance of Docker contaniner hosting provider to run the app
- name: publish
type: boolean
label: Visible from outside
initial: true
required: false
description: >-
Check if you intend to access application from the Internet

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

View File

@ -0,0 +1,10 @@
Format: 1.0
Type: Application
FullName: io.murano.apps.docker.DockerJenkins
Name: Docker Jenkins
Description: |
Jenkins is an award-winning application that monitors executions of repeated jobs, such as building a software project or jobs run by cron.
Author: 'Mirantis, Inc'
Tags: [docker, application, Jenkins]
Classes:
io.murano.apps.docker.DockerJenkins: DockerJenkins.yaml

View File

@ -0,0 +1,54 @@
Namespaces:
=: io.murano.apps.docker
std: io.murano
Name: DockerMariaDB
Extends: DockerApplication
Properties:
name:
Contract: $.string().notNull()
publish:
Contract: $.bool().notNull()
Default: true
password:
Contract: $.string().notNull()
Methods:
initialize:
Body:
- $._environment: $.find(std:Environment).require()
- $._scope: switch($.publish, $ => public, not $ => internal)
getContainer:
Body:
Return:
name: $.name
image: 'tutum/mariadb'
env:
MARIADB_PASS: $.password
ports:
- port: 3306
scope: $._scope
onInstallationStart:
Body:
- $._environment.reporter.report($this, 'Installing MariaDB')
onInstallationFinish:
Body:
- If: $.publish
Then:
- $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)))
Else:
- $._environment.reporter.report($this, 'MariaDB {0} has deployed but is not accessible from outside'.format($.name))

View File

@ -0,0 +1,41 @@
Version: 2
Application:
?:
type: io.murano.apps.docker.DockerMariaDB
name: $.appConfiguration.name
host: $.appConfiguration.host
publish: $.appConfiguration.publish
password: $.appConfiguration.password
Forms:
- appConfiguration:
fields:
- name: name
type: string
label: Application Name
initial: 'DockerMariaDB'
description: >-
Enter a desired name for the application. Just A-Z, a-z, 0-9, dash and
underline are allowed
- name: host
type:
- io.murano.apps.docker.kubernetes.KubernetesPod
- io.murano.apps.docker.DockerStandaloneHost
label: Container Host
description: >-
Select an instance of Docker contaniner hosting provider to run the app
- name: password
type: password
required: true
label: MariaDB Password
description: >-
Password for root user in MariaDB
- name: publish
type: boolean
label: Visible from outside
initial: true
required: false
description: >-
Check if you intend to access application from the Internet

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

View File

@ -0,0 +1,13 @@
Format: 1.0
Type: Application
FullName: io.murano.apps.docker.DockerMariaDB
Name: Docker MariaDB
Description: |
MariaDB strives to be the logical choice for database professionals looking for a robust, scalable, and reliable
SQL server. To accomplish this, the MariaDB Foundation work closely and cooperatively with the larger community
of users and developers in the true spirit of Free and open source software, and release software in a manner
that balances predictability with reliability.
Author: 'Mirantis, Inc'
Tags: [docker, application, MariaDB]
Classes:
io.murano.apps.docker.DockerMariaDB: DockerMariaDB.yaml

View File

@ -0,0 +1,49 @@
Namespaces:
=: io.murano.apps.docker
std: io.murano
Name: DockerMongoDB
Extends: DockerApplication
Properties:
name:
Contract: $.string().notNull()
publish:
Contract: $.bool().notNull()
Default: true
Methods:
initialize:
Body:
- $._environment: $.find(std:Environment).require()
- $._scope: switch($.publish, $ => public, not $ => internal)
getContainer:
Body:
Return:
name: $.name
image: mongo
ports:
- port: 27017
scope: $._scope
onInstallationStart:
Body:
- $._environment.reporter.report($this, 'Installing MongoDB')
onInstallationFinish:
Body:
- If: $.publish
Then:
- $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)))
Else:
- $._environment.reporter.report($this, 'MongoDB {0} has deployed but is not accessible from outside'.format($.name))

View File

@ -0,0 +1,33 @@
Version: 2
Application:
?:
type: io.murano.apps.docker.DockerMongoDB
name: $.appConfiguration.name
host: $.appConfiguration.host
publish: $.appConfiguration.publish
Forms:
- appConfiguration:
fields:
- name: name
type: string
label: Application Name
initial: 'DockerMongoDB'
description: >-
Enter a desired name for the application. Just A-Z, a-z, 0-9, dash and
underline are allowed
- name: host
type:
- io.murano.apps.docker.kubernetes.KubernetesPod
- io.murano.apps.docker.DockerStandaloneHost
label: Container Host
description: >-
Select an instance of Docker contaniner hosting provider to run the app
- name: publish
type: boolean
label: Make application accessible from outside
initial: false
required: true
description: >-
Check if you intend to access application from the Internet

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

@ -0,0 +1,10 @@
Format: 1.0
Type: Application
FullName: io.murano.apps.docker.DockerMongoDB
Name: Docker MongoDB
Description: |
MongoDB (from “humongous”) is a cross-platform document-oriented database. Classified as a NoSQL database, MongoDB eschews the traditional table-based relational database structure in favor of JSON-like documents with dynamic schemas.
Author: 'Mirantis, Inc'
Tags: [Docker, MongoDB]
Classes:
io.murano.apps.docker.DockerMongoDB: DockerMongoDB.yaml

View File

@ -0,0 +1,54 @@
Namespaces:
=: io.murano.apps.docker
std: io.murano
Name: DockerMySQL
Extends: DockerApplication
Properties:
name:
Contract: $.string().notNull()
publish:
Contract: $.bool().notNull()
Default: true
password:
Contract: $.string().notNull()
Methods:
initialize:
Body:
- $._environment: $.find(std:Environment).require()
- $._scope: switch($.publish, $ => public, not $ => internal)
getContainer:
Body:
Return:
name: $.name
image: mysql
env:
MYSQL_ROOT_PASSWORD: $.password
ports:
- port: 3306
scope: $._scope
onInstallationStart:
Body:
- $._environment.reporter.report($this, 'Installing MySQL')
onInstallationFinish:
Body:
- If: $.publish
Then:
- $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)))
Else:
- $._environment.reporter.report($this, 'MySQL {0} has deployed but is not accessible from outside'.format($.name))

View File

@ -0,0 +1,39 @@
Version: 2
Application:
?:
type: io.murano.apps.docker.DockerMySQL
name: $.appConfiguration.name
host: $.appConfiguration.host
publish: $.appConfiguration.publish
password: $.appConfiguration.password
Forms:
- appConfiguration:
fields:
- name: name
type: string
label: Application Name
initial: DockerMySQL
description: >-
Enter a desired name for the application. Just A-Z, a-z, 0-9, dash and
underline are allowed
- name: host
type:
- io.murano.apps.docker.kubernetes.KubernetesPod
- io.murano.apps.docker.DockerStandaloneHost
label: Container Host
description: >-
Select an instance of Docker contaniner hosting provider to run the app
- name: password
type: password
label: MySQL Password
description: >-
Password for root user in MySQL
- name: publish
type: boolean
label: Visible from outside
initial: true
required: false
description: >-
Check if you intend to access application from the Internet

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

View File

@ -0,0 +1,10 @@
Format: 1.0
Type: Application
FullName: io.murano.apps.docker.DockerMySQL
Name: Docker MySQL
Description: |
MySQL Docker Application. Adds MySQL docker container with MySQL listening on port 3306.
Author: 'Mirantis, Inc'
Tags: [docker, application]
Classes:
io.murano.apps.docker.DockerMySQL: DockerMySQL.yaml

View File

@ -0,0 +1,48 @@
Namespaces:
=: io.murano.apps.docker
std: io.murano
Name: DockerNginx
Extends: DockerApplication
Properties:
name:
Contract: $.string().notNull()
publish:
Contract: $.bool().notNull()
Default: true
Methods:
initialize:
Body:
- $._environment: $.find(std:Environment).require()
- $._scope: switch($.publish, $ => public, not $ => internal)
getContainer:
Body:
Return:
name: $.name
image: nginx
ports:
- port: 80
scope: $._scope
onInstallationStart:
Body:
- $._environment.reporter.report($this, 'Installing Nginx')
onInstallationFinish:
Body:
- If: $.publish
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)))
Else:
- $._environment.reporter.report($this, 'Nginx {0} has deployed but is not accessible from outside'.format($.name))

View File

@ -0,0 +1,34 @@
Version: 2
Application:
?:
type: io.murano.apps.docker.DockerNginx
name: $.appConfiguration.name
host: $.appConfiguration.host
publish: $.appConfiguration.publish
Forms:
- appConfiguration:
fields:
- name: name
type: string
label: Application Name
initial: DockerNginx
description: >-
Enter a desired name for the application. Just A-Z, a-z, 0-9, dash and
underline are allowed
- name: host
type:
- io.murano.apps.docker.kubernetes.KubernetesPod
- io.murano.apps.docker.DockerStandaloneHost
label: Container Host
description: >-
Select an instance of Docker contaniner hosting provider to run the app
- name: publish
type: boolean
label: Visible from outside
initial: true
required: false
description: >-
Check if you intend to access application from the Internet

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

@ -0,0 +1,10 @@
Format: 1.0
Type: Application
FullName: io.murano.apps.docker.DockerNginx
Name: Docker Nginx
Description: |
Nginx (pronounced “engine-x”) is an open source reverse proxy server for HTTP, HTTPS, SMTP, POP3, and IMAP protocols, as well as a load balancer, HTTP cache, and a web server (origin server).
Author: 'Mirantis, Inc'
Tags: [docker, application, Nginx]
Classes:
io.murano.apps.docker.DockerNginx: DockerNginx.yaml

View File

@ -0,0 +1,52 @@
Namespaces:
=: io.murano.apps.docker
std: io.murano
Name: DockerNginxSite
Extends: DockerApplication
Properties:
name:
Contract: $.string().notNull()
publish:
Contract: $.bool().notNull()
Default: true
siteRepo:
Contract: $.string().notNull()
Methods:
initialize:
Body:
- $._environment: $.find(std:Environment).require()
- $._scope: switch($.publish, $ => public, not $ => internal)
getContainer:
Body:
Return:
name: $.name
image: 'ddovbii/nginx-site'
env:
APP_URL: $.siteRepo
ports:
- port: 80
scope: $._scope
onInstallationStart:
Body:
- $._environment.reporter.report($this, 'Installing Nginx and site from ' + $.siteRepo)
onInstallationFinish:
Body:
- 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)))
Else:
- $._environment.reporter.report($this, 'Nginx application {0} has deployed but is not accessible from outside'.format($.name))

View File

@ -0,0 +1,41 @@
Version: 2
Application:
?:
type: io.murano.apps.docker.DockerNginxSite
name: $.appConfiguration.name
host: $.appConfiguration.host
publish: $.appConfiguration.publish
siteRepo: $.appConfiguration.siteRepo
Forms:
- appConfiguration:
fields:
- name: name
type: string
label: Application Name
initial: DockerNginxSite
description: >-
Enter a desired name for the application. Just A-Z, a-z, 0-9, dash and
underline are allowed
- name: siteRepo
type: string
required: true
label: Repository URL
initial: http://github.com/*
description: Enter an URL to git repository with site content
- name: host
type:
- io.murano.apps.docker.kubernetes.KubernetesPod
- io.murano.apps.docker.DockerStandaloneHost
label: Container Host
description: >-
Select an instance of Docker contaniner hosting provider to run the app
- name: publish
type: boolean
label: Visible from outside
initial: true
required: false
description: >-
Check if you intend to access application from the Internet

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

@ -0,0 +1,10 @@
Format: 1.0
Type: Application
FullName: io.murano.apps.docker.DockerNginxSite
Name: Docker Nginx Site
Description: |
Deploys a site from a Git URL using Nginx as the web server.
Author: 'Mirantis, Inc'
Tags: [docker, application, Nginx]
Classes:
io.murano.apps.docker.DockerNginxSite: DockerNginxSite.yaml

View File

@ -0,0 +1,74 @@
Namespaces:
=: io.murano.apps.docker
std: io.murano
Name: DockerPHPZendServer
Extends: DockerApplication
Properties:
name:
Contract: $.string().notNull()
publish:
Contract: $.bool().notNull()
Default: true
password:
Contract: $.string().notNull()
database:
Contract: $.class(DockerMySQL).notNull()
dbName:
Contract: $.string().notNull()
dbUser:
Contract: $.string().notNull()
dbPass:
Contract: $.string().notNull()
Methods:
initialize:
Body:
- $._environment: $.find(std:Environment).require()
- $._scope: switch($.publish, $ => public, not $ => internal)
getContainer:
Body:
- $.database.deploy()
- $dbLink: $.getConnectionTo($.database, 3306)
- Return:
name: $.name
image: 'php-zendserver'
env:
MYSQL_HOSTNAME: $dbLink.host
MYSQL_PORT: $dbLink.port
MYSQL_USERNAME: $.dbUser
MYSQL_PASSWORD: $.dbPass
MYSQL_DBNAME: $.dbName
ZS_ADMIN_PASSWORD: $.password
ports:
- port: 80
scope: $._scope
- port: 10081
scope: $._scope
onInstallationStart:
Body:
- $._environment.reporter.report($this, 'Installing PHPZendServer')
onInstallationFinish:
Body:
- If: $.publish
Then:
- $endpoints: $.applicationEndpoints.where($.scope = $this._scope and $.containerPort = 80).
select(format('http://{0}:{1}', $.address, $.port))
- $._environment.reporter.report($this, 'PHPZendServer {0} is available at {1}'.format($.name, join(', ', $endpoints)))
Else:
- $._environment.reporter.report($this, 'PHPZendServer {0} has deployed but is not accessible from outside'.format($.name))

View File

@ -0,0 +1,75 @@
Version: 2
Application:
?:
type: io.murano.apps.docker.DockerPHPZendServer
name: $.appConfiguration.name
host: $.appConfiguration.host
publish: $.appConfiguration.publish
password: $.appConfiguration.password
database: $.dbConfig.database
dbName: $.dbConfig.dbName
dbUser: $.dbConfig.dbUser
dbPass: $.dbConfig.dbPass
Forms:
- appConfiguration:
fields:
- name: name
type: string
label: Application Name
initial: DockerPHP-ZendServer
description: >-
Enter a desired name for the application. Just A-Z, a-z, 0-9, dash and
underline are allowed
- name: host
type:
- io.murano.apps.docker.kubernetes.KubernetesPod
- io.murano.apps.docker.DockerStandaloneHost
label: Container Host
description: >-
Select an instance of Docker contaniner hosting provider to run the app
- name: password
type: password
label: Admin Password
description: >-
Password for admin user in ZendServer
- name: publish
type: boolean
label: Visible from outside
initial: true
required: false
description: >-
Check if you intend to access application from the Internet
- dbConfig:
fields:
- name: database
type: io.murano.apps.docker.DockerMySQL
label: MySQL instance
required: true
description: >-
Please select existing MySQL instance or add a new one
- name: dbName
type: string
label: MySQL database
required: true
description: >-
Please specify a MySQL database name to connect to
- name: dbUser
type: string
label: MySQL user name
initial: admin
required: true
description: >-
Please specify a MySQL user
- name: dbPass
type: password
label: MySQL user pass
required: true
description: >-
Please specify a MySQL user password

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

@ -0,0 +1,10 @@
Format: 1.0
Type: Application
FullName: io.murano.apps.docker.DockerPHPZendServer
Name: Docker PHP-ZendServer
Description: |
Zend Server provides a complete, reliable and secure PHP stack, bundling over 80 of the most popular PHP extensions and libraries. Whether on Apache, nginx or IIS - Zend Server provides you with a consistent PHP environment across all major operating systems, for both development and production.
Author: 'Mirantis, Inc'
Tags: [docker, application, PHPZendServer]
Classes:
io.murano.apps.docker.DockerPHPZendServer: DockerPHPZendServer.yaml

View File

@ -0,0 +1,53 @@
Namespaces:
=: io.murano.apps.docker
std: io.murano
Name: DockerPostgreSQL
Extends: DockerApplication
Properties:
name:
Contract: $.string().notNull()
publish:
Contract: $.bool().notNull()
Default: true
password:
Contract: $.string().notNull()
Methods:
initialize:
Body:
- $._environment: $.find(std:Environment).require()
- $._scope: switch($.publish, $ => public, not $ => internal)
getContainer:
Body:
Return:
name: $.name
image: postgres
env:
POSTGRES_PASSWORD: $.password
ports:
- port: 5432
scope: $._scope
onInstallationStart:
Body:
- $._environment.reporter.report($this, 'Installing PostgreSQL')
onInstallationFinish:
Body:
- If: $.publish
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)))
Else:
- $._environment.reporter.report($this, 'PostgreSQL {0} has deployed but is not accessible from outside'.format($.name))

View File

@ -0,0 +1,40 @@
Version: 2
Application:
?:
type: io.murano.apps.docker.DockerPostgreSQL
name: $.appConfiguration.name
host: $.appConfiguration.host
publish: $.appConfiguration.publish
password: $.appConfiguration.password
Forms:
- appConfiguration:
fields:
- name: name
type: string
label: Application Name
initial: DockerPostgres
description: >-
Enter a desired name for the application. Just A-Z, a-z, 0-9, dash and
underline are allowed
- name: host
type:
- io.murano.apps.docker.kubernetes.KubernetesPod
- io.murano.apps.docker.DockerStandaloneHost
label: Container Host
description: >-
Select an instance of Docker contaniner hosting provider to run the app
- name: password
type: password
required: true
label: PostgreSQL Password
description: >-
Password for root user in PostgreSQL
- name: publish
type: boolean
label: Visible from outside
initial: true
required: false
description: >-
Check if you intend to access application from the Internet

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

View File

@ -0,0 +1,10 @@
Format: 1.0
Type: Application
FullName: io.murano.apps.docker.DockerPostgreSQL
Name: Docker Postgres
Description: |
PostgreSQL, often simply “Postgres”, is an object-relational database management system (ORDBMS) with an emphasis on extensibility and standards-compliance. As a database server, its primary function is to store data, securely and supporting best practices, and retrieve it later, as requested by other software applications, be it those on the same computer or those running on another computer across a network (including the Internet).
Author: 'Mirantis, Inc'
Tags: [docker, application, Postgres]
Classes:
io.murano.apps.docker.DockerPostgreSQL: DockerPostgreSQL.yaml

View File

@ -0,0 +1,48 @@
Namespaces:
=: io.murano.apps.docker
std: io.murano
Name: DockerRedis
Extends: DockerApplication
Properties:
name:
Contract: $.string().notNull()
publish:
Contract: $.bool().notNull()
Default: true
Methods:
initialize:
Body:
- $._environment: $.find(std:Environment).require()
- $._scope: switch($.publish, $ => public, not $ => internal)
getContainer:
Body:
Return:
name: $.name
image: redis
ports:
- port: 6379
scope: $._scope
onInstallationStart:
Body:
- $._environment.reporter.report($this, 'Installing Redis')
onInstallationFinish:
Body:
- If: $.publish
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)))
Else:
- $._environment.reporter.report($this, 'Redis {0} has deployed but is not accessible from outside'.format($.name))

View File

@ -0,0 +1,34 @@
Version: 2
Application:
?:
type: io.murano.apps.docker.DockerRedis
name: $.appConfiguration.name
host: $.appConfiguration.host
publish: $.appConfiguration.publish
Forms:
- appConfiguration:
fields:
- name: name
type: string
label: Application Name
initial: DockerRedis
description: >-
Enter a desired name for the application. Just A-Z, a-z, 0-9, dash and
underline are allowed
- name: host
type:
- io.murano.apps.docker.kubernetes.KubernetesPod
- io.murano.apps.docker.DockerStandaloneHost
label: Container Host
description: >-
Select an instance of Docker contaniner hosting provider to run the app
- name: publish
type: boolean
label: Make application accessible from outside
initial: true
required: false
description: >-
Check if you intend to access application from the Internet

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

View File

@ -0,0 +1,10 @@
Format: 1.0
Type: Application
FullName: io.murano.apps.docker.DockerRedis
Name: Docker Redis
Description: |
Redis is an open-source, networked, in-memory, key-value data store with optional durability. It is written in ANSI C and the name Redis means REmote DIctionary Server.
Author: 'Mirantis, Inc'
Tags: [docker, application, Redis]
Classes:
io.murano.apps.docker.DockerRedis: DockerRedis.yaml

View File

@ -0,0 +1,53 @@
Namespaces:
=: io.murano.apps.docker
std: io.murano
Name: DockerTomcat
Extends: DockerApplication
Properties:
name:
Contract: $.string().notNull()
publish:
Contract: $.bool().notNull()
Default: true
password:
Contract: $.string().notNull()
Methods:
initialize:
Body:
- $._environment: $.find(std:Environment).require()
- $._scope: switch($.publish, $ => public, not $ => internal)
getContainer:
Body:
Return:
name: $.name
image: 'tutum/tomcat'
env:
TOMCAT_PASS: $.password
ports:
- port: 8080
scope: $._scope
onInstallationStart:
Body:
- $._environment.reporter.report($this, 'Installing Tomcat')
onInstallationFinish:
Body:
- If: $.publish
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)))
Else:
- $._environment.reporter.report($this, 'Tomcat {0} has deployed but is not accessible from outside'.format($.name))

View File

@ -0,0 +1,39 @@
Version: 2
Application:
?:
type: io.murano.apps.docker.DockerTomcat
name: $.appConfiguration.name
host: $.appConfiguration.host
publish: $.appConfiguration.publish
password: $.appConfiguration.password
Forms:
- appConfiguration:
fields:
- name: name
type: string
label: Application Name
initial: 'DockerTomcat'
description: >-
Enter a desired name for the application. Just A-Z, a-z, 0-9, dash and
underline are allowed
- name: password
type: password
label: Admin Password
description: Password for admin user in Tomcat
- name: host
type:
- io.murano.apps.docker.kubernetes.KubernetesPod
- io.murano.apps.docker.DockerStandaloneHost
label: Container Host
description: >-
Select an instance of Docker contaniner hosting provider to run the app
- name: publish
type: boolean
label: Make application accessible from outside
initial: true
required: false
description: >-
Check if you intend to access application from the Internet

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

View File

@ -0,0 +1,10 @@
Format: 1.0
Type: Application
FullName: io.murano.apps.docker.DockerTomcat
Name: Docker Tomcat
Description: |
Apache Tomcat (or simply Tomcat) is an open source web server and servlet container developed by the Apache Software Foundation (ASF). Tomcat implements the Java Servlet and the JavaServer Pages (JSP) specifications from Oracle, and provides a “pure Java” HTTP web server environment for Java code to run in.
Author: 'Mirantis, Inc'
Tags: [docker, application, Tomcat]
Classes:
io.murano.apps.docker.DockerTomcat: DockerTomcat.yaml

View File

@ -0,0 +1,25 @@
Namespaces:
=: io.murano.apps.docker
std: io.murano
Name: ApplicationPort
Properties:
port:
Contract: $.int().notNull().check($ > 0 and $ < 65536)
scope:
Contract: $.string().notNull().check($ in list(public, cloud, host, internal))
Default: private
protocol:
Contract: $.string().notNull().check($ in list(TCP, UDP))
Default: TCP
Methods:
getRepresentation:
Body:
Return:
port: $.port
scope: $.scope
protocol: $.protocol

View File

@ -0,0 +1,91 @@
Namespaces:
=: io.murano.apps.docker
std: io.murano
Name: DockerApplication
Extends: std:Application
Properties:
host:
Contract: $.class(DockerContainerHost).notNull()
applicationEndpoints:
Contract:
- port: $.int().notNull().check($ > 0)
address: $.string().notNull()
scope: $.string().notNull().check($ in list(public, cloud, internal, host))
portScope: $.string().notNull().check($ in list(public, cloud, internal, host))
containerPort: $.int().notNull().check($ > 0)
protocol: $.string().notNull().check($ in list(TCP, UDP))
Usage: Out
Methods:
initialize:
Body:
- $._environment: $.find(std:Environment).require()
deploy:
Body:
- $._environment.reporter.report($this, 'Waiting for the host to be ready')
- $.host.deploy()
- $container: $.getContainer()
- $repr: $._getContainerRepresentation($container)
- If: $.getAttr(container, null) != $repr
Then:
- $.onInstallationStart()
- $.applicationEndpoints: $.host.hostContainer($container)
- $.setAttr(container, $repr)
- $.onInstallationFinish()
getConnectionTo:
Arguments:
- application:
Contract: $.class(DockerApplication).notNull()
- port:
Contract: $.int().notNull().check($ > 0)
- protocol:
Contract: $.string().notNull().check($ in list(TCP, UDP))
Default: TCP
Body:
- $scopes: [cloud, public]
- If: $.host = $application.host
Then:
- $scopes: list(host, internal) + $scopes
Else:
- If: $.host.getInternalScopeId() = $application.host.getInternalScopeId()
Then:
- $scopes: list(internal) + $scope
- For: s
In: $scopes
Do:
- $endpoints: $application.applicationEndpoints.where(true).where(
$.scope = $s and $.containerPort = $port and $.protocol = $protocol)
- If: len($endpoints) > 0
Then:
- $index: int(len($endpoints) * random())
- $endpoint: $endpoints[$index]
- Return:
host: $endpoint.address
port: $endpoint.port
_getContainerRepresentation:
Arguments:
- container:
Contract: $.class(DockerContainer).notNull()
Body:
Return: $container.getRepresentation()
getContainer:
onInstallationStart:
Body:
onInstallationFinish:
Body:

View File

@ -0,0 +1,46 @@
Namespaces:
=: io.murano.apps.docker
Name: DockerContainer
Properties:
name:
Contract: $.string().notNull()
image:
Contract: $.string().notNull()
commands:
Contract:
- $.string().notNull()
Default: []
env:
Contract:
$.string().notNull(): $.string().notNull()
Default: {}
ports:
Contract:
- $.class(ApplicationPort)
Default: []
volumes:
Contract:
$.string().notNull(): $.class(DockerVolume).notNull()
Default: {}
Methods:
getRepresentation:
Body:
- $volumeRepresentations: {}
- For: volume
In: $.volumes
Do:
- $volumeRepresentations[$volume]: $.volumes.get($volume).getRepresentation()
- Return:
name: $.name
image: $.image
env: env
ports: $.ports.select($.getRepresentation())
volumes: $volumeRepresentations

View File

@ -0,0 +1,30 @@
Namespaces:
=: io.murano.apps.docker
std: io.murano
Name: DockerContainerHost
Extends: std:Application
Properties:
name:
Contract: $.string().notNull()
Methods:
hostContainer:
Arguments:
- container:
Contract: $.class(DockerContainer).notNull()
deleteContainer:
Arguments:
- name:
Contract: $.string().notNull()
getEndpoints:
Arguments:
- applicationName:
Contract: $.string().notNull()
getInternalScopeId:

View File

@ -0,0 +1,30 @@
Namespaces:
=: io.murano.apps.docker
Name: DockerHelpers
Methods:
labels2Map:
Arguments:
labelsString:
Contract: $.string().notNull()
Body:
- $result: {}
- For: t
In: $labelsString.replace(',', ';').split(';')
Do:
- $pair: $t.split('=')
- If: len($pair) < 2
Then:
Continue:
- $key: $pair[0].trim()
- $result[$key]: $pair[1].trim()
- Return: $result
map2labels:
Arguments:
labelsMap:
Contract:
$.string().notNull(): $.string().notNull()
Body:
- Return: join(';', $labelsMap.select(list($, $labelsMap.get($))).select(join('=', $)))

View File

@ -0,0 +1,20 @@
Namespaces:
=: io.murano.apps.docker
Name: DockerHostVolume
Extends: DockerVolume
Properties:
path:
Contract: $.string().notNull()
Methods:
getType:
Body:
Return: HostDir
getParameters:
Body:
Return: $.path

View File

@ -0,0 +1,15 @@
Namespaces:
=: io.murano.apps.docker
Name: DockerTempVolume
Extends: DockerVolume
Methods:
getType:
Body:
Return: TempVolume
getParameters:
Body:
Return: null

View File

@ -0,0 +1,19 @@
Namespaces:
=: io.murano.apps.docker
Name: DockerVolume
Properties:
name:
Contract: $.string().notNull()
Methods:
getType:
getParameters:
getRepresentation:
Body:
Return:
type: $.getType()
parameters: $.getParameters()

View File

@ -0,0 +1,19 @@
Format: 1.0
Type: Library
FullName: io.murano.apps.docker.Interfaces
Name: Docker Interface Library
Description: |
The library provides all necessary interface for Docker
and Kubernetes applications
Author: 'Mirantis, Inc'
Tags: [Docker, Kubernetes]
Classes:
io.murano.apps.docker.DockerApplication: DockerApplication.yaml
io.murano.apps.docker.DockerContainer: DockerContainer.yaml
io.murano.apps.docker.DockerContainerHost: DockerContainerHost.yaml
io.murano.apps.docker.DockerHelpers: DockerHelpers.yaml
io.murano.apps.docker.DockerHostVolume: DockerHostVolume.yaml
io.murano.apps.docker.DockerTempVolume: DockerTempVolume.yaml
io.murano.apps.docker.DockerVolume: DockerVolume.yaml
io.murano.apps.docker.ApplicationPort: ApplicationPort.yaml

View File

@ -0,0 +1,277 @@
Namespaces:
=: io.murano.apps.docker
res: io.murano.resources
std: io.murano
sys: io.murano.system
Name: DockerStandaloneHost
Extends:
- DockerContainerHost
Properties:
name:
Contract: $.string().notNull()
instance:
Contract: $.class(res:LinuxMuranoInstance).notNull()
dockerRegistry:
Contract: $.string()
applicationEndpoints:
Contract:
- port: $.int().notNull().check($ > 0)
address: $.string().notNull()
scope: $.string().notNull().check($ in list(public, cloud, internal, host))
portScope: $.string().notNull().check($ in list(public, cloud, internal, host))
containerPort: $.int().notNull().check($ > 0)
applicationName: $.string().notNull()
protocol: $.string().notNull().check($ in list(TCP, UDP))
Default: []
Usage: Out
containers:
Contract:
- $.string().notNull()
Default: []
Usage: Out
Methods:
initialize:
Body:
- $._environment: $.find(std:Environment).require()
deploy:
Body:
- If: not $.getAttr(deployed, false)
Then:
- $._environment.reporter.report($this, 'Create VM for Docker Server')
- $.instance.deploy()
- If: $.dockerRegistry != null and $.dockerRegistry != ''
Then:
- $._environment.reporter.report($this, 'Configuring Docker registry')
- $resources: new(sys:Resources)
- $template: $resources.yaml('SetupDockerRegistry.template').bind(dict(
dockerRegistry => $.dockerRegistry
))
- $.instance.agent.call($template, $resources)
- $._environment.reporter.report($this, 'Docker Server is up and running')
- $.setAttr(deployed, true)
hostContainer:
Arguments:
- container:
Contract: $.class(DockerContainer).notNull()
Body:
- $.deploy()
- $.deleteContainer($container.name)
- $portBindings: {}
- $newEndpoints: []
- $._pullImage(image => $container.image)
- For: applicationPort
In: $container.ports
Do:
- If: $applicationPort.scope != host
Then:
- $hostPort: $._acquirePort($applicationPort, $container.name)
- $containerPort: $._getPortSpec($applicationPort)
- $portBindings[$hostPort]: $containerPort
- If: $applicationPort.scope = public
Then:
- $rule:
- ToPort: $hostPort
FromPort: $hostPort
IpProtocol: toLower($applicationPort.protocol)
External: true
- $._environment.securityGroupManager.addGroupIngress($rule)
- $record:
port: $hostPort
address: $.instance.ipAddresses[0]
scope: cloud
containerPort: $applicationPort.port
portScope: $applicationPort.scope
protocol: $applicationPort.protocol
applicationName: $container.name
- $newEndpoints: $newEndpoints + list($record)
- If: $applicationPort.scope = public and $.instance.floatingIpAddress != null
Then:
- $record.address: $.instance.floatingIpAddress
- $record.scope: public
- $newEndpoints: $newEndpoints + list($record)
- $volumeMap: {}
- For: path
In: $container.volumes
Do:
- $volume: $container.volumes.get($path)
- If: $volume.getType() = HostDir
Then:
- $hostDir: $volume.getParameters()
- $volumeMap[$hostDir]: $path
- $._environment.reporter.report($this, 'Adding Docker Application')
- $resources: new(sys:Resources)
- $template: $resources.yaml('RunContainer.template').bind(dict(
appName => $container.name,
image => $container.image,
env => $container.env,
portMap => $portBindings,
volumeMap => $volumeMap,
commands => $container.commands
))
- $._removeApplicationEndpoints($container.name)
- $privateIp: $.instance.agent.call($template, $resources)
- $record:
port: $applicationPort.port
address: $privateIp
scope: host
containerPort: $applicationPort.port
portScope: $applicationPort.scope
protocol: $applicationPort.protocol
applicationName: $container.name
- $newEndpoints: $newEndpoints + list($record)
- $._environment.stack.push()
- If: not $container.name in $.containers
Then:
- $.containers: $.containers + list($container.name)
- $.applicationEndpoints: $.applicationEndpoints + $newEndpoints
- Return: $.getEndpoints($container.name)
getEndpoints:
Arguments:
- applicationName:
Contract: $.string().notNull()
Body:
- Return: $.applicationEndpoints.where($.applicationName = $applicationName)
_getPortSpec:
Arguments:
- applicationPort:
Contract: $.class(ApplicationPort).notNull()
Body:
- If: $applicationPort.protocol = UDP
Then:
- Return: format('{0}/udp', $applicationPort.port)
Else:
- Return: str($applicationPort.port)
_pullImage:
Arguments:
- image:
Contract: $.string().notNull()
Body:
- $._environment.reporter.report($this, 'Pulling app image {0}'.format($image))
- $resources: new(sys:Resources)
- $template: $resources.yaml('PullImage.template').bind(dict(
image => $image
))
- $.instance.agent.call($template, $resources)
- $._environment.reporter.report($this, 'Image saved')
_acquirePort:
Arguments:
- applicationPort:
Contract: $.class(ApplicationPort).notNull()
- applicationName:
Contract: $.string().notNull()
Body:
- $portMap: $.getAttr(portMap, dict())
- $applicationPorts: $.getAttr(applicationPorts, dict())
- $key: format('{0}-{1}-{2}', $applicationPort.port, $applicationPort.protocol, $applicationName)
- If: $key in $applicationPorts
Then:
- Return: $applicationPorts[$key]
- $port: $applicationPort.port
- If: $port in $portMap
Then:
- $port: 1025
- While: $port in $portMap
Do:
$port: $port + 1
- $portMap[$port]: $applicationName
- $applicationPorts[$key]: $port
- $.setAttr(portMap, $portMap)
- $.setAttr(applicationPorts, $applicationPorts)
- Return: $port
_releaseApplicationPorts:
Arguments:
- applicationName:
Contract: $.string().notNull()
Body:
- $portMap: $.getAttr(portMap, dict())
- $applicationPorts: $.getAttr(applicationPorts, dict())
- $newPortMap: {}
- $newApplicationPorts: {}
- $portsToDelete: []
- For: port
In: $portMap.keys()
Do:
- $value: $portMap.get($port)
- If: $value = $applicationName
Then:
- $portsToDelete: $portsToDelete + list($port)
Else:
- $newPortMap[$port]: $value
- For: key
In: $applicationPorts.keys()
Do:
- $value: $applicationPorts.get($port)
- If: not $value in $portsToDelete
Then:
- $newApplicationPorts[$key]: $value
- $.setAttr(portMap, $newPortMap)
- $.setAttr(applicationPorts, $newApplicationPorts)
_getResourceName:
Arguments:
- applicationName:
Contract: $.string().notNull()
Body:
- Return: format('{0}-{1}', $applicationName, $.id())
_removeApplicationEndpoints:
Arguments:
- applicationName:
Contract: $.string().notNull()
Body:
- $.applicationEndpoints: $.applicationEndpoints.select($.applicationName != $applicationName)
deleteContainer:
Arguments:
- name:
Contract: $.string().notNull()
Body:
- If: $name in $.containers
Then:
- $._environment.reporter.report($this, 'Deleting container {0}'.format($name))
- $._removeApplicationEndpoints($name)
- $._releaseApplicationPorts($name)
- $.containers: $.containers.where($ != $name)
- $resources: new(sys:Resources)
- $template: $resources.yaml('RemoveContainer.template').bind(dict(
name => $name
))
- $.instance.agent.call($template, $resources)
- $._environment.reporter.report($this, 'Container {0} deleted'.format($name))
getInternalScopeId:
Body:
Return: $.id()

View File

@ -0,0 +1,18 @@
FormatVersion: 2.0.0
Version: 1.0.0
Name: Pull image
Parameters:
image: $image
Body: |
runDockerCommand('pull {0}'.format(args.image))
Scripts:
runDockerCommand:
Type: Application
Version: 1.0.0
EntryPoint: runDockerCommand.sh
Options:
captureStdout: true
captureStderr: true

View File

@ -0,0 +1,19 @@
FormatVersion: 2.0.0
Version: 1.0.0
Name: Remove container
Parameters:
name: $name
Body: |
runDockerCommand('rm -f {0}'.format(args.name))
Scripts:
runDockerCommand:
Type: Application
Version: 1.0.0
EntryPoint: runDockerCommand.sh
Options:
captureStdout: false
captureStderr: false
verifyExitcode: false

View File

@ -0,0 +1,32 @@
FormatVersion: 2.0.0
Version: 1.0.0
Name: Run container
Parameters:
appName: $appName
portMap: $portMap
volumeMap: $volumeMap
env: $env
image: $image
commands: $commands
Body: |
options = ['-d', '--name ' + args.appName]
for container_port, host_port in args.portMap.iteritems():
options.append('-p {0}:{1}'.format(host_port, container_port))
for host_dir, container_dir in args.volumeMap.iteritems():
options.append("-v '{0}':'{1}'".format(host_dir, container_dir))
for key, value in args.env.iteritems():
options.append("-e '{0}'='{1}'".format(key, value))
runDockerCommand('run {0} {1} {2}'.format(' '.join(options), args.image, ' '.join(args.commands)).rstrip())
return runDockerCommand('inspect -f={{.NetworkSettings.IPAddress}} ' + args.appName).stdout
Scripts:
runDockerCommand:
Type: Application
Version: 1.0.0
EntryPoint: runDockerCommand.sh
Options:
captureStdout: true
captureStderr: true

View File

@ -0,0 +1,19 @@
FormatVersion: 2.0.0
Version: 1.0.0
Name: Setup Docker registry
Parameters:
dockerRegistry: $dockerRegistry
Body: |
setupRegistry(args.dockerRegistry)
Scripts:
setupRegistry:
Type: Application
Version: 1.0.0
EntryPoint: setupDockerRegistry.sh
Files: []
Options:
captureStdout: true
captureStderr: true

View File

@ -0,0 +1,3 @@
#!/bin/bash
docker $*

View File

@ -0,0 +1,7 @@
#!/bin/bash
source /etc/default/docker
DOCKER_OPTS+=" --registry-mirror=$1"
echo DOCKER_OPTS=\"$DOCKER_OPTS\" > /etc/default/docker
service docker restart

View File

@ -0,0 +1,71 @@
Version: 2
Application:
?:
type: io.murano.apps.docker.DockerStandaloneHost
name: $.appConfiguration.name
dockerRegistry: $.appConfiguration.dockerRegistry
instance:
?:
type: io.murano.resources.LinuxMuranoInstance
name: generateHostname($.instanceConfiguration.unitNamingPattern, 1)
flavor: $.instanceConfiguration.flavor
image: 'ubuntu14.04-x64-docker'
keyname: $.instanceConfiguration.keyPair
assignFloatingIp: $.appConfiguration.assignFloatingIP
availabilityZone: $.instanceConfiguration.availabilityZone
Forms:
- appConfiguration:
fields:
- name: name
type: string
label: Application Name
initial: Docker Standalone Host
description: >-
Enter a desired name for the application. Just A-Z, a-z, 0-9, dash and
underline are allowed
- name: assignFloatingIP
type: boolean
label: Assign Floating IP
description: >-
Select to true to assign floating IP automatically
initial: true
required: false
- name: dockerRegistry
type: string
label: Custom Docker registry URL
description: >-
URL of docker repository mirror to use. Leave empty for Docker default
required: false
- instanceConfiguration:
fields:
- name: title
type: string
required: false
hidden: true
description: Specify some instance parameters on which the application would be created
- name: flavor
type: flavor
label: Instance flavor
description: >-
Select registered in Openstack flavor. Consider that application performance
depends on this parameter.
required: false
- name: keyPair
type: keypair
label: Key Pair
description: >-
Select a Key Pair to control access to instances. You can login to
instances using this KeyPair after the deployment of application.
required: false
- name: availabilityZone
type: azone
label: Availability zone
description: Select availability zone where the application would be installed.
required: false
- name: unitNamingPattern
label: Hostname
type: string
required: false

View File

@ -0,0 +1,10 @@
Images:
- Name: 'ubuntu14.04-x64-docker'
Hash: 'f1688ab306415289280d3946984e1583'
Meta:
title: 'ubuntu14.04-x64-docker'
type: 'linux'
DiskFormat: 'qcow2'
ContainerFormat: 'bare'
Url: 'http://murano-files.mirantis.com/ubuntu14.04-x64-docker.qcow2'

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

View File

@ -0,0 +1,14 @@
Format: 1.0
Type: Application
FullName: io.murano.apps.docker.DockerStandaloneHost
Name: Docker Standalone Host
Description: |
Docker is an open platform for developers and sysadmins to build, ship, and run
distributed applications. Consisting of Docker Engine, a portable, lightweight
runtime and packaging tool, and Docker Hub, a cloud service for sharing applications
and automating workflows, Docker enables apps to be quickly assembled from components
and eliminates the friction between development, QA, and production environments.
Author: 'Mirantis, Inc'
Tags: [ Docker ]
Classes:
io.murano.apps.docker.DockerStandaloneHost: DockerStandaloneHost.yaml

View File

@ -0,0 +1,468 @@
Namespaces:
=: io.murano.apps.docker.kubernetes
std: io.murano
res: io.murano.resources
sys: io.murano.system
docker: io.murano.apps.docker
Name: KubernetesCluster
Extends: std:Application
Properties:
name:
Contract: $.string().notNull()
masterNode:
Contract: $.class(KubernetesMasterNode).notNull()
minionNodes:
Contract:
- $.class(KubernetesMinionNode).notNull()
- 1
nodeCount:
Contract: $.int().notNull().check($ > 0)
Usage: InOut
gatewayCount:
Contract: $.int().notNull()
Usage: InOut
gatewayNodes:
Contract:
- $.class(KubernetesGatewayNode).notNull()
dockerRegistry:
Contract: $.string()
serviceEndpoints:
Contract:
- port: $.int().notNull().check($ > 0)
address: $.string().notNull()
scope: $.string().notNull().check($ in list(public, cloud, internal, host))
portScope: $.string().notNull().check($ in list(public, cloud, internal, host))
containerPort: $.int().notNull().check($ > 0)
protocol: $.string().notNull().check($ in list(TCP, UDP))
applicationName: $.string().notNull()
podId: $.string().notNull()
serviceName: $.string()
Default: []
Usage: Out
Methods:
initialize:
Body:
- $._environment: $.find(std:Environment).require()
deploy:
Body:
- If: not $.getAttr(deployed, false)
Then:
- $._environment.reporter.report($this, 'Creating VMs for Kubernetes cluster')
- $securityGroupIngress:
- ToPort: 4001
FromPort: 4001
IpProtocol: tcp
External: false
- ToPort: 7001
FromPort: 7001
IpProtocol: tcp
External: false
- ToPort: 10250
FromPort: 10250
IpProtocol: tcp
External: false
- ToPort: 8080
FromPort: 8080
IpProtocol: tcp
External: $.masterNode.instance.assignFloatingIp
- ToPort: 2380
FromPort: 2380
IpProtocol: tcp
External: false
- ToPort: 8285
FromPort: 8285
IpProtocol: udp
External: false
- $._environment.securityGroupManager.addGroupIngress($securityGroupIngress)
- $.setAttr(deployed, true)
- $._environment.reporter.report($this, 'Setting up Kubernetes cluster')
- Parallel:
- Do: $.masterNode.deployInstance()
- Do: $.minionNodes.take($.nodeCount).pselect($.deployInstance())
- Do: $.gatewayNodes.take($.gatewayCount).pselect($.deployInstance())
- $.masterNode.setupEtcd()
- $.minionNodes.take($.nodeCount).select($.setupEtcd())
- $.gatewayNodes.take($.gatewayCount).select($.setupEtcd())
- $.masterNode.setupNode()
- Parallel:
- Do: $.minionNodes.take($.nodeCount).pselect($.setupNode())
- Do: $.minionNodes.skip($.nodeCount).pselect($.removeFromCluster())
- Do: $.gatewayNodes.take($.gatewayCount).pselect($.setupNode())
- $._updateEndpoints()
- $._environment.reporter.report($this, 'Kubernetes cluster is up and running')
getIp:
Body:
Return: $.masterNode.getIp()
createPod:
Arguments:
- definition:
Contract: {}
- isNew:
Contract: $.bool().notNull()
Default: true
Body:
- $.deploy()
- $resources: new(sys:Resources)
- $template: $resources.yaml('UpdatePod.template').bind(dict(
podDefinition => $definition,
isNew => $isNew
))
- $.masterNode.instance.agent.call($template, $resources)
createReplicationController:
Arguments:
- definition:
Contract: {}
- isNew:
Contract: $.bool().notNull()
Default: true
Body:
- $.deploy()
- $resources: new(sys:Resources)
- $template: $resources.yaml('UpdateReplicationController.template').bind(dict(
controllerDefinition => $definition,
isNew => $isNew
))
- $.masterNode.instance.agent.call($template, $resources)
destroyReplicationController:
Arguments:
- id:
Contract: $.string().notNull()
Body:
- $.deploy()
- $resources: new(sys:Resources)
- $template: $resources.yaml('DestroyReplicationController.template').bind(dict(rcId => $id))
- $.kubernetesCluster.masterNode.instance.agent.call($template, $resources)
createServices:
Arguments:
- applicationName:
Contract: $.string().notNull()
- applicationPorts:
Contract:
- $.class(docker:ApplicationPort)
- podId:
Contract: $.string().notNull()
Body:
- $resources: new(sys:Resources)
- $applicationServices: {}
- For: endpoint
In: $.serviceEndpoints.where($.applicationName = $applicationName).where($.serviceName != null)
Do:
- $serviceName: $endpoint.serviceName
- $applicationServices[$serviceName]: $endpoint
- $.serviceEndpoints: $.serviceEndpoints.where($.applicationName != $applicationName)
- $servicesUsed: []
- For: applicationPort
In: $applicationPorts
Do:
- If: $applicationPort.scope != host
Then:
- $serviceName: null
- $reuseEndpoint: null
- For: service
In: $applicationServices.keys()
Do:
- $endpoint: $applicationServices.get($service)
- If: $endpoint.containerPort = $applicationPort.port and $endpoint.protocol = $applicationPort.protocol
Then:
- $serviceName: $service
- $reuseEndpoint: $endpoint
- Break:
- If: $serviceName = null
Then:
- $serviceName: format('svc-{0}', randomName())
- $servicePort: $._findUnusedPort($applicationPort.port, $applicationPort.protocol)
- $serviceIp: $._createService($podId, $serviceName, $servicePort, $applicationPort)
Else:
- $servicesUsed: $servicesUsed + list($serviceName)
- $servicePort: $reuseEndpoint.port
- $serviceIp: $._updateService($podId, $reuseEndpoint)
- $newEndpoint:
port: $servicePort
address: $serviceIp
scope: internal
portScope: $applicationPort.scope
applicationName: $applicationName
containerPort: $applicationPort.port
protocol: $applicationPort.protocol
podId: $podId
serviceName: $serviceName
- $.serviceEndpoints: $.serviceEndpoints + list($newEndpoint)
- If: $applicationPort.scope in list(public, cloud)
Then:
- If: $.gatewayCount > 0
Then:
- $nodes: $.gatewayNodes.take($.gatewayCount)
Else:
- $nodes: $.minionNodes.take($.nodeCount)
- For: t
In: $nodes
Do:
- $newEndpoint.address: $t.getIp()
- $newEndpoint.scope: cloud
- $.serviceEndpoints: $.serviceEndpoints + list($newEndpoint)
- If: $t.instance.floatingIpAddress != null and $applicationPort.scope = public
Then:
- $newEndpoint.address: $t.instance.floatingIpAddress
- $newEndpoint.scope: public
- $.serviceEndpoints: $.serviceEndpoints + list($newEndpoint)
- $newEndpoint:
port: $applicationPort.port
address: '127.0.0.1'
scope: host
portScope: $applicationPort.scope
containerPort: $applicationPort.port
protocol: $applicationPort.protocol
applicationName: $applicationName
podId: $podId
serviceName: null
- $.serviceEndpoints: $.serviceEndpoints + list($newEndpoint)
- For: service
In: $applicationServices.keys()
Do:
- If: not $service in $servicesUsed
Then:
- $._destroyService($service)
- $._environment.stack.push()
_createService:
Arguments:
- podId:
Contract: $.string().notNull()
- serviceName:
Contract: $.string().notNull()
- servicePort:
Contract: $.int().notNull()
- applicationPort:
Contract: $.class(docker:ApplicationPort)
Body:
- $resources: new(sys:Resources)
- $serviceDefinition: $._buildServiceDefinition(
$serviceName,
$servicePort,
$applicationPort.protocol,
$applicationPort.port,
$podId,
$.gatewayCount = 0
)
- $template: $resources.yaml('UpdateService.template').bind(dict(
serviceDefinition => $serviceDefinition,
isNew => true
))
- $securityGroupIngress:
- ToPort: $servicePort
FromPort: $servicePort
IpProtocol: toLower($applicationPort.protocol)
External: $applicationPort.scope = public
- $._environment.securityGroupManager.addGroupIngress($securityGroupIngress)
- Return: $.masterNode.instance.agent.call($template, $resources)
_updateService:
Arguments:
- podId:
Contract: $.string().notNull()
- endpoint:
Contract:
port: $.int().notNull().check($ > 0)
address: $.string().notNull()
scope: $.string().notNull().check($ in list(public, cloud, internal, host))
containerPort: $.int().notNull().check($ > 0)
protocol: $.string().notNull().check($ in list(TCP, UDP))
applicationName: $.string().notNull()
podId: $.string().notNull()
serviceName: $.string()
Body:
- $resources: new(sys:Resources)
- $prevNodeCount: $.getAttr(lastNodeCount, 0-1) # 0-1 instead of -1 because YAQL 0.2 doesn't understand unary operators
- $prevGatewayCount: $.getAttr(lastGatewayCount, 0-1)
- $gatewayModeChanged: $prevGatewayCount != $.gatewayCount and $prevGatewayCount * $.gatewayCount = 0
- $serviceChanged: $endpoint.podId != $podId or
$endpoint.portScope in list(public, cloud) and (
$gatewayModeChanged or $.gatewayCount = 0 and $prevNodeCount != $.nodeCount)
- If: $serviceChanged
Then:
- $serviceDefinition: $._buildServiceDefinition(
$endpoint.serviceName,
$endpoint.port,
$endpoint.protocol,
$endpoint.containerPort,
$podId,
$.gatewayCount = 0
)
- $template: $resources.yaml('UpdateService.template').bind(dict(
serviceDefinition => $serviceDefinition,
isNew => false
))
- $serviceIp: $.masterNode.instance.agent.call($template, $resources)
Else:
- $serviceIp: $endpoint.address
- Return: $serviceIp
_updateEndpoints:
Body:
- For: endpoint
In: $.serviceEndpoints
Do:
- $._updateService($endpoint.podId, $endpoint)
- $.setAttr(lastNodeCount, $.nodeCount)
- $.setAttr(lastGatewayCount, $.gatewayCount)
_destroyService:
Arguments:
serviceName:
Contract: $.string().notNull()
Body:
- $resources: new(sys:Resources)
- $template: $resources.yaml('DestroyService.template').bind(dict(
serviceId => $service
))
- $.masterNode.instance.agent.call($template, $resources)
destroyService:
Arguments:
- applicationName:
Contract: $.string().notNull()
- podId:
Contract: $.string().notNull()
Body:
- $._destroyService($applicationName, $podId)
_findUnusedPort:
Arguments:
- initial:
Contract: $.int().notNull()
- protocol:
Contract: $.string().notNull()
Body:
- If: initial != 22 and $._checkIfPortIsNotUsed($initial, $protocol)
Then:
Return: $initial
- $port: 1025
- While: not $._checkIfPortIsNotUsed($port, $protocol)
Do:
$port: $port + 1
- Return: $port
_checkIfPortIsNotUsed:
Arguments:
- port:
Contract: $.int().notNull()
- protocol:
Contract: $.string().notNull()
Body:
- Return: len(list($.serviceEndpoints.where($.port = $port).where($.protocol = $protocol))) = 0
_buildServiceDefinition:
Arguments:
- serviceName:
Contract: $.string().notNull()
- servicePort:
Contract: $.int().notNull()
- protocol:
Contract: $.string().notNull()
- containerPort:
Contract: $.int().notNull()
- podId:
Contract: $.string().notNull()
- withNodeIps:
Contract: $.bool().notNull()
Body:
- $result:
id: $serviceName
kind: Service
apiVersion: v1beta1
port: $servicePort
containerPort: $containerPort
protocol: $protocol
selector:
id: $podId
- If: $withNodeIps
Then:
- $result.publicIPs: $.minionNodes.take($.nodeCount).select($.getIp())
- Return: $result
scaleNodesUp:
Usage: Action
Body:
- If: $.nodeCount < len($.minionNodes)
Then:
- $._environment.reporter.report($this, 'Scaling up Kubernetes cluster')
- $.nodeCount: $.nodeCount + 1
- $.deploy()
scaleNodesDown:
Usage: Action
Body:
- If: $.nodeCount > 1
Then:
- $._environment.reporter.report($this, 'Scaling Kubernetes cluster down')
- $.nodeCount: $.nodeCount - 1
- $.deploy()
scaleGatewaysUp:
Usage: Action
Body:
- If: $.gatewayCount < len($.gatewayNodes)
Then:
- $._environment.reporter.report($this, 'Adding new gateway node')
- $.gatewayCount: $.gatewayCount + 1
- $.deploy()
exportConfig:
Usage: Action
Body:
- $._environment.reporter.report($this, 'Action exportConfig called')
- $resources: new(sys:Resources)
- $template: $resources.yaml('ExportConfig.template')
- $result: $.masterNode.instance.agent.call($template, $resources)
- $._environment.reporter.report($this, 'Got archive from Kubernetes')
- Return: new(std:File, base64Content => $result.content,
filename => 'application.tar.gz')

View File

@ -0,0 +1,61 @@
Namespaces:
=: io.murano.apps.docker.kubernetes
std: io.murano
res: io.murano.resources
sys: io.murano.system
Name: KubernetesGatewayNode
Extends: KubernetesNode
Methods:
initialize:
Body:
- $._environment: $.find(std:Environment).require()
- $._cluster: $.find(KubernetesCluster).require()
deployInstance:
Body:
- If: not $.getAttr(instanceDeployed, false)
Then:
- $._environment.reporter.report($this, 'Creating Gateway node for Kubernetes services')
- $.super($.deployInstance())
- $.setAttr(instanceDeployed, true)
setupEtcd:
Body:
- If: not $.getAttr(etcdConfigured, false)
Then:
- $._environment.reporter.report($, 'Configuring etcd node {0}'.format($.instance.name))
- $resources: new(sys:Resources)
- $template: $resources.yaml('EtcdAddMember.template').bind(dict(
name => $.instance.name,
ip => $.getIp()
))
- $clusterConfig: $._cluster.masterNode.instance.agent.call($template, $resources)
- $template: $resources.yaml('MemberEtcdSetup.template').bind(dict(
name => $.instance.name,
ip => $.getIp(),
clusterConfig => $clusterConfig
))
- $.instance.agent.call($template, $resources)
- $.setAttr(etcdConfigured, true)
setupNode:
Body:
- If: not $.getAttr(nodeConfigured, false)
Then:
- $._environment.reporter.report($this, 'Setup Flannel network on {0}'.format($.instance.name))
- $resources: new(sys:Resources)
- $template: $resources.yaml('SetupFlannelNode.template')
- $.instance.agent.call($template, $resources)
- $._environment.reporter.report($, 'Setup Load Balancer on {0}'.format($.instance.name))
- $template: $resources.yaml('HAProxySetup.template').bind(dict(
masterIp => $._cluster.masterNode.getIp()
))
- $.instance.agent.call($template, $resources)
- $.setAttr(nodeConfigured, true)

View File

@ -0,0 +1,56 @@
Namespaces:
=: io.murano.apps.docker.kubernetes
std: io.murano
res: io.murano.resources
sys: io.murano.system
Name: KubernetesMasterNode
Extends: KubernetesNode
Methods:
initialize:
Body:
- $._environment: $.find(std:Environment).require()
deployInstance:
Body:
- If: not $.getAttr(instanceDeployed, false)
Then:
- $._environment.reporter.report($this, 'Creating Kubernetes Master')
- $.super($.deployInstance())
- $.setAttr(instanceDeployed, true)
setupEtcd:
Body:
- If: not $.getAttr(etcdConfigured, false)
Then:
- $._environment.reporter.report($, 'Configuring etcd master node')
- $resources: new(sys:Resources)
- $template: $resources.yaml('MasterEtcdSetup.template').bind(dict(
name => $.instance.name,
ip => $.getIp()
))
- $.instance.agent.call($template, $resources)
- $.setAttr(etcdConfigured, true)
setupNode:
Body:
- If: not $.getAttr(nodeConfigured, false)
Then:
- $resources: new(sys:Resources)
- $._environment.reporter.report($this, 'Setup Flannel network on master node')
- $template: $resources.yaml('SetupFlannelMaster.template')
- $.instance.agent.call($template, $resources)
- $._environment.reporter.report($this, 'Setup Kubernetes API host')
- $resources: new(sys:Resources)
- $template: $resources.yaml('KubeMasterSetup.template').bind(dict(
name => $.instance.name,
ip => $.getIp()
))
- $.instance.agent.call($template, $resources)
- $.setAttr(nodeConfigured, true)

View File

@ -0,0 +1,102 @@
Namespaces:
=: io.murano.apps.docker.kubernetes
std: io.murano
res: io.murano.resources
sys: io.murano.system
Name: KubernetesMinionNode
Extends: KubernetesNode
Properties:
enableMonitoring:
Contract: $.bool().notNull()
Default: false
Methods:
initialize:
Body:
- $._environment: $.find(std:Environment).require()
- $._cluster: $.find(KubernetesCluster).require()
deployInstance:
Body:
- If: not $.getAttr(instanceDeployed, false)
Then:
- $._environment.reporter.report($this, 'Creating Kubernetes Minion')
- $.super($.deployInstance())
- $.setAttr(instanceDeployed, true)
setupEtcd:
Body:
- If: not $.getAttr(etcdConfigured, false)
Then:
- $._environment.reporter.report($, 'Configuring etcd node {0}'.format($.instance.name))
- $resources: new(sys:Resources)
- $template: $resources.yaml('EtcdAddMember.template').bind(dict(
name => $.instance.name,
ip => $.getIp()
))
- $clusterConfig: $._cluster.masterNode.instance.agent.call($template, $resources)
- $template: $resources.yaml('MemberEtcdSetup.template').bind(dict(
name => $.instance.name,
ip => $.getIp(),
clusterConfig => $clusterConfig
))
- $.instance.agent.call($template, $resources)
- $.setAttr(etcdConfigured, true)
setupNode:
Body:
- If: not $.getAttr(nodeConfigured, false)
Then:
- $._environment.reporter.report($this, 'Setup Flannel network on {0}'.format($.instance.name))
- $resources: new(sys:Resources)
- $template: $resources.yaml('SetupFlannelNode.template')
- $.instance.agent.call($template, $resources)
- If: $.enableMonitoring
Then:
- $._environment.reporter.report($this, 'Adding access to cAdvisor')
- $securityGroupIngress:
- ToPort: 4194
FromPort: 4194
IpProtocol: tcp
External: true
- $._environment.securityGroupManager.addGroupIngress($securityGroupIngress)
- $._environment.reporter.report($, 'Setup Kubernetes Minion on {0}'.format($.instance.name))
- $template: $resources.yaml('KubeMinionSetup.template').bind(dict(
name => $.instance.name,
ip => $.getIp(),
masterIp => $._cluster.masterNode.getIp(),
enableMonitoring => $.enableMonitoring,
dockerRegistry => $._cluster.dockerRegistry
))
- $.instance.agent.call($template, $resources)
- $template: $resources.yaml('KubeRegisterNode.template').bind(dict(
name => $.instance.name,
nodeId => $.getIp()
))
- $._cluster.masterNode.instance.agent.call($template, $resources)
- $.setAttr(nodeConfigured, true)
removeFromCluster:
Body:
- If: $.getAttr(nodeConfigured, false)
Then:
- $._environment.reporter.report($this, 'Deleting Kubernetes Minion')
- $resources: new(sys:Resources)
- $template: $resources.yaml('RemoveMinion.template').bind(dict(
nodeId => $.getIp()
))
- $._cluster.masterNode.instance.agent.call($template, $resources)
- $._environment.reporter.report($this, 'Node {0} deleted'.format($.instance.name))
- $.setAttr(nodeConfigured, false)

View File

@ -0,0 +1,27 @@
Namespaces:
=: io.murano.apps.docker.kubernetes
std: io.murano
res: io.murano.resources
sys: io.murano.system
Name: KubernetesNode
Properties:
instance:
Contract: $.class(res:LinuxMuranoInstance).notNull()
Methods:
getIp:
Body:
Return: $.instance.ipAddresses[0]
deployInstance:
Body:
- $.instance.deploy()
setupEtcd:
setupNode:

View File

@ -0,0 +1,20 @@
FormattVersion: 2.0.0
Version: 1.0.0
Name: Destroy Replication Controller
Parameters:
rcId: $rcId
Body: |
return destroyReplicationController(args.rcId).stdout
Scripts:
destroyReplicationController:
Type: Application
Version: 1.0.0
EntryPoint: destroyReplicationController.sh
Files: []
Options:
captureStdout: true
captureStderr: true

View File

@ -0,0 +1,20 @@
FormatVersion: 2.0.0
Version: 1.0.0
Name: Destroy Service
Parameters:
serviceId: $serviceId
Body: |
return destroyService('{0}'.format(args.serviceId)).stdout
Scripts:
destroyService:
Type: Application
Version: 1.0.0
EntryPoint: destroyService.sh
Files: []
Options:
captureStdout: true
captureStderr: true

View File

@ -0,0 +1,21 @@
FormatVersion: 2.0.0
Version: 1.0.0
Name: Add etcd member
Parameters:
name: $name
ip: $ip
Body: |
return setup('{0} {1}'.format(args.name, args.ip)).stdout
Scripts:
setup:
Type: Application
Version: 1.0.0
EntryPoint: master-add-member.sh
Files: []
Options:
captureStdout: true
captureStderr: true

View File

@ -0,0 +1,23 @@
FormatVersion: 2.0.0
Version: 1.0.0
Name: Export Config
Parameters:
name: $name
Body: |
log=setup('{0}'.format(args.name)).stdout
filename='/var/run/murano-kubernetes/application.tgz.b64'
with open(filename,'r') as f:
content=f.read()
return {'log': log, 'content': content}
Scripts:
setup:
Type: Application
Version: 1.0.0
EntryPoint: exportConfig.sh
Files: []
Options:
captureStdout: true
captureStderr: true

View File

@ -0,0 +1,24 @@
FormatVersion: 2.0.0
Version: 1.0.0
Name: Setup HAProxy
Parameters:
masterIp: $masterIp
Body: |
setup(args.masterIp)
Scripts:
setup:
Type: Application
Version: 1.0.0
EntryPoint: haproxy-setup.sh
Files:
- default_scripts/haproxy
- init_conf/confd.conf
- haproxy.tmpl
- haproxy.toml
Options:
captureStdout: true
captureStderr: true

View File

@ -0,0 +1,30 @@
FormatVersion: 2.0.0
Version: 1.0.0
Name: Setup Kubernetes Master
Parameters:
name: $name
ip: $ip
Body: |
return setup('{0} {1}'.format(args.name, args.ip)).stdout
Scripts:
setup:
Type: Application
Version: 1.0.0
EntryPoint: master-kube-setup.sh
Files:
- init_conf/kube-apiserver.conf
- init_conf/kube-controller-manager.conf
- init_conf/kube-scheduler.conf
- initd_scripts/kube-apiserver
- initd_scripts/kube-controller-manager
- initd_scripts/kube-scheduler
- default_scripts/kube-apiserver
- default_scripts/kube-scheduler
- default_scripts/kube-controller-manager
Options:
captureStdout: true
captureStderr: true

Some files were not shown because too many files have changed in this diff Show More