This software is licensed under the Apache License, Version 2.0 (the "License"); you may not use this software 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.
The Contrail Web Core repository contains back end (web server) code and common resources required to render Contrail Web UI for the management of Contrail network virtualization solution. This module interacts with other components of both Contrail network virtualization solution and underlying orchestration systems like Openstack, Cloudstack.
The API requests from web client to web server and web server to other components are REST based.
The code that implements various features of the Web UI (such as Dashboard, Configuration, Monitoring, Reporting) is available in a separate code repository Contrail Web Controller.
- Download, extract and compile the following.
a) Node.JS v0.8.15 (Recommended).
wget http://nodejs.org/dist/v0.8.15/node-v0.8.15.tar.gz -O /tmp/node-v0.8.15.tar.gz
cd /tmp
tar -xf node-v0.8.15.tar.gz
./configure
make
sudo make install
Verify Node.JS installation.
node --version
b) Any version of Redis Server.
http://redis.io/download
or
wget http://download.redis.io/releases/redis-2.8.9.tar.gz
tar xzf redis-2.8.9.tar.gz
cd redis-2.8.9
make
- Get the
contrail-web-core
repo
SSH clone URL:
git clone git@github.com:Juniper/contrail-web-core.git
HTTPS clone URL:
git clone https://github.com/Juniper/contrail-web-core.git
-
Get Contrail Web Controller code.
cd contrail-web-core make repos
'make repos' downloads two more repos contrail-web-controller and contrail-webui-third-party in parent directory.
-
Execute the following commands under
contrail-web-core
directory to setup development environment. It downloads all the third-party libraries and generates the files required for Contrail Web UI.make fetch-pkgs-dev make dev-env
'make fetch-pkgs-dev' downloads all the third-party modules required for development.
'make dev-env' sets the environment for development. It copies all the third-party modules in correct path. Please note this step changes the file contents in dashboard.tmpl, login.tmpl and login-error.tmpl under webroot/html directory. So if you have any changes in any of these three files, before check-in, you MUST issue below command
make rem-ts-prod
-
Start
redis-server
on port 6383, 6383 is the default port used by Contrail Web UI, the port can be changed as explained in 'Configuration parameters' section.redis-server --port 6383
The configuration file(config.global.js
) is located under contrail-web-core/config
directory
Configure the following settings as required.
- Identify Openstack/Cloudstack Services’ IP (E.g. 1.1.1.1)
- Identify Configuration API Server IP (E.g. 2.2.2.2)
- Identify Analytics Server IP (E.g.IP: 3.3.3.3
Fill the following Orchestration Services’ IP (E.g. 1.1.1.1). Note that config.identityManager.ip
is mandatory.
config.identityManager.ip
config.networkManager.ip
config.imageManager.ip
config.computeManager.ip
config.storageManager.ip
Fill the below with Configuration API Server Node IP (E.g. 2.2.2.2)
config.cnfg.server_ip
Fill the below with Analytics Node IP (E.g. 3.3.3.3)
config.analytics.server_ip
To Change the redis-server port, change the below entry and start redis-server on that specific port (E.g. 6383).
config.redis_server_port
Create an empty file /var/log/contrail-webui.log
. This is the log file for Contrail Web UI.
Contrail Web UI has two servers:
- Main web server - which handles all the Web Client requests
- Job server / Contrail Web UI Middleware - If any request needs more processing or job based task, then it is performed by Job Server.
To Start Main web server, invoke (in contrail-web-core
directory)
node webServerStart.js
And to Start Job Server:
node jobServerStart.js
If both are running successfully, then point the browser to http://localhost:8080/
.
Default credentials are
Username: admin
Password: contrail123
config - Contains web server configuration file.
The file 'config.global.js' holds configuration parameters related to web server (IP address/Port/Protocol,Caching, Log levels etc).
It also has configuration parameters required to communicate with underlying orchestration modules, the IP addresses/Port/Protocol these module listen at etc.
Refer section 'Configuration parameters' for further details.
keys - Contains certificate file, certificate request, RSA private key files.
src - Source directory for backend code
test - Files required to unit-test files under src directory.
webroot - Contains resources such as utility files, images, customized css commonly used to render Contrail Web UI.
Note: All the files/directories under 'webroot' directory of Contrail Web Controller are copied under this directory during Contrail Web UI Package creation.
- Sign the CLA
- Submit change requests via gerrit at http://review.opencontrail.org.