diff --git a/CloudFoundry/package/Classes/CloudFoundry.yaml b/CloudFoundry/package/Classes/CloudFoundry.yaml index 5b688e07..5e8debf2 100644 --- a/CloudFoundry/package/Classes/CloudFoundry.yaml +++ b/CloudFoundry/package/Classes/CloudFoundry.yaml @@ -30,13 +30,13 @@ Properties: Methods: initialize: Body: - - $.environment: $.find(std:Environment).require() + - $._environment: $.find(std:Environment).require() deploy: Body: - If: not $.getAttr(deployed, false) Then: - - $.environment.reporter.report($this, 'Creating VM for CloudFoundry ') + - $._environment.reporter.report($this, 'Creating VM for CloudFoundry ') - $securityGroupIngress: - ToPort: 80 FromPort: 80 @@ -50,39 +50,53 @@ Methods: FromPort: 443 IpProtocol: tcp External: true - - $.environment.securityGroupManager.addGroupIngress($securityGroupIngress) + - $._environment.securityGroupManager.addGroupIngress($securityGroupIngress) - $.instance.deploy() - $resources: new(sys:Resources) + + #NOTE(ddovbii) This is workaround which forbids installing CF to non-Ubuntu images + #As soon as we have the ability to filter images by distribution type + #(https://blueprints.launchpad.net/murano/+spec/better-image-filtering) + #this workaround should be deleted + - $template: $resources.yaml('CheckOS.template') + - $os: $.instance.agent.call($template, $resources) + - If: not $os.startsWith('Ubuntu 14.04') + Then: + - $msg: 'Unable to deploy. Only Ubuntu 14.04 is supported' + - $._environment.reporter.report_error($this, $msg) + - Throw: UnsupportedDistributionVersion + Message: $msg + #All steps below actually follow the process in ./scripts/install.sh # Just add more interactivity to provide status # Install Ruby part - $template: $resources.yaml('InstallRuby.template') - - $.environment.reporter.report($this, '[1/6] Installing Ruby...') + - $._environment.reporter.report($this, '[1/6] Installing Ruby...') - $.instance.agent.call($template, $resources, 3600) #Clone base repos - $template: $resources.yaml('CloneRepos.template') - - $.environment.reporter.report($this, '[2/6]Cloning git repositories for BOSH and cf-release...') + - $._environment.reporter.report($this, '[2/6]Cloning git repositories for BOSH and cf-release...') - $.instance.agent.call($template, $resources, 3600) #Install Environment - $template: $resources.yaml('InstallEnvironment.template') - - $.environment.reporter.report($this, '[3/6]Install Environment...') + - $._environment.reporter.report($this, '[3/6]Install Environment...') - $.instance.agent.call($template, $resources, 3600) #Install CF release - $template: $resources.yaml('InstallCFRelease.template') - - $.environment.reporter.report($this, '[4/6]Installing cf-release...') + - $._environment.reporter.report($this, '[4/6]Installing cf-release...') - $.instance.agent.call($template, $resources, 7200) #Install CF CLI - $template: $resources.yaml('InstallCFcli.template') - - $.environment.reporter.report($this, '[5/6]Installing CF CLI...') + - $._environment.reporter.report($this, '[5/6]Installing CF CLI...') - $.instance.agent.call($template, $resources, 600) - $template: $resources.yaml('StartCloudFoundry.template') - - $.environment.reporter.report($this, '[6/6]Start CloudFoundry services...') + - $._environment.reporter.report($this, '[6/6]Start CloudFoundry services...') - $result: $.instance.agent.call($template, $resources, 3600) - - $.environment.reporter.report($this, 'CloudFoundry is started') - - $.environment.reporter.report($this, $result) + - $._environment.reporter.report($this, 'CloudFoundry is started') + - $._environment.reporter.report($this, $result) - $.setAttr(deployed, True) diff --git a/CloudFoundry/package/README.rst b/CloudFoundry/package/README.rst new file mode 100644 index 00000000..f0b36d5a --- /dev/null +++ b/CloudFoundry/package/README.rst @@ -0,0 +1,19 @@ +============= +Cloud Foundry +============= + +Cloud Foundry is an open platform as a service, providing a choice of clouds, +developer frameworks, and application services. Cloud Foundry makes it faster +and easier to build, test, deploy, and scale applications. It is an open source +project and is available through a variety of private cloud distributions and +public cloud instances. + +This package deploys Cloud Foundry v2 in a single VM instance using cf_nise_installer: + +https://github.com/yudai/cf_nise_installer + +### Requirements + +* Ubuntu 14.04 64bit (Trusty) +* 8GB+ free HDD space +* 2GB+ memory \ No newline at end of file diff --git a/CloudFoundry/package/Resources/CheckOS.template b/CloudFoundry/package/Resources/CheckOS.template new file mode 100644 index 00000000..88dbbb8a --- /dev/null +++ b/CloudFoundry/package/Resources/CheckOS.template @@ -0,0 +1,28 @@ +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +FormatVersion: 2.0.0 +Version: 1.0.0 +Name: Check OS Distribution + +Body: | + return checkOS().stdout + +Scripts: + checkOS: + Type: Application + Version: 1.0.0 + EntryPoint: checkOS.sh + Options: + captureStdout: true + captureStderr: true + diff --git a/CloudFoundry/package/Resources/scripts/checkOS.sh b/CloudFoundry/package/Resources/scripts/checkOS.sh new file mode 100644 index 00000000..23594c99 --- /dev/null +++ b/CloudFoundry/package/Resources/scripts/checkOS.sh @@ -0,0 +1,22 @@ +#!/bin/bash +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +command_exists() { + command -v "$@" > /dev/null 2>&1 +} + +if command_exists lsb_release; then + lsb_release -sd +else + echo "unknown version" +fi diff --git a/CloudFoundry/package/UI/ui.yaml b/CloudFoundry/package/UI/ui.yaml index c18bf2bc..2aba1904 100644 --- a/CloudFoundry/package/UI/ui.yaml +++ b/CloudFoundry/package/UI/ui.yaml @@ -68,6 +68,10 @@ Forms: - name: flavor type: flavor label: Instance flavor + requirements: + min_disk: 8 + min_vcpus: 2 + min_memory_mb: 2048 description: >- Select registered in Openstack flavor. Consider that application performance depends on this parameter.