Develop and update official OVP web portal
For OVP Web development, the source code can be found in github https://github.com/opnfv/dovetail-webportal.
The web portal is composed by 5 different Docker containers and the corresponding Docker images are,
- opnfv/testapi:cvp.0.5.0
- mongo:3.2.1
- jwilder/nginx-proxy
- opnfv/dovetail-webportal-web:latest
- opnfv/dovetail-webportal-web-onap:latest
- opnfv/dovetail-webportal-api:latest
The first 3 2 Docker images are basic images and has no relationship with dovetail-webportal repo. So in order to update the web, it only needs to update the last 2 3 Docker images.
These 2 3 images will be rebuilt automatically when there are new patched merged to repo dovetail-webportal.
Tag the repo (e.g. 2.0.0), then it will build 2 3 docker images with that tag, and they can be used for updating official OVP web portal.
After the Docker images have been successfully pushed to Dovetail Docker hub, contact Trevor Bramwell to use the new Docker images to update the Web.follow the below directions to update the website.
Updating the OVP portal
The OVP dashboard is deployed from a clone of the dovetail-webportal repo by the jenkins-ci user on a VM.
To update the dashboard navigate to '/home/jenkins-ci/dovetail-webportal/docker' on the VM
and run the following command:
docker-compose up -d
Configuration for the deployment is stored under 'dovetail-webportal/docker' in:
- vhost.env
- config.env
Any changes to these files will require reloading the containers with the above command
Backups of the dashboard run on a daily cronjob of the jenkins-ci user and get stored at /home/jenkins-ci/backups/:
HOME=/home/jenkins-ci
# Backup OVP database and logs
@daily $HOME/backup.sh >> $HOME/logs/backup.log
Test web portal locally
Before updating the official web, it needs to test locally.
...
Use the local IP and port (default is 8000) to access the local web.
ONAP web portal
VNF web portal
Anchor | ||||
---|---|---|---|---|
|
The ONAP web portal prototype has been demonstrated by Dan Xu, Former user (Deleted) and Former user (Deleted) in ONAP DDF + OPNFV Plugfest.
...
The Part 2 is considered as the presentation of the demo of the ONAP VNF web portal along with screen shots for each page of the portal.Apart of the ONAP portal itself, in this presentation, a common LFN page has been presented as a central started point and as a introduction page.
The ONAP VNF web portal uses the same Docker containers and the corresponding Docker images with OVP web portal.
The ONAP portal is still under development phase, but you can deploy it locally using the following patches:
The web portal as well as the LFN introduction page have not been officially released, so the contents have been used only for the demo purposes.
For the local test activities of the web portal(s), you could use the following guides:
Build Instructions
Update the "/etc/hosts" file introducing also the new page / portal addresses
.localhost lfnCode Block language bash firstline 1 linenumbers true 127.0.0.1 localhost ovp.localhost onap
.localhost
Build new images
using as input the code in the local directory instead of the code that have been upstream. That's why a new version of Dockerfile.api and Dockerfile.web should be created.Prepare a new 'Dockerfile_api' from the Dockerfile.avi file removing the instructions which clone again the latest merged code locally.
e.g. RUNWiki Markup for REST api and the Front End Portals by running the following commands:
Code Block language bash firstline 1 linenumbers true git clone https://gerrit.opnfv.org/gerrit/dovetail-webportal $HOME/testapi && \
Give the following command in order to build the new enhanced api image
Wiki Markup [dovetail_path]/dovetail-webportal cd [dovetail_path]/dovetail-webportal/docker sudo docker build -f dovetail-webportal/docker/Dockerfile_apiDockerfile.web -t api_temp .
Prepare a new 'Dockerfile_web' from the Dockerfile.web with removing the instructions which clone again the latest latest merged code locally.
Wiki Markup e.g. RUN git clone https://gerrit.opnfv.org/gerrit/dovetail-webportal $HOME/testapi && \
Give the following command in order to build the new enhanced web image
Repeat the above instructions related to the Dockerfile_web replacing the 'opnfv' path with 'onap' and 'lfn' in order to build the images 'onap_temp' and 'lfn_temp' respectively.Wiki Markup opnfv-web . sudo docker build --build-arg CONTAINER=onap --build-arg GUI=onap-ui -f Dockerfile.web -t onap-web . sudo docker build -f dovetail-webportal/docker/Dockerfile_webDockerfile.api -t opnfv_temprest-api .
Create the appropriate config files:
Code Block language bash firstline 1 linenumbers true cd [dovetail_path]/dovetail-webportal/docker cat <<EOF > vhost-onap.env VIRTUAL_HOST=onap.localhost EOF cat <<EOF > vhost-opnfv.env VIRTUAL_HOST=ovp.localhost EOF cat <<EOF > config.env mongodb_url=mongodb://mongodb:27017/ base_url=http://ovp.localhost testapi_url=lfnapi:8010 PYTHONUNBUFFERED=True EOF
Update the docker-compose file , defining as images the ones that have been prepared to use the images created in step 2
Wiki Markup Code Block language bash firstline 1 linenumbers true cd [dovetail_path]/dovetail-webportal/docker vim docker-compose.yml ... — version: '3' services: .... web-opnfvwebopnfv: image: opnfv_temp/dovetail-webportal-web:latest container_name: cvp-web-opnfv .... web-onapwebonap: image: onap_temp container_name: cvpopnfv/dovetail-webportal-web-onap .... web-lfn: image: lfn_temp:latest container_name: cvp-web-lfnonap .... cvpapilfnapi: image: api_tempopnfv/dovetail-webportal-api:latest container_name: cvplfn-cvpapiapi ....
Give Start the deployment with the following command in order create the containers
unmigrated-wiki-markup:
Code Block language bash firstline 1 linenumbers true cd [dovetail_path]/dovetail-webportal/docker sudo docker-compose up
Once the docker are createddeployment is up, all three pages are ready for use. Open a browser and use can be accessed by the following addresses:
Wiki Markup Code Block language bash firstline 1 linenumbers true http://opnfv.localhost onap.localhost lfnhttp://onap.localhost