After making a small fix within the Portal site I wanted to build and run the Portal locally in order to test my fix.
This is what I needed to do
- Checking the tools versions
- docker: 17.12.1-ce
- kubectl: v1.14.0
- minikube: v0.28.2
- helm: v2.8.2
2. Refreshing the code
- take the Portal latest source from gerrit
- apply your patch
- take the Portal/SDK latest source and put it into the portal/sdk directory
- take the OOM latest source
3. Checking if the /lib/systemd/system/docker.service has this line:
ExecStart=/usr/bin/dockerd -H tcp://127.0.0.1:2375 -H fd://
If the line is different edit it and then execute:
sudo systemctl daemon-reload
sudo systemctl restart docker
sudo systemctl status docker
4. Run in the directory portal/deliveries:
- chmod a+x *.sh
- ./build_portalapps_dockers.sh
5. If registry is not running on docker start it with the following command:
docker run -d -p 5000:5000 --restart=always --name registry registry:2
6. Tag the images that were created by the build_portalapps_dockers.sh script
docker tag onap/portal-{yyy}:casablanca 127.0.0.1:5000/onap/portal-{yyy}:casablanca
where {yyy} is equal to app, wms, sdk and db
7. And push all of them:
docker push 127.0.0.1:5000/onap/portal-{yyy}:casablanca
8. Start the minikube
sudo minikube start --vm-driver=none
9. To make sure helm is running execute
helm version
both Client and Server should show up
If there are problems please try:
helm init --upgrade or
helm serve &
10. Edit the following oom/kubernetes/portal/charts/portal-{xxx}/values.yaml files. They should read now:
# application image
repository: 127.0.0.1:5000 # nexus3.onap.org:10001
image: onap/portal-{xxx}:casablanca # 2.5.0-STAGING-latest
where {xxx} should stand for app, widget, sdk and mariadb.
11. In the directory oom/kubernetes you should now run:
make all
make onap
12. You will now run:
helm install local/onap -n demo --namespace demo -f onap/resources/environments/disable-allcharts.yaml --set portal.enabled=true
13. You can observe the statuses of your pods:
watch kubectl get pods -n demo
After a few (8 in my case) minutes the pod demo-portal-app-?-? should show status Running.
It's ready for your tests