Dear Team,
I have developed a cutomized pipeconf ONOS app in existing onos/apps folder. When I try to do bazel build onos with my new app (with all required code files and BUILD file in onos/apps/my-app-folder), build goes well, but the OAR file is NOT generated for my app. I can see that bazel generated OAR file for existing Apps, but there is not OAR file for my app anywhere in Onos folder.
I have searched a lot about it, but couldn't find the solution. I also read in one thread that if you want to generate JAR file for your app, you need to add your App name in modules.bzl. I did that and I can see the jar is generated for my app, but NO OAR.
Can you please help me with this? Am I missing some step? Do I have to add my App name in some file?
Thanks in advance. Sample BUILD file is attached as well.
Regards,
Deval.
Error has been solved. Thanks for the help and support.
Hi,
So, I have been to create OAR both with Bazel and Maven.
For Maven, list is long as I had to include corresponding dependencies with correct version, specific to my app and may not be relevant here.
For Bazel,
I had to add the dependencies to BUILD file, same as above. Then there was a class mismatch error so, I had to upgrade my JAVA to JAVA 11. Nice guide here:
https://www.javahelps.com/2017/09/install-oracle-jdk-9-on-linux.html
Also directory structure should be proper. It should match the BUNDLE in your BUILD file. BUILD file location also should be correct, above the /src directory in your app directory.
Within /src also the directory structure should be proper. Open any existing app and you may follow it. If you have some P4-code then it should be complied and the corresponding p4info, bin and json should be kept in /resources under src/main/resources.
I followed the steps how they complied fabric.p4 and the Makefile from
https://github.com/opencord/fabric-tofino
After this, final step is to include your App name in tools / build / bazle / modules.bzl file as "// apps / application name: onos-apps-application name-oar
Important thing is to add OAR int the end, else it will create only JAR file.
Hope this will save some efforts to someone.
Thanks,
Deval.
Hi again,
Now, I want to populate tables for my app on Tofino using Onos through my pipeconfApp, which is now running on Onos. I have been referring to the tutorial here: https://github.com/opencord/fabric-tofino
So as I understand,
1. Either I can install stratum or use something like below to start gRPC server on tofino to enable the communication with Onos.
./run_switchd.sh -c $SDE_INSTALL/share/p4/targets/tofino/skip_p4.conf
--skip-p4 --p4rt-server 0.0.0.0:50051
2. Also, I need to push netcfg.json to Onos with REST using curl or similar. For that, is below json file would be valid (given gRPC is on above IP:port)?
1 {
1 "devices": {
2 "device:tofino": {
3 "basic": {
4 "managementAddress": "grpc://0.0.0.0:50051?device_id=1",
5 "driver": "stratum-tofino",
6 "pipeconf": "org.opencord.my_pipeconf"
7 }
8 }
9 }
10 }
Thanks,
Deval
Hi Carmelo,
Thank you for your reply and I have gone through the resource suggested.
My problem is, I am communicating with Tofino Switch using bfshell on address 127.0.0.1:7777 and it works.
Now, as per the ONOS Pipaconf guide, when I try to push the below tofinno-necfg.json for my vepg app, ONOS says (screenshot attached).
1 "devices": {
2 "device:tofino": {
3 "basic": {
4 "managementAddress": "grpc://127.0.0.1:7777?device_id=1",
5 "driver": "p4runtime",
6 "pipeconf": "org.opencord.fabric.tofino.montara_sde_8_9_0"
7 }
8 }
9 }
10 }
As you can see in the beginning part, ONOS LOG says:
2020-03-05T11:36:19,072 | WARN | onos-gdp-1 | GeneralDeviceProvider | 235 - org.onosproject.onos-providers-general-device - 2.2.2.SNAPSHOT | Detected change of connection endpoints for device:tofino, will tear down existing connection and set up a new one...
2020-03-05T11:36:19,109 | INFO | onos-gdp-1 | GrpcChannelControllerImpl | 230 - org.onosproject.onos-protocols-grpc-ctl - 2.2.2.SNAPSHOT | Creating new gRPC channel grpc://127.0.0.1:7777?device_id=1...
2020-03-05T11:36:19,191 | INFO | onos-gdp-1 | DeviceManager | 193 - org.onosproject.onos-core-net - 2.2.2.SNAPSHOT | Local role is MASTER for device:tofino
So loks like communication channel is being established. But later on it says:
2020-03-05T11:36:19,195 | WARN | onos-event-dispatch-default0 | ModelCache | 210 - org.onosproject._onos-gui2-base-jar - 2.2.2.SNAPSHOT | DeviceID device:tofino not found as a UiDevice
2020-03-05T11:36:19,197 | INFO | onos-gdp-1 | GeneralDeviceProvider | 235 - org.onosproject.onos-providers-general-device - 2.2.2.SNAPSHOT | Notifying role MASTER (preference 0) for term 1 to device:tofino
2020-03-05T11:36:19,199 | WARN | onos-event-dispatch-default0 | ModelCache | 210 - org.onosproject._onos-gui2-base-jar - 2.2.2.SNAPSHOT | DeviceID device:tofino not found as a UiDevice
2020-03-05T11:36:19,200 | WARN | onos-device-manager-background | DeviceManager | 193 - org.onosproject.onos-core-net - 2.2.2.SNAPSHOT | Node was instructed to be MASTER role for device:tofino, but this node cannot reach the device. Relinquishing role.
So I cannot see any device or when I try to populate tables, I get message:
2020-03-05T11:38:01,377 | WARN | onos-flowservice-device-installer-3 | ECFlowRuleStore | 192 - org.onosproject.onos-core-dist - 2.2.2.SNAPSHOT | No master for device:tofino
Please suggest.
Thanks,
Deval.
To view this discussion on the web visit https://groups.google.com/a/onosproject.org/d/msgid/brigade-p4/f77d9e2b3f254a4c98f6268121e82d76%40kau.se.