Add CloudFoundryDiego

This application installs a single VM instance of CloudFoundry Diego.
It will require a special image to be built. DIB elements are included.

Change-Id: I5c960294f8f85852db7e3321aed8d58f3f610977
This commit is contained in:
Andrey Shestakov 2015-04-17 10:15:39 +03:00
parent aaf753732f
commit 735771b6f6
21 changed files with 1148 additions and 0 deletions

View File

@ -0,0 +1,7 @@
#!/bin/bash
set -eu
# enable cgroups in kernel
sed -i -e 's/\(^GRUB_CMDLINE_LINUX.*\)"$/\1 cgroup_enable=memory swapaccount=1"/' /etc/default/grub
update-grub

View File

@ -0,0 +1,152 @@
#!/bin/bash
set -eu
function retry()
{
local n=0
local try=$1
local cmd="${@: 2}"
[[ $# -le 1 ]] && {
echo "Usage $0 <retry_number> <Command>"; }
until [[ $n -ge $try ]]
do
$cmd && break || {
echo "Command Fail.."
((n++))
echo "retry $n ::"
sleep 1;
}
done
}
install-packages git build-essential ruby ruby-dev libxml2-dev libsqlite3-dev libxslt1-dev libpq-dev libmysqlclient-dev quota cmake unzip
# install spiff
wget https://github.com/cloudfoundry-incubator/spiff/releases/download/v1.0.3/spiff_linux_amd64.zip -O /tmp/spiff_linux_amd64.zip
unzip /tmp/spiff_linux_amd64.zip -d /usr/local/bin/
rm /tmp/spiff_linux_amd64.zip
# install bosh_cli
gem install bundler bosh_cli --no-ri --no-rdoc
# prepare repos
mkdir /root/workspace
# CF
cd /root/workspace
git clone https://github.com/cloudfoundry/cf-release
cd /root/workspace/cf-release
# checkout to release-207
#git reset --hard afbe01cecc67fc4fe45a1a7cfc774fc2baa25d6c
git checkout v207
# update
git submodule sync
git submodule foreach --recursive 'git submodule sync; git clean -d --force --force'
git submodule update --init --recursive --force
git clean -ffd
# remove buildpacks
cat << EOF > /root/workspace/remove-cf-buildpacks.patch
diff --git a/config/blobs.yml b/config/blobs.yml
index c048acc..fc6c0b3 100644
--- a/config/blobs.yml
+++ b/config/blobs.yml
@@ -115,32 +115,3 @@ consul/consul_0.5.0_linux_amd64.zip:
object_id: 3e6c1e47-95a5-45ef-aeec-2cb4cc4c529a
sha: 00e4c6e9ff2fb326d3b586fd86c3037f3b7e0974
size: 4669655
-go-buildpack/go_buildpack-cached-v1.2.0.zip:
- object_id: da609e02-aec5-4d54-93bc-86ca0b44eed7
- sha: e58788c873ddbecd641532f32ce4d535b2a79f81
- size: 663443569
-python-buildpack/python_buildpack-cached-v1.2.0.zip:
- object_id: 3e8561a1-7cdc-45c2-9eff-b8d49ebc4e88
- sha: 2ca4545ab99ac2a2e430f58fe1ec55fe6b96a7b3
- size: 685706721
-ruby-buildpack/ruby_buildpack-cached-v1.3.0.zip:
- object_id: 3d8d4bfc-91b2-419b-857d-9f26e31340bd
- sha: 5dde3ea0e15908554eaa5b12df38652436c469b5
- size: 966348817
-php-buildpack/php_buildpack-offline-v3.1.0.zip:
- object_id: b817bdc3-4765-423c-aebd-195b980550a3
- sha: 9bb6c36e13976288c62794f8dcb06965ef898033
- size: 1089981446
-nodejs-buildpack/nodejs_buildpack-cached-v1.2.1.zip:
- object_id: 21a8eb83-97b9-49cd-ba57-bd2cca1f9133
- sha: !binary |-
- OGM1MzQwNTdmYzFmZTBjY2JkZmE1NTQ3YzI1ZjMwYWQ3OWRkMzY4ZA==
- size: 437119230
-java-buildpack/java-buildpack-offline-v3.0.zip:
- object_id: 8fe6e89a-aa63-4119-8fd0-23715820f31d
- sha: a300c3fca530dc16345dbd6feb26b13897d05265
- size: 324816174
-java-buildpack/java-buildpack-v3.0.zip:
- object_id: 34bff29b-9ec3-42aa-891f-db301f7f978d
- sha: 177715b012505051d14611bf706f0ebe50cc55f0
- size: 150091
diff --git a/jobs/cloud_controller_ng/spec b/jobs/cloud_controller_ng/spec
index 82a4545..90281eb 100644
--- a/jobs/cloud_controller_ng/spec
+++ b/jobs/cloud_controller_ng/spec
@@ -29,13 +29,6 @@ packages:
- libpq
- mysqlclient
- ruby-2.1.4
- - buildpack_java
- - buildpack_java_offline
- - buildpack_ruby
- - buildpack_nodejs
- - buildpack_go
- - buildpack_python
- - buildpack_php
properties:
ssl.skip_cert_verify:
EOF
patch -p1 < /root/workspace/remove-cf-buildpacks.patch
rm -f /root/workspace/remove-cf-buildpacks.patch
rm -rf packages/buildpack_*
# Diego
cd /root/workspace
git clone https://github.com/cloudfoundry-incubator/diego-release
cd /root/workspace/diego-release
# reset to release 0.1099
git reset --hard bbdd0d01a2bafb2f7772a0f088262858bccd4620
git submodule foreach --recursive git submodule sync && git submodule update --init --recursive
git submodule sync --recursive && git submodule foreach --recursive git submodule sync && git submodule update --init --recursive
# generate manifests
echo "director_uuid: __director_uuid__" > /root/workspace/director.yml
cd /root/workspace/cf-release
./generate_deployment_manifest warden \
/root/workspace/director.yml \
/root/workspace/diego-release/stubs-for-cf-release/enable_diego_docker_in_cc.yml \
/root/workspace/diego-release/stubs-for-cf-release/enable_consul_with_cf.yml \
> /root/workspace/cf.yml
cd ~/workspace/diego-release
./scripts/generate-deployment-manifest \
/root/workspace/director.yml \
manifest-generation/bosh-lite-stubs/property-overrides.yml \
manifest-generation/bosh-lite-stubs/instance-count-overrides.yml \
manifest-generation/bosh-lite-stubs/persistent-disk-overrides.yml \
manifest-generation/bosh-lite-stubs/iaas-settings.yml \
manifest-generation/bosh-lite-stubs/additional-jobs.yml \
/root/workspace \
> /root/workspace/diego.yml
rm /root/workspace/director.yml
# create cf release file
cd /root/workspace/cf-release
retry 3 bosh -n create release --force --with-tarball
mv dev_releases/cf/cf-207+dev.1.tgz /root/workspace/cf-release.tgz
# create diego release file
cd /root/workspace/diego-release
retry 3 bosh -n create release --force --with-tarball
mv dev_releases/diego/diego-0.1099.0+dev.1.tgz /root/workspace/diego-release.tgz
# cleanup
rm -rf /root/workspace/cf-release
rm -rf /root/workspace/diego-release
rm -rf /root/.bosh

View File

@ -0,0 +1,84 @@
# 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.
Namespaces:
=: io.murano.apps.paas
std: io.murano
res: io.murano.resources
sys: io.murano.system
Name: CloudFoundryDiego
Extends: std:Application
Properties:
name:
Contract: $.string().notNull()
instance:
Contract: $.class(res:Instance).notNull()
Methods:
initialize:
Body:
- $.environment: $.find(std:Environment).require()
deploy:
Body:
- If: not $.getAttr(deployed, false)
Then:
- $.environment.reporter.report($this, 'Creating VM for CloudFoundryDiego ')
- $securityGroupIngressDiego:
- ToPort: 80
FromPort: 80
IpProtocol: tcp
External: true
- ToPort: 65535
FromPort: 1024
IpProtocol: tcp
External: false
- ToPort: 443
FromPort: 443
IpProtocol: tcp
External: true
- $.environment.securityGroupManager.addGroupIngress($securityGroupIngress)
- $.instance.deploy()
- $resources: new(sys:Resources)
# Install Bosh
- $template: $resources.yaml('InstallBosh.template')
- $.environment.reporter.report($this, '[1/5] Installing Bosh...')
- $.instance.agent.call($template, $resources, 3600)
# Upload releases
- $template: $resources.yaml('UploadReleases.template')
- $.environment.reporter.report($this, '[2/5] Upload releases...')
- $.instance.agent.call($template, $resources, 3600)
# Deploy CF Release
- $template: $resources.yaml('DeployCFRelease.template')
- $.environment.reporter.report($this, '[3/5] Deploying cf-release...')
- $.instance.agent.call($template, $resources, 3600)
# Deploy Diego Release
- $template: $resources.yaml('DeployDiegoRelease.template')
- $.environment.reporter.report($this, '[4/5] Deploying diego-release...')
- $.instance.agent.call($template, $resources, 3600)
# Install CLI
- $template: $resources.yaml('InstallCLI.template')
- $.environment.reporter.report($this, '[5/5] Installing CLI...')
- $result: $.instance.agent.call($template, $resources, 600)
- $.environment.reporter.report($this, 'CloudFoundry Diego is ready')
- $.environment.reporter.report($this, $result)
- $.setAttr(deployed, true)

View File

@ -0,0 +1,175 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.

View File

@ -0,0 +1,32 @@
# 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: Deploy CF Release
Parameters:
appName: $appName
Body: |
return deploy(args.appName).stdout
Scripts:
deploy:
Type: Application
Version: 1.0.0
EntryPoint: deployCFRelease.sh
Files:
- <common.sh>
Options:
captureStdout: true
captureStderr: true

View File

@ -0,0 +1,32 @@
# 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: Deploy Diego Release
Parameters:
appName: $appName
Body: |
return deploy(args.appName).stdout
Scripts:
deploy:
Type: Application
Version: 1.0.0
EntryPoint: deployDiegoRelease.sh
Files:
- <common.sh>
Options:
captureStdout: true
captureStderr: true

View File

@ -0,0 +1,34 @@
# 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: Install Bosh
Parameters:
appName: $appName
Body: |
return deploy(args.appName).stdout
Scripts:
deploy:
Type: Application
Version: 1.0.0
EntryPoint: installBosh.sh
Files:
- <common.sh>
- <config.json>
- <manifest.yml>
Options:
captureStdout: true
captureStderr: true

View File

@ -0,0 +1,33 @@
# 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: Install CLI
Parameters:
appName: $appName
Body: |
return deploy(args.appName).stdout
Scripts:
deploy:
Type: Application
Version: 1.0.0
EntryPoint: installCLI.sh
Files:
- <common.sh>
Options:
captureStdout: true
captureStderr: true

View File

@ -0,0 +1,32 @@
# 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: Upload Releases
Parameters:
appName: $appName
Body: |
return deploy(args.appName).stdout
Scripts:
deploy:
Type: Application
Version: 1.0.0
EntryPoint: uploadReleases.sh
Files:
- <common.sh>
Options:
captureStdout: true
captureStderr: true

View File

@ -0,0 +1,34 @@
#!/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.
set +eu
function retry()
{
local n=0
local try=$1
local cmd="${@: 2}"
[[ $# -le 1 ]] && {
echo "Usage $0 <retry_number> <Command>"; }
until [[ $n -ge $try ]]
do
$cmd && break || {
echo "Command Fail.."
((n++))
echo "retry $n ::"
sleep 1;
}
done
}

View File

@ -0,0 +1,27 @@
{
"assets_dir": "/root/workspace/bosh-provisioner/assets",
"repos_dir": "/opt/bosh-provisioner/repos",
"blobstore": {
"provider": "local",
"options": {
"blobstore_path": "/opt/bosh-provisioner/blobstore"
}
},
"vm_provisioner": {
"full_stemcell_compatibility": false,
"agent_provisioner": {
"infrastructure": "warden",
"platform": "ubuntu",
"configuration": { "platform": {"linux": {"UseDefaultTmpDir": true}}},
"mbus": "https://user:password@127.0.0.1:4321/agent"
}
},
"deployment_provisioner": {
"manifest_path": "/root/workspace/manifest.yml"
}
}

View File

@ -0,0 +1,34 @@
#!/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.
set -eu
exec &> /tmp/deploy_cf_release.log
function include(){
curr_dir=$(cd $(dirname "$0") && pwd)
inc_file_path=$curr_dir/$1
if [ -f "$inc_file_path" ]; then
. $inc_file_path
else
echo -e "$inc_file_path not found!"
exit 1
fi
}
include "common.sh"
BOSH_UUID=$(bosh status --uuid)
sed -i "s/__director_uuid__/${BOSH_UUID}/g" /root/workspace/cf.yml
bosh deployment /root/workspace/cf.yml
retry 3 bosh -n deploy --recreate

View File

@ -0,0 +1,34 @@
#!/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.
set -eu
exec &> /tmp/deploy_diego_release.log
function include(){
curr_dir=$(cd $(dirname "$0") && pwd)
inc_file_path=$curr_dir/$1
if [ -f "$inc_file_path" ]; then
. $inc_file_path
else
echo -e "$inc_file_path not found!"
exit 1
fi
}
include "common.sh"
BOSH_UUID=$(bosh status --uuid)
sed -i "s/__director_uuid__/${BOSH_UUID}/g" /root/workspace/diego.yml
bosh deployment /root/workspace/diego.yml
retry 3 bosh -n deploy --recreate

View File

@ -0,0 +1,56 @@
#!/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.
set -eu
exec &> /tmp/install_bosh.log
function include(){
curr_dir=$(cd $(dirname "$0") && pwd)
inc_file_path=$curr_dir/$1
if [ -f "$inc_file_path" ]; then
. $inc_file_path
else
echo -e "$inc_file_path not found!"
exit 1
fi
}
include "common.sh"
mkdir -p /root/workspace
install -D -g root -o root -m 0644 config.json /root/workspace
install -D -g root -o root -m 0644 manifest.yml /root/workspace
IP=$(ip addr | grep 'inet .*global' | cut -f 6 -d ' ' | cut -f1 -d '/' | head -n 1)
sed -i "s/_local_ip_/$IP/g" /root/workspace/manifest.yml
apt-get update
apt-get -o Dpkg::Options::="--force-confnew" -y install git build-essential ruby ruby-dev libxml2-dev libsqlite3-dev libxslt1-dev libpq-dev libmysqlclient-dev
cd /root/workspace
git clone https://github.com/cppforlife/bosh-provisioner
cd /root/workspace/bosh-provisioner
git checkout 82fd27a53a6a049908293d7de9bf89c22ec941cd
retry 3 ./assets/bosh-provisioner -configPath=/root/workspace/config.json
(cat <<BOSH_CONFIG
target: https://127.0.0.1:25555
auth:
https://127.0.0.1:25555:
username: admin
password: admin
BOSH_CONFIG
) > $HOME/.bosh_config
bosh target 127.0.0.1

View File

@ -0,0 +1,30 @@
#!/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.
set -eu
exec &> /tmp/install_cli.log
wget "https://cli.run.pivotal.io/stable?release=linux64-binary&source=github" -O /tmp/cf-cli.tgz
tar xf /tmp/cf-cli.tgz -C /tmp
mv /tmp/cf /usr/local/bin/
rm /tmp/cf-cli.tgz
cf add-plugin-repo CF-Community http://plugins.cloudfoundry.org/ || true
cf install-plugin Diego-Beta -r CF-Community
cf login -a api.10.244.0.34.xip.io -u admin -p admin --skip-ssl-validation
cf create-org diego
cf target -o diego
cf create-space diego
cf target -s diego

View File

@ -0,0 +1,195 @@
---
name: bosh-lite
releases:
- name: bosh
version: 136
url: https://s3.amazonaws.com/bosh-jenkins-artifacts/release/bosh-2824.tgz
- name: bosh-warden-cpi
version: 18
url: https://s3.amazonaws.com/bosh-warden-cpi-blobs/bosh-warden-cpi-18.tgz
networks:
- name: default
type: dynamic
update:
canary_watch_time: 5000 - 60000
update_watch_time: 5000 - 300000
compilation:
network: default
jobs:
- name: bosh
instances: 1
networks:
- name: default
templates:
- name: nats
release: bosh
- name: redis
release: bosh
- name: blobstore
release: bosh
- name: postgres
release: bosh
- name: director
release: bosh
- name: health_monitor
release: bosh
- name: cpi
release: bosh-warden-cpi
- name: warden
release: bosh-warden-cpi
properties:
ntp: ["0.us.pool.ntp.org"]
nats:
user: nats
password: nats-password
address: 127.0.0.1
port: 4222
blobstore:
address: 127.0.0.1
port: 25251
backend_port: 25552
agent:
user: agent
password: agent-password
director:
user: director
password: director-password
postgres:
user: bosh
password: bosh-password
host: 127.0.0.1
port: 5432
database: bosh
redis:
password: redis-password
address: 127.0.0.1
port: 25255
director:
name: bosh-lite
address: 127.0.0.1
port: 25555
encryption: false
enable_snapshots: true
max_tasks: 100
db:
user: bosh
password: bosh-password
host: 127.0.0.1
port: 5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
jSSH6iaOwk2yQxKVqUKNPfz1PqtRgaUBjVWrh2+Wf22KzOTORouBOrSfdxep1Cjz
lQWt2W5l05dvf2vZTlaqDCk8PBF36FWPlwmZxRsHGACVuckl3yJ69jIaa+i+mK3k
cfi05ZafWeFwm21ahqzwK/kGsK1ofPHKxE8CAwEAATANBgkqhkiG9w0BAQUFAAOC
AQEAD1VzwtWCx32pQi5l0oFfjWqktnqfhs/Rr0ZpwacBBXHBvKuz9ENXmblt5pZu
JP7je+uXQD+da/oVhl0US2L0upIdMmD1utVXYHfRji5r/tIPl2SEKTrFiNZR1Wp6
J0nE/BW7nm41dXRBIAZR71yproaQrt1tFDFZvdfhwHGLC51L6toOhk/7S604sxbk
qV0tzT+VaR4hh09FEt9xGmB/3yFh329Yib8ScT94nKzSzoNoDp4Ms/smFhF4lUio
7SD2+b2/nt8Mcz7q58nYvZteipRrmkOFszlNF5dU31FjvRLITn0bhiOOFRD3qAou
cSOr1qwsAKuu6MzYNh2ubsLvfg==
-----END CERTIFICATE-----
hm:
http:
port: 25923
user: admin
password: admin-password
director_account:
user: admin
password: admin-password
intervals:
poll_director: 60
poll_grace_period: 30
log_stats: 300
analyze_agents: 60
agent_timeout: 180
rogue_agent_alert: 180
loglevel: info
email_notifications: false
tsdb_enabled: false
cloud_watch_enabled: false
resurrector_enabled: true
external_cpi:
enabled: true
name: cpi
# Control some remote vCenter
vcenter:
address: fake-address
user: fake-user
password: fake-password
datacenters: []
# cpi job template
cpi:
warden:
connect_network: tcp
connect_address: 127.0.0.1:7777
agent:
mbus: nats://nats:nats-password@_local_ip_:4222
blobstore:
provider: dav
options:
endpoint: http://_local_ip_:25251
user: agent
password: agent-password
# warden job template
warden:
listen_network: tcp
listen_address: 0.0.0.0:7777
network_pool: 10.244.0.0/16 # bosh-lite v1 used this pool
disk_quota_enabled: false
kernel_network_tuning_enabled: false

View File

@ -0,0 +1,40 @@
#!/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.
set -eu
exec &> /tmp/upload_releases.log
function include(){
curr_dir=$(cd $(dirname "$0") && pwd)
inc_file_path=$curr_dir/$1
if [ -f "$inc_file_path" ]; then
. $inc_file_path
else
echo -e "$inc_file_path not found!"
exit 1
fi
}
include "common.sh"
cd /tmp
IMAGE=$(bosh public stemcells | grep bosh-stemcell-.*-warden-boshlite-ubuntu-trusty-go_agent.tgz | head -n1 | awk '{print $2}')
bosh download public stemcell ${IMAGE}
bosh upload stemcell ${IMAGE}
rm -f ${IMAGE}
retry 3 bosh -n upload release /root/workspace/cf-release.tgz
retry 3 bosh -n upload release /root/workspace/diego-release.tgz
rm -f /root/workspace/cf-release.tgz
rm -f /root/workspace/diego-release.tgz

View File

@ -0,0 +1,74 @@
# 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.
Version: 2
Application:
?:
type: io.murano.apps.paas.CloudFoundryDiego
name: $.appConfiguration.name
instance:
?:
type: io.murano.resources.LinuxMuranoInstance
name: generateHostname($.instanceConfiguration.unitNamingPattern, 1)
flavor: $.instanceConfiguration.flavor
image: 'murano-bosh-cf-diego'
keyname: $.instanceConfiguration.keyPair
assignFloatingIp: $.appConfiguration.assignFloatingIP
Forms:
- appConfiguration:
fields:
- name: license
type: string
description: Apache License, Version 2.0
hidden: true
required: false
- name: name
type: string
label: Application Name
initial: CF
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: false
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: unitNamingPattern
label: Hostname
type: string
required: false

View File

@ -0,0 +1,21 @@
# 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.
Images:
- Name: 'murano-bosh-cf-diego'
Hash: 'f1688ab306415289280d3946984e1583'
Meta:
title: 'murano-bosh-cf-diego'
type: 'linux'
DiskFormat: 'qcow2'
ContainerFormat: 'bare'
Url: 'http://murano-files.mirantis.com/murano-bosh-cf-diego.qcow2'

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

View File

@ -0,0 +1,22 @@
# 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.
Format: 1.0
Type: Application
FullName: io.murano.apps.paas.CloudFoundryDiego
Name: Cloud Foundry Diego
Description: |
Cloud Foundry is an opensource PaaS solution. Diego is responsible for the uptime of applications. It can stream output from the application processes and ensures the routing of requests to those applications. This application installs a single VM instance of CloudFoundry v207 and Diego 0.1099 on BOSH-Lite. It will require a special image to be built.
Author: 'Mirantis, Inc'
Tags: ['PAAS', 'CloudFoundry']
Classes:
io.murano.apps.paas.CloudFoundryDiego: CloudFoundryDiego.yaml