Execute the following steps, to configure and then run ADS as a service:
Copy ovpl/config/sample_config.json
to ovpl/config/config.json
and make
the following changes:
- To set the proxies.
"ENVIRONMENT": {
"HTTP_PROXY":"http://proxy. vlabs.ac.in:8080",
"HTTPS_PROXY":"http://proxy.vlabs.ac.in:8080"
},
- if no proxies are used,
"ENVIRONMENT": {
"HTTP_PROXY":"",
"HTTPS_PROXY":""
},
- Set the COOKIE_SECRET value in CONTROLLER_CONFIG to some long randomly generated string.
"COOKIE_SECRET": "<generate a long random UUID>",
- Set the SERVER_IP in LOGSERVER_CONFIGURATION to the IP address of the
machine on which the ADS services are running.
"LOGSERVER_CONFIGURATION": {
"SERVER_IP": "ads-server-private-ip",
},
- Choose
POOLID
andADAPTERID
fromVPOOLS
section. Make the appropriate change inADAPTER_TO_USE
. TheADAPTERID
foraws_adapter
,centos_openvz_adapter
andcentos_bridged_adapter
is 1, 2 and 3 respectively.
"ADAPTER_TO_USE" : {"POOLID" : 1, "ADAPTERID" : 2}
- Copy
config/adapters/sample_base_config.py
toconfig/adapters/base_config.py
. Foraws_adapter
, no change in this file has to be done. Forcentos_openvz_adapter
andcentos_bridged_adapter
make the following changes in the file:- If the services are running on the base machine,
set
ADS_ON_CONTAINER
to False and copy public key (id_rsa.pub) to authorized_keys - If the services are running on a container, set
ADS_ON_CONTAINER
to True and copy the public key of the container to the authorized_keys of the base machine. - Set BASE_IP_ADDRESS = “root@<IP>” where IP is the ip address of base machine on which containers are created.
- Set ADS_SERVER_VM_ID to CTID of container running ADS. ADS_SERVER_VM_ID = “<CTID>”
- SUBNET field to match with the subnet of your base machine If the ip address of your base machine is 10.2.58.XXX, SUBNET = [“10.2.58.12/28”]
ADAPTER_NAME_SERVER
, set the field to a specific nameserver that is used in the cluster or leave it as ‘inherit’ to use the nameserver configuration from the base machine.SECRET_KEY
, used to authenticate the ADS WEB APP.
- If the services are running on the base machine,
set
Copy config/adapters/sample_centos_bridged_config.py
to config/adapters/centos_bridged_config.py
,
and change the SUBNET_BRIDGE
in the file.
- Copy
config/adapters/sample_centos_openvz_config.py
toconfig/adapters/centos_openvz_config.py
.
Copy config/adapters/sample_aws_config.py
to config/adapters/aws_config.py
, and edit the values
accordingly. The private key key_file_name.pem
should be copied inside src/
directory.
See here for more details.
- As root, go into
ovpl
directory and runmanage_services.sh
file:
$ cd ovpl $ ./manage_services (or) ./manage_services start
- To stop the services
$ cd ovpl $ ./manage_services stop
- To stop or start specific service use
./manage_services.sh [action] [services]
- [action] = start (or) stop
- [services] = LOGGER (or) ADAPTER (or) CONTROLLER
$ cd ovpl $ ./manage_services.sh start LOGGER
- For more help use
./manage_services.sh --help
.
This assumes apache server is installed. If not, please install the apache server.
sudo su - yum update -y yum install epel-release yum install "mod_wsgi" -y yum install python-pip cd /root/ovpl/src/ads-web-app python setup.py install rsync -avz --progress /root/ovpl/src/ads-web-app /var/www/html/ chmod -R 777 /var/www/html/ads-web-app
- Create a project at Google Dashboard and create
Oauth
credentails. - Provide
CONSUMER_KEY
andCONSUMER_SECRET
in/var/www/html/ads-web-app/config.py
.
CONSUMER_KEY = "<consumerkey>" CONSUMER_SECRET = "<consumer secret key>"
- Provide
ADS
running server IP/Domain name to variableADS_URL
. - Set secret key of
ADS
server to variableADS_SECRET_KEY
.
ADS_URL = "http://<ip/domain>:5000" ADS_SECRET_KEY= "defaultadskey"
- Add emails ids to
AUTHORIZED_USERS
AUTHORIZED_USERS = [ "[email protected]" ]
- Restart
Flask
server
cd /var/www/html/ads-web-app/ python app.py &
- Open the location
http://ads-server-public-ip:8080
from the browser and provide the lab id, lab sources url and version/tag. - View the logs at /root/logs/ovpl.log by
tail -f /root/logs/ovpl.log
Steps to manually create a container
- vzctl create 101 –ostemplate ubuntu-12.04-custom-x86_64 –ipadd 10.2.58.3 –diskspace 10G:15.0G –hostname cse02.vlabs.ac.in
- vzctl start 101
- vzctl set 101 –nameserver inherit –ram 256M –swap 512M –onboot yes –save