CNaaS NMS docker build on CentOS

CentOS 8

install docker:
sudo yum install -y yum-utils
sudo yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
sudo yum install docker-ce docker-ce-cli containerd.io
sudo yum install iptables
sudo systemctl start docker
sudo systemctl enable docker
sudo groupadd docker
sudo usermod -aG docker $USER
newgrp docker


install docker-compose:
sudo curl -L "https://github.com/docker/compose/releases/download/1.27.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose




install cnaas-nms:
docker volume create cnaas-jwtcert
docker volume create cnaas-postgres-data
docker volume create cnaas-settings
docker volume create cnaas-templates
docker volume create cnaas-cacert

git clone https://github.com/SUNET/cnaas-nms.git
cd cnaas-nms/test/
sed replace POSTGRES_PASSWD -> POSTGRES_PASSWORD in ../docker/docker-compose.yaml
./integrationtests.sh
wait until error 500
ctrl-C the integrationtests.sh

# fix permissions so code coverage running inside the container can save results to host (user 33:33 is www-data in container)
chcon -R -t container_file_t ../docker/coverage/
sudo chown -R 33:33 ../docker/coverage/

curl https://raw.githubusercontent.com/SUNET/cnaas-nms/f9ee117e28b8ec307eeffee33f8045cab21772dd/src/certs/public.pem > ~/public.pem
sudo docker cp ~/public.pem docker_cnaas_api_1:/opt/cnaas/jwtcert/public.pem

docker-compose -f ../docker/docker-compose.yaml down
./integrationtests.sh

expected output:
[centos@centos-test test]$ ./integrationtests.sh
~/cnaas-nms/test ~/cnaas-nms/test
mkdir: cannot create directory ‘coverage/’: File exists
Creating network "cnaas" with driver "bridge"
Creating docker_cnaas_redis_1 ... done
Creating docker_cnaas_postgres_1 ... done
Creating docker_cnaas_auth_1 ... done
Creating docker_cnaas_httpd_1 ... done
Creating docker_cnaas_api_1 ... done
Creating docker_cnaas_dhcpd_1 ... done
~/cnaas-nms/test
Starting integration tests...
/usr/lib/python3.6/site-packages/urllib3/connectionpool.py:847: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
InsecureRequestWarning)
Template refresh status: 200
Settings refresh status: 200
..

curl -k https://localhost/api/v1.0/system/version
{"status": "success", "data": {"version": "1.2.0dev2", "git_version": "Git commitc1330e87163ef448947367896403387ca0c84950 develop (2020-11-09 15:16:52+01:00)"}}

  • No labels