2 ## Build and deploy O2 services over O-Cloud (INF)
5 ## Bring up builder container from O-Cloud controller node
9 mkdir -p /home/sysadmin/share
10 sudo docker run -dt --privileged -v /home/sysadmin/share/:/home/sysadmin/share/ -v /var/run:/var/run --name o2imsbuilder centos:7
13 ## Build O2 service images inside the builder container
17 sudo docker exec -it o2imsbuilder bash
22 curl -L https://get.daocloud.io/docker/compose/releases/download/1.25.4/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
23 chmod +x /usr/local/bin/docker-compose
26 yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
28 yum install -y docker-ce
33 cd /home/sysadmin/share/
34 git clone "https://gerrit.o-ran-sc.org/r/pti/o2"
39 git clone --depth 1 --branch master https://opendev.org/starlingx/config.git
40 git clone --depth 1 --branch master https://opendev.org/starlingx/distcloud-client.git
49 ### Push O2 service images to local registry (with auth user admin)
52 sudo docker tag o2imsdms:latest registry.local:9001/o-ran-sc/pti-o2imsdms:2.0.0
53 sudo docker image push registry.local:9001/o-ran-sc/pti-o2imsdms:2.0.0
57 ## Deploy O2 services with helm chart over O-Cloud controller node (with auth user admin)
60 export NAMESPACE=oran-o2
61 kubectl create ns ${NAMESPACE}
64 source /etc/platform/openrc
65 cat <<EOF>ocloud-override.yaml
67 - default-registry-key
70 serviceaccountname: admin-oran-o2
73 o2service: registry.local:9001/o-ran-sc/pti-o2imsdms:2.0.0
74 postgres: docker.io/library/postgres:9.6
75 redis: docker.io/library/redis:alpine
76 pullPolicy: IfNotPresent
80 OS_AUTH_URL: "${OS_AUTH_URL}"
81 OS_USERNAME: "${OS_USERNAME}"
82 OS_PASSWORD: "${OS_PASSWORD}"
85 sudo docker login registry.local:9001 -u ${OS_PROJECT_NAME} -p ${OS_PASSWORD}
87 kubectl -n ${NAMESPACE} create secret docker-registry ${OS_PROJECT_NAME}-${NAMESPACE}-registry-secret \
88 --docker-server=registry.local:9001 --docker-username=${OS_PROJECT_NAME} \
89 --docker-password=${OS_PASSWORD} --docker-email=noreply@windriver.com
91 cd /home/sysadmin/share/o2
93 helm install o2imstest charts/ -f /home/sysadmin/ocloud-override.yaml
95 kubectl -n ${NAMESPACE} get pods
102 curl -k http(s)://<Node IP>:30205
103 curl -k http(s)://<Node IP>:30205/o2ims_infrastructureInventory/v1
110 kubectl -n ${NAMESPACE} logs -f o2api-<xxx> -c o2api
111 kubectl -n ${NAMESPACE} logs -f o2api-<xxx> -c postgres
112 kubectl -n ${NAMESPACE} logs -f o2api-<xxx> -c o2pubsub
113 kubectl -n ${NAMESPACE} logs -f o2api-<xxx> -c watcher
116 kubectl -n ${NAMESPACE} logs -f o2api-<xxx> -c o2api
118 kubectl -n ${NAMESPACE} exec -it o2api-<xxx> -c postgres -- bash
125 select * from ocloud;
135 1, there is chance the containers crash due to random bootstrap order of containers