使用buck安装ONOS
2017-11-20 本文已影响823人
ljyfree
安装环境
- 可以联网的PC-CentOS7(有FQ代理更好)
- PC的时间要准确
- 预先安装好的软件
- git
- curl
- JAVA1.8(必须是oracle的,openjdk不行),并切换为当前JAVA默认版本
- karaf-3.0.8(解压后的文件夹必须放在~/Applications/)
- maven-3.3.9(解压后的文件夹必须放在~/Applications/)
git操作
-
了解一下git常用操作的示意图
常用git操作示意图 - 先将git配置代理,这样拉代码能快一些
[centec@compute1 Applications]$ git config --global http.proxy http://proxy_host:_proxy_port
- 将ONOS代码库拉到本地
[centec@compute1 Applications]$ git clone http://github.com/opennetworkinglab/onos.git
Cloning into 'onos'...
remote: Counting objects: 395378, done.
remote: Compressing objects: 100% (931/931), done.
remote: Total 395378 (delta 607), reused 1579 (delta 468), pack-reused 393654
Receiving objects: 100% (395378/395378), 114.98 MiB | 47.00 KiB/s, done.
Resolving deltas: 100% (180095/180095), done.
[centec@compute1 Applications]$
- 进入到新生成的目录onos/,checkout指定版本的代码
[centec@compute1 Applications]$ cd onos
[centec@compute1 onos]$ git checkout 1.10.8
Note: checking out '1.10.8'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:
git checkout -b new_branch_name
HEAD is now at 66866e3... Tagging 1.10.8
[centec@compute1 onos]$
设置,修改和编译打包
- 将git网络代理设置去掉,不然太卡了
[centec@compute1 Applications]$ git config --global --unset http.proxy
[centec@compute1 Applications]$cd onos/
- 设置环境变量,source profile(可以看一下这个文件的内容)
[centec@compute1 onos]$ export ONOS_ROOT=/home/centec/Applications/onos
[centec@compute1 onos]$
[centec@compute1 onos]$ source $ONOS_ROOT/tools/dev/bash_profile
[centec@compute1 onos]$
- 修改buckconfig,更换为阿里云的源
[centec@compute1 onos]$ vi .buckconfig
[maven_repositories]
# central = https://repo1.maven.org/maven2
central = http://maven.aliyun.com/nexus/content/groups/public/
- 如果有修改代码的需求,例如希望下发流表的时候不要加clear_action这个instructions
[centec@compute1 onos]$ vi providers/openflow/flow/src/main/java/org/onosproject/provider/of/flow/impl/FlowModBuilderVer13.java
if (treatment.clearedDeferred()) {
// instructions.add(factory().instructions().clearActions());
- 精简注释掉不需要编译的内容,提高编译速度和成功率。下面是个示例
[centec@compute1 onos]$ cat modules.defs
UTILS = [
'//utils/osgi:onlab-osgi',
'//utils/junit:onlab-junit',
'//utils/misc:onlab-misc',
'//utils/rest:onlab-rest',
'//tools/build/conf:onos-build-conf',
]
API = [
'//core/api:onos-api',
'//incubator/api:onos-incubator-api',
]
CORE = UTILS + API + [
'//core/net:onos-core-net',
'//core/common:onos-core-common',
'//core/store/primitives:onos-core-primitives',
'//core/store/serializers:onos-core-serializers',
'//core/store/dist:onos-core-dist',
'//core/security:onos-security',
'//core/store/persistence:onos-core-persistence',
'//incubator/net:onos-incubator-net',
'//incubator/core:onos-incubator-core',
'//incubator/store:onos-incubator-store',
'//incubator/rpc:onos-incubator-rpc',
'//cli:onos-cli',
'//protocols/rest/api:onos-protocols-rest-api',
'//protocols/rest/ctl:onos-protocols-rest-ctl',
# '//protocols/bgp/bgpio:onos-protocols-bgp-bgpio',
# '//protocols/bgp/api:onos-protocols-bgp-api',
# '//protocols/bgp/ctl:onos-protocols-bgp-ctl',
'//protocols/netconf/api:onos-protocols-netconf-api',
'//protocols/netconf/ctl:onos-protocols-netconf-ctl',
'//protocols/openflow/api:onos-protocols-openflow-api',
'//protocols/openflow/ctl:onos-protocols-openflow-ctl',
# '//protocols/ospf/api:onos-protocols-ospf-api',
# '//protocols/ospf/protocol:onos-protocols-ospf-protocol',
# '//protocols/ospf/ctl:onos-protocols-ospf-ctl',
'//protocols/ovsdb/rfc:onos-protocols-ovsdb-rfc',
'//protocols/ovsdb/api:onos-protocols-ovsdb-api',
'//protocols/ovsdb/ctl:onos-protocols-ovsdb-ctl',
# '//protocols/pcep/pcepio:onos-protocols-pcep-pcepio',
# '//protocols/pcep/api:onos-protocols-pcep-api',
# '//protocols/pcep/ctl:onos-protocols-pcep-ctl',
'//protocols/snmp/api:onos-protocols-snmp-api',
'//protocols/snmp/ctl:onos-protocols-snmp-ctl',
# '//protocols/isis/api:onos-protocols-isis-api',
# '//protocols/isis/ctl:onos-protocols-isis-ctl',
# '//protocols/isis/isisio:onos-protocols-isis-isisio',
# '//protocols/lisp/api:onos-protocols-lisp-api',
# '//protocols/lisp/ctl:onos-protocols-lisp-ctl',
# '//protocols/lisp/msg:onos-protocols-lisp-msg',
# '//protocols/tl1/api:onos-protocols-tl1-api',
# '//protocols/tl1/ctl:onos-protocols-tl1-ctl',
'//protocols/restconf/client/api:onos-protocols-restconf-client-api',
'//protocols/restconf/client/ctl:onos-protocols-restconf-client-ctl',
'//drivers/utilities:onos-drivers-utilities',
'//providers/netconf/device:onos-providers-netconf-device',
'//providers/openflow/device:onos-providers-openflow-device',
'//providers/openflow/packet:onos-providers-openflow-packet',
'//providers/openflow/flow:onos-providers-openflow-flow',
'//providers/openflow/group:onos-providers-openflow-group',
'//providers/openflow/meter:onos-providers-openflow-meter',
'//providers/ovsdb/device:onos-providers-ovsdb-device',
'//providers/ovsdb/tunnel:onos-providers-ovsdb-tunnel',
'//providers/rest/device:onos-providers-rest-device',
# '//providers/snmp/device:onos-providers-snmp-device',
# '//providers/isis/cfg:onos-providers-isis-cfg',
# '//providers/isis/topology:onos-providers-isis-topology',
# '//providers/lisp/device:onos-providers-lisp-device',
# '//providers/tl1/device:onos-providers-tl1-device',
'//web/api:onos-rest',
'//web/gui:onos-gui',
]
ONOS_DRIVERS = [
# Drivers
'//drivers/default:onos-drivers-default-oar',
# '//drivers/arista:onos-drivers-arista-oar',
# TODO ONOS-5554 excluding from the build
#'//drivers/bti:onos-drivers-bti-oar',
# '//drivers/ciena:onos-drivers-ciena-oar',
# '//drivers/cisco:onos-drivers-cisco-oar',
# '//drivers/corsa:onos-drivers-corsa-oar',
# '//drivers/fujitsu:onos-drivers-fujitsu-oar',
# '//drivers/lumentum:onos-drivers-lumentum-oar',
# '//drivers/netconf:onos-drivers-netconf-oar',
# '//drivers/optical:onos-drivers-optical-oar',
'//drivers/ovsdb:onos-drivers-ovsdb-oar',
# '//drivers/juniper:onos-drivers-juniper-oar',
# '//drivers/lisp:onos-drivers-lisp-oar',
# '//drivers/flowspec:onos-drivers-flowspec-oar',
# '//drivers/huawei:onos-drivers-huawei-oar',
# '//drivers/microsemi:onos-drivers-microsemi-oar',
# '//drivers/oplink:onos-drivers-oplink-oar',
# '//drivers/hp:onos-drivers-hp-oar',
]
ONOS_PROVIDERS = [
# Providers
# '//providers/bgp:onos-providers-bgp-oar',
# '//providers/bgpcep:onos-providers-bgpcep-oar',
# '//providers/host:onos-providers-host-oar',
'//providers/lldp:onos-providers-lldp-oar',
# '//providers/netcfghost:onos-providers-netcfghost-oar',
# '//providers/netcfglinks:onos-providers-netcfglinks-oar',
# '//providers/netconf:onos-providers-netconf-oar',
'//providers/openflow/message:onos-providers-openflow-message-oar',
'//providers/ovsdb:onos-providers-ovsdb-oar',
'//providers/ovsdb/host:onos-providers-ovsdb-host-oar',
'//providers/ovsdb/base:onos-providers-ovsdb-base-oar',
# '//providers/pcep:onos-providers-pcep-oar',
# '//providers/null:onos-providers-null-oar',
'//providers/openflow/base:onos-providers-openflow-base-oar',
'//providers/openflow/app:onos-providers-openflow-app-oar',
'//providers/rest:onos-providers-rest-oar',
# '//providers/isis:onos-providers-isis-oar',
# '//providers/snmp:onos-providers-snmp-oar',
# '//providers/link:onos-providers-link-oar',
# '//providers/lisp:onos-providers-lisp-oar',
# '//providers/tl1:onos-providers-tl1-oar',
# '//providers/ietfte:onos-providers-ietfte-oar',
]
ONOS_APPS = [
# Apps
# '//apps/dhcp:onos-apps-dhcp-oar',
# '//apps/dhcprelay:onos-apps-dhcprelay-oar',
'//apps/fwd:onos-apps-fwd-oar',
# '//apps/acl:onos-apps-acl-oar',
# '//apps/bgprouter:onos-apps-bgprouter-oar',
# '//apps/cip:onos-apps-cip-oar',
# '//apps/drivermatrix:onos-apps-drivermatrix-oar',
# '//apps/events:onos-apps-events-oar',
# '//apps/proxyarp:onos-apps-proxyarp-oar',
# '//apps/segmentrouting:onos-apps-segmentrouting-oar',
# '//apps/gangliametrics:onos-apps-gangliametrics-oar',
# '//apps/graphitemetrics:onos-apps-graphitemetrics-oar',
# '//apps/flowanalyzer:onos-apps-flowanalyzer-oar',
# '//apps/intentsync:onos-apps-intentsync-oar',
# '//apps/influxdbmetrics:onos-apps-influxdbmetrics-oar',
# '//apps/metrics:onos-apps-metrics-oar',
# '//apps/mfwd:onos-apps-mfwd-oar',
# '//apps/mlb:onos-apps-mlb-oar',
# '//apps/openstacknetworking:onos-apps-openstacknetworking-oar',
# '//apps/mobility:onos-apps-mobility-oar',
'//apps/optical:onos-apps-optical-oar',
'//apps/newoptical:onos-apps-newoptical-oar',
'//apps/optical-model:onos-apps-optical-model-oar',
# '//apps/pathpainter:onos-apps-pathpainter-oar',
# '//apps/pcep-api:onos-apps-pcep-api-oar',
# '//apps/pim:onos-apps-pim-oar',
# '//apps/reactive-routing:onos-apps-reactive-routing-oar',
# '//apps/roadm:onos-apps-roadm-oar',
# '//apps/sdnip:onos-apps-sdnip-oar',
# '//apps/test/demo:onos-apps-test-demo-oar',
# '//apps/test/distributed-primitives:onos-apps-test-distributed-primitives-oar',
# '//apps/test/election:onos-apps-test-election-oar',
# '//apps/test/flow-perf:onos-apps-test-flow-perf-oar',
# '//apps/test/intent-perf:onos-apps-test-intent-perf-oar',
# '//apps/test/loadtest:onos-apps-test-loadtest-oar',
# '//apps/test/netcfg-monitor:onos-apps-test-netcfg-monitor-oar',
# '//apps/test/messaging-perf:onos-apps-test-messaging-perf-oar',
# '//apps/test/transaction-perf:onos-apps-test-transaction-perf-oar',
# '//apps/virtualbng:onos-apps-virtualbng-oar',
# '//apps/vpls:onos-apps-vpls-oar',
# '//apps/vrouter:onos-apps-vrouter-oar',
# '//apps/routing/fibinstaller:onos-apps-routing-fibinstaller-oar',
# '//apps/routing/cpr:onos-apps-routing-cpr-oar',
# '//apps/routing/fpm:onos-apps-routing-fpm-oar',
# '//apps/vtn:onos-apps-vtn-oar',
# '//apps/faultmanagement:onos-apps-faultmanagement-oar',
# '//apps/openstacknode:onos-apps-openstacknode-oar',
# '//apps/cpman/app:onos-apps-cpman-app-oar',
# '//apps/scalablegateway:onos-apps-scalablegateway-oar',
# '//apps/castor:onos-apps-castor-oar',
# '//apps/yms:onos-apps-yms-oar',
# '//apps/ofagent:onos-apps-ofagent-oar',
# '//apps/mappingmanagement:onos-apps-mappingmanagement-oar',
# '//apps/config:onos-apps-config-oar',
# '//apps/netconf/client:onos-apps-netconf-client-oar',
# '//apps/tetopology:onos-apps-tetopology-oar',
# '//apps/tetunnel:onos-apps-tetunnel-oar',
## '//apps/tenbi/yangmodel:onos-apps-tenbi-yangmodel-feature',
## '//apps/tenbi:onos-apps-tenbi-oar',
'//protocols/restconf/server:onos-protocols-restconf-server-oar',
'//apps/restconf:onos-apps-restconf-oar',
# '//apps/flowspec-api:onos-apps-flowspec-api-oar',
# '//apps/yang:onos-apps-yang-oar',
# '//apps/yang-gui:onos-apps-yang-gui-oar',
# '//apps/cord-support:onos-apps-cord-support-oar',
# '//apps/network-troubleshoot:onos-apps-network-troubleshoot-oar',
# '//apps/l3vpn:onos-apps-l3vpn-oar',
# '//apps/openroadm:onos-apps-openroadm-oar',
# '//apps/cfm:onos-apps-cfm-oar',
]
MODELS = [
# '//models/demo:onos-models-demo-oar',
# '//models/openroadm:onos-models-openroadm-oar',
# '//models/l3vpn:onos-models-l3vpn-oar',
# '//models/microsemi:onos-models-microsemi-oar'
]
APP_JARS = [
# '//apps/cpman/api:onos-apps-cpman-api',
# '//apps/routing-api:onos-apps-routing-api',
# '//apps/dhcp/api:onos-apps-dhcp-api',
# '//apps/dhcp/app:onos-apps-dhcp-app',
# '//apps/dhcprelay:onos-apps-dhcprelay',
# '//apps/fwd:onos-apps-fwd',
# '//apps/iptopology-api:onos-apps-iptopology-api',
# '//apps/openstacknode:onos-apps-openstacknode',
# '//apps/routing/common:onos-apps-routing-common',
# '//apps/vtn/vtnrsc:onos-apps-vtn-vtnrsc',
# '//apps/vtn/sfcmgr:onos-apps-vtn-sfcmgr',
# '//apps/vtn/vtnmgr:onos-apps-vtn-vtnmgr',
# '//apps/vtn/vtnweb:onos-apps-vtn-vtnweb',
]
APPS = ONOS_DRIVERS + ONOS_PROVIDERS + ONOS_APPS + MODELS
[centec@compute1 onos]$
- 更换一下central的URL
[centec@compute1 onos]$ vi tools/build/libgen/src/main/java/org/onosproject/libgen/AetherResolver.java
...
public class AetherResolver {
private static final String CENTRAL_URL = "http://maven.aliyun.com/nexus/content/groups/public/";
...
- 更换过源后,需要onos-lib-gen,请耐心等待,尤其是apache-karaf
[centec@compute1 onos]$ ./tools/build/onos-lib-gen
aopalliance-repackaged mvn:org.glassfish.hk2.external:aopalliance-repackaged:jar:2.5.0-b32
amqp-client mvn:com.rabbitmq:amqp-client:jar:3.6.1
asm mvn:org.ow2.asm:asm:jar:5.0.4
atomix mvn:io.atomix:atomix-all:jar:1.0.8
commons-codec mvn:commons-codec:commons-codec:jar:1.10
commons-collections mvn:commons-collections:commons-collections:jar:3.2.2
commons-configuration mvn:commons-configuration:commons-configuration:jar:1.10
commons-io mvn:commons-io:commons-io:jar:2.4
commons-lang mvn:commons-lang:commons-lang:jar:2.6
commons-lang3 mvn:org.apache.commons:commons-lang3:jar:3.5
commons-logging mvn:commons-logging:commons-logging:jar:1.2
commons-math3 mvn:org.apache.commons:commons-math3:jar:3.6.1
commons-pool mvn:commons-pool:commons-pool:jar:1.6
commons-beanutils mvn:commons-beanutils:commons-beanutils:jar:1.9.2
concurrent-trees mvn:com.googlecode.concurrent-trees:concurrent-trees:jar:2.6.0
easymock mvn:org.easymock:easymock:jar:3.4
antlr mvn:antlr:antlr:jar:2.7.7
error_prone_annotations mvn:com.google.errorprone:error_prone_annotations:jar:2.0.11
ganymed-ssh2 mvn:ch.ethz.ganymed:ganymed-ssh2:jar:262
gmetric4j mvn:info.ganglia.gmetric4j:gmetric4j:jar:1.0.10
gson mvn:com.google.code.gson:gson:jar:2.6.2
guava mvn:com.google.guava:guava:jar:22.0
guava-testlib mvn:com.google.guava:guava-testlib:jar:22.0
hamcrest-all mvn:org.hamcrest:hamcrest-all:jar:1.3
hk2-api mvn:org.glassfish.hk2:hk2-api:jar:2.5.0-b32
hk2-locator mvn:org.glassfish.hk2:hk2-locator:jar:2.5.0-b32
hk2-osgi-resource-locator mvn:org.glassfish.hk2:osgi-resource-locator:jar:1.0.1
hk2-utils mvn:org.glassfish.hk2:hk2-utils:jar:2.5.0-b32
httpclient-osgi mvn:org.apache.httpcomponents:httpclient-osgi:jar:4.5.1
httpcore-osgi mvn:org.apache.httpcomponents:httpcore-osgi:jar:4.4.4
influxdb-java mvn:org.influxdb:influxdb-java:jar:2.2
retrofit mvn:com.squareup.retrofit:retrofit:jar:1.9.0
okhttp mvn:com.squareup.okhttp:okhttp:jar:2.4.0
okio mvn:com.squareup.okio:okio:jar:1.4.0
jackson-annotations mvn:com.fasterxml.jackson.core:jackson-annotations:jar:2.8.6
jackson-core mvn:com.fasterxml.jackson.core:jackson-core:jar:2.8.6
jackson-databind mvn:com.fasterxml.jackson.core:jackson-databind:jar:2.8.6
javax.annotation-api mvn:javax.annotation:javax.annotation-api:jar:1.2
javax.inject mvn:org.glassfish.hk2.external:javax.inject:jar:2.5.0-b32
javax.ws.rs-api mvn:javax.ws.rs:javax.ws.rs-api:jar:2.0.1
jersey-client mvn:org.glassfish.jersey.core:jersey-client:jar:2.25.1
jersey-common mvn:org.glassfish.jersey.core:jersey-common:jar:2.25.1
jersey-container-jetty-http mvn:org.glassfish.jersey.containers:jersey-container-jetty-http:jar:2.25.1
jersey-container-servlet mvn:org.glassfish.jersey.containers:jersey-container-servlet:jar:2.25.1
jersey-container-servlet-core mvn:org.glassfish.jersey.containers:jersey-container-servlet-core:jar:2.25.1
jersey-guava mvn:org.glassfish.jersey.bundles.repackaged:jersey-guava:jar:2.25.1
jersey-media-multipart mvn:org.glassfish.jersey.media:jersey-media-multipart:jar:2.25.1
jersey-server mvn:org.glassfish.jersey.core:jersey-server:jar:2.25.1
jersey-test-framework-core mvn:org.glassfish.jersey.test-framework:jersey-test-framework-core:jar:2.25.1
jersey-test-framework-jetty mvn:org.glassfish.jersey.test-framework.providers:jersey-test-framework-provider-jetty:jar:2.25.1
jetty-util mvn:org.eclipse.jetty:jetty-util:jar:9.2.21.v20170120
jetty-websocket mvn:org.eclipse.jetty:jetty-websocket:jar:8.1.19.v20160209
jetty-server mvn:org.eclipse.jetty:jetty-server:jar:9.2.21.v20170120
jetty-continuation mvn:org.eclipse.jetty:jetty-continuation:jar:9.2.21.v20170120
jetty-http mvn:org.eclipse.jetty:jetty-http:jar:9.2.21.v20170120
jetty-io mvn:org.eclipse.jetty:jetty-io:jar:9.2.21.v20170120
javax.servlet-api mvn:javax.servlet:javax.servlet-api:jar:3.1.0
joda-time mvn:joda-time:joda-time:jar:2.9.3
jsch mvn:com.jcraft:jsch:jar:0.1.53
jsr305 mvn:com.google.code.findbugs:jsr305:jar:3.0.1
junit mvn:junit:junit:jar:4.12
kryo mvn:com.esotericsoftware:kryo:jar:4.0.0
mapdb mvn:org.mapdb:mapdb:jar:1.0.9
metrics-core mvn:io.dropwizard.metrics:metrics-core:jar:3.1.0
metrics-ganglia mvn:io.dropwizard.metrics:metrics-ganglia:jar:3.1.2
metrics-graphite mvn:io.dropwizard.metrics:metrics-graphite:jar:3.1.2
metrics-influxdb mvn:com.izettle:metrics-influxdb:jar:1.1.1
metrics-json mvn:io.dropwizard.metrics:metrics-json:jar:3.1.0
minimal-json mvn:com.eclipsesource.minimal-json:minimal-json:jar:0.9.4
minlog mvn:com.esotericsoftware:minlog:jar:1.3.0
netty mvn:io.netty:netty:jar:3.10.5.Final
netty-buffer mvn:io.netty:netty-buffer:jar:4.1.5.Final
netty-codec mvn:io.netty:netty-codec:jar:4.1.5.Final
netty-common mvn:io.netty:netty-common:jar:4.1.5.Final
netty-handler mvn:io.netty:netty-handler:jar:4.1.5.Final
netty-transport mvn:io.netty:netty-transport:jar:4.1.5.Final
netty-transport-native-epoll mvn:io.netty:netty-transport-native-epoll:jar:4.1.5.Final
netty-resolver mvn:io.netty:netty-resolver:jar:4.1.5.Final
catalyst-concurrent mvn:io.atomix.catalyst:catalyst-concurrent:jar:1.2.1
catalyst-netty mvn:io.atomix.catalyst:catalyst-netty:jar:1.2.1
catalyst-transport mvn:io.atomix.catalyst:catalyst-transport:jar:1.2.1
objenesis mvn:org.objenesis:objenesis:jar:2.2
openflowj mvn:org.onosproject:openflowj:jar:0.9.9.onos
org.apache.felix.scr mvn:org.apache.felix:org.apache.felix.scr:jar:1.8.2
org.apache.felix.scr.annotations mvn:org.apache.felix:org.apache.felix.scr.annotations:jar:1.9.12
org.apache.karaf.features.core mvn:org.apache.karaf.features:org.apache.karaf.features.core:jar:3.0.8
org.apache.karaf.shell.console mvn:org.apache.karaf.shell:org.apache.karaf.shell.console:jar:3.0.8
org.apache.karaf.system.core mvn:org.apache.karaf.system:org.apache.karaf.system.core:jar:3.0.8
org.apache.servicemix.bundles.snmp4j mvn:org.apache.servicemix.bundles:org.apache.servicemix.bundles.snmp4j:jar:2.3.4_1
org.osgi.compendium mvn:org.osgi:org.osgi.compendium:jar:5.0.0
osgi-core mvn:org.osgi:org.osgi.core:jar:5.0.0
reflectasm mvn:com.esotericsoftware:reflectasm:jar:1.11.0
remotetea-oncrpc mvn:org.acplt.remotetea:remotetea-oncrpc:jar:1.1.3
rrd4j mvn:org.rrd4j:rrd4j:jar:2.2
javassist mvn:org.javassist:javassist:jar:3.20.0-GA
mimepull mvn:org.jvnet.mimepull:mimepull:jar:1.9.6
servlet-api mvn:javax.servlet:servlet-api:jar:2.5
slf4j-api mvn:org.slf4j:slf4j-api:jar:1.7.21
slf4j-jdk14 mvn:org.slf4j:slf4j-jdk14:jar:1.7.21
typesafe-config mvn:com.typesafe:config:jar:1.2.1
validation-api mvn:javax.validation:validation-api:jar:1.1.0.Final
checkstyle mvn:com.puppycrawl.tools:checkstyle:jar:6.19
apache-karaf
op
http://onlab.vicci.org/onos/third-party/apache-karaf-3.0.8-offline-20170202.tar.gz
bndlib mvn:biz.aQute.bnd:biz.aQute.bndlib:jar:3.1.0
bndexe http://onlab.vicci.org/onos/third-party/biz.aQute.bnd-3.1.0.jar
libthrift mvn:org.apache.thrift:libthrift:jar:0.9.3
qdox mvn:com.thoughtworks.qdox:qdox:jar:2.0-M3
org.apache.felix.scr.bnd https://oss.sonatype.org/content/repositories/snapshots/org/onosproject/org.apache.felix.scr.bnd/1.4.1-SNAPSHOT/org.apache.felix.scr.bnd-1.4.1-20160328.235003-2.jar
snmp-core mvn:org.onosproject:snmp-core:jar:1.3-20161021.1
bti7000 mvn:org.onosproject:mibbler-mibs-bti7000:jar:1.0-20151221.1
mibs-net-snmp mvn:org.onosproject:mibbler-mibs-net-snmp:jar:1.0-20151221.1
mibs-rfc mvn:org.onosproject:mibbler-mibs-rfc:jar:1.0-20151221.1
openstack4j-core mvn:org.pacesys:openstack4j-core:jar:2.11
openstack4j-http-connector mvn:org.pacesys.openstack4j.connectors:openstack4j-http-connector:jar:2.11
openstack4j-httpclient mvn:org.pacesys.openstack4j.connectors:openstack4j-httpclient:jar:2.11
onos-yang-datamodel mvn:org.onosproject:onos-yang-datamodel:jar:1.11
onos-yang-maven-plugin mvn:org.onosproject:onos-yang-maven-plugin:jar:1.11
onos-yang-utils-generator mvn:org.onosproject:onos-yang-utils-generator:jar:1.11
onos-yang-model mvn:org.onosproject:onos-yang-model:jar:2.1
onos-yang-compiler-api mvn:org.onosproject:onos-yang-compiler-api:jar:2.1
onos-yang-runtime mvn:org.onosproject:onos-yang-runtime:jar:2.1
onos-yang-serializers-json mvn:org.onosproject:onos-yang-serializers-json:jar:2.1
onos-yang-serializers-xml mvn:org.onosproject:onos-yang-serializers-xml:jar:2.1
onos-yang-serializers-utils mvn:org.onosproject:onos-yang-serializers-utils:jar:2.1
org.apache.servicemix.bundles.dom4j mvn:org.apache.servicemix.bundles:org.apache.servicemix.bundles.dom4j:jar:1.6.1_5
openflowj-3.0 https://oss.sonatype.org/content/repositories/snapshots/org/projectfloodlight/openflowj/3.0.0-SNAPSHOT/openflowj-3.0.0-20161029.095322-40.jar
plexus-utils mvn:org.codehaus.plexus:plexus-utils:jar:3.0.24
sshd-core mvn:org.apache.sshd:sshd-core:jar:1.4.0
Finish writing lib/BUCK
[centec@compute1 onos]$
- 开始编译打包,op=onos-package
[centec@compute1 onos]$ op
Updating Buck...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 44.0M 100 44.0M 0 0 22238 0 0:34:37 0:34:36 0:00:01 30834
Archive: cache/buck-v2017.05.25.01.zip
inflating: buck
extracting: .buck_version
creating: plugins/
inflating: plugins/onos.jar
inflating: plugins/yang.jar
Successfully updated Buck in /home/centec/Applications/onos/bin/buck to buck-v2017.05.25.01.zip
Not using buckd because NO_BUCKD is set.
[-] PROCESSING BUCK FILES...FINISHED 3.0s [100%] \U0001f433 New buck daemon
[+] DOWNLOADING... (0.00 B/S, TOTAL: 0.00 B, 0 Artifacts)
[+] BUILDING...2m33.6s [100%] (363/363 JOBS, 287 UPDATED, 287 [79.1%] CACHE MISS)
|=> IDLE
|=> IDLE
The outputs are:
//tools/package:onos-package buck-out/gen/tools/package/onos-package/onos.tar.gz
-rw-rw-r-- 1 centec centec 123269856 Nov 16 05:29 /tmp/onos-1.10.8.centec.tar.gz
2071771737 123269856 /tmp/onos-1.10.8.centec.tar.gz
[centec@compute1 onos]$
- 编译成功后,可以找到打包好的文件
[centec@compute1 onos]$ cd buck-out/gen/tools/package/onos-package
[centec@compute1 onos-package]$ ll
total 120384
-rw-rw-r-- 1 centec centec 123269856 Nov 16 05:29 onos.tar.gz
[centec@compute1 onos-package]$
运行
- 将onos.tar.gz放到需要部署PC的/opt,解压缩,改名为onos/
root@centec:/opt# tar -zxvf onos.tar.gz
root@centec:/opt# mv onos-1.10.8 onos
- 运行ONOS
root@centec:/opt# /opt/onos/bin/onos-service start
Welcome to Open Network Operating System (ONOS)!
____ _ ______ ____
/ __ \/ |/ / __ \/ __/
/ /_/ / / /_/ /\ \
\____/_/|_/\____/___/
Documentation: wiki.onosproject.org
Tutorials: tutorials.onosproject.org
Mailing lists: lists.onosproject.org
Come help out! Find out how at: contribute.onosproject.org
Hit '<tab>' for a list of available commands
and '[cmd] --help' for help on a specific command.
Hit '<ctrl-d>' or type 'system:shutdown' or 'logout' to shutdown ONOS.
onos>
一些问题的记录
- 开VNC的时候,最好把有道词典关掉,否则会在VNC的终端莫名其妙加Ctl+C
- buck加速,先查看onos-buck文件
[centec@compute1 build]$ pwd
/home/centec/Applications/onos/tools/build
[centec@compute1 build]$ cat onos-buck
#!/bin/bash
# -----------------------------------------------------------------------------
# Runs the custom version of Buck required by ONOS.
# -----------------------------------------------------------------------------
set -e
BUCK_URL="http://repo1.maven.org/maven2/org/onosproject/onos-buck/v2018.01.10.02/buck-v2018.01.10.02.zip"
BUCK_SHA="04ac8754c6ca5957ac68a75544d1bd0c9d17b908"
每次buck都会从上面的网址下载这个zip文件,可以先把它下载好,然后修改BUCK_URL为本地文件地址
[centec@compute1 Applications]$ sha1sum buck-v2018.02.09.01.zip
45d8bd28f441991257babf89f7a317edb3a2b536 buck-v2018.02.09.01.zip
[centec@compute1 build]$ vi onos-buck
BUCK_URL="file:///home/centec/Applications/buck-v2018.02.09.01.zip"
BUCK_SHA="45d8bd28f441991257babf89f7a317edb3a2b536"
- 如果onos-lib-gen或是op出错,可以查看deps.json
[centec@compute1 onos]$ cat ./lib/deps.json
{
"libraries": {
"COMPILE": [
"joda-time",
"commons-configuration",
"commons-logging",
"commons-collections",
"commons-lang",
"commons-lang3",
"commons-io",
"commons-pool",
"objenesis",
"guava",
"netty",
"netty-common",
"minimal-json",
"kryo",
"reflectasm",
"asm",
"minlog",
"metrics-core",
"metrics-json",
"slf4j-api",
"osgi-core",
"org.osgi.compendium",
{ "name": "org.apache.felix.scr.annotations", "compile_only": true },
"org.apache.felix.scr",
"jackson-annotations",
"jackson-core",
"jackson-databind",
"org.apache.karaf.features.core",
"org.apache.karaf.system.core",
{ "name": "jsr305", "compile_only": true },
"onos-yang-datamodel",
"onos-yang-utils-generator",
"onos-yang-model",
"onos-yang-compiler-api",
"onos-yang-maven-plugin",
"onos-yang-serializers-json",
"onos-yang-serializers-xml",
"onos-yang-serializers-utils",
"org.apache.servicemix.bundles.dom4j"
],
"CORE_DEPS": [
":COMPILE",
"//core/api:onos-api",
"//utils/misc:onlab-misc",
"//utils/osgi:onlab-osgi"
],
"TEST": [
"junit",
"easymock",
"hamcrest-all",
"guava-testlib",
"//utils/junit:onlab-junit"
],
"TEST_ADAPTERS": [
":TEST",
"//core/common:onos-core-common",
"//core/api:onos-api-tests",
"//core/common:onos-core-common-tests"
],
"TEST_REST": [
":TEST_ADAPTERS",
"jersey-client",
"jersey-server",
"jersey-common",
"jersey-test-framework-core",
"jersey-test-framework-jetty",
"jersey-container-jetty-http",
"jetty-continuation",
"jetty-http",
"jetty-server",
"jetty-io",
"jetty-util",
"javax.servlet-api",
"jersey-guava",
"hk2-api",
"hk2-locator",
"hk2-utils",
"javax.inject",
"hk2-osgi-resource-locator",
"javax.annotation-api",
"validation-api",
"//core/common:onos-core-common",
"//core/api:onos-api-tests",
"//core/common:onos-core-common-tests",
"//utils/osgi:onlab-osgi-tests"
]
},
"artifacts": {
"aopalliance-repackaged": "mvn:org.glassfish.hk2.external:aopalliance-repackaged:2.5.0-b32",
"amqp-client": "mvn:com.rabbitmq:amqp-client:jar:3.6.1",
"asm": "mvn:org.ow2.asm:asm:5.0.4",
"atomix": "mvn:io.atomix:atomix-all:1.0.8",
"commons-codec": "mvn:commons-codec:commons-codec:1.10",
"commons-collections": "mvn:commons-collections:commons-collections:3.2.2",
"commons-configuration": "mvn:commons-configuration:commons-configuration:1.10",
"commons-io": "mvn:commons-io:commons-io:2.4",
"commons-lang": "mvn:commons-lang:commons-lang:2.6",
"commons-lang3": "mvn:org.apache.commons:commons-lang3:3.5",
"commons-logging": "mvn:commons-logging:commons-logging:1.2",
"commons-math3": "mvn:org.apache.commons:commons-math3:3.6.1",
"commons-pool": "mvn:commons-pool:commons-pool:1.6",
"commons-beanutils": "mvn:commons-beanutils:commons-beanutils:1.9.2",
"concurrent-trees": "mvn:com.googlecode.concurrent-trees:concurrent-trees:2.6.0",
"easymock": "mvn:org.easymock:easymock:3.4",
"antlr": "mvn:antlr:antlr:2.7.7",
"error_prone_annotations": "mvn:com.google.errorprone:error_prone_annotations:2.0.11",
"ganymed-ssh2": "mvn:ch.ethz.ganymed:ganymed-ssh2:262",
"gmetric4j": "mvn:info.ganglia.gmetric4j:gmetric4j:1.0.10",
"gson": "mvn:com.google.code.gson:gson:jar:2.6.2",
"guava": "mvn:com.google.guava:guava:22.0",
"guava-testlib": "mvn:com.google.guava:guava-testlib:22.0",
"hamcrest-all": "mvn:org.hamcrest:hamcrest-all:1.3",
"hk2-api": "mvn:org.glassfish.hk2:hk2-api:2.5.0-b32",
"hk2-locator": "mvn:org.glassfish.hk2:hk2-locator:2.5.0-b32",
"hk2-osgi-resource-locator": "mvn:org.glassfish.hk2:osgi-resource-locator:1.0.1",
"hk2-utils": "mvn:org.glassfish.hk2:hk2-utils:2.5.0-b32",
"httpclient-osgi": "mvn:org.apache.httpcomponents:httpclient-osgi:4.5.1",
"httpcore-osgi": "mvn:org.apache.httpcomponents:httpcore-osgi:4.4.4",
"influxdb-java": "mvn:org.influxdb:influxdb-java:2.2",
"retrofit": "mvn:com.squareup.retrofit:retrofit:1.9.0",
"okhttp": "mvn:com.squareup.okhttp:okhttp:2.4.0",
"okio": "mvn:com.squareup.okio:okio:1.4.0",
"jackson-annotations": "mvn:com.fasterxml.jackson.core:jackson-annotations:2.8.6",
"jackson-core": "mvn:com.fasterxml.jackson.core:jackson-core:2.8.6",
"jackson-databind": "mvn:com.fasterxml.jackson.core:jackson-databind:2.8.6",
"javax.annotation-api": "mvn:javax.annotation:javax.annotation-api:1.2",
"javax.inject": "mvn:org.glassfish.hk2.external:javax.inject:2.5.0-b32",
"javax.ws.rs-api": "mvn:javax.ws.rs:javax.ws.rs-api:2.0.1",
"jersey-client": "mvn:org.glassfish.jersey.core:jersey-client:2.25.1",
"jersey-common": "mvn:org.glassfish.jersey.core:jersey-common:2.25.1",
"jersey-container-jetty-http": "mvn:org.glassfish.jersey.containers:jersey-container-jetty-http:2.25.1",
"jersey-container-servlet": "mvn:org.glassfish.jersey.containers:jersey-container-servlet:2.25.1",
"jersey-container-servlet-core": "mvn:org.glassfish.jersey.containers:jersey-container-servlet-core:2.25.1",
"jersey-guava": "mvn:org.glassfish.jersey.bundles.repackaged:jersey-guava:2.25.1",
"jersey-media-multipart": "mvn:org.glassfish.jersey.media:jersey-media-multipart:2.25.1",
"jersey-server": "mvn:org.glassfish.jersey.core:jersey-server:2.25.1",
"jersey-test-framework-core": "mvn:org.glassfish.jersey.test-framework:jersey-test-framework-core:2.25.1",
"jersey-test-framework-jetty": "mvn:org.glassfish.jersey.test-framework.providers:jersey-test-framework-provider-jetty:2.25.1",
"jetty-util": "mvn:org.eclipse.jetty:jetty-util:9.2.21.v20170120",
"jetty-websocket": "mvn:org.eclipse.jetty:jetty-websocket:8.1.19.v20160209",
"jetty-server": "mvn:org.eclipse.jetty:jetty-server:9.2.21.v20170120",
"jetty-continuation": "mvn:org.eclipse.jetty:jetty-continuation:9.2.21.v20170120",
"jetty-http": "mvn:org.eclipse.jetty:jetty-http:9.2.21.v20170120",
"jetty-io": "mvn:org.eclipse.jetty:jetty-io:9.2.21.v20170120",
"javax.servlet-api": "mvn:javax.servlet:javax.servlet-api:3.1.0",
"joda-time": "mvn:joda-time:joda-time:2.9.3",
"jsch": "mvn:com.jcraft:jsch:0.1.53",
"jsr305": "mvn:com.google.code.findbugs:jsr305:3.0.1",
"junit": "mvn:junit:junit:4.12",
"kryo": "mvn:com.esotericsoftware:kryo:4.0.0",
"mapdb": "mvn:org.mapdb:mapdb:1.0.9",
"metrics-core": "mvn:io.dropwizard.metrics:metrics-core:3.1.0",
"metrics-ganglia": "mvn:io.dropwizard.metrics:metrics-ganglia:3.1.2",
"metrics-graphite": "mvn:io.dropwizard.metrics:metrics-graphite:3.1.2",
"metrics-influxdb": "mvn:com.izettle:metrics-influxdb:1.1.1",
"metrics-json": "mvn:io.dropwizard.metrics:metrics-json:3.1.0",
"minimal-json": "mvn:com.eclipsesource.minimal-json:minimal-json:0.9.4",
"minlog": "mvn:com.esotericsoftware:minlog:1.3.0",
"netty": "mvn:io.netty:netty:3.10.5.Final",
"netty-buffer": "mvn:io.netty:netty-buffer:4.1.5.Final",
"netty-codec": "mvn:io.netty:netty-codec:4.1.5.Final",
"netty-common": "mvn:io.netty:netty-common:4.1.5.Final",
"netty-handler": "mvn:io.netty:netty-handler:4.1.5.Final",
"netty-transport": "mvn:io.netty:netty-transport:4.1.5.Final",
"netty-transport-native-epoll": "mvn:io.netty:netty-transport-native-epoll:4.1.5.Final",
"netty-resolver": "mvn:io.netty:netty-resolver:4.1.5.Final",
"catalyst-concurrent": "mvn:io.atomix.catalyst:catalyst-concurrent:1.2.1",
"catalyst-netty": "mvn:io.atomix.catalyst:catalyst-netty:1.2.1",
"catalyst-transport": "mvn:io.atomix.catalyst:catalyst-transport:1.2.1",
"objenesis": "mvn:org.objenesis:objenesis:2.2",
"openflowj": "mvn:org.onosproject:openflowj:0.9.9.onos",
"org.apache.felix.scr": "mvn:org.apache.felix:org.apache.felix.scr:1.8.2",
"org.apache.felix.scr.annotations": "mvn:org.apache.felix:org.apache.felix.scr.annotations:1.9.12",
"org.apache.karaf.features.core": "mvn:org.apache.karaf.features:org.apache.karaf.features.core:3.0.8",
"org.apache.karaf.shell.console": "mvn:org.apache.karaf.shell:org.apache.karaf.shell.console:3.0.8",
"org.apache.karaf.system.core": "mvn:org.apache.karaf.system:org.apache.karaf.system.core:3.0.8",
"org.apache.servicemix.bundles.snmp4j": "mvn:org.apache.servicemix.bundles:org.apache.servicemix.bundles.snmp4j:2.3.4_1",
"org.osgi.compendium": "mvn:org.osgi:org.osgi.compendium:5.0.0",
"osgi-core": "mvn:org.osgi:org.osgi.core:5.0.0",
"reflectasm": "mvn:com.esotericsoftware:reflectasm:1.11.0",
"remotetea-oncrpc": "mvn:org.acplt.remotetea:remotetea-oncrpc:1.1.3",
"rrd4j": "mvn:org.rrd4j:rrd4j:2.2",
"javassist": "mvn:org.javassist:javassist:3.20.0-GA", //transitive
"mimepull": "mvn:org.jvnet.mimepull:mimepull:1.9.6", //transitive
"servlet-api": "mvn:javax.servlet:servlet-api:2.5",
"slf4j-api": "mvn:org.slf4j:slf4j-api:1.7.21",
"slf4j-jdk14": "mvn:org.slf4j:slf4j-jdk14:1.7.21",
"typesafe-config": "mvn:com.typesafe:config:1.2.1",
"validation-api": "mvn:javax.validation:validation-api:1.1.0.Final",
"checkstyle": "mvn:com.puppycrawl.tools:checkstyle:6.19",
"apache-karaf": "http://onlab.vicci.org/onos/third-party/apache-karaf-3.0.8-offline-20170202.tar.gz",
"bndlib": "mvn:biz.aQute.bnd:biz.aQute.bndlib:jar:3.1.0",
"bndexe": "http://onlab.vicci.org/onos/third-party/biz.aQute.bnd-3.1.0.jar",
"libthrift": "mvn:org.apache.thrift:libthrift:0.9.3",
"qdox": "mvn:com.thoughtworks.qdox:qdox:2.0-M3",
"org.apache.felix.scr.bnd": {
"uri": "mvn:org.onosproject:org.apache.felix.scr.bnd:1.4.1-SNAPSHOT",
"repo": "https://oss.sonatype.org/content/repositories/snapshots"
},
"snmp-core": "mvn:org.onosproject:snmp-core:1.3-20161021.1",
"bti7000": "mvn:org.onosproject:mibbler-mibs-bti7000:1.0-20151221.1",
"mibs-net-snmp": "mvn:org.onosproject:mibbler-mibs-net-snmp:1.0-20151221.1",
"mibs-rfc": "mvn:org.onosproject:mibbler-mibs-rfc:1.0-20151221.1",
// Openstack4j related jars
"openstack4j-core": "mvn:org.pacesys:openstack4j-core:2.11",
"openstack4j-http-connector": "mvn:org.pacesys.openstack4j.connectors:openstack4j-http-connector:2.11",
"openstack4j-httpclient": "mvn:org.pacesys.openstack4j.connectors:openstack4j-httpclient:2.11",
"onos-yang-datamodel": "mvn:org.onosproject:onos-yang-datamodel:1.11",
"onos-yang-maven-plugin": "mvn:org.onosproject:onos-yang-maven-plugin:1.11",
"onos-yang-utils-generator": "mvn:org.onosproject:onos-yang-utils-generator:1.11",
"onos-yang-model":"mvn:org.onosproject:onos-yang-model:2.1",
"onos-yang-compiler-api":"mvn:org.onosproject:onos-yang-compiler-api:2.1",
"onos-yang-runtime":"mvn:org.onosproject:onos-yang-runtime:2.1",
"onos-yang-serializers-json":"mvn:org.onosproject:onos-yang-serializers-json:2.1",
"onos-yang-serializers-xml":"mvn:org.onosproject:onos-yang-serializers-xml:2.1",
"onos-yang-serializers-utils":"mvn:org.onosproject:onos-yang-serializers-utils:2.1",
"org.apache.servicemix.bundles.dom4j":"mvn:org.apache.servicemix.bundles:org.apache.servicemix.bundles.dom4j:1.6.1_5",
"openflowj-3.0": {
"uri": "mvn:org.projectfloodlight:openflowj:3.0.0-SNAPSHOT",
"repo": "https://oss.sonatype.org/content/repositories/snapshots"
},
"plexus-utils": "mvn:org.codehaus.plexus:plexus-utils:3.0.24",
"sshd-core": "mvn:org.apache.sshd:sshd-core:1.4.0"
}
}
[centec@compute1 onos]$
很大可能是因为下载apache-karaf超时导致。可以先下载带本地,然后启动一个http文件服务,将相关网址替换掉,例如
"apache-karaf": "http://127.0.0.1/apache-karaf-3.0.8-offline-20170202.tar.gz",
其它的有网址对应的文件也可以这样加速,记得提更换后一定要记得一定要 ./tools/build/onos-lib-gen
- 如果编译时候还有报错,在modules.defs中将相关内容用"//"注释掉
- 做了修改,最好是删除之前的编译结果重新编译
[centec@compute1 onos]$ rm -fr buck-out/
[centec@compute1 onos]$ op
-
如果是开发的同学, 需要反复编译的,还是建议用Nexus Repository Manager搭建一个本地的maven库,然后把上面用到的下载到本地后再上传到nexus,网址换成本地
当然,修改后需要./tools/build/onos-lib-gen