59b849f72dc6e91ca9ad4b6df2565af3f7a49785
[it/test.git] / XTesting / powder-profiles / osc-ricplt
1 """Install the latest OSC RIC platform with Ubuntu 20.04 on a hardware type of your choice."""
2
3 import geni.portal as portal
4 # Import the ProtoGENI library.
5 import geni.rspec.pg as rspec
6
7 pc = portal.Context()
8
9 pc.defineParameter('hardware_type', 'Hardware type', portal.ParameterType.NODETYPE, '')
10
11 params = pc.bindParameters()
12
13 request = pc.makeRequestRSpec()
14
15 node = request.RawPC('node-0')
16 node.hardware_type = params.hardware_type
17 node.disk_image = 'urn:publicid:IDN+emulab.net+image+emulab-ops//UBUNTU20-64-STD'
18
19 node.addService(rspec.Execute(shell="bash", command="sudo git clone \"https://gerrit.o-ran-sc.org/r/ric-plt/ric-dep\" /ric-plt"))
20 node.addService(rspec.Execute(shell="bash", command="cd /ric-plt/bin && sudo cat install_k8s_and_helm.sh | sed -e '341d' > /tmp/12"))
21 node.addService(rspec.Execute(shell="bash", command="sudo sed '341 i   kubectl apply -f \"https:\/\/raw.githubusercontent.com\/flannel-io\/flannel\/9de10c12c8266b0cfe09bc0d5c969ae28832239f\/Documentation\/kube-flannel.yml\"' /tmp/12 > /tmp/123"))
22
23 node.addService(rspec.Execute(shell="bash", command="cd /ric-plt/bin && sudo cp /tmp/123 install_k8s_and_helm.sh && sudo ./install_k8s_and_helm.sh 2>&1 | tee /tmp/k8s.log"))
24 node.addService(rspec.Execute(shell="bash", command="cd /ric-plt/bin && sudo ./install_common_templates_to_helm.sh 2>&1 >> /tmp/common.log"))
25 node.addService(rspec.Execute(shell="bash", command="cd /ric-plt/RECIPE_EXAMPLE && sudo rm example_recipe_latest_stable.yaml && sudo ln -s example_recipe_oran_f_release.yaml example_recipe_latest_stable.yaml"))
26 node.addService(rspec.Execute(shell="bash", command="cd /ric-plt/bin && sudo cat ../RECIPE_EXAMPLE/example_recipe_latest_stable.yaml | sed -e 's/10\.0\.0\.1//g' > /tmp/example_recipe_latest_stable.yaml.overwrite && sudo cp /tmp/example_recipe_latest_stable.yaml.overwrite ../RECIPE_EXAMPLE/example_recipe_latest_stable.yaml.overwrite && sudo ./install -f ../RECIPE_EXAMPLE/example_recipe_latest_stable.yaml.overwrite 2>&1 | tee /tmp/install.log"))
27 pc.printRequestRSpec(request)