Develop and update official OVP web portal
For OVP Web development, currently the source code is included in Dovetail repo. The github link is can be found in github https://github.com/opnfv/dovetail/tree/master/cvp-webportal.
The web portal is composed by 3 5 different Docker containers and the corresponding Docker images are,
- opnfv/testapimongo:cvp3.0.3.02.1
- jwilder/nginx-proxy
- opnfv/dovetail-webportal-web:web.ovp.1.1.0latest
- opnfv/dovetail-webportal-web-onap:latest
- opnfv/dovetail:api.ovp.1.1.0-webportal-api:latest
The first testapi Docker image is a basic image 2 Docker images are basic images and has no relationship with Dovetail dovetail-webportal repo. So in order to update the web, it only needs to update the last 2 3 Docker images.
Here using Dovetail Docker hub for these 2 Docker images and distinguish them with different image tags. These 2 images need to be rebuilt manually These 3 images will be rebuilt automatically when there are new patched merged . Also the Dovetail docker build job can be used to build them with a little modifications.
- The link of Dovetail Docker build job is https://build.opnfv.org/ci/view/dovetail/job/dovetail-docker-build-push-master/
- Your account needs to have the privilege to build the Jenkins jobs manually
- Click 'Build with Parameters'
- Change 'DOCKER_DIR', 'COMMIT_ID', 'GERRIT_REFNAME' and 'DOCKERFILE'
- For opnfv/dovetail:web.ovp.1.1.0
- DOCKER_DIR: cvp/docker
- COMMIT_ID: one commit id that merged no earlier than the OVP web patch
- GERRIT_REFNAME: the tag name you want to tag the Docker image (e.g. web.ovp.1.1.0)
- DOCKERFILE: Dockerfile.web
- For opnfv/dovetail:api.ovp.1.1.0
- DOCKER_DIR: cvp/docker
- COMMIT_ID: one commit id that merged no earlier than the OVP web patch
- GERRIT_REFNAME: the tag name you want to tag the Docker image (e.g. api.ovp.1.1.0)
- DOCKERFILE: Dockerfile
- Suggest to name these 2 Docker image tags with different versions from the existing tags. Then the old ones can be kept which can be used to revert the Web.
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.to repo dovetail-webportal.
Tag the repo (e.g. 2.0.0), then it will build 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, 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.
Pull the dovetail-webportal source code and download the 5 docker images mentioned before.
Go to dovetail-webportal/docker, refer to file README.rst to edit config.env and vhost.env.
Run all containers with docker-compose.yml. (exec cmd: docker-compose up -d)
Use the local IP and port (default is 8000) to access the local web.
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.
You can find both parts (Part 1 and Part 2) in ONAP DDF + OPNFV Plugfest wiki.
The Part 2 is considered as the presentation of the demo of the VNF web portal along with screen shots for each page of the portal.
The VNF web portal uses the same Docker containers and the corresponding Docker images with OVP web portal.
Build Instructions
Update the "/etc/hosts" file introducing also the new page / portal addresses
Code Block language bash firstline 1 linenumbers true 127.0.0.1 localhost ovp.localhost onap.localhost
Build new images 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 [dovetail_path]/dovetail-webportal cd [dovetail_path]/dovetail-webportal/docker sudo docker build -f Dockerfile.web -t opnfv-web . sudo docker build --build-arg CONTAINER=onap --build-arg GUI=onap-ui -f Dockerfile.web -t onap-web . sudo docker build -f Dockerfile.api -t rest-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 to use the images created in step 2
Code Block language bash firstline 1 linenumbers true cd [dovetail_path]/dovetail-webportal/docker vim docker-compose.yml ... — version: '3' services: .... webopnfv: image: opnfv/dovetail-webportal-web:latest container_name: web-opnfv .... webonap: image: opnfv/dovetail-webportal-web-onap:latest container_name: web-onap .... lfnapi: image: opnfv/dovetail-webportal-api:latest container_name: lfn-api ....
Start the deployment with the following command:
Code Block language bash firstline 1 linenumbers true cd [dovetail_path]/dovetail-webportal/docker sudo docker-compose up
Once the deployment is up, all three pages can be accessed by the following addresses:
Code Block language bash firstline 1 linenumbers true http://opnfv.localhost http://onap.localhost