Skip to content

Dev install #1930

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 7 additions & 17 deletions scripts/dev/localnode/_functions
Original file line number Diff line number Diff line change
@@ -1,33 +1,23 @@
#!/bin/bash

export AYSBRANCH=${AYSBRANCH:-master}
export JSBRANCH=${JSBRANCH:-master}
export OVCBRANCH=${OVCBRANCH:-master}
export SSHKEY=${SSHKEY:-id_rsa.pub}

installjs() {
if [ -e "/opt/jumpscale7/hrd/system/system.hrd" ]; then
if [ -e "/opt/jumpscale7/cdf/system/system.yml" ]; then
return 0
fi
cd /tmp;rm -f install.sh;curl -k https://raw.githubusercontent.com/Jumpscale7/jumpscale_core7/$JSBRANCH/install/install.sh > install.sh;bash install.sh

cat <<EOF > /opt/jumpscale7/hrd/system/atyourservice.hrd
metadata.jumpscale =
branch:'$AYSBRANCH',
url:'https://github.com/jumpscale7/ays_jumpscale7',

metadata.openvcloud =
branch:'$OVCBRANCH',
url:'https://github.com/0-complexity/openvcloud_ays',
EOF
md5=$(hostname -s | md5sum | awk '{print $1}')
machineid="${md5:0:12}"
cat << EOF > /opt/jumpscale7/hrd/system/grid.hrd
id = '66'
node.id = ''
node.machineguid = '${machineid}'
node.roles =
'node',
cat << EOF > /opt/jumpscale7/cfg/system/grid.yml
id: 66
node:
id: ''
machineguid: '${machineid}'
roles: ['node']

EOF
}
Expand Down
12 changes: 0 additions & 12 deletions scripts/dev/localnode/cfg/masterconfig.hrd

This file was deleted.

16 changes: 13 additions & 3 deletions scripts/dev/localnode/masterinstall
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,19 @@ apt-get install -y postfix
systemctl enable postfix
systemctl start postfix

installjs
ays install -n python_portal
ays install -n cb_master_aio --hrdseed /opt/code/github/0-complexity/openvcloud/scripts/dev/localnode/cfg/masterconfig.hrd
#installjs
# RUN PACKAGER HERE
export LC_ALL=C
apt-get install python-pip nginx -y
pip install requests oyaml click
export MANIFESTURL=https://raw.githubusercontent.com/0-complexity/devmanifests/master/manifests/
export VERSION=9.9.9
rm -fr /etc/nginx/sites-enabled/default
cp /opt/code/github/0-complexity/openvcloud/apps/nginx/ms1_fe /etc/nginx/sites-enabled
systemctl restart nginx
python /opt/code/github/0-complexity/openvcloud_installer/scripts/buildlib/packager.py --manifest /opt/code/github/0-complexity/openvcloud_installer/scripts/dockers/cb_master/dep-manifest.yml -l
cp -r /opt/code/github/0-complexity/openvcloud_installer/scripts/dockers/cb_master/apps/* /opt/jumpscale7/cfg/
jspython /opt/code/github/0-complexity/openvcloud_installer/scripts/install/installnode --role=master --masterips 127.0.0.1 --password=rooter --fqdn=172.17.1.1 --env_subdomain=devsetup --client_id=greenitglobe.development.environments.local --secret=7b6nPW0EpZ3XGAPPxrs3nV8g5119yLcAmoQGUqlXn8uT_hciAIZF --gid=66 --ovs_url=https://172.17.1.10
echo "
pcl = j.clients.portal.getByInstance('main')
pcl.actors.cloudbroker.iaas.addExternalNetwork(name='docknet', subnet='172.17.0.0/16', gateway='172.17.0.1', startip='172.17.1.100', endip='172.17.1.120', gid=66, vlan=0)
Expand Down
35 changes: 21 additions & 14 deletions scripts/dev/localnode/nodeinstall
Original file line number Diff line number Diff line change
@@ -1,25 +1,32 @@
#!/bin/bash
set -e
source "$(dirname $(readlink -f $0))/_functions"

export LC_ALL=C
apt-get install python-pip lsof -y
pip install requests oyaml click
installovsrepo
installjs
ays install -n cb_cpunode_aio --hrdseed /opt/code/github/0-complexity/openvcloud/scripts/dev/localnode/cfg/node.hrd
export MANIFESTURL=https://raw.githubusercontent.com/0-complexity/devmanifests/master/manifests/
export VERSION=9.9.9
python /opt/code/github/0-complexity/openvcloud_installer/scripts/buildlib/packager.py --manifest /opt/code/github/0-complexity/openvcloud_installer/scripts/dockers/base/dep-manifest.yml
cp -r /opt/code/github/0-complexity/openvcloud_installer/scripts/dockers/cb_master/apps/* /opt/jumpscale7/cfg/
jspython /opt/code/github/0-complexity/openvcloud_installer/scripts/install/installnode --role=cpu --masterips 172.17.1.1 --password=rooter --gid=66 --fqdn=172.17.1.1 --gwmgmt_ip=10.199.0.14/22 --vxbackend_vlan=2313 --vxbackend_ip=10.240.0.14/16 --gwmgmt_vlan=2314 --env=devsetup --client_id=greenitglobe.development.environments.local --secret=7b6nPW0EpZ3XGAPPxrs3nV8g5119yLcAmoQGUqlXn8uT_hciAIZF --ovs_url=https://172.17.1.10
cp /opt/code/github/0-complexity/openvcloud/apps/nginx/cpunode_aio /etc/nginx/sites-enabled
cp /opt/code/github/0-complexity/openvcloud/apps/nginx/storagedriver_aio /etc/nginx/sites-enabled
if ! grep "^host_uuid" /etc/libvirt/libvirtd.conf > /dev/null; then
echo "host_uuid = \"$(uuidgen)\"" >> /etc/libvirt/libvirtd.conf
fi
systemctl enable libvirt-bin
systemctl start libvirt-bin
systemctl enable virtlogd
systemctl start virtlogd
echo "
<network>
<name>gw_mgmt</name>
<forward mode='bridge'/>
<bridge name='gw_mgmt'/>
<virtualport type='openvswitch'/>
</network>
" > /tmp/net.xml
virsh net-define /tmp/net.xml || true
virsh net-autostart gw_mgmt || true
virsh net-start gw_mgmt || true
# echo "
# <network>
# <name>gw_mgmt</name>
# <forward mode='bridge'/>
# <bridge name='gw_mgmt'/>
# <virtualport type='openvswitch'/>
# </network>
# " > /tmp/net.xml
# virsh net-define /tmp/net.xml || true
# virsh net-autostart gw_mgmt || true
# virsh net-start gw_mgmt || true
10 changes: 6 additions & 4 deletions scripts/dev/localnode/nodeinstallovs
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,10 @@ cat << EOF > /opt/OpenvStorage/config/preconfig.json
}}
EOF
ovs setup
installjs
ays install -n cb_storagedriver_aio --hrdseed /opt/code/github/0-complexity/openvcloud/scripts/dev/localnode/cfg/node.hrd
ays install -n cb_storagenode_aio --hrdseed /opt/code/github/0-complexity/openvcloud/scripts/dev/localnode/cfg/node.hrd
jspython /opt/code/github/0-complexity/openvcloud/scripts/ovs/alba-create-user.py
jspython /opt/code/github/0-complexity/openvcloud_installer/scripts/install/installnode --role=storage --masterips 172.17.1.1 --password=rooter --gid=66 --fqdn=172.17.1.1 --gwmgmt_ip=10.199.0.14/22 --vxbackend_vlan=2313 --vxbackend_ip=10.240.0.14/16 --gwmgmt_vlan=2314 --env=devsetup --client_id=greenitglobe.development.environments.local --secret=7b6nPW0EpZ3XGAPPxrs3nV8g5119yLcAmoQGUqlXn8uT_hciAIZF --ovs_url=https://172.17.1.10
jspython /opt/code/github/0-complexity/openvcloud/scripts/dev/localnode/setupovs.py
echo "
portal_config = j.core.config.get('portal_client', 'main')
portal_config['port'] = 80
j.core.config.set('portal_client', 'main', portal_config)
"|js