├── .gitattributes ├── .github ├── FUNDING.yml └── workflows │ └── go.yml ├── .gitignore ├── .mk ├── api.mk ├── bench.mk ├── bindata.mk ├── check.mk ├── contrib.mk ├── debug.mk ├── dist.mk ├── easyjson.mk ├── ebpf.mk ├── gendecoder.mk ├── k8s.mk ├── ovn.mk ├── proto.mk ├── static.mk ├── stringer.mk ├── swagger.mk ├── tests.mk ├── ui.mk └── vppapi.mk ├── .travis.yml ├── CHANGELOG.md ├── CONTRIBUTING.md ├── Dockerfile ├── GOVERNANCE.md ├── LICENSE ├── Makefile ├── README.md ├── agent ├── agent.go ├── flow_probes.go ├── host.go └── topology_probes.go ├── analyzer ├── probes.go ├── server.go └── storage.go ├── api ├── client │ ├── client.go │ └── gremlin.go ├── server │ ├── capture.go │ ├── config.go │ ├── edgerule.go │ ├── jsre.go │ ├── no_packet_injector.go │ ├── noderule.go │ ├── packet_injector.go │ ├── packet_injector_common.go │ ├── pcap.go │ ├── swagger_base.json │ ├── swagger_definitions.tmpl │ ├── swagger_operations.tmpl │ ├── topology.go │ └── workflow.go └── types │ └── types.go ├── cmd ├── agent │ └── agent.go ├── allinone │ ├── allinone.go │ └── no_allinone.go ├── analyzer │ └── analyzer.go ├── client │ ├── capture.go │ ├── client.go │ ├── edgerule.go │ ├── noderule.go │ ├── packet_injector.go │ ├── pcap.go │ └── status.go ├── cmd.go ├── completion │ └── completion.go ├── config │ └── config.go ├── injector │ ├── standalone.go │ └── standalone_linux.go ├── seed │ └── seed.go ├── skydive │ ├── nsenter.c │ ├── nsenter.go │ └── skydive.go └── version │ └── version.go ├── common └── types.go ├── config ├── auth.go ├── config.go ├── config_test.go ├── logging.go ├── rbac.go ├── tls.go └── websocket.go ├── contrib ├── ansible │ ├── README.md │ ├── ansible.cfg │ ├── devmode.yml │ ├── inventory │ │ ├── README.md │ │ ├── hosts.localhost │ │ ├── hosts.localhost.auth │ │ ├── hosts.localhost.container │ │ ├── hosts.localhost.extra │ │ ├── hosts.localhost.openstack │ │ ├── hosts.multiple │ │ └── hosts.multiple.container │ ├── library │ │ ├── skydive_edge.py │ │ ├── skydive_edge_list.py │ │ ├── skydive_node.py │ │ ├── skydive_node_list.py │ │ └── skydive_query.py │ ├── playbook.yml.sample │ └── roles │ │ ├── elasticsearch │ │ └── tasks │ │ │ └── main.yml │ │ ├── orientdb │ │ ├── defaults │ │ │ └── main.yml │ │ └── tasks │ │ │ └── main.yml │ │ ├── skydive_agent │ │ ├── defaults │ │ │ └── main.yml │ │ ├── meta │ │ │ └── main.yml │ │ └── tasks │ │ │ ├── binary.yml │ │ │ ├── config.yml │ │ │ ├── container.yml │ │ │ ├── main.yml │ │ │ └── package.yml │ │ ├── skydive_analyzer │ │ ├── defaults │ │ │ └── main.yml │ │ ├── meta │ │ │ └── main.yml │ │ └── tasks │ │ │ ├── binary.yml │ │ │ ├── config.yml │ │ │ ├── container.yml │ │ │ ├── iptables.yml │ │ │ ├── keystone.yml │ │ │ ├── main.yml │ │ │ ├── package.yml │ │ │ └── tests.yml │ │ ├── skydive_common │ │ ├── defaults │ │ │ └── main.yml │ │ ├── library │ │ │ └── yedit.py │ │ ├── meta │ │ │ └── main.yml │ │ ├── tasks │ │ │ ├── binary.yml │ │ │ ├── config.yml │ │ │ ├── container.yml │ │ │ ├── docker.yml │ │ │ ├── main.yml │ │ │ ├── package.yml │ │ │ ├── permissions.yml │ │ │ └── systemd.yml │ │ └── templates │ │ │ └── skydive.service.j2 │ │ └── skydive_dev │ │ ├── defaults │ │ └── main.yml │ │ └── tasks │ │ ├── build.yml │ │ ├── centos.yml │ │ ├── ci.yml │ │ ├── docker-ce.yml │ │ ├── docker.yml │ │ ├── dpdk.yml │ │ ├── fedora.yml │ │ ├── gimme.yml │ │ ├── lxd.yml │ │ ├── main.yml │ │ ├── ovn.yml │ │ ├── protobuf.yml │ │ ├── runtime.yml │ │ ├── static.yml │ │ ├── tests.yml │ │ ├── virtualbox.yml │ │ └── vpp.yml ├── charts │ ├── Makefile │ ├── elasticsearch │ │ └── Makefile │ ├── kibana │ │ └── Makefile │ ├── skydive-agent │ │ ├── Chart.yaml │ │ ├── Makefile │ │ ├── templates │ │ │ ├── _helpers.tpl │ │ │ └── daemonset.yaml │ │ └── values.yaml │ └── skydive-analyzer │ │ ├── Chart.yaml │ │ ├── Makefile │ │ ├── fleet.yaml │ │ ├── templates │ │ ├── NOTES.txt │ │ ├── _helpers.tpl │ │ ├── clusterrolebinging.yaml │ │ ├── deployment.yaml │ │ ├── service.yaml │ │ └── serviceaccount.yaml │ │ └── values.yaml ├── dev │ ├── Vagrantfile │ ├── devmode.yml │ └── roles ├── docker │ ├── Dockerfile │ ├── docker-compose.yml │ └── skydive.yml ├── fleet │ ├── Makefile │ └── skydive.sh ├── jsonof │ ├── Makefile │ ├── jsonof.go │ └── openflow-json-v0.1.schema.json ├── kubernetes │ ├── README.md │ ├── samples │ │ ├── README.md │ │ └── skydive.sh │ └── skydive.yaml ├── openshift │ ├── README.md │ ├── deploy_skydive_ocp.sh │ ├── skydive-flow-exporter-template.yaml │ └── skydive-template.yaml ├── packaging │ └── rpm │ │ ├── generate-skydive-bootstrap.sh │ │ ├── skydive-agent.sysconfig │ │ ├── skydive-analyzer.sysconfig │ │ ├── skydive-selinux.8 │ │ ├── skydive.fc │ │ ├── skydive.if │ │ ├── skydive.spec │ │ ├── skydive.te.fedora │ │ ├── skydive.te.rhel │ │ └── specfile-update-bundles ├── python │ └── api │ │ ├── LICENSE.txt │ │ ├── README.md │ │ ├── requirements.txt │ │ ├── samples │ │ ├── fs-watcher.py │ │ ├── inject-nodes1.py │ │ └── requirements.txt │ │ ├── setup.cfg │ │ ├── setup.py │ │ ├── skydive │ │ ├── __init__.py │ │ ├── alerts.py │ │ ├── auth.py │ │ ├── captures.py │ │ ├── encoder.py │ │ ├── graph.py │ │ ├── packet_injector.py │ │ ├── rest │ │ │ ├── __init__.py │ │ │ └── client.py │ │ ├── rules.py │ │ ├── tls.py │ │ ├── websocket │ │ │ ├── __init__.py │ │ │ └── client.py │ │ └── wsshell.py │ │ └── tests │ │ └── tests.py ├── snort │ ├── Makefile │ └── snortSkydive.go ├── systemd │ ├── skydive-agent.service │ └── skydive-analyzer.service └── vagrant │ ├── Vagrantfile │ ├── playbook-dev.yml │ ├── playbook-es.yml │ ├── provisioning │ ├── requirements.yml │ ├── roles │ └── skydive_dev │ ├── setup-common.sh │ ├── start-agent.sh │ └── start-analyzer.sh ├── coverage.sh ├── devstack ├── local.conf.cpu ├── local.conf.full ├── override-defaults ├── plugin.sh └── settings ├── dpdk └── Makefile ├── ebpf ├── Dockerfile ├── Makefile ├── common.h ├── defs.h ├── flow-gre.c ├── flow.c ├── flow.h ├── flow_network.c ├── statics │ └── bindata.go └── tests │ └── tests.go ├── etc └── skydive.yml.default ├── flow ├── allocator.go ├── application.go ├── bpf.go ├── client.go ├── client │ └── flow_client.go ├── decoder.go ├── ebpf.go ├── ebpf_test.go ├── filters.go ├── flow.go ├── flow.pb.go ├── flow.pb_gendecoder.go ├── flow.proto ├── flow_test.go ├── hash.go ├── icmp.go ├── ipdefrag.go ├── layers │ ├── dhcpv4.pb.go │ ├── dhcpv4.proto │ ├── dns.go │ ├── dns.pb.go │ ├── dns.proto │ ├── vrrpv2.pb.go │ └── vrrpv2.proto ├── metrics.go ├── metrics_test.go ├── no_bpf.go ├── no_ebpf.go ├── ondemand │ ├── client │ │ └── client.go │ ├── ondemand.go │ └── server │ │ └── server.go ├── pcap.go ├── pcaptraces │ ├── contrail-udp-mpls-eth-and-ipv4.pcap │ ├── dns.pcap │ ├── erspanII.pcap │ ├── eth-ip4-arp-dns-req-http-google.pcap │ ├── eth-ipv4-tcp-http-ooo.pcap │ ├── geneve.pcap │ ├── gre-gre-icmpv4.pcap │ ├── gre-mpls-icmpv4.pcap │ ├── icmp-vlan.pcap │ ├── icmpv4-4vlanQinQ-id-8-10-20-30.pcap │ ├── icmpv4-symetric.pcap │ ├── icmpv4-truncated.pcap │ ├── iperf-same-L2L3.pcap │ ├── ipv4-fragments.pcap │ ├── layer-key-mode.pcap │ ├── link-type-12.pcap │ ├── ntp-corrupted.pcap │ ├── ping-with-without-ethernet.pcap │ ├── simple-tcpv4.pcap │ ├── simple-tcpv6.pcap │ ├── vxlan-icmpv4-truncated.pcap │ └── vxlan-src-port.pcap ├── probes │ ├── bpf.go │ ├── capabilities.go │ ├── dpdk │ │ ├── dpdk.go │ │ └── no_dpdk.go │ ├── ebpf │ │ ├── ebpf.go │ │ └── no_ebpf.go │ ├── gopacket │ │ ├── afpacket.go │ │ ├── gopacket.go │ │ ├── no_gopacket.go │ │ └── pcap.go │ ├── ovsmirror │ │ ├── no_ovsmirror.go │ │ └── ovsmirror.go │ ├── ovsnetflow │ │ └── ovsnetflow.go │ ├── ovssflow │ │ └── ovssflow.go │ ├── pcapsocket │ │ └── pcapsocket.go │ ├── probes.go │ ├── probes_gendecoder.go │ ├── sflow │ │ └── sflow.go │ └── targets │ │ ├── erspan.go │ │ ├── local.go │ │ ├── netflow_v5.go │ │ ├── no_erspan.go │ │ └── target.go ├── server.go ├── server │ ├── flow_server.go │ └── flow_subscriber_endpoint.go ├── set.go ├── set_test.go ├── storage │ ├── elasticsearch │ │ └── elasticsearch.go │ ├── orientdb │ │ └── orientdb.go │ └── storage.go ├── table.go ├── table_test.go └── tcpassembler.go ├── go.mod ├── go.sum ├── graffiti ├── README.md ├── alert │ └── server.go ├── api │ ├── client │ │ ├── client.go │ │ └── gremlin.go │ ├── rest │ │ ├── kv.go │ │ └── rest.go │ ├── server │ │ ├── alert.go │ │ ├── edge.go │ │ ├── node.go │ │ ├── server.go │ │ ├── status.go │ │ ├── topology.go │ │ ├── workflow.go │ │ └── workflow_runtime.go │ └── types │ │ └── types.go ├── assets │ └── assets.go ├── clients │ ├── forwarder.go │ ├── seed.go │ └── subscriber.go ├── cmd │ ├── client │ │ ├── alert.go │ │ ├── client.go │ │ ├── edge.go │ │ ├── json.go │ │ ├── liner.go │ │ ├── node.go │ │ ├── query.go │ │ ├── shell.go │ │ ├── terminal_unix.go │ │ ├── topology.go │ │ └── workflow.go │ ├── hub.go │ └── pod.go ├── endpoints │ ├── publisher_endpoint.go │ ├── pubsub_endpoint.go │ ├── replication_endpoint.go │ └── subscriber_endpoint.go ├── etcd │ ├── client │ │ ├── client.go │ │ └── election.go │ └── server │ │ └── server.go ├── filters │ ├── filters.go │ ├── filters.pb.go │ ├── filters.proto │ ├── range_regexp.go │ └── range_regexp_test.go ├── gendecoder │ └── main.go ├── getter │ └── getter.go ├── go.mod ├── go.sum ├── graffiti.go ├── graph │ ├── cachedbackend.go │ ├── elasticsearch.go │ ├── elasticsearch_test.go │ ├── filters.go │ ├── graph.go │ ├── graph_test.go │ ├── indexer.go │ ├── indexer_test.go │ ├── linker.go │ ├── linker_test.go │ ├── memory.go │ ├── memory_test.go │ ├── metadata.go │ ├── metadata_test.go │ ├── orientdb.go │ ├── orientdb_test.go │ ├── origin.go │ ├── processor.go │ ├── processor_test.go │ ├── sort.go │ ├── time.go │ ├── transaction.go │ └── traversal │ │ ├── iterator.go │ │ ├── token.go │ │ ├── token_string.go │ │ ├── traversal.go │ │ ├── traversal_extension.go │ │ ├── traversal_parser.go │ │ ├── traversal_scanner.go │ │ └── traversal_test.go ├── http │ ├── auth.go │ ├── basic.go │ ├── basic_map_provider.go │ ├── basic_test.go │ ├── client.go │ ├── keystone.go │ ├── noauth.go │ └── server.go ├── hub │ ├── hub.go │ ├── hub_test.go │ └── peering.go ├── js │ ├── api.js │ ├── api.ts │ ├── bindata.go │ ├── bootstrap.js │ ├── completion.go │ ├── otto.js │ ├── package-lock.json │ ├── package.json │ ├── promise-7.0.4.min.js │ ├── promise-done-7.0.4.min.js │ ├── pure-uuid.js │ ├── runtime.go │ └── test.ts ├── logging │ ├── logging.go │ ├── no_syslog.go │ └── syslog.go ├── messages │ ├── messages.go │ └── messages_test.go ├── ondemand │ ├── client │ │ └── client.go │ ├── ondemand.go │ └── server │ │ └── server.go ├── pod │ └── pod.go ├── rbac │ ├── enforcer.go │ ├── etcdadapter.go │ └── etcdwatcher.go ├── schema │ └── validator.go ├── service │ ├── address.go │ ├── address_test.go │ ├── service.go │ └── state.go ├── storage │ ├── elasticsearch │ │ ├── client.go │ │ └── rollindex.go │ ├── orientdb │ │ └── client.go │ └── storage.go ├── tls │ └── tls.go └── websocket │ ├── client.go │ ├── master.go │ ├── message.go │ ├── message_test.go │ ├── pool.go │ ├── server.go │ ├── server_test.go │ ├── structmessage.pb.go │ └── structmessage.proto ├── gremlin ├── query.go ├── query_test.go ├── traversal │ ├── ascendants.go │ ├── descendants.go │ ├── flow_test.go │ ├── flows.go │ ├── group.go │ ├── group_test.go │ ├── metrics.go │ ├── metrics_test.go │ ├── neighbors.go │ ├── neighbors_test.go │ ├── nexthop.go │ ├── nexthop_test.go │ ├── rawpackets.go │ ├── sockets.go │ ├── sockets_test.go │ ├── token.go │ ├── topology.go │ └── workflow.go └── value.go ├── js ├── api.js ├── api.ts ├── browser.js ├── browser.ts ├── package-lock.json └── package.json ├── netflow └── agent.go ├── netns ├── netns.go └── no_netns.go ├── openflow ├── client.go ├── of10.go ├── of11.go ├── of12.go ├── of13.go ├── of14.go ├── of15.go └── protocol.go ├── ovs ├── monitor │ └── monitor.go └── ovsdb │ ├── ovsdb.go │ └── ovsdb_test.go ├── packetinjector ├── client.go ├── forge.go ├── injector.go ├── injector_gendecoder.go ├── no_server.go ├── pcap.go ├── server.go └── server_common.go ├── plugin └── topology.go ├── portallocator └── port_allocator.go ├── probe └── bundle.go ├── process └── proc.go ├── profiling └── profiling.go ├── rawsocket ├── no_rawsocket.go └── rawsocket.go ├── rbac └── policy.csv ├── scripts ├── ci │ ├── build-copr.sh │ ├── convert-to-gif.sh │ ├── create-release.sh │ ├── create-vagrant-boxes.sh │ ├── devstack │ │ ├── Vagrantfile │ │ ├── run-devstack.sh │ │ └── run-openstack-tests.sh │ ├── extract-changelog.py │ ├── kolla │ │ ├── Vagrantfile │ │ └── run-kolla.sh │ ├── opencontrail-tests.nix │ ├── ovnkube-setup.sh │ ├── run-cdd-overview-tests.sh │ ├── run-compile-tests.sh │ ├── run-coverage.sh │ ├── run-devstack-tests.sh │ ├── run-functional-tests.sh │ ├── run-go-fmt.sh │ ├── run-helm-tests.sh │ ├── run-istio-tests.sh │ ├── run-k8s-tests.sh │ ├── run-kolla-tests.sh │ ├── run-opencontrail-tests.sh │ ├── run-ovnk8s-tests.sh │ ├── run-packaging-tests.sh │ ├── run-python-tests.sh │ ├── run-scale.sh │ ├── run-selinux-tests.sh │ ├── run-tests-utils.sh │ ├── run-unit-tests.sh │ └── run-vagrant-tests.sh ├── multinode.sh ├── scale.sh ├── simple.sh ├── skydive_coverage.sh ├── test.sh ├── topology.sh └── tunnel.sh ├── sflow ├── agent.go ├── sflow.go ├── sflow_gendecoder.go └── sflow_test.go ├── skydive.go ├── skydive_prof.go ├── statics ├── bindata.go ├── schemas │ ├── edge.schema │ └── node.schema ├── statics.go ├── ui │ ├── css │ │ ├── bootstrap.3.3.7.min.css │ │ ├── fake-mouse.css │ │ ├── font-awesome.4.7.0.min.css │ │ ├── graph-layout.css │ │ ├── images │ │ │ ├── ui-bg_flat_0_aaaaaa_40x100.png │ │ │ ├── ui-bg_flat_75_ffffff_40x100.png │ │ │ ├── ui-bg_glass_55_fbf9ee_1x400.png │ │ │ ├── ui-bg_glass_65_ffffff_1x400.png │ │ │ ├── ui-bg_glass_75_dadada_1x400.png │ │ │ ├── ui-bg_glass_75_e6e6e6_1x400.png │ │ │ ├── ui-bg_glass_95_fef1ec_1x400.png │ │ │ ├── ui-bg_highlight-soft_75_cccccc_1x100.png │ │ │ ├── ui-icons_222222_256x240.png │ │ │ ├── ui-icons_2e83ff_256x240.png │ │ │ ├── ui-icons_454545_256x240.png │ │ │ ├── ui-icons_888888_256x240.png │ │ │ └── ui-icons_cd0a0a_256x240.png │ │ ├── jquery-ui.1.10.1.css │ │ ├── legend.css │ │ ├── skydive.css │ │ ├── switch.css │ │ ├── themes │ │ │ └── light │ │ │ │ ├── graph-layout.css │ │ │ │ ├── legend.css │ │ │ │ ├── skydive.css │ │ │ │ └── topology-options.css │ │ ├── tooltip.css │ │ ├── topology-options.css │ │ └── transitions.css │ ├── fonts │ │ ├── fontawesome-webfont.woff2 │ │ └── glyphicons-halflings-regular.woff2 │ ├── img │ │ ├── blockdev.png │ │ ├── blockdevleaf.png │ │ ├── blockdevlvm.png │ │ ├── bridge.png │ │ ├── cluster.png │ │ ├── collapse.gif │ │ ├── configmap.png │ │ ├── container.png │ │ ├── cronjob.png │ │ ├── daemonset.png │ │ ├── deployment.png │ │ ├── destinationrule.png │ │ ├── docker.png │ │ ├── endpoints.png │ │ ├── expand.gif │ │ ├── gateway.png │ │ ├── host.png │ │ ├── ingress.png │ │ ├── intf.png │ │ ├── istio.png │ │ ├── job.png │ │ ├── k8s.png │ │ ├── lxd.png │ │ ├── media-inject.png │ │ ├── media-record.png │ │ ├── minus-outline-16.png │ │ ├── networkpolicy.png │ │ ├── ns.png │ │ ├── openstack.png │ │ ├── ovn.png │ │ ├── persistentvolume.png │ │ ├── persistentvolumeclaim.png │ │ ├── pin.png │ │ ├── plus-16.png │ │ ├── pod.png │ │ ├── pointer-down.png │ │ ├── pointer.png │ │ ├── port.png │ │ ├── quotaspec.png │ │ ├── quotaspecbinding.png │ │ ├── record.png │ │ ├── record_red.png │ │ ├── refresh.png │ │ ├── replicaset.png │ │ ├── replicationcontroller.png │ │ ├── runc.png │ │ ├── secret.png │ │ ├── service.png │ │ ├── serviceentry.png │ │ ├── skydive-logo-16x16.png │ │ ├── statefulset.png │ │ ├── storageclass.png │ │ ├── switch.png │ │ ├── trash.png │ │ ├── veth.png │ │ ├── virtualservice.png │ │ └── vm.png │ ├── index.html │ └── js │ │ ├── api.js │ │ ├── app.js │ │ ├── bundle.js │ │ ├── components │ │ ├── alert-form.js │ │ ├── alert-list.js │ │ ├── autocomplete.js │ │ ├── buttons.js │ │ ├── capture-form.js │ │ ├── capture-list.js │ │ ├── collapse.js │ │ ├── dynamic-table.js │ │ ├── edgerule-form.js │ │ ├── edgerule-list.js │ │ ├── feature-table.js │ │ ├── flow-table.js │ │ ├── graph-layout.js │ │ ├── gremlin-console.js │ │ ├── inject-form.js │ │ ├── injection-list.js │ │ ├── layout.js │ │ ├── login.js │ │ ├── metrics-table.js │ │ ├── node-selector.js │ │ ├── noderule-form.js │ │ ├── noderule-list.js │ │ ├── notifications.js │ │ ├── object-detail.js │ │ ├── panel.js │ │ ├── preference.js │ │ ├── routing-table.js │ │ ├── rule-detail.js │ │ ├── status.js │ │ ├── tabs.js │ │ ├── topology-rules.js │ │ ├── topology.js │ │ └── workflow.js │ │ ├── fake-mouse.js │ │ ├── utils.js │ │ ├── vendor │ │ ├── bootstrap.3.3.7.min.js │ │ ├── bootstrap.min.3.3.5.js │ │ ├── d3-selection-multi.v1.min.js │ │ ├── d3.4.7.4.js │ │ ├── jquery-ui.1.10.1.js │ │ ├── jquery.1.9.1.min.js │ │ ├── lscache.min.js │ │ ├── popper.js │ │ ├── pure-uuid.js │ │ ├── tooltip.js │ │ ├── v-tooltip.js │ │ ├── vue-2.5.16.js │ │ ├── vue-router.min-2.2.1.js │ │ ├── vue.min-2.5.16.js │ │ ├── vuejs-datepicker.js │ │ ├── vuejs-markdown.js │ │ └── vuex.min-2.1.2.js │ │ └── websocket.js ├── ui_v2 │ ├── package-lock.json │ └── package.json └── workflows │ ├── check-connectivity.yaml │ ├── check-mtu.yaml │ ├── flow-matrix.yaml │ └── flow-validation.yaml ├── tests ├── alert_test.go ├── api_test.go ├── blockdev_test.go ├── bookinfo │ ├── bookinfo-ibmcloud-image-policy.yaml │ ├── bookinfo-netpol-deny.yaml │ ├── bookinfo-netpol-details.yaml │ ├── bookinfo-netpol-ratings.yaml │ ├── bookinfo-netpol-reviews-v1.yaml │ ├── bookinfo-netpol-reviews-v2.yaml │ ├── bookinfo-netpol-reviews-v3.yaml │ └── bookinfo.sh ├── cdd_test.go ├── coverage │ ├── coverage.go │ └── coverage_test.go ├── docker_test.go ├── elasticsearch_test.go ├── flow_ebpf_test.go ├── flow_test.go ├── istio │ ├── destinationrule-service.yaml │ ├── destinationrule-serviceentry.yaml │ ├── destinationrule.yaml │ ├── gateway-virtualservice.yaml │ ├── gateway.yaml │ ├── quotaspec.yaml │ ├── quotaspecbinding.yaml │ ├── serviceentry.yaml │ ├── virtualservice-pod.yaml │ └── virtualservice.yaml ├── istio_test.go ├── k8s │ ├── configmap.yaml │ ├── container.yaml │ ├── cronjob.yaml │ ├── daemonset.yaml │ ├── deployment.yaml │ ├── deployment_modern.yaml │ ├── endpoints.yaml │ ├── ingress.yaml │ ├── ingress1.yaml │ ├── job.yaml │ ├── mysql-deployment.yaml │ ├── namespace.yaml │ ├── networkpolicy-egress-allow.yaml │ ├── networkpolicy-egress-deny.yaml │ ├── networkpolicy-ingress-allow-namespace.yaml │ ├── networkpolicy-ingress-allow-pod.yaml │ ├── networkpolicy-ingress-allow-ports.yaml │ ├── networkpolicy-ingress-allow.yaml │ ├── networkpolicy-ingress-deny.yaml │ ├── networkpolicy-namespace.yaml │ ├── networkpolicy-pod.yaml │ ├── networkpolicy.yaml │ ├── persistentvolume.yaml │ ├── persistentvolumeclaim.yaml │ ├── pod.yaml │ ├── pv-claim.yaml │ ├── pv-pod.yaml │ ├── pv-volume.yaml │ ├── replicaset.yaml │ ├── replicationcontroller.yaml │ ├── secret.yaml │ ├── service-pod.yaml │ ├── service.yaml │ ├── statefulset.yaml │ ├── storage.sh │ ├── storageclass.yaml │ ├── wordpress-deployment.yaml │ └── wordpress.sh ├── k8s_test.go ├── libvirt │ ├── device.xml │ ├── network.xml │ └── vm.xml ├── libvirt_test.go ├── lldp_test.go ├── lxd_test.go ├── neutron_test.go ├── opencontrail_test.go ├── openflow_test.go ├── ovn_test.go ├── ovnk8s_test.go ├── pcaptraces │ ├── eth-ip4-arp-dns-req-http-google.pcap │ └── lldp-detailed.pcap ├── runc_test.go ├── scale_test.go ├── selenium.go ├── sriov_test.go ├── startup_capture_test.go ├── tests.go ├── topology_test.go ├── vpp_test.go └── workflow_test.go ├── tools.go ├── topology ├── container.go ├── container_gendecoder.go ├── enhancers │ └── topology_manager.go ├── metrics.go ├── metrics_gendecoder.go ├── metrics_test.go ├── neighbors.go ├── neighbors_gendecoder.go ├── nexthop.go ├── nexthop_gendecoder.go ├── probes │ ├── bess │ │ └── bess.go │ ├── blockdev │ │ ├── blockdev.go │ │ ├── blockdev_metrics.go │ │ ├── blockdev_metrics_gendecoder.go │ │ ├── metadata.go │ │ ├── metadata_gendecoder.go │ │ └── no_blockdev.go │ ├── docker │ │ ├── docker.go │ │ └── no_docker.go │ ├── fabric │ │ └── fabric.go │ ├── hardware │ │ ├── hardware.go │ │ ├── hardware_inux_test.go │ │ ├── hardware_linux.go │ │ ├── metadata.go │ │ ├── metadata_gendecoder.go │ │ └── no_hardware.go │ ├── istio │ │ ├── destinationrule.go │ │ ├── gateway.go │ │ ├── graph.go │ │ ├── istio.go │ │ ├── serviceentry.go │ │ ├── verifiers.go │ │ └── virtualservice.go │ ├── k8s │ │ ├── cache.go │ │ ├── cluster.go │ │ ├── configmap.go │ │ ├── container.go │ │ ├── cronjob.go │ │ ├── daemonset.go │ │ ├── deployment.go │ │ ├── endpoints.go │ │ ├── graph.go │ │ ├── ingress.go │ │ ├── job.go │ │ ├── k8s.go │ │ ├── linker.go │ │ ├── namespace.go │ │ ├── networkpolicy.go │ │ ├── node.go │ │ ├── persistentvolume.go │ │ ├── persistentvolumeclaim.go │ │ ├── pod.go │ │ ├── probe.go │ │ ├── replicaset.go │ │ ├── replicationcontroller.go │ │ ├── secret.go │ │ ├── service.go │ │ ├── statefulset.go │ │ └── storageclass.go │ ├── libvirt │ │ ├── golibvirt.go │ │ ├── libvirt.go │ │ ├── libvirtgo.go │ │ ├── metadata.go │ │ ├── metadata_gendecoder.go │ │ └── no_libvirt.go │ ├── lldp │ │ ├── lldp.go │ │ ├── metadata.go │ │ ├── metadata_gendecoder.go │ │ ├── no_lldp.go │ │ ├── rawsockaddr_signed_int.go │ │ └── rawsockaddr_unsigned_int.go │ ├── lxd │ │ ├── lxd.go │ │ ├── metadata.go │ │ ├── metadata_gendecoder.go │ │ └── no_lxd.go │ ├── netlink │ │ ├── metadata.go │ │ ├── metadata_gendecoder.go │ │ ├── netlink.go │ │ ├── no_netlink.go │ │ └── sriov.go │ ├── netns │ │ ├── netns.go │ │ └── no_netns.go │ ├── neutron │ │ ├── neutron.go │ │ └── neutron_gendecoder.go │ ├── opencontrail │ │ ├── metadata.go │ │ ├── metadata_gendecoder.go │ │ ├── no_opencontrail.go │ │ ├── opencontrail.go │ │ └── routing_table.go │ ├── ovn │ │ ├── no_ovn.go │ │ ├── ovn.go │ │ ├── ovnmetagen │ │ │ ├── links.go │ │ │ ├── main.go │ │ │ ├── model.go │ │ │ └── table.go │ │ └── ovnmodel │ │ │ ├── acl.go │ │ │ ├── acl_gendecoder.go │ │ │ ├── address_set.go │ │ │ ├── address_set_gendecoder.go │ │ │ ├── connection.go │ │ │ ├── connection_gendecoder.go │ │ │ ├── dhcp_options.go │ │ │ ├── dhcp_options_gendecoder.go │ │ │ ├── dns.go │ │ │ ├── dns_gendecoder.go │ │ │ ├── forwarding_group.go │ │ │ ├── forwarding_group_gendecoder.go │ │ │ ├── gateway_chassis.go │ │ │ ├── gateway_chassis_gendecoder.go │ │ │ ├── gen.go │ │ │ ├── ha_chassis.go │ │ │ ├── ha_chassis_gendecoder.go │ │ │ ├── ha_chassis_group.go │ │ │ ├── ha_chassis_group_gendecoder.go │ │ │ ├── links.go │ │ │ ├── load_balancer.go │ │ │ ├── load_balancer_gendecoder.go │ │ │ ├── load_balancer_health_check.go │ │ │ ├── load_balancer_health_check_gendecoder.go │ │ │ ├── logical_router.go │ │ │ ├── logical_router_gendecoder.go │ │ │ ├── logical_router_policy.go │ │ │ ├── logical_router_policy_gendecoder.go │ │ │ ├── logical_router_port.go │ │ │ ├── logical_router_port_gendecoder.go │ │ │ ├── logical_router_static_route.go │ │ │ ├── logical_router_static_route_gendecoder.go │ │ │ ├── logical_switch.go │ │ │ ├── logical_switch_gendecoder.go │ │ │ ├── logical_switch_port.go │ │ │ ├── logical_switch_port_gendecoder.go │ │ │ ├── meter.go │ │ │ ├── meter_band.go │ │ │ ├── meter_band_gendecoder.go │ │ │ ├── meter_gendecoder.go │ │ │ ├── model.go │ │ │ ├── nat.go │ │ │ ├── nat_gendecoder.go │ │ │ ├── nb_global.go │ │ │ ├── nb_global_gendecoder.go │ │ │ ├── port_group.go │ │ │ ├── port_group_gendecoder.go │ │ │ ├── qos.go │ │ │ ├── qos_gendecoder.go │ │ │ ├── ssl.go │ │ │ ├── ssl_gendecoder.go │ │ │ └── types.go │ ├── ovnk8s │ │ └── ovnk8s.go │ ├── ovsdb │ │ ├── jsonof │ │ │ ├── ovs_rule_parser.go │ │ │ └── ovs_rule_parser_test.go │ │ ├── of10.go │ │ ├── of12.go │ │ ├── of13.go │ │ ├── of14.go │ │ ├── of15.go │ │ ├── ofctl.go │ │ ├── ofnative.go │ │ ├── ovs_of.go │ │ ├── ovs_of_test.go │ │ ├── ovsdb.go │ │ └── ovsdb_gendecoder.go │ ├── peering │ │ └── peering.go │ ├── probe.go │ ├── runc │ │ ├── no_runc.go │ │ ├── runc.go │ │ └── runc_test.go │ ├── socketinfo │ │ ├── connection.go │ │ ├── connection_gendecoder.go │ │ ├── no_socket_info.go │ │ ├── socket_info.go │ │ ├── socket_info_ebpf.go │ │ ├── socket_info_noebpf.go │ │ ├── socket_info_proc.go │ │ └── socket_info_test.go │ ├── vpp │ │ ├── bin_api │ │ │ ├── interfaces │ │ │ │ └── interfaces.ba.go │ │ │ └── vpe │ │ │ │ └── vpe.ba.go │ │ ├── no_vpp.go │ │ └── vpp.go │ └── wrapper.go ├── routes.go ├── routes_gendecoder.go ├── tid.go ├── topology.go └── validator.go ├── ui └── server.go ├── validator ├── validator.go └── validator_test.go └── version └── version.go /.gitattributes: -------------------------------------------------------------------------------- 1 | statics/js/vendor/*.js -diff -merge 2 | statics/js/vendor/*.js linguist-vendored=true 3 | statics/js/dev/*.js -diff -merge 4 | statics/js/dev/*.js linguist-vendored=true 5 | *.pb.go -diff -merge 6 | *.pb.go linguist-generated=true 7 | *_easyjson.go -diff -merge 8 | *_easyjson.go linguist-generated=true 9 | *_gendecoder.go -diff -merge 10 | *_gendecoder.go linguist-generated=true 11 | */bindata.go -diff -merge 12 | */bindata.go linguist-generated=true 13 | topology/probes/vpp/bin_api/interfaces/* -diff -merge 14 | topology/probes/vpp/bin_api/interfaces/* linguist-generated=true 15 | topology/probes/vpp/bin_api/vpe/* -diff -merge 16 | topology/probes/vpp/bin_api/vpe/* linguist-generated=true 17 | statics/js/bundle.js -diff -merge 18 | statics/js/bundle.js linguist-generated=true 19 | js/browser.js -diff -merge 20 | js/browser.js linguist-generated=true 21 | js/api.js -diff -merge 22 | js/api.js linguist-generated=true 23 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | community_bridge: skydive 2 | -------------------------------------------------------------------------------- /.github/workflows/go.yml: -------------------------------------------------------------------------------- 1 | name: Go 2 | 3 | on: 4 | push: 5 | branches: [ "master" ] 6 | pull_request: 7 | branches: [ "master" ] 8 | 9 | jobs: 10 | 11 | build: 12 | runs-on: ubuntu-latest 13 | steps: 14 | - uses: actions/checkout@v3 15 | 16 | - name: Set up Go 17 | uses: actions/setup-go@v4 18 | with: 19 | go-version: '1.21' 20 | cache-dependency-path: go.sum 21 | 22 | - name: Install pcap 23 | run: sudo apt-get install -y libpcap0.8-dev 24 | 25 | - name: Build graffiti 26 | run: cd graffiti && go build -v ./... 27 | 28 | - name: Build 29 | run: go build -v ./... 30 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | vendor/github.com/ 2 | vendor/golang.org/ 3 | vendor/google.golang.org/ 4 | vendor/gopkg.in/ 5 | vendor/go.uber.org/ 6 | vendor/k8s.io/ 7 | contrib/packaging/rpm/*.tar.gz 8 | contrib/vagrant/.vagrant/ 9 | contrib/dev/.vagrant/ 10 | contrib/snort/snortSkydive 11 | contrib/docker/skydive.* 12 | skydive.yml 13 | ebpf/flow.o 14 | ebpf/flow-gre.o 15 | js/node_modules/ 16 | .idea 17 | lint.json 18 | -------------------------------------------------------------------------------- /.mk/api.mk: -------------------------------------------------------------------------------- 1 | API_JS_FILES := \ 2 | graffiti/js/api.js \ 3 | js/api.js \ 4 | js/browser.js \ 5 | statics/ui/js/bundle.js 6 | 7 | .typescript: $(API_JS_FILES) 8 | 9 | graffiti/js/api.js: graffiti/js/api.ts 10 | cd graffiti/js && npm ci && PATH=`npm bin`:$$PATH tsc --module commonjs --target ES5 api.ts 11 | 12 | js/api.js: graffiti/js/api.ts js/api.ts 13 | cd js && npm ci && PATH=`npm bin`:$$PATH tsc --module commonjs --target ES5 api.ts 14 | 15 | js/browser.js: graffiti/js/api.js js/api.js js/browser.ts 16 | cd js && npm ci && PATH=`npm bin`:$$PATH tsc --module commonjs --target ES5 browser.ts 17 | 18 | statics/ui/js/bundle.js: js/browser.js 19 | cd js && npm ci && PATH=`npm bin`:$$PATH browserify browser.js -o ../statics/ui/js/bundle.js 20 | 21 | .PHONY: .typescript.touch 22 | .typescript.touch: 23 | @echo $(API_JS_FILES) | xargs touch 24 | 25 | .PHONY: .typescript.clean 26 | .typescript.clean: 27 | rm -f graffiti/js/api.js js/api.js js/browser.js statics/ui/js/bundle.js 28 | -------------------------------------------------------------------------------- /.mk/bench.mk: -------------------------------------------------------------------------------- 1 | .PHONY: bench 2 | bench: skydive bench.flow 3 | 4 | flow/pcaptraces/201801011400.pcap.gz: 5 | aria2c -s 16 -x 16 -o $@ "http://mawi.nezu.wide.ad.jp/mawi/samplepoint-F/2018/201801011400.pcap.gz" 6 | 7 | flow/pcaptraces/%.pcap: flow/pcaptraces/%.pcap.gz 8 | gunzip -fk $< 9 | 10 | flow/pcaptraces/201801011400.small.pcap: flow/pcaptraces/201801011400.pcap 11 | tcpdump -r $< -w $@ "ip host 203.82.244.188" 12 | 13 | bench.flow.traces: flow/pcaptraces/201801011400.small.pcap 14 | 15 | bench.flow: bench.flow.traces 16 | $(GO) test -bench=. ${SKYDIVE_GITHUB}/flow 17 | 18 | -------------------------------------------------------------------------------- /.mk/contrib.mk: -------------------------------------------------------------------------------- 1 | .PHONY: contribs.clean 2 | contribs.clean: contrib.snort.clean 3 | 4 | .PHONY: contribs 5 | contribs: contrib.snort 6 | 7 | .PHONY: contribs.snort.clean 8 | contrib.snort.clean: 9 | $(MAKE) -C contrib/snort clean 10 | 11 | .PHONY: contrib.snort 12 | contrib.snort:genlocalfiles 13 | $(MAKE) -C contrib/snort 14 | -------------------------------------------------------------------------------- /.mk/debug.mk: -------------------------------------------------------------------------------- 1 | 2 | DLV_FLAGS=--check-go-version=false 3 | 4 | ifeq (${DEBUG}, true) 5 | define skydive_run 6 | sudo -E $$(which dlv) $(DLV_FLAGS) exec $$(which skydive) -- $1 -c skydive.yml 7 | endef 8 | else 9 | define skydive_run 10 | sudo -E $$(which skydive) $1 -c skydive.yml 11 | endef 12 | endif 13 | 14 | ifeq (${DEBUG}, true) 15 | GOFLAGS=-gcflags='-N -l' 16 | GO_BINDATA_FLAGS+=-debug 17 | export DEBUG 18 | endif 19 | 20 | .PHONY: run.agent 21 | run.agent: 22 | $(call skydive_run,agent) 23 | 24 | .PHONY: run.analyzer 25 | run.analyzer: 26 | $(call skydive_run,analyzer) 27 | -------------------------------------------------------------------------------- /.mk/easyjson.mk: -------------------------------------------------------------------------------- 1 | GEN_EASYJSON_FILES = $(patsubst %.go,%_easyjson.go,$(shell git grep //go:generate | grep "easyjson" | grep -v ovnmetagen | grep -v Makefile | cut -d ":" -f 1)) 2 | GEN_EASYJSON_FILES += flow/flow.pb_easyjson.go 3 | 4 | %_easyjson.go: %.go 5 | go generate -run easyjson $< 6 | 7 | .PHONY: .easyjson 8 | .easyjson: flow/flow.pb_easyjson.go $(GEN_EASYJSON_FILES) 9 | 10 | .PHONY: .easyjson.touch 11 | .easyjson.touch: 12 | @echo $(GEN_EASYJSON_FILES) | xargs touch 13 | 14 | .PHONY: .easyjson.clean 15 | .easyjson.clean: 16 | find . \( -name *_easyjson.go ! -path './vendor/*' \) -exec rm {} \; 17 | 18 | -------------------------------------------------------------------------------- /.mk/ebpf.mk: -------------------------------------------------------------------------------- 1 | .PHONY: .ebpf 2 | .ebpf: moddownload 3 | ifeq ($(WITH_EBPF_DOCKER_BUILDER), true) 4 | $(MAKE) -C ebpf docker-ebpf-build 5 | else 6 | $(MAKE) -C ebpf 7 | endif 8 | 9 | .PHONY: ebpf.test 10 | ebpf.test: .ebpf ebpf/statics/bindata.go 11 | $(MAKE) -C ebpf ebpf-test 12 | 13 | .PHONY: .ebpf.clean 14 | .ebpf.clean: 15 | $(MAKE) -C ebpf clean 16 | -------------------------------------------------------------------------------- /.mk/gendecoder.mk: -------------------------------------------------------------------------------- 1 | GEN_DECODER_FILES = $(patsubst %.go,%_gendecoder.go,$(shell git grep //go:generate | grep "gendecoder" | grep -v ovnmetagen | grep -v "\.mk" | cut -d ":" -f 1)) 2 | GEN_DECODER_FILES += flow/flow.pb_gendecoder.go 3 | 4 | %_gendecoder.go: %.go 5 | go generate -run gendecoder $< 6 | 7 | .PHONY: .gendecoder 8 | .gendecoder: $(GEN_DECODER_FILES) 9 | 10 | .PHONY: .gendecoder.touch 11 | .gendecoder.touch: 12 | @echo $(GEN_DECODER_FILES) | xargs touch 13 | 14 | .PHONY: .gendecoder.clean 15 | .gendecoder.clean: 16 | find . \( -name *_gendecoder.go ! -path './vendor/*' \) -exec rm {} \; 17 | -------------------------------------------------------------------------------- /.mk/ovn.mk: -------------------------------------------------------------------------------- 1 | OVN_VERSION ?= branch-20.12 2 | SCHEMA_REMOTE_FILE = https://raw.githubusercontent.com/ovn-org/ovn/$(OVN_VERSION)/ovn-nb.ovsschema 3 | MODEL_DIR = topology/probes/ovn/ovnmodel/ 4 | GEN_DIR = topology/probes/ovn/ovnmetagen 5 | GEN_BIN = $(GEN_DIR)/ovnmetagen 6 | SCHEMA_FILE = $(MODEL_DIR)/ovn-nb.ovsschema 7 | 8 | 9 | $(SCHEMA_FILE): 10 | curl -o $@ $(SCHEMA_REMOTE_FILE) 11 | 12 | $(GEN_BIN): 13 | go build -o $(GEN_DIR) ./$(GEN_DIR) 14 | 15 | .PHONY: .ovnmodel 16 | .ovnmodel: $(SCHEMA_FILE) $(GEN_BIN) 17 | ifeq ($(WITH_OVN), true) 18 | @go generate -tags "${BUILD_TAGS}" topology/probes/ovn/ovnmodel/gen.go 19 | endif 20 | 21 | .PHONY: .ovnmodel.clean 22 | .ovnmodel.clean: 23 | ifeq ($(WITH_OVN), true) 24 | @find $(MODEL_DIR) -name "*.go" | xargs grep 'generated by ovnmetagen' | cut -d: -f 1 | xargs rm -f 25 | @rm -f $(SCHEMA_FILE) 26 | @rm -f $(GEN_BIN) 27 | endif 28 | -------------------------------------------------------------------------------- /.mk/stringer.mk: -------------------------------------------------------------------------------- 1 | STRINGER_FILES = $(patsubst %.go,%_string.go,$(shell git grep //go:generate | grep "stringer" | cut -d ":" -f 1)) 2 | 3 | %_string.go: %.go 4 | go generate -run stringer $< 5 | 6 | .PHONY: .stringer 7 | .stringer: $(STRINGER_FILES) 8 | 9 | .PHONY: .stringer.clean 10 | .stringer.clean: 11 | find . \( -name *_string.go ! -path './vendor/*' \) -exec rm {} \; 12 | 13 | -------------------------------------------------------------------------------- /.mk/swagger.mk: -------------------------------------------------------------------------------- 1 | SWAGGER_JSON_FILES = $(patsubst %.go,%_swagger.json,$(shell git grep //go:generate | grep "renderizer" | grep -v .mk | cut -d ":" -f 1 | uniq)) 2 | 3 | %_swagger.json: %.go 4 | go generate -run renderizer $< 5 | 6 | .PHONY: swagger 7 | swagger: $(SWAGGER_JSON_FILES) 8 | go run github.com/go-swagger/go-swagger/cmd/swagger generate spec -m -o /tmp/swagger.json 9 | for def in `ls api/server/*_swagger.json` `ls graffiti/api/server/*_swagger.json`; do \ 10 | jq -s '.[0] * .[1] * {tags: (.[0].tags + .[1].tags)}' /tmp/swagger.json $$def > swagger.json; \ 11 | cp swagger.json /tmp; \ 12 | done 13 | jq -s '.[0] * .[1]' /tmp/swagger.json api/server/swagger_base.json > swagger.json 14 | sed -i 's/easyjson:json//g' swagger.json 15 | 16 | swagger-ui: swagger 17 | docker run -p 80:8080 -e SWAGGER_JSON=/swagger.json -v `pwd`/swagger.json:/swagger.json swaggerapi/swagger-ui 18 | 19 | .PHONY: swagger.clean 20 | swagger.clean: 21 | find -name "*_swagger.go" -exec rm {} \; 22 | find -name "*_swagger.json" -exec rm {} \; 23 | -------------------------------------------------------------------------------- /.mk/ui.mk: -------------------------------------------------------------------------------- 1 | UI_DIRS := \ 2 | statics/ui/index.html \ 3 | statics/ui/css/* \ 4 | statics/ui/css/themes/*/* \ 5 | statics/ui/fonts/* \ 6 | statics/ui/img/* \ 7 | statics/ui/js/* 8 | 9 | UI_V2_DIRS := \ 10 | statics/ui_v2/index.html \ 11 | statics/ui_v2/assets \ 12 | statics/ui_v2/dist \ 13 | statics/ui_v2/fonts 14 | 15 | .PHONY: .ui 16 | .ui: .ui_v2 17 | 18 | .PHONY: .ui_v2 19 | .ui_v2: 20 | cd statics/ui_v2 && npm install && npm run prepare && cd - 21 | -------------------------------------------------------------------------------- /.mk/vppapi.mk: -------------------------------------------------------------------------------- 1 | .PHONY: .vppbinapi 2 | .vppbinapi: 3 | ifeq ($(WITH_VPP), true) 4 | go generate -tags "${BUILD_TAGS}" ${SKYDIVE_GITHUB}/topology/probes/vpp 5 | endif 6 | 7 | .PHONY: .vppbinapi.clean 8 | .vppbinapi.clean: 9 | rm -rf topology/probes/vpp/bin_api 10 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:22.04 as builder 2 | ARG DEBIAN_FRONTEND=noninteractive 3 | RUN apt-get -y update \ 4 | && apt-get -y install build-essential git-core golang npm openvswitch-common libpcap0.8 libpcap0.8-dev libxml2-dev protobuf-compiler libprotobuf-dev libvirt-dev curl \ 5 | && rm -rf /var/lib/apt/lists/* 6 | WORKDIR /go/src/github.com/skydive-project/skydive 7 | COPY . . 8 | ARG GOPATH=/go 9 | RUN make build 10 | 11 | FROM ubuntu:22.04 as skydive 12 | ARG DEBIAN_FRONTEND=noninteractive 13 | RUN apt-get -y update \ 14 | && apt-get -y install golang npm openvswitch-common libpcap0.8 libvirt0 \ 15 | && rm -rf /var/lib/apt/lists/* 16 | COPY --from=builder /go/src/github.com/skydive-project/skydive/skydive /usr/bin/skydive 17 | COPY contrib/docker/skydive.yml /etc/skydive.yml 18 | ENTRYPOINT ["/usr/bin/skydive", "--conf", "/etc/skydive.yml"] 19 | -------------------------------------------------------------------------------- /api/server/no_packet_injector.go: -------------------------------------------------------------------------------- 1 | //go:build !packetinject 2 | 3 | /* 4 | * Copyright (C) 2016 Red Hat, Inc. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy ofthe License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specificlanguage governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | 20 | package server 21 | 22 | import ( 23 | "fmt" 24 | 25 | "github.com/skydive-project/skydive/api/types" 26 | ) 27 | 28 | func (pi *PacketInjectorAPI) validateRequest(ppr *types.PacketInjection) error { 29 | return fmt.Errorf("packet injection disabled because skydive was not built with \"packetinject\" build tag") 30 | } 31 | -------------------------------------------------------------------------------- /api/server/swagger_base.json: -------------------------------------------------------------------------------- 1 | { 2 | "securityDefinitions": { 3 | "basicAuth": { 4 | "type": "basic" 5 | }, 6 | "authToken": { 7 | "type": "apiKey", 8 | "name": "X-Auth-Token", 9 | "in": "header" 10 | } 11 | }, 12 | "security": [ 13 | { 14 | "basicAuth": [] 15 | }, 16 | { 17 | "authToken": [] 18 | } 19 | ], 20 | "x-tagGroups": [ { 21 | "name": "Misc", 22 | "tags": [ "Login", "API Info", "Config", "Status" ] 23 | }, { 24 | "name": "Topology Management", 25 | "tags": [ "Topology", "Node rules", "Edge rules" ] 26 | }, { 27 | "name": "Flow Management", 28 | "tags": [ "Captures", "Injections", "PCAP" ] 29 | }, { 30 | "name": "Automation", 31 | "tags": [ "Alerts", "Workflows" ] 32 | } ] 33 | } -------------------------------------------------------------------------------- /api/server/swagger_definitions.tmpl: -------------------------------------------------------------------------------- 1 | { 2 | "tags": [ { 3 | "name": "{{ .Title }}s", 4 | "description": "{{ .Title }}" 5 | } ], 6 | "definitions": { 7 | "AnyValue": {}, 8 | "{{ .Type }}s": { 9 | "description": "{{ .Title }}s", 10 | "type": "object", 11 | "title": "Map of {{ .Name }}s", 12 | "x-additionalPropertiesName": "UUID", 13 | "additionalProperties": { 14 | "$ref": "#/definitions/{{ .Type }}" 15 | } 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /cmd/allinone/no_allinone.go: -------------------------------------------------------------------------------- 1 | // +build !linux 2 | 3 | /* 4 | * Copyright (C) 2018 Red Hat, Inc. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy ofthe License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specificlanguage governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | 20 | package allinone 21 | 22 | import ( 23 | "github.com/spf13/cobra" 24 | ) 25 | 26 | var AllInOneCmd *cobra.Command 27 | -------------------------------------------------------------------------------- /cmd/cmd.go: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Red Hat, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy ofthe License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specificlanguage governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | 18 | package cmd 19 | 20 | var ( 21 | // CfgFiles holds the Skydive configuration files 22 | CfgFiles []string 23 | // CfgBackend holds the current configuration backend 24 | CfgBackend string 25 | ) 26 | -------------------------------------------------------------------------------- /cmd/completion/completion.go: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017 Red Hat, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy ofthe License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specificlanguage governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | 18 | package completion 19 | 20 | import ( 21 | "fmt" 22 | 23 | "github.com/spf13/cobra" 24 | ) 25 | 26 | // BashCompletion skydive root command 27 | var BashCompletion = &cobra.Command{ 28 | Use: "bash-completion", 29 | Short: "Generate bash completion helper", 30 | Long: "Generate bash completion helper (skydive-bash-completion.sh)", 31 | SilenceUsage: true, 32 | Run: func(cmd *cobra.Command, args []string) { 33 | cmd.Root().GenBashCompletionFile("skydive-bash-completion.sh") 34 | fmt.Println("skydive-bash-completion.sh has been generated") 35 | }, 36 | } 37 | -------------------------------------------------------------------------------- /cmd/injector/standalone.go: -------------------------------------------------------------------------------- 1 | //go:build !linux 2 | 3 | /* 4 | * Copyright (C) 2019 Red Hat, Inc. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy ofthe License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specificlanguage governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | 20 | package injector 21 | 22 | import ( 23 | "github.com/spf13/cobra" 24 | ) 25 | 26 | // InjectPacketCmd injects packets without using any Skydive analyzer/agent 27 | var InjectPacketCmd *cobra.Command 28 | -------------------------------------------------------------------------------- /cmd/skydive/nsenter.go: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 Red Hat, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy ofthe License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specificlanguage governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | 18 | package skydive 19 | 20 | /* 21 | #cgo CFLAGS: -Wall 22 | 23 | extern void nsexec(); 24 | 25 | void __attribute__((constructor)) init(void) { 26 | nsexec(); 27 | } 28 | */ 29 | import "C" 30 | -------------------------------------------------------------------------------- /cmd/version/version.go: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Red Hat, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy ofthe License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specificlanguage governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | 18 | package version 19 | 20 | import ( 21 | "github.com/skydive-project/skydive/version" 22 | "github.com/spf13/cobra" 23 | ) 24 | 25 | // VersionCmd skydive version root command 26 | var VersionCmd = &cobra.Command{ 27 | Use: "version", 28 | Short: "Print the version number of Skydive", 29 | Run: func(cmd *cobra.Command, args []string) { 30 | version.PrintVersion() 31 | }, 32 | } 33 | -------------------------------------------------------------------------------- /common/types.go: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Red Hat, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy ofthe License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specificlanguage governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | 18 | package common 19 | 20 | // Metric defines a common metric interface 21 | type Metric interface { 22 | // part of the Getter interface 23 | GetFieldInt64(field string) (int64, error) 24 | GetFieldKeys() []string 25 | 26 | Add(m Metric) Metric 27 | Sub(m Metric) Metric 28 | Split(cut int64) (Metric, Metric) 29 | GetStart() int64 30 | SetStart(start int64) 31 | GetLast() int64 32 | SetLast(last int64) 33 | IsZero() bool 34 | } 35 | -------------------------------------------------------------------------------- /contrib/ansible/README.md: -------------------------------------------------------------------------------- 1 | # Skydive Ansible 2 | 3 | The documentation is available here: 4 | http://skydive.network/documentation/deployment#ansible -------------------------------------------------------------------------------- /contrib/ansible/ansible.cfg: -------------------------------------------------------------------------------- 1 | [defaults] 2 | # For ofter testing ignoring ssh key 3 | host_key_checking = False 4 | # Use the YAML callback plugin. For a better CLI experience 5 | stdout_callback = yaml 6 | # Use the stdout_callback when running ad-hoc commands. 7 | bin_ansible_callbacks = True 8 | -------------------------------------------------------------------------------- /contrib/ansible/devmode.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Deploy Skydive development machine 3 | hosts: dev 4 | become: yes 5 | pre_tasks: 6 | - selinux: state=disabled 7 | - shell: setenforce 0 8 | roles: 9 | - role: elasticsearch 10 | - role: orientdb 11 | - role: skydive_dev 12 | -------------------------------------------------------------------------------- /contrib/ansible/inventory/README.md: -------------------------------------------------------------------------------- 1 | # Skydive Ansible, example of inventory config files 2 | -------------------------------------------------------------------------------- /contrib/ansible/inventory/hosts.localhost: -------------------------------------------------------------------------------- 1 | [skydive:children] 2 | analyzers 3 | agents 4 | 5 | [skydive:vars] 6 | skydive_listen_ip=0.0.0.0 7 | 8 | [analyzers] 9 | localhost ansible_connection=local 10 | 11 | [agents] 12 | localhost ansible_connection=local 13 | -------------------------------------------------------------------------------- /contrib/ansible/inventory/hosts.localhost.auth: -------------------------------------------------------------------------------- 1 | [skydive:children] 2 | analyzers 3 | agents 4 | 5 | [skydive:vars] 6 | skydive_listen_ip=0.0.0.0 7 | skydive_username=admin 8 | skydive_password=secret 9 | 10 | [analyzers] 11 | localhost ansible_connection=local 12 | 13 | [analyzers:vars] 14 | skydive_auth_type=basic 15 | 16 | [agents] 17 | localhost ansible_connection=local 18 | -------------------------------------------------------------------------------- /contrib/ansible/inventory/hosts.localhost.container: -------------------------------------------------------------------------------- 1 | [skydive:children] 2 | analyzers 3 | agents 4 | 5 | [skydive:vars] 6 | skydive_listen_ip=0.0.0.0 7 | skydive_deployment_mode=container 8 | 9 | [analyzers] 10 | localhost ansible_connection=local 11 | 12 | [agents] 13 | localhost ansible_connection=local 14 | 15 | [agents:vars] 16 | skydive_extra_config={'agent.topology.probes': ['docker']} 17 | -------------------------------------------------------------------------------- /contrib/ansible/inventory/hosts.localhost.extra: -------------------------------------------------------------------------------- 1 | [skydive:children] 2 | analyzers 3 | agents 4 | 5 | [skydive:vars] 6 | skydive_listen_ip=0.0.0.0 7 | 8 | [analyzers] 9 | localhost ansible_connection=local 10 | 11 | [agents] 12 | localhost ansible_connection=local 13 | 14 | [agents:vars] 15 | skydive_extra_config={'agent.topology.probes': ['socketinfo', 'docker'], 'logging.level': 'DEBUG'} 16 | -------------------------------------------------------------------------------- /contrib/ansible/inventory/hosts.localhost.openstack: -------------------------------------------------------------------------------- 1 | [skydive:children] 2 | analyzers 3 | agents 4 | 5 | [skydive:vars] 6 | skydive_listen_ip=0.0.0.0 7 | skydive_etcd_port=12380 8 | skydive_deployment_mode=container 9 | 10 | skydive_auth_type=keystone 11 | 12 | os_auth_url=http://192.168.0.16/identity/v3 13 | os_username=admin 14 | os_password=secret 15 | os_tenant_name=admin 16 | os_user_domain_name=Default 17 | os_project_domain_name=Default 18 | os_identity_api_version=3 19 | 20 | skydive_os_auth_url=http://192.168.0.16/identity/v3 21 | skydive_os_service_username=skydive 22 | skydive_os_service_password=secret 23 | skydive_os_service_tenant_name=service 24 | skydive_os_service_domain_name=Default 25 | skydive_os_service_region_name=RegionOne 26 | 27 | [analyzers] 28 | localhost ansible_connection=local 29 | 30 | [agents] 31 | localhost ansible_connection=local 32 | 33 | [agents:vars] 34 | skydive_extra_config={'agent.topology.probes': ['docker','neutron', 'ovsdb']} 35 | -------------------------------------------------------------------------------- /contrib/ansible/inventory/hosts.multiple: -------------------------------------------------------------------------------- 1 | [skydive:children] 2 | analyzers 3 | agents 4 | 5 | [skydive:vars] 6 | skydive_listen_ip=0.0.0.0 7 | 8 | [analyzers] 9 | 10.0.0.4 10 | 11 | [agents] 12 | 10.0.0.9 13 | 14 | # For skydive-flow-matrix add skydive_extra_config: 15 | #[agents:vars] 16 | #skydive_extra_config={'agent.topology.probes': ['socketinfo',]} 17 | -------------------------------------------------------------------------------- /contrib/ansible/inventory/hosts.multiple.container: -------------------------------------------------------------------------------- 1 | [skydive:children] 2 | analyzers 3 | agents 4 | 5 | [skydive:vars] 6 | skydive_listen_ip=0.0.0.0 7 | skydive_deployment_mode=container 8 | 9 | [analyzers] 10 | 10.0.0.4 11 | 12 | [agents] 13 | 10.0.0.9 14 | 10.0.0.4 15 | 16 | [agents:vars] 17 | skydive_extra_config={'agent.topology.probes': ['docker']} 18 | -------------------------------------------------------------------------------- /contrib/ansible/playbook.yml.sample: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Setup localhost 3 | hosts: localhost 4 | connection: local 5 | 6 | - name: Gather facts 7 | hosts: all 8 | tasks: 9 | - name: Gather facts on all hosts 10 | setup: {} 11 | 12 | - name: Deploy Skydive agents 13 | hosts: agents 14 | become: yes 15 | roles: 16 | - skydive_agent 17 | 18 | - name: Deploy Skydive analyzers 19 | hosts: analyzers 20 | become: yes 21 | roles: 22 | - skydive_analyzer 23 | -------------------------------------------------------------------------------- /contrib/ansible/roles/elasticsearch/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install elasticsearch GPG key 3 | rpm_key: 4 | state: present 5 | key: https://packages.elastic.co/GPG-KEY-elasticsearch 6 | 7 | - name: Install elasticsearch YUM repository 8 | yum_repository: 9 | state: present 10 | name: elasticsearch 11 | description: Elasticsearch repository for 6.x packages 12 | gpgcheck: true 13 | gpgkey: https://artifacts.elastic.co/GPG-KEY-elasticsearch 14 | baseurl: https://artifacts.elastic.co/packages/6.x/yum 15 | 16 | - name: Install elasticsearch package 17 | package: 18 | name: "{{ item }}" 19 | state: present 20 | with_items: 21 | - java 22 | - elasticsearch 23 | 24 | - name: Set elasticsearch minimum heap size 25 | lineinfile: 26 | dest: /etc/elasticsearch/jvm.options 27 | regexp: '^-Xms.$' 28 | line: '-Xms512m' 29 | 30 | - name: Set elasticsearch maximum heap size 31 | lineinfile: 32 | dest: /etc/elasticsearch/jvm.options 33 | regexp: '^-Xmx.$' 34 | line: '-Xmx512m' 35 | 36 | - name: Starts and enable elasticsearch 37 | service: 38 | name: elasticsearch 39 | state: started 40 | enabled: yes 41 | -------------------------------------------------------------------------------- /contrib/ansible/roles/orientdb/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | orientdb_version: 3.0.19 3 | orientdb_root_password: root 4 | -------------------------------------------------------------------------------- /contrib/ansible/roles/skydive_agent/defaults/main.yml: -------------------------------------------------------------------------------- 1 | skydive_agent_port: 8081 2 | skydive_agent_docker_extra_env: 3 | skydive_agent_docker_image: skydive/skydive 4 | skydive_agent_docker_command: agent 5 | skydive_agent_docker_image_tag: 6 | skydive_topology_probes: 7 | -------------------------------------------------------------------------------- /contrib/ansible/roles/skydive_agent/meta/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | galaxy_info: 3 | author: Sylvain Baubeau 4 | description: Skydive Agent 5 | company: Red Hat 6 | license: Apache License, Version 2.0 7 | min_ansible_version: 2.3 8 | platforms: 9 | - name: EL 10 | versions: 11 | - 7 12 | categories: 13 | - cloud 14 | - system 15 | dependencies: 16 | - role: skydive_common 17 | -------------------------------------------------------------------------------- /contrib/ansible/roles/skydive_agent/tasks/binary.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_role: 3 | name: skydive_common 4 | tasks_from: systemd 5 | vars: 6 | service_name: skydive-agent 7 | exec_start: "{{ skydive_binary_location }} agent --conf {{ skydive_config_file }}" 8 | user: root 9 | group: root 10 | -------------------------------------------------------------------------------- /contrib/ansible/roles/skydive_agent/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Determine agent IP 3 | set_fact: 4 | skydive_agent_ip: >- 5 | {%- if skydive_listen_ip is defined -%} 6 | {{ skydive_listen_ip }} 7 | {%- elif skydive_nic is defined -%} 8 | {{ hostvars[inventory_hostname][skydive_nic].ipv4.address }} 9 | {%- else -%} 10 | {{ hostvars[inventory_hostname].ansible_default_ipv4.address }} 11 | {%- endif -%} 12 | tags: 13 | - config 14 | 15 | - include_tasks: config.yml 16 | tags: 17 | - config 18 | 19 | - include_tasks: container.yml 20 | when: skydive_deployment_mode == "container" 21 | 22 | - include_tasks: package.yml 23 | when: skydive_deployment_mode == "package" 24 | 25 | - include_tasks: binary.yml 26 | when: skydive_deployment_mode == "binary" 27 | 28 | - include_role: 29 | name: skydive_common 30 | tasks_from: permissions 31 | -------------------------------------------------------------------------------- /contrib/ansible/roles/skydive_agent/tasks/package.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install skydive agent package 3 | package: 4 | name: skydive-agent 5 | state: present 6 | 7 | - name: Start service 8 | service: 9 | name: skydive-agent 10 | state: started 11 | enabled: yes 12 | -------------------------------------------------------------------------------- /contrib/ansible/roles/skydive_analyzer/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | skydive_analyzer_docker_extra_env: 3 | skydive_analyzer_docker_image: skydive/skydive 4 | skydive_analyzer_docker_command: analyzer 5 | skydive_analyzer_docker_image_tag: 6 | skydive_etcd_embedded: yes 7 | skydive_etcd_port: 12379 8 | skydive_etcd_scheme: http 9 | skydive_etcd_servers: 10 | skydive_auto_fabric: yes 11 | skydive_fabric_default_interface: eth0 12 | skydive_fabric_tor_name: tor1 13 | skydive_fabric_tor_mtu: 1500 14 | skydive_auth_type: 15 | skydive_basic_auth_file: /var/lib/skydive/skydive.secret 16 | 17 | os_auth_url: 18 | os_username: 19 | os_password: 20 | os_tenant_name: admin 21 | os_user_domain_name: Default 22 | os_project_domain_name: Default 23 | os_identity_api_version: 3 24 | 25 | # Role of the user created that will be used for the probe 26 | # authentication 27 | skydive_os_service_user_role: admin 28 | 29 | skydive_os_auth_url: 30 | 31 | skydive_auth_os_tenant_name: skydive 32 | skydive_auth_os_domain_name: Default 33 | skydive_auth_os_domain_id: default 34 | skydive_auth_os_user_role: admin 35 | 36 | skydive_deployment_test: yes 37 | 38 | skydive_iptables_rules: false 39 | 40 | validate_certs: true 41 | -------------------------------------------------------------------------------- /contrib/ansible/roles/skydive_analyzer/meta/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | galaxy_info: 3 | author: Sylvain Baubeau 4 | description: Skydive Analyzer 5 | company: Red Hat 6 | license: Apache License, Version 2.0 7 | min_ansible_version: 2.3 8 | platforms: 9 | - name: EL 10 | versions: 11 | - 7 12 | categories: 13 | - cloud 14 | - system 15 | dependencies: 16 | - role: skydive_common 17 | -------------------------------------------------------------------------------- /contrib/ansible/roles/skydive_analyzer/tasks/binary.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_role: 3 | name: skydive_common 4 | tasks_from: systemd 5 | vars: 6 | service_name: skydive-analyzer 7 | exec_start: "{{ skydive_binary_location }} analyzer --conf /etc/skydive/skydive.yml" 8 | user: "{{ skydive_sys_username }}" 9 | group: "{{ skydive_sys_groupname }}" 10 | -------------------------------------------------------------------------------- /contrib/ansible/roles/skydive_analyzer/tasks/package.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install skydive analyzer package 3 | package: 4 | name: skydive-analyzer 5 | state: present 6 | 7 | - name: Start service 8 | service: 9 | name: skydive-analyzer 10 | state: started 11 | enabled: yes 12 | -------------------------------------------------------------------------------- /contrib/ansible/roles/skydive_analyzer/tasks/tests.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Check API status, retrieve token from login page 3 | uri: 4 | url: "http://{{ analyzers.split(',')[0] }}/login" 5 | status_code: 200 6 | method: POST 7 | body: "username={{ skydive_username }}&password={{ skydive_password }}" 8 | headers: 9 | Content-Type: "application/x-www-form-urlencoded" 10 | register: login 11 | until: login is not failed 12 | retries: 10 13 | delay: 20 14 | tags: 15 | - tests 16 | 17 | - name: Check API status 18 | uri: 19 | url: "http://{{ analyzers.split(',')[0] }}/api/status" 20 | method: GET 21 | return_content: yes 22 | headers: 23 | Cookie: "{{ login.set_cookie | regex_replace(',', ';') }}" 24 | register: response 25 | changed_when: false 26 | until: response.json is defined and response.json.Agents is defined and (response.json.Agents|length) == (groups['agents']|length) 27 | retries: 10 28 | delay: 20 29 | tags: 30 | - tests 31 | -------------------------------------------------------------------------------- /contrib/ansible/roles/skydive_common/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | skydive_release: v0.28.0 3 | skydive_docker_registry: docker.io 4 | skydive_docker_image_tag: latest 5 | skydive_config_file: /etc/skydive/skydive.yml 6 | skydive_binary_location: /usr/bin/skydive 7 | skydive_binary_remote_location: https://github.com/skydive-project/skydive/releases/download/{{ skydive_release }}/skydive 8 | skydive_deployment_mode: binary 9 | skydive_analyzer_port: 8082 10 | skydive_agent_port: 8081 11 | skydive_flow_protocol: udp 12 | 13 | skydive_auth_type: 14 | skydive_username: skydive 15 | skydive_password: secret 16 | 17 | skydive_os_auth_url: 18 | skydive_os_service_username: skydive.service 19 | skydive_os_service_password: secret 20 | skydive_os_service_tenant_name: service 21 | skydive_os_service_domain_name: Default 22 | skydive_os_service_region_name: RegionOne 23 | skydive_os_service_endpoint_type: internal 24 | skydive_os_service_insecure: true 25 | 26 | skydive_cluster_username: skydive 27 | skydive_cluster_password: secret 28 | 29 | skydive_sys_username: skydive 30 | skydive_sys_groupname: skydive 31 | 32 | skydive_container_cli: 33 | 34 | skydive_deployment_source: 35 | -------------------------------------------------------------------------------- /contrib/ansible/roles/skydive_common/meta/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | galaxy_info: 3 | author: Sylvain Baubeau 4 | description: Skydive Commons 5 | company: Red Hat 6 | license: Apache License, Version 2.0 7 | min_ansible_version: 2.3 8 | platforms: 9 | - name: EL 10 | versions: 11 | - 7 12 | categories: 13 | - cloud 14 | - system 15 | -------------------------------------------------------------------------------- /contrib/ansible/roles/skydive_common/tasks/binary.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Copy skydive binary 3 | copy: 4 | src: "{{ skydive_binary_remote_location | replace('file://', '') }}" 5 | dest: "{{ skydive_binary_location }}" 6 | force: true 7 | mode: 0755 8 | when: '"file://" in skydive_binary_remote_location' 9 | 10 | - name: Download skydive binary 11 | get_url: 12 | url: "{{ skydive_binary_remote_location }}" 13 | dest: "{{ skydive_binary_location }}" 14 | force: true 15 | mode: 0755 16 | when: '"file://" not in skydive_binary_remote_location' 17 | -------------------------------------------------------------------------------- /contrib/ansible/roles/skydive_common/tasks/main.yml: -------------------------------------------------------------------------------- 1 | - name: Display all variables/facts known for a host 2 | debug: 3 | var: hostvars[inventory_hostname] 4 | verbosity: 4 5 | 6 | - name: Set analyzers list 7 | set_fact: 8 | analyzers: >- 9 | {% for i in groups['analyzers'] -%} 10 | {%- if hostvars[i]['skydive_listen_ip'] is defined and hostvars[i]['skydive_listen_ip'] != "0.0.0.0" -%} 11 | {{ hostvars[i]['skydive_listen_ip'] }}:{{ skydive_analyzer_port }} 12 | {%- elif skydive_nic is defined -%} 13 | {{ hostvars[i][skydive_nic].ipv4.address }}:{{ skydive_analyzer_port }} 14 | {%- else -%} 15 | {{ hostvars[i].ansible_default_ipv4.address }}:{{ skydive_analyzer_port }} 16 | {%- endif -%} 17 | {%- if not loop.last -%},{%- endif -%} 18 | {%- endfor %} 19 | tags: 20 | - config 21 | - iptables 22 | - tests 23 | 24 | - include_tasks: binary.yml 25 | when: skydive_deployment_mode == "binary" 26 | 27 | - include_tasks: package.yml 28 | when: skydive_deployment_mode == "package" 29 | 30 | - include_tasks: config.yml 31 | tags: 32 | - config -------------------------------------------------------------------------------- /contrib/ansible/roles/skydive_common/tasks/package.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install opstools repository 3 | package: 4 | name: centos-release-opstools 5 | state: present 6 | update_cache: yes 7 | when: ansible_distribution == 'CentOS' and skydive_package_location is not defined 8 | 9 | - name: Copy skydive packages 10 | copy: 11 | src: "{{ skydive_package_location | replace('file://', '') }}" 12 | dest: /tmp 13 | force: true 14 | mode: 0755 15 | when: skydive_package_location is defined 16 | 17 | - name: Move skydive packages 18 | shell: "mv /tmp/*/*.rpm /tmp" 19 | when: skydive_package_location is defined 20 | 21 | - name: Install createrepo 22 | package: 23 | name: createrepo 24 | state: present 25 | when: skydive_package_location is defined 26 | 27 | - name: Create local repository 28 | shell: "createrepo /tmp" 29 | when: skydive_package_location is defined 30 | 31 | - name: Add local repository 32 | yum_repository: 33 | name: local 34 | description: Local Skydive repository 35 | baseurl: "file:///tmp" 36 | gpgcheck: no 37 | when: skydive_package_location is defined 38 | 39 | - name: Install skydive package 40 | package: 41 | name: skydive 42 | state: present 43 | -------------------------------------------------------------------------------- /contrib/ansible/roles/skydive_common/tasks/permissions.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Ensure config file permissions 3 | file: 4 | path: "{{ skydive_config_file }}" 5 | owner: "root" 6 | group: "{{ skydive_sys_groupname }}" 7 | mode: 0640 8 | 9 | - name: Ensure /var/lib permissions 10 | file: 11 | path: "/var/lib/skydive" 12 | owner: "{{ skydive_sys_username }}" 13 | group: "{{ skydive_sys_groupname }}" 14 | mode: 0770 15 | state: directory 16 | -------------------------------------------------------------------------------- /contrib/ansible/roles/skydive_common/tasks/systemd.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Generate systemd unit file 3 | become: yes 4 | template: 5 | src: "{{ role_path }}/templates/skydive.service.j2" 6 | dest: /etc/systemd/system/{{ service_name }}.service 7 | owner: "root" 8 | group: "root" 9 | mode: "0644" 10 | 11 | - name: Start service 12 | systemd: 13 | name: "{{ service_name }}" 14 | state: restarted 15 | enabled: yes 16 | daemon_reload: yes 17 | 18 | - name: Check Skydive service started 19 | command: systemctl status {{ service_name }} 20 | ignore_errors: yes 21 | changed_when: false 22 | register: service_skydive_status 23 | 24 | - name: Report status of Skydive service 25 | fail: 26 | msg: | 27 | Service {{ service_name }} is not running. 28 | {{ service_skydive_status.stdout }} 29 | {{ service_skydive_status.stderr }} 30 | when: service_skydive_status is failed 31 | -------------------------------------------------------------------------------- /contrib/ansible/roles/skydive_common/templates/skydive.service.j2: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description={{ service_name }} 3 | {% if skydive_container_cli == 'docker' %} 4 | After=docker.service 5 | {% endif %} 6 | 7 | [Service] 8 | Type=simple 9 | EnvironmentFile=-/etc/environment 10 | EnvironmentFile=-/etc/sysconfig/{{ service_name }} 11 | {% if exec_start_pre is defined %} 12 | ExecStartPre=-{{ exec_start_pre }} 13 | ExecStartPre=-/usr/bin/{{ skydive_container_cli }} rm {{ service_name }}-{{ ansible_hostname }} 14 | {% endif %} 15 | ExecStart={{ exec_start }} 16 | {% if exec_start_post is defined %} 17 | ExecStopPost=-{{ exec_stop_post }} 18 | {% endif %} 19 | Restart=always 20 | RestartSec=10s 21 | TimeoutStartSec=120 22 | TimeoutStopSec=15 23 | User={{ user }} 24 | Group={{ group }} 25 | 26 | [Install] 27 | WantedBy=multi-user.target 28 | -------------------------------------------------------------------------------- /contrib/ansible/roles/skydive_dev/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | skydive_container_cli: docker 3 | -------------------------------------------------------------------------------- /contrib/ansible/roles/skydive_dev/tasks/build.yml: -------------------------------------------------------------------------------- 1 | - package: 2 | name: "{{ item }}" 3 | state: present 4 | with_items: 5 | - git 6 | - wget 7 | - unzip 8 | - gcc 9 | - make 10 | - docker 11 | - npm 12 | - libpcap-devel 13 | - libxml2-devel 14 | - rpm-build 15 | - libvirt-devel 16 | - numactl-devel 17 | - kernel-devel 18 | - llvm-devel 19 | - clang-devel 20 | - bcc-devel 21 | - elfutils-libelf-devel 22 | - selinux-policy-devel 23 | - policycoreutils-devel 24 | 25 | - include_tasks: protobuf.yml 26 | 27 | - include_tasks: static.yml 28 | 29 | - include_tasks: gimme.yml 30 | tags: 31 | - vagrant -------------------------------------------------------------------------------- /contrib/ansible/roles/skydive_dev/tasks/centos.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - package: 3 | name: "{{ item }}" 4 | state: present 5 | with_items: 6 | - centos-release 7 | - https://www.rdoproject.org/repos/rdo-release.rpm 8 | - "https://dl.fedoraproject.org/pub/epel/epel-release-latest-{{ ansible_distribution_major_version }}.noarch.rpm" 9 | 10 | - package: 11 | name: centos-release-openstack-queens 12 | state: present 13 | 14 | - name: "Install copr yum plugin" 15 | package: 16 | name: yum-plugin-copr 17 | state: present 18 | -------------------------------------------------------------------------------- /contrib/ansible/roles/skydive_dev/tasks/ci.yml: -------------------------------------------------------------------------------- 1 | - package: 2 | name: "{{ item }}" 3 | state: present 4 | with_items: 5 | - ffmpeg 6 | - gifsicle 7 | - libvirt 8 | - ruby-devel 9 | - virt-what 10 | - ansible 11 | - dnf-utils 12 | - manifest-tool 13 | - git-lfs 14 | - qemu-system-s390x 15 | - qemu-system-ppc 16 | - qemu-system-aarch64 17 | - qemu-user-static 18 | 19 | - service: 20 | name: libvirtd 21 | state: started 22 | enabled: yes 23 | 24 | - service: 25 | name: systemd-binfmt 26 | state: started 27 | enabled: yes 28 | 29 | - include_tasks: virtualbox.yml 30 | -------------------------------------------------------------------------------- /contrib/ansible/roles/skydive_dev/tasks/docker-ce.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - package: 3 | name: "{{ item }}" 4 | state: absent 5 | with_items: 6 | - docker 7 | - docker-client 8 | - docker-client-latest 9 | - docker-common 10 | - docker-latest 11 | - docker-latest-logrotate 12 | - docker-logrotate 13 | - docker-selinux 14 | - docker-engine-selinux 15 | - docker-engine 16 | 17 | - yum_repository: 18 | state: present 19 | name: docker-ce-stable 20 | description: "Docker CE Stable - $basearch" 21 | gpgcheck: true 22 | gpgkey: "https://download.docker.com/linux/{{ ansible_distribution|lower }}/gpg" 23 | baseurl: "https://download.docker.com/linux/{{ ansible_distribution|lower }}/$releasever/$basearch/stable" 24 | 25 | - group: 26 | name: docker 27 | state: present 28 | 29 | - user: 30 | name: vagrant 31 | groups: docker 32 | append: yes 33 | 34 | - package: 35 | name: "{{ item }}" 36 | state: present 37 | with_items: 38 | - docker-ce 39 | - docker-ce-cli 40 | - containerd.io 41 | 42 | - service: 43 | name: docker 44 | state: restarted 45 | enabled: yes 46 | -------------------------------------------------------------------------------- /contrib/ansible/roles/skydive_dev/tasks/docker.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - group: 3 | name: docker 4 | state: present 5 | 6 | - user: 7 | name: vagrant 8 | groups: docker 9 | append: yes 10 | 11 | - service: 12 | name: docker 13 | state: restarted 14 | enabled: yes 15 | -------------------------------------------------------------------------------- /contrib/ansible/roles/skydive_dev/tasks/dpdk.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - package: 3 | name: "{{ item }}" 4 | state: present 5 | with_items: 6 | - rdma-core-devel 7 | - lua-devel 8 | - libmnl-devel 9 | - libibverbs-devel 10 | - git: 11 | repo: 'http://dpdk.org/git/dpdk' 12 | dest: /usr/local/src/dpdk 13 | version: v19.05 14 | - shell: | 15 | export RTE_TARGET=x86_64-native-linuxapp-gcc 16 | make -C /usr/local/src/dpdk config T=$RTE_TARGET 17 | make -C /usr/local/src/dpdk install T=$RTE_TARGET DESTDIR=/usr/local EXTRA_CFLAGS=-fPIC 18 | -------------------------------------------------------------------------------- /contrib/ansible/roles/skydive_dev/tasks/fedora.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: "Installing the rpmfusion repo packages" 3 | dnf: name=['http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-{{ ansible_distribution_version }}.noarch.rpm'] 4 | state=present 5 | 6 | - name: "Install copr dnf plugin" 7 | package: 8 | name: dnf-plugins-core 9 | state: present 10 | -------------------------------------------------------------------------------- /contrib/ansible/roles/skydive_dev/tasks/gimme.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: download gimme binary 3 | get_url: 4 | url: "https://raw.githubusercontent.com/travis-ci/gimme/master/gimme" 5 | dest: "/usr/local/bin/gimme" 6 | force: true 7 | mode: 0755 8 | 9 | - name: run gimme in bash profile 10 | lineinfile: 11 | path: /home/vagrant/.bash_profile 12 | line: 'eval "$(gimme 1.14.x)"' 13 | 14 | - name: set GOPATH 15 | lineinfile: 16 | path: /home/vagrant/.bash_profile 17 | line: 'export GOPATH=/home/vagrant/go' 18 | 19 | - name: set PATH 20 | lineinfile: 21 | path: /home/vagrant/.bash_profile 22 | line: 'export PATH=/home/vagrant/go/bin:$PATH' 23 | 24 | - name: run gimme once 25 | command: /usr/local/bin/gimme 1.14.x 26 | become: yes 27 | become_user: vagrant 28 | -------------------------------------------------------------------------------- /contrib/ansible/roles/skydive_dev/tasks/lxd.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - selinux: 3 | policy: targeted 4 | state: permissive 5 | 6 | - shell: yum -y copr enable ganto/lxc3 7 | 8 | - package: 9 | name: lxc 10 | state: present 11 | 12 | - package: 13 | name: lxd 14 | state: present 15 | 16 | - lineinfile: 17 | path: /etc/subuid 18 | line: 'root:1000000:65536' 19 | 20 | - lineinfile: 21 | path: /etc/subgid 22 | line: 'root:1000000:65536' 23 | 24 | - shell: | 25 | grubby --args="user_namespace.enable=1" --update-kernel="$(grubby --default-kernel)" 26 | grubby --args="namespace.unpriv_enable=1" --update-kernel="$(grubby --default-kernel)" 27 | when: ansible_distribution == "CentOS" 28 | 29 | - copy: 30 | content: user.max_user_namespaces=3883 31 | dest: /etc/sysctl.d/99-userns.conf 32 | mode: 0644 33 | when: ansible_distribution == "CentOS" 34 | 35 | - service: 36 | name: lxd 37 | state: started 38 | enabled: yes 39 | 40 | - file: 41 | src: /var/run/lxd.socket 42 | dest: /var/lib/lxd/unix.socket 43 | state: link 44 | 45 | - shell: "systemctl enable lxd" 46 | 47 | - shell: "lxd init --auto" 48 | -------------------------------------------------------------------------------- /contrib/ansible/roles/skydive_dev/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_tasks: fedora.yml 3 | when: ansible_distribution == "Fedora" 4 | 5 | - include_tasks: centos.yml 6 | when: ansible_distribution == "CentOS" 7 | 8 | - include_tasks: runtime.yml 9 | 10 | - include_tasks: build.yml 11 | 12 | - include_tasks: tests.yml 13 | 14 | - include_tasks: ci.yml 15 | 16 | - include_tasks: dpdk.yml 17 | -------------------------------------------------------------------------------- /contrib/ansible/roles/skydive_dev/tasks/ovn.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - package: 3 | name: "{{ item }}" 4 | state: present 5 | with_items: 6 | - openvswitch-ovn-common 7 | - openvswitch-ovn-central 8 | 9 | - name: Allow accessing OVN using TCP 10 | copy: 11 | content: "OVN_NORTHD_OPTS=--ovn-northd-nb-db=tcp:127.0.0.1:6641 --db-nb-create-insecure-remote=yes" 12 | dest: /etc/sysconfig/ovn-northd 13 | mode: 0640 14 | 15 | - service: 16 | name: ovn-northd 17 | state: started 18 | enabled: yes 19 | -------------------------------------------------------------------------------- /contrib/ansible/roles/skydive_dev/tasks/protobuf.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - package: 3 | name: "{{ item }}" 4 | state: present 5 | with_items: 6 | - unzip 7 | - wget 8 | - automake 9 | - autoconf 10 | - libtool 11 | - shell: | 12 | mkdir -p /tmp/protoc 13 | cd /tmp/protoc 14 | wget https://github.com/google/protobuf/releases/download/v3.1.0/protoc-3.1.0-linux-x86_64.zip 15 | unzip -o protoc-3.1.0-linux-x86_64.zip 16 | chmod +x bin/protoc 17 | mv bin/protoc /usr/bin/ 18 | chmod -R 755 include/google 19 | rm -rf /usr/include/google 20 | mv include/google /usr/include 21 | when: ansible_architecture != "ppc64le" 22 | - shell: | 23 | mkdir -p /tmp/protoc 24 | cd /tmp/protoc 25 | wget https://github.com/google/protobuf/archive/v3.1.0.tar.gz 26 | tar xzf v3.1.0.tar.gz 27 | cd protobuf-3.1.0 28 | ./autogen.sh 29 | ./configure --enable-static --disable-shared 30 | chmod a+x ./src/protoc 31 | mv ./src/protoc /usr/bin/ 32 | wget https://github.com/google/protobuf/releases/download/v3.1.0/protoc-3.1.0-linux-x86_64.zip 33 | unzip -o protoc-3.1.0-linux-x86_64.zip 34 | rm -rf /usr/include/google 35 | chmod -R 755 include/google 36 | mv -f include/google /usr/include 37 | when: ansible_architecture == "ppc64le" 38 | -------------------------------------------------------------------------------- /contrib/ansible/roles/skydive_dev/tasks/runtime.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - package: 3 | name: "{{ item }}" 4 | state: present 5 | with_items: 6 | - libpcap 7 | - libvirt-libs 8 | - libxml2 9 | -------------------------------------------------------------------------------- /contrib/ansible/roles/skydive_dev/tasks/static.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - package: 3 | name: "{{ item }}" 4 | state: present 5 | with_items: 6 | - glibc-static 7 | - xz-static 8 | - zlib-static 9 | - flex 10 | - bison 11 | - byacc 12 | - libxml2-static 13 | - shell: | 14 | cd /tmp 15 | rm -rf libpcap 16 | git clone https://github.com/the-tcpdump-group/libpcap.git 17 | cd libpcap 18 | git checkout libpcap-1.5.3 19 | curl http://'git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD' -o config.guess 20 | curl http://'git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD' -o config.sub 21 | ./configure --prefix=/usr/local --disable-shared --disable-dbus --disable-bluetooth --disable-canusb 22 | make 23 | sudo make install 24 | -------------------------------------------------------------------------------- /contrib/ansible/roles/skydive_dev/tasks/tests.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - include_tasks: docker-ce.yml 3 | 4 | - package: 5 | name: "{{ item }}" 6 | state: present 7 | with_items: 8 | - openvswitch 9 | - screen 10 | - iperf 11 | - libselinux-python 12 | - bridge-utils 13 | - rpmlint 14 | - libvirt-client 15 | - ansible 16 | - kubernetes-client 17 | - tcpdump 18 | - socat 19 | - python2-virtualenv 20 | - selinux-policy-devel 21 | - policycoreutils-devel 22 | - mock 23 | - podman 24 | - bc 25 | 26 | - package: 27 | name: "{{ item }}" 28 | state: present 29 | with_items: 30 | - perl-Graph-Easy 31 | - python3-virtualenv 32 | - inotify-tools 33 | - jq 34 | - aria2 35 | when: ansible_distribution == "Fedora" 36 | 37 | - service: 38 | name: openvswitch 39 | state: started 40 | enabled: yes 41 | 42 | - include_tasks: lxd.yml 43 | when: ansible_architecture == "x86_64" 44 | 45 | - include_tasks: ovn.yml 46 | 47 | - include_tasks: vpp.yml 48 | -------------------------------------------------------------------------------- /contrib/ansible/roles/skydive_dev/tasks/virtualbox.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - package: 3 | name: "{{ item }}" 4 | state: present 5 | with_items: 6 | - akmod-VirtualBox 7 | - VirtualBox 8 | - kernel-devel 9 | - "kernel-devel-{{ ansible_kernel }}" 10 | - kernel-headers 11 | - "kernel-headers-{{ ansible_kernel }}" 12 | 13 | - shell: "akmods" 14 | -------------------------------------------------------------------------------- /contrib/ansible/roles/skydive_dev/tasks/vpp.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - shell: dnf -y copr enable nucleo/frr 3 | when: ansible_distribution == "Fedora" 4 | 5 | - copy: 6 | dest: "/etc/yum.repos.d/fdio-release.repo" 7 | content: | 8 | [fdio_release] 9 | name=fdio_release 10 | baseurl=https://packagecloud.io/fdio/release/el/7/$basearch 11 | repo_gpgcheck=1 12 | gpgcheck=0 13 | enabled=1 14 | gpgkey=https://packagecloud.io/fdio/release/gpgkey 15 | sslverify=1 16 | sslcacert=/etc/pki/tls/certs/ca-bundle.crt 17 | metadata_expire=300 18 | when: ansible_distribution != "Fedora" 19 | 20 | - package: 21 | name: "{{ item }}" 22 | state: present 23 | with_items: 24 | - vpp 25 | - vpp-devel 26 | - vpp-api-python 27 | 28 | - service: 29 | name: vpp 30 | state: started 31 | enabled: yes 32 | -------------------------------------------------------------------------------- /contrib/charts/Makefile: -------------------------------------------------------------------------------- 1 | SUBDIRS := \ 2 | elasticsearch \ 3 | kibana \ 4 | skydive-analyzer \ 5 | skydive-agent 6 | 7 | .PHONY: install uninstall status 8 | install uninstall status: 9 | for i in $(SUBDIRS); do \ 10 | make -C $$i $@; \ 11 | done 12 | 13 | include ../../.mk/k8s.mk 14 | -------------------------------------------------------------------------------- /contrib/charts/kibana/Makefile: -------------------------------------------------------------------------------- 1 | include ../../../.mk/k8s.mk 2 | 3 | # must be within the range of k8s nodePort 4 | KIBANA_NODEPORT?=30030 5 | KIBANA_PORT?=5601 6 | ES_SERVICE?=elasticsearch-master 7 | ES_PORT?=9200 8 | 9 | .PHONY: repo 10 | repo: $(TOOLSBIN)/helm 11 | helm repo remove elastic https://helm.elastic.co 2>/dev/null || true 12 | helm repo add elastic https://helm.elastic.co 13 | helm repo update 14 | 15 | .PHONY: uninstall 16 | uninstall: $(TOOLSBIN)/helm 17 | helm uninstall kibana 2>/dev/null || true 18 | 19 | .PHONY: install 20 | install: $(TOOLSBIN)/helm 21 | helm install kibana elastic/kibana \ 22 | --set elasticsearchHosts="http://${ES_SERVICE}:${ES_PORT}" \ 23 | --set service.port=${KIBANA_PORT} \ 24 | --set service.type=NodePort \ 25 | --set service.nodePort=${KIBANA_NODEPORT} 26 | 27 | .PHONY: status 28 | status: $(TOOLSBIN)/kubectl 29 | kubectl get all -l app=kibana 30 | 31 | .PHONY: logs 32 | logs: $(TOOLSBIN)/kubectl 33 | kubectl logs -f -l app=kibana 34 | 35 | .PHONY: verify 36 | verify: 37 | curl http://localhost:${KIBANA_NODEPORT}/app/dashborads 38 | 39 | .PHONY: port-forward 40 | port-forward: $(TOOLSBIN)/kubectl 41 | kubectl port-forward service/kibana-kibana ${KIBANA_PORT}:${KIBANA_PORT} 42 | 43 | .PHONY: help 44 | help: 45 | @echo "Kibana is running at: http://localhost:${ELASTIC_NODEPORT}" 46 | -------------------------------------------------------------------------------- /contrib/charts/skydive-agent/Chart.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v2 2 | name: skydive-agent 3 | description: Skydive Agent - Network Topology and Protocols Analyzer 4 | version: 0.0.0 5 | appVersion: 0.0.0 6 | icon: http://skydive.network/assets/images/logo.png 7 | -------------------------------------------------------------------------------- /contrib/charts/skydive-agent/Makefile: -------------------------------------------------------------------------------- 1 | include ../../../.mk/k8s.mk 2 | 3 | ANALYZER_SERVICE?=skydive-analyzer 4 | ANALYZER_PORT?=8082 5 | 6 | .PHONY: uninstall 7 | uninstall: $(TOOLSBIN)/helm 8 | helm uninstall skydive-agent 2>/dev/null || true 9 | 10 | .PHONY: install 11 | install: $(TOOLSBIN)/helm 12 | helm install skydive-agent . \ 13 | --set analyzer.host=${ANALYZER_SERVICE}:${ANALYZER_PORT} 14 | 15 | .PHONY: status 16 | status: $(TOOLSBIN)/kubectl 17 | kubectl get all -l app=skydive-agent 18 | 19 | .PHONY: logs 20 | logs: $(TOOLSBIN)/kubectl 21 | kubectl logs -f -l app=skydive-agent 22 | -------------------------------------------------------------------------------- /contrib/charts/skydive-agent/values.yaml: -------------------------------------------------------------------------------- 1 | image: 2 | repository: skydive/skydive 3 | tag: "latest" 4 | imagePullPolicy: IfNotPresent 5 | 6 | resources: 7 | limits: 8 | cpu: 2000m 9 | memory: 8192Mi 10 | requests: 11 | cpu: 100m 12 | memory: 512Mi 13 | 14 | analyzer: 15 | host: skydive-analyzer:8082 16 | 17 | # Extra environment variables to be appended to default skydive variables 18 | extraEnvs: [] 19 | # - name: MY_ENVIRONMENT_VAR 20 | # value: the_value_goes_here 21 | -------------------------------------------------------------------------------- /contrib/charts/skydive-analyzer/Chart.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v2 2 | name: skydive-analyzer 3 | description: Skydive Analyzer - Network Topology and Protocols Analyzer 4 | version: 0.0.0 5 | appVersion: 0.0.0 6 | icon: http://skydive.network/assets/images/logo.png 7 | -------------------------------------------------------------------------------- /contrib/charts/skydive-analyzer/templates/NOTES.txt: -------------------------------------------------------------------------------- 1 | To access skydive GUI execute: 2 | 3 | (Bear with us couple of seconds until Skydive starts ...) 4 | 5 | {{- if contains "NodePort" .Values.service.type }} 6 | export UI_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "servicename" . }}) 7 | export UI_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") 8 | echo "Skydive UI is running at: http://$UI_IP:$UI_PORT" 9 | 10 | {{- else if contains "LoadBalancer" .Values.service.type }} 11 | export UI_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "servicename" . }}) 12 | export UI_IP=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.status.loadBalancer.ingress[0].ip}" services {{ template "servicename" . }}) 13 | echo "Skydive UI is running at: http://$UI_IP:$UI_PORT" 14 | 15 | {{- else }} 16 | export UI_SERVICE=$(kubectl get --namespace {{ .Release.Namespace }} services {{ template "servicename" . }}) 17 | echo -e "To access Skydive UI use details from\n\n$UI_SERVICE" 18 | {{- end }} 19 | -------------------------------------------------------------------------------- /contrib/charts/skydive-analyzer/templates/clusterrolebinging.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: ClusterRoleBinding 3 | metadata: 4 | name: skydive-analyzer 5 | labels: 6 | app: skydive-analyzer 7 | roleRef: 8 | apiGroup: rbac.authorization.k8s.io 9 | kind: ClusterRole 10 | name: cluster-admin 11 | subjects: 12 | - kind: ServiceAccount 13 | name: skydive-analyzer 14 | namespace: {{ .Release.Namespace }} 15 | -------------------------------------------------------------------------------- /contrib/charts/skydive-analyzer/templates/service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: {{ .Values.service.name }} 5 | labels: 6 | app: skydive-analyzer 7 | spec: 8 | type: {{ .Values.service.type }} 9 | ports: 10 | - port: {{ .Values.service.port }} 11 | name: service 12 | nodePort: {{ .Values.service.nodePort }} 13 | - port: {{ .Values.etcd.port }} 14 | name: etcd 15 | nodePort: {{ .Values.etcd.nodePort }} 16 | {{- if .Values.newui.enabled }} 17 | - port: {{ .Values.newui.port }} 18 | name: newui 19 | nodePort: {{ .Values.newui.nodePort }} 20 | {{- end }} 21 | selector: 22 | app: skydive-analyzer 23 | -------------------------------------------------------------------------------- /contrib/charts/skydive-analyzer/templates/serviceaccount.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ServiceAccount 3 | metadata: 4 | name: skydive-analyzer 5 | namespace: {{ .Release.Namespace }} 6 | labels: 7 | app: skydive-analyzer 8 | imagePullSecrets: 9 | - name: sa-{{ .Release.Namespace }} 10 | -------------------------------------------------------------------------------- /contrib/charts/skydive-analyzer/values.yaml: -------------------------------------------------------------------------------- 1 | image: 2 | repository: skydive/skydive 3 | tag: "latest" 4 | imagePullPolicy: IfNotPresent 5 | 6 | resources: 7 | limits: 8 | cpu: 2000m 9 | memory: 8192Mi 10 | requests: 11 | cpu: 100m 12 | memory: 512Mi 13 | 14 | service: 15 | type: NodePort # applies for all services 16 | name: skydive-analyzer 17 | port: 8082 18 | nodePort: 19 | 20 | etcd: 21 | port: 12379 22 | nodePort: 23 | 24 | newui: 25 | enabled: false 26 | image: 27 | repository: "skydive/skydive-ui" 28 | tag: "latest" 29 | port: 8080 30 | nodePort: 31 | 32 | elasticsearch: 33 | enabled: false 34 | host: "elasticsearch-master:9200" 35 | query: 36 | 37 | # Extra environment variables to be appended to default skydive variables 38 | extraEnvs: [] 39 | # - name: MY_ENVIRONMENT_VAR 40 | # value: the_value_goes_here 41 | -------------------------------------------------------------------------------- /contrib/dev/devmode.yml: -------------------------------------------------------------------------------- 1 | ../ansible/devmode.yml -------------------------------------------------------------------------------- /contrib/dev/roles: -------------------------------------------------------------------------------- 1 | ../ansible/roles/ -------------------------------------------------------------------------------- /contrib/docker/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG BASE=ubuntu:20.04 2 | FROM $BASE 3 | ARG ARCH=amd64 4 | RUN apt-get -y update \ 5 | && apt-get -y install openvswitch-common libpcap0.8 libxml2 libvirt0 \ 6 | && rm -rf /var/lib/apt/lists/* 7 | COPY skydive.$ARCH /usr/bin/skydive 8 | COPY skydive.yml /etc/skydive.yml 9 | ENTRYPOINT ["/usr/bin/skydive", "--conf", "/etc/skydive.yml"] 10 | -------------------------------------------------------------------------------- /contrib/docker/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '2' 2 | services: 3 | elasticsearch: 4 | image: elasticsearch:5 5 | ports: 6 | - "19200:9200" 7 | - "19300:9300" 8 | environment: 9 | - "discovery.type=single-node" 10 | networks: 11 | - skynet 12 | 13 | skydive-analyzer: 14 | image: skydive/skydive 15 | ports: 16 | - "8082:8082" 17 | - "8082:8082/udp" 18 | links: 19 | - elasticsearch 20 | command: analyzer --listen=0.0.0.0:8082 21 | environment: 22 | - SKYDIVE_STORAGE_ELASTICSEARCH_HOST=elasticsearch:9200 23 | - SKYDIVE_ANALYZER_STORAGE_BACKEND=elasticsearch 24 | - SKYDIVE_GRAPH_BACKEND=elasticsearch 25 | - SKYDIVE_ETCD_LISTEN=0.0.0.0:12379 26 | networks: 27 | - skynet 28 | 29 | skydive-agent: 30 | image: skydive/skydive 31 | depends_on: 32 | - skydive-analyzer 33 | network_mode: "host" 34 | pid: "host" 35 | command: agent --listen=0.0.0.0:8081 36 | privileged: true 37 | volumes: 38 | - /var/run/docker.sock:/var/run/docker.sock 39 | - /var/run/netns:/host/run 40 | - /var/run/openvswitch/db.sock:/var/run/openvswitch/db.sock 41 | environment: 42 | - SKYDIVE_AGENT_TOPOLOGY_NETNS_RUN_PATH=/host/run 43 | - SKYDIVE_ANALYZERS=127.0.0.1:8082 44 | 45 | networks: 46 | skynet: 47 | -------------------------------------------------------------------------------- /contrib/docker/skydive.yml: -------------------------------------------------------------------------------- 1 | agent: 2 | topology: 3 | probes: 4 | - ovsdb 5 | - docker 6 | - runc 7 | 8 | runc: 9 | run_path: 10 | - /var/run/runc 11 | - /var/run/runc-ctrs 12 | 13 | analyzer: 14 | listen: 0.0.0.0:8082 15 | -------------------------------------------------------------------------------- /contrib/fleet/Makefile: -------------------------------------------------------------------------------- 1 | include ../../.mk/k8s.mk 2 | 3 | .PHONY: install uinstall status logs 4 | install uninstall status logs: $(TOOLSBIN)/k3d $(TOOLSBIN)/helm $(TOOLSBIN)/kubectl $(TOOLSBIN)/jq 5 | ./skydive.sh $@ 6 | 7 | .PHONY: broker east west 8 | broker east west: $(TOOLSBIN)/kubectl 9 | kubectl --context k3d-$@ port-forward service/skydive-analyzer 8082:8082 10 | -------------------------------------------------------------------------------- /contrib/jsonof/Makefile: -------------------------------------------------------------------------------- 1 | 2 | .PHONY: all 3 | all: jsonof 4 | 5 | jsonof: jsonof.go 6 | go build jsonof.go 7 | 8 | clean: 9 | rm -f jsonof 10 | -------------------------------------------------------------------------------- /contrib/kubernetes/README.md: -------------------------------------------------------------------------------- 1 | # Skydive Kubernetes 2 | 3 | ## Usage 4 | 5 | To install run: 6 | 7 | ``` 8 | kubectl apply -f skydive.yaml 9 | ``` 10 | 11 | To expose UI management port: 12 | 13 | ``` 14 | kubectl port-forward service/skydive-analyzer 8082:8082 15 | ``` 16 | 17 | To uninstall run: 18 | 19 | ``` 20 | kubectl delete -f skydive.yaml 21 | ``` 22 | 23 | ## Configuration 24 | 25 | Change analyzer listening port from 8082 to 18082: 26 | 27 | ``` 28 | cat skydive.yaml | sed -e s/8082/18082/ | kubectl apply -f - 29 | ``` 30 | 31 | Change agent listening port from 8081 to 18081: 32 | 33 | ``` 34 | cat skydive.yaml | sed -e s/8081/18081/ | kubectl apply -f - 35 | ``` 36 | 37 | Change elasticsearch port from 9200 to 19200: 38 | 39 | ``` 40 | cat skydive.yaml | sed -e s/9200/19200/ | kubectl apply -f - 41 | ``` 42 | 43 | Change etcd port from 12379/12380 to 22379/22380: 44 | 45 | ``` 46 | cat skydive.yaml | sed -e s/12379/22379/ -e s/12380/22380/ | kubectl apply -f - 47 | ``` 48 | 49 | Deploy to namespace `mynamespace` instead of `default`: 50 | 51 | ``` 52 | cat skydive.yaml | sed -e "s/namespace: default/namespace: mynamespace/" | kubectl apply -n mynamespace -f - 53 | ``` 54 | -------------------------------------------------------------------------------- /contrib/packaging/rpm/generate-skydive-bootstrap.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -v 4 | 5 | function usage { 6 | echo "Usage: $0 [-b|-s|-a|-l] [-r tag_or_commit]" 7 | } 8 | 9 | gitdir=$(cd "$(dirname "$0")/../../.."; pwd) 10 | rpmbuilddir=$gitdir/rpmbuild 11 | 12 | target=dist 13 | from=HEAD 14 | build_opts=-ba 15 | 16 | while getopts ":asblr:" opt; do 17 | case $opt in 18 | a) 19 | build_opts="-ba" 20 | ;; 21 | s) 22 | build_opts="-bs" 23 | ;; 24 | b) 25 | build_opts="-bb" 26 | ;; 27 | l) 28 | target="localdist" 29 | ;; 30 | r) 31 | from=$OPTARG 32 | ;; 33 | \?) 34 | echo "Invalid option: -$OPTARG" >&2 35 | usage 36 | exit 1 37 | ;; 38 | esac 39 | done 40 | 41 | version=$(make -C $gitdir -s version) 42 | define="fullver ${version}" 43 | 44 | set -e 45 | 46 | mkdir -p $rpmbuilddir/SOURCES 47 | mkdir -p $rpmbuilddir/SPECS 48 | make -C $gitdir $target DESTDIR=$rpmbuilddir/SOURCES 49 | $(dirname "$0")/specfile-update-bundles $gitdir/go.mod $gitdir/contrib/packaging/rpm/skydive.spec > $rpmbuilddir/SPECS/skydive.spec 50 | set -x 51 | rpmbuild --nodeps $build_opts --undefine dist --define "$define" --define "_topdir $rpmbuilddir" $rpmbuilddir/SPECS/skydive.spec 52 | set +x 53 | rm -rf $rpmbuilddir/BUILD/skydive-$version 54 | -------------------------------------------------------------------------------- /contrib/packaging/rpm/skydive-agent.sysconfig: -------------------------------------------------------------------------------- 1 | SKYDIVE_AGENT_OPTIONS= 2 | -------------------------------------------------------------------------------- /contrib/packaging/rpm/skydive-analyzer.sysconfig: -------------------------------------------------------------------------------- 1 | SKYDIVE_ANALYZER_OPTIONS= 2 | -------------------------------------------------------------------------------- /contrib/packaging/rpm/skydive.fc: -------------------------------------------------------------------------------- 1 | /usr/bin/skydive -- gen_context(system_u:object_r:skydive_exec_t,s0) 2 | /var/lib/skydive(/.*)? gen_context(system_u:object_r:skydive_var_lib_t,s0) 3 | -------------------------------------------------------------------------------- /contrib/packaging/rpm/specfile-update-bundles: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | import json 4 | import subprocess 5 | import sys 6 | 7 | BUNDLE_MARKER = "### AUTO-BUNDLED-GEN-ENTRY-POINT" 8 | 9 | def usage(): 10 | print(sys.argv[0], " ") 11 | 12 | if len(sys.argv) != 3: 13 | usage() 14 | sys.exit(0) 15 | 16 | provides = [] 17 | mod = json.loads(subprocess.check_output(["go", "mod", "edit", "-json", sys.argv[1]])) 18 | for package in mod["Require"]: 19 | provides.append("Provides: bundled(golang(%s)) = %s" % (package["Path"], package["Version"].split("-")[-1].split("+")[0])) 20 | 21 | spec = open(sys.argv[2]).read() 22 | spec = spec.replace(BUNDLE_MARKER, "\n".join(provides)) 23 | print(spec) 24 | -------------------------------------------------------------------------------- /contrib/python/api/README.md: -------------------------------------------------------------------------------- 1 | # Skydive Python client library 2 | 3 | Skydive is an open source real-time network topology and protocols analyzer. 4 | It aims to provide a comprehensive way of understanding what is happening in 5 | the network infrastructure. 6 | 7 | Skydive project is hosted on [GitHub](https://github.com/skydive-project/skydive) 8 | 9 | This library provides classes for REST and WebSocket based clients. 10 | -------------------------------------------------------------------------------- /contrib/python/api/requirements.txt: -------------------------------------------------------------------------------- 1 | autobahn>=0.17.1 2 | trollius>=2.1;python_version<'3.0' 3 | asyncio>=3.4.3;python_version>='3.0' 4 | requests>=2.14.2 5 | 6 | -------------------------------------------------------------------------------- /contrib/python/api/samples/requirements.txt: -------------------------------------------------------------------------------- 1 | aionotify==0.2.0 2 | -------------------------------------------------------------------------------- /contrib/python/api/setup.cfg: -------------------------------------------------------------------------------- 1 | [metadata] 2 | name = skydive-client 3 | url = https://github.com/skydive-project/skydive 4 | summary = Skydive Python client library 5 | description-file = README.md 6 | author = Sylvain Afchain 7 | author-email = safchain@gmail.com 8 | home-page = https://github.com/skydive-project/skydive 9 | classifier = 10 | Intended Audience :: Information Technology 11 | Intended Audience :: Developers 12 | License :: OSI Approved :: Apache Software License 13 | Operating System :: POSIX :: Linux 14 | Programming Language :: Python 15 | Programming Language :: Python :: 2 16 | Programming Language :: Python :: 2.7 17 | Programming Language :: Python :: 3 18 | Programming Language :: Python :: 3.4 19 | Programming Language :: Python :: 3.5 20 | -------------------------------------------------------------------------------- /contrib/python/api/setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup 2 | import sys 3 | 4 | 5 | def get_install_requires(): 6 | install_requires = ['autobahn>=0.17.1', 'requests>=2.14.2'] 7 | if sys.version_info[0] < 3: 8 | install_requires.append('trollius>=2.1') 9 | else: 10 | install_requires.append('asyncio>=3.4.3') 11 | return install_requires 12 | 13 | 14 | setup(name='skydive-client', 15 | version='0.10.0', 16 | description='Skydive Python client library', 17 | url='http://github.com/skydive-project/skydive', 18 | author='Sylvain Afchain', 19 | author_email='safchain@gmail.com', 20 | license='Apache2', 21 | packages=['skydive', 'skydive.rest', 'skydive.websocket'], 22 | entry_points={ 23 | 'console_scripts': [ 24 | 'skydive-ws-client = skydive.wsshell:main', 25 | ], 26 | }, 27 | install_requires=get_install_requires(), 28 | zip_safe=False) 29 | -------------------------------------------------------------------------------- /contrib/python/api/skydive/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/contrib/python/api/skydive/__init__.py -------------------------------------------------------------------------------- /contrib/python/api/skydive/encoder.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2017 Red Hat, Inc. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy ofthe License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specificlanguage governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | import json 18 | 19 | 20 | class JSONEncoder(json.JSONEncoder): 21 | def default(self, obj): 22 | if hasattr(obj, "repr_json"): 23 | return obj.repr_json() 24 | else: 25 | return json.JSONEncoder.default(self, obj) 26 | -------------------------------------------------------------------------------- /contrib/python/api/skydive/rest/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/contrib/python/api/skydive/rest/__init__.py -------------------------------------------------------------------------------- /contrib/python/api/skydive/tls.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2020 Sylvain Baubeau 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy ofthe License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specificlanguage governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | import ssl 18 | 19 | 20 | def create_ssl_context(insecure=False, cafile="", certfile="", keyfile=""): 21 | context = ssl.create_default_context() 22 | 23 | if insecure: 24 | context.check_hostname = False 25 | context.verify_mode = ssl.CERT_NONE 26 | 27 | if cafile: 28 | context.load_verify_locations(cafile) 29 | 30 | if certfile and keyfile: 31 | context.load_cert_chain(certfile=certfile, keyfile=keyfile) 32 | 33 | return context 34 | -------------------------------------------------------------------------------- /contrib/python/api/skydive/websocket/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/contrib/python/api/skydive/websocket/__init__.py -------------------------------------------------------------------------------- /contrib/snort/Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: all 2 | all: snortSkydive 3 | 4 | .PHONY: clean 5 | clean: 6 | rm -rf snortSkydive 7 | 8 | snortSkydive: snortSkydive.go 9 | go build -o $$GOPATH/bin/snort-skydive $< 10 | -------------------------------------------------------------------------------- /contrib/systemd/skydive-agent.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Skydive agent 3 | After=network-online.target openvswitch.service docker.service 4 | 5 | [Service] 6 | Type=simple 7 | EnvironmentFile=-/etc/sysconfig/skydive-agent 8 | ExecStart=/usr/bin/skydive agent $SKYDIVE_AGENT_OPTIONS --conf /etc/skydive/skydive.yml 9 | Restart=on-failure 10 | 11 | [Install] 12 | WantedBy=multi-user.target 13 | -------------------------------------------------------------------------------- /contrib/systemd/skydive-analyzer.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Skydive analyzer 3 | After=network-online.target elasticsearch.service 4 | 5 | [Service] 6 | Type=simple 7 | EnvironmentFile=-/etc/sysconfig/skydive-analyzer 8 | ExecStart=/usr/bin/skydive analyzer $SKYDIVE_ANALYZER_OPTIONS --conf /etc/skydive/skydive.yml 9 | Restart=on-failure 10 | 11 | [Install] 12 | WantedBy=multi-user.target 13 | -------------------------------------------------------------------------------- /contrib/vagrant/playbook-dev.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Deploy dev role 3 | hosts: all 4 | become: yes 5 | tasks: 6 | - include_role: 7 | name: skydive_dev 8 | tasks_from: centos 9 | - include_role: 10 | name: skydive_dev 11 | tasks_from: runtime 12 | - include_role: 13 | name: skydive_dev 14 | tasks_from: tests 15 | tags: 16 | - skydive_functional_tests -------------------------------------------------------------------------------- /contrib/vagrant/playbook-es.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install elasticsearch 3 | hosts: elasticsearch 4 | roles: 5 | - role: elastic.elasticsearch 6 | es_major_version: "6.x" 7 | es_version: "6.6.0" 8 | es_instance_name: "{{ inventory_hostname }}" 9 | es_heap_size: 256m 10 | es_config: 11 | network.host: 0.0.0.0 12 | http.cors.enabled: true 13 | http.cors.allow-origin: "*" 14 | ignore_errors: yes 15 | -------------------------------------------------------------------------------- /contrib/vagrant/provisioning: -------------------------------------------------------------------------------- 1 | ../ansible -------------------------------------------------------------------------------- /contrib/vagrant/requirements.yml: -------------------------------------------------------------------------------- 1 | - src: elastic.elasticsearch 2 | version: 7.5.1 3 | -------------------------------------------------------------------------------- /contrib/vagrant/roles/skydive_dev: -------------------------------------------------------------------------------- 1 | ../../ansible/roles/skydive_dev -------------------------------------------------------------------------------- /contrib/vagrant/setup-common.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | sudo yum -y install python2 python-yaml libpcap ntpdate audit 4 | sudo setenforce 0 5 | sudo sed -i 's/SELINUX=enforcing/SELINUX=permissive/' /etc/sysconfig/selinux 6 | -------------------------------------------------------------------------------- /contrib/vagrant/start-agent.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | sudo systemctl start skydive-agent.service 4 | -------------------------------------------------------------------------------- /contrib/vagrant/start-analyzer.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | sudo systemctl start skydive-analyzer 4 | -------------------------------------------------------------------------------- /devstack/local.conf.cpu: -------------------------------------------------------------------------------- 1 | [[local|localrc]] 2 | HOST_IP=192.168.0.57 3 | 4 | SERVICE_HOST=192.168.0.56 5 | 6 | MYSQL_HOST=${SERVICE_HOST} 7 | RABBIT_HOST=${SERVICE_HOST} 8 | GLANCE_HOSTPORT=${SERVICE_HOST}:9292 9 | ADMIN_PASSWORD=password 10 | MYSQL_PASSWORD=password 11 | RABBIT_PASSWORD=password 12 | SERVICE_PASSWORD=password 13 | 14 | ENABLED_SERVICES=n-cpu,rabbit,q-agt 15 | 16 | enable_plugin skydive https://github.com/skydive-project/skydive.git 17 | enable_service skydive-agent 18 | 19 | SKYDIVE_ANALYZERS=${SERVICE_HOST}:8082 20 | SKYDIVE_ANALYZER_ETCD=${SERVICE_HOST}:12379 21 | SKYDIVE_AGENT_LISTEN=${HOST_IP}:8081 22 | -------------------------------------------------------------------------------- /devstack/local.conf.full: -------------------------------------------------------------------------------- 1 | [[local|localrc]] 2 | HOST_IP=192.168.0.56 3 | 4 | SERVICE_HOST=${HOST_IP} 5 | 6 | MYSQL_HOST=${HOST_IP} 7 | RABBIT_HOST=${HOST_IP} 8 | GLANCE_HOSTPORT=${HOST_IP}:9292 9 | ADMIN_PASSWORD=password 10 | DATABASE_PASSWORD=password 11 | RABBIT_PASSWORD=password 12 | SERVICE_PASSWORD=password 13 | 14 | disable_service n-net 15 | ENABLED_SERVICES+=,q-svc,q-dhcp,q-meta,q-agt,q-l3 16 | 17 | enable_plugin skydive https://github.com/skydive-project/skydive.git 18 | enable_service skydive-agent skydive-analyzer 19 | 20 | SKYDIVE_ANALYZER_LISTEN=${HOST_IP}:8082 21 | SKYDIVE_ANALYZER_ETCD=${HOST_IP}:12379 22 | SKYDIVE_ANALYZERS=${HOST_IP}:8082 23 | SKYDIVE_AGENT_LISTEN=${HOST_IP}:8081 24 | 25 | # When using multiple nodes in your Devstack, you need to 26 | # specify the nodes and their public interface 27 | # SKYDIVE_PUBLIC_INTERFACES=devstack1/eth0 devstack2/eth1 28 | -------------------------------------------------------------------------------- /devstack/override-defaults: -------------------------------------------------------------------------------- 1 | ELASTICSEARCH_VERSION=2.0 2 | 3 | -------------------------------------------------------------------------------- /devstack/settings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/devstack/settings -------------------------------------------------------------------------------- /dpdk/Makefile: -------------------------------------------------------------------------------- 1 | PROJECT_ROOT := $(abspath $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/..) 2 | 3 | DPDK_VERSION = 17.08 4 | DPDK_DIR = dpdk-$(DPDK_VERSION) 5 | export RTE_SDK = $(PROJECT_ROOT)/dpdk/$(DPDK_DIR) 6 | export RTE_TARGET = x86_64-native-linuxapp-gcc 7 | 8 | DPDK_INSTALL_DIR=$(RTE_TARGET)-install 9 | 10 | 11 | .PHONY: all 12 | all: $(DPDK_DIR)/$(DPDK_INSTALL_DIR) 13 | 14 | 15 | $(DPDK_DIR): 16 | curl http://fast.dpdk.org/rel/dpdk-$(DPDK_VERSION).tar.xz | tar xJ 17 | 18 | $(DPDK_DIR)/$(DPDK_INSTALL_DIR): $(DPDK_DIR) 19 | $(MAKE) -C $(DPDK_DIR) config T=$(RTE_TARGET) 20 | $(MAKE) -C $(DPDK_DIR) install T=$(RTE_TARGET) DESTDIR=$(DPDK_INSTALL_DIR) EXTRA_CFLAGS=-fPIC 21 | 22 | clean: 23 | rm -rf $(DPDK_DIR) 24 | -------------------------------------------------------------------------------- /ebpf/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM fedora:30 2 | RUN dnf install -y kernel-devel make binutils golang go-bindata git cmake gcc g++ llvm clang 3 | -------------------------------------------------------------------------------- /flow/layers/dhcpv4.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | package layers; 3 | 4 | option go_package = "github.com/skydive-project/skydive/flow/layers"; 5 | 6 | // LayerDHCPv4 wrapper to generate extra layer 7 | message DHCPv4 { 8 | bytes contents = 1; 9 | bytes payload = 2; 10 | uint32 hardware_len = 3; 11 | uint32 hardware_opts = 4; 12 | uint32 xid = 5; 13 | uint32 secs = 6; 14 | uint32 flags = 7; 15 | bytes server_name = 8; 16 | bytes file = 9; 17 | } 18 | -------------------------------------------------------------------------------- /flow/layers/vrrpv2.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | package layers; 3 | 4 | option go_package = "github.com/skydive-project/skydive/flow/layers"; 5 | 6 | // LayerVRRPv2 wrapper to generate extra layer 7 | message VRRPv2 { 8 | bytes contents = 1; 9 | bytes payload = 2; 10 | uint32 version = 3; 11 | uint32 virtual_rtrID = 4; 12 | uint32 priority = 5; 13 | uint32 count_ipaddr = 6; 14 | uint32 adver_int = 7; 15 | uint32 checksum = 8; 16 | } 17 | -------------------------------------------------------------------------------- /flow/no_ebpf.go: -------------------------------------------------------------------------------- 1 | //go:build !linux 2 | 3 | /* 4 | * Copyright (C) 2016 Red Hat, Inc. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy ofthe License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specificlanguage governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | 20 | package flow 21 | 22 | // EBPFFlow Wrapper type used for passing flows from probe to main agent routine 23 | type EBPFFlow struct { 24 | KernFlow interface{} 25 | } 26 | 27 | func kernFlowKey(kernFlow interface{}) uint64 { 28 | return 0 29 | } 30 | 31 | func (ft *Table) newFlowFromEBPF(ebpfFlow *EBPFFlow, key uint64) ([]string, []*Flow, error) { 32 | return nil, nil, nil 33 | } 34 | 35 | func (ft *Table) updateFlowFromEBPF(ebpfFlow *EBPFFlow, f *Flow) bool { 36 | return false 37 | } 38 | -------------------------------------------------------------------------------- /flow/ondemand/ondemand.go: -------------------------------------------------------------------------------- 1 | //go:generate go run github.com/mailru/easyjson/easyjson $GOFILE 2 | 3 | /* 4 | * Copyright (C) 2019 Red Hat, Inc. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy ofthe License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specificlanguage governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | 20 | package ondemand 21 | 22 | import ( 23 | "github.com/skydive-project/skydive/api/types" 24 | ) 25 | 26 | // CaptureQuery describes a query for the capture API 27 | // easyjson:json 28 | type CaptureQuery struct { 29 | NodeID string 30 | Capture types.Capture 31 | } 32 | -------------------------------------------------------------------------------- /flow/pcaptraces/contrail-udp-mpls-eth-and-ipv4.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/flow/pcaptraces/contrail-udp-mpls-eth-and-ipv4.pcap -------------------------------------------------------------------------------- /flow/pcaptraces/dns.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/flow/pcaptraces/dns.pcap -------------------------------------------------------------------------------- /flow/pcaptraces/erspanII.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/flow/pcaptraces/erspanII.pcap -------------------------------------------------------------------------------- /flow/pcaptraces/eth-ip4-arp-dns-req-http-google.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/flow/pcaptraces/eth-ip4-arp-dns-req-http-google.pcap -------------------------------------------------------------------------------- /flow/pcaptraces/eth-ipv4-tcp-http-ooo.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/flow/pcaptraces/eth-ipv4-tcp-http-ooo.pcap -------------------------------------------------------------------------------- /flow/pcaptraces/geneve.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/flow/pcaptraces/geneve.pcap -------------------------------------------------------------------------------- /flow/pcaptraces/gre-gre-icmpv4.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/flow/pcaptraces/gre-gre-icmpv4.pcap -------------------------------------------------------------------------------- /flow/pcaptraces/gre-mpls-icmpv4.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/flow/pcaptraces/gre-mpls-icmpv4.pcap -------------------------------------------------------------------------------- /flow/pcaptraces/icmp-vlan.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/flow/pcaptraces/icmp-vlan.pcap -------------------------------------------------------------------------------- /flow/pcaptraces/icmpv4-4vlanQinQ-id-8-10-20-30.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/flow/pcaptraces/icmpv4-4vlanQinQ-id-8-10-20-30.pcap -------------------------------------------------------------------------------- /flow/pcaptraces/icmpv4-symetric.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/flow/pcaptraces/icmpv4-symetric.pcap -------------------------------------------------------------------------------- /flow/pcaptraces/icmpv4-truncated.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/flow/pcaptraces/icmpv4-truncated.pcap -------------------------------------------------------------------------------- /flow/pcaptraces/iperf-same-L2L3.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/flow/pcaptraces/iperf-same-L2L3.pcap -------------------------------------------------------------------------------- /flow/pcaptraces/ipv4-fragments.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/flow/pcaptraces/ipv4-fragments.pcap -------------------------------------------------------------------------------- /flow/pcaptraces/layer-key-mode.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/flow/pcaptraces/layer-key-mode.pcap -------------------------------------------------------------------------------- /flow/pcaptraces/link-type-12.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/flow/pcaptraces/link-type-12.pcap -------------------------------------------------------------------------------- /flow/pcaptraces/ntp-corrupted.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/flow/pcaptraces/ntp-corrupted.pcap -------------------------------------------------------------------------------- /flow/pcaptraces/ping-with-without-ethernet.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/flow/pcaptraces/ping-with-without-ethernet.pcap -------------------------------------------------------------------------------- /flow/pcaptraces/simple-tcpv4.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/flow/pcaptraces/simple-tcpv4.pcap -------------------------------------------------------------------------------- /flow/pcaptraces/simple-tcpv6.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/flow/pcaptraces/simple-tcpv6.pcap -------------------------------------------------------------------------------- /flow/pcaptraces/vxlan-icmpv4-truncated.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/flow/pcaptraces/vxlan-icmpv4-truncated.pcap -------------------------------------------------------------------------------- /flow/pcaptraces/vxlan-src-port.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/flow/pcaptraces/vxlan-src-port.pcap -------------------------------------------------------------------------------- /flow/probes/dpdk/no_dpdk.go: -------------------------------------------------------------------------------- 1 | //go:build !dpdk 2 | 3 | /* 4 | * Copyright (C) 2017 Red Hat, Inc. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy ofthe License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specificlanguage governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | 20 | package dpdk 21 | 22 | import ( 23 | "github.com/skydive-project/skydive/flow/probes" 24 | "github.com/skydive-project/skydive/probe" 25 | ) 26 | 27 | // NewProbe returns a new DPDK probe 28 | func NewProbe(ctx probes.Context, bundle *probe.Bundle) (probes.FlowProbeHandler, error) { 29 | return nil, probe.ErrNotCompiled 30 | } 31 | -------------------------------------------------------------------------------- /flow/probes/ebpf/no_ebpf.go: -------------------------------------------------------------------------------- 1 | //go:build !ebpf 2 | 3 | /* 4 | * Copyright (C) 2017 Red Hat, Inc. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy ofthe License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specificlanguage governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | 20 | package ebpf 21 | 22 | import ( 23 | "github.com/skydive-project/skydive/flow/probes" 24 | "github.com/skydive-project/skydive/probe" 25 | ) 26 | 27 | // NewProbe returns a new eBPF probe 28 | func NewProbe(ctx probes.Context, bundle *probe.Bundle) (probes.FlowProbeHandler, error) { 29 | return nil, probe.ErrNotCompiled 30 | } 31 | -------------------------------------------------------------------------------- /flow/probes/gopacket/no_gopacket.go: -------------------------------------------------------------------------------- 1 | //go:build !linux 2 | 3 | /* 4 | * Copyright (C) 2016 Red Hat, Inc. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy ofthe License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specificlanguage governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | 20 | package gopacket 21 | 22 | import ( 23 | "github.com/skydive-project/skydive/flow/probes" 24 | "github.com/skydive-project/skydive/probe" 25 | ) 26 | 27 | // NewProbe returns a new GoPacket probe 28 | func NewProbe(ctx probes.Context, bundle *probe.Bundle) (probes.FlowProbeHandler, error) { 29 | return nil, probe.ErrNotImplemented 30 | } 31 | -------------------------------------------------------------------------------- /flow/probes/ovsmirror/no_ovsmirror.go: -------------------------------------------------------------------------------- 1 | // +build !linux 2 | 3 | /* 4 | * Copyright (C) 2018 Red Hat, Inc. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy ofthe License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specificlanguage governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | 20 | package ovsmirror 21 | 22 | import ( 23 | "github.com/skydive-project/skydive/flow/probes" 24 | "github.com/skydive-project/skydive/probe" 25 | ) 26 | 27 | // NewProbe returns an empty flow probe handler and an error 28 | func NewProbe(ctx probes.Context, bundle *probe.Bundle) (probes.FlowProbeHandler, error) { 29 | return nil, probe.ErrNotImplemented 30 | } 31 | -------------------------------------------------------------------------------- /graffiti/api/client/client.go: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 Red Hat, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy ofthe License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specificlanguage governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | 18 | package client 19 | 20 | // Operation describes a JSONPatch operation 21 | type Operation struct { 22 | Op string `json:"op"` 23 | Path string `json:"path"` 24 | Value interface{} `json:"value"` 25 | } 26 | 27 | // JSONPatch describes a JSON patch 28 | type JSONPatch []Operation 29 | 30 | // NewPatchOperation creates a new JSON patch operation 31 | func NewPatchOperation(op, path string, value ...interface{}) Operation { 32 | patchOperation := Operation{ 33 | Op: op, 34 | Path: path, 35 | } 36 | if len(value) > 0 { 37 | patchOperation.Value = value[0] 38 | } 39 | return patchOperation 40 | } 41 | -------------------------------------------------------------------------------- /graffiti/assets/assets.go: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020 Sylvain Baubeau 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy ofthe License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specificlanguage governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | 18 | package assets 19 | 20 | // Assets is the interface by an asset provider 21 | type Assets interface { 22 | Asset(name string) ([]byte, error) 23 | } 24 | -------------------------------------------------------------------------------- /graffiti/cmd/client/terminal_unix.go: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Red Hat, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy ofthe License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specificlanguage governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | 18 | package client 19 | 20 | import ( 21 | "fmt" 22 | ) 23 | 24 | func cursorUp() { 25 | fmt.Print("\x1b[1A") 26 | } 27 | 28 | func eraseInLine() { 29 | fmt.Print("\x1b[0K") 30 | } 31 | -------------------------------------------------------------------------------- /graffiti/graffiti.go: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 Red Hat, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy ofthe License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specificlanguage governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | 18 | package main 19 | 20 | import ( 21 | "github.com/skydive-project/skydive/graffiti/cmd" 22 | "github.com/skydive-project/skydive/graffiti/cmd/client" 23 | "github.com/spf13/cobra" 24 | ) 25 | 26 | var rootCmd = &cobra.Command{ 27 | Use: "graffiti [sub]", 28 | Short: "Graffiti", 29 | SilenceUsage: true, 30 | } 31 | 32 | func main() { 33 | client.ClientCmd.PersistentFlags().StringVarP(&client.HubAddress, "hub", "", "127.0.0.1:8082", "hub address") 34 | 35 | rootCmd.AddCommand(cmd.HubCmd) 36 | rootCmd.AddCommand(cmd.PodCmd) 37 | rootCmd.AddCommand(client.ClientCmd) 38 | rootCmd.Execute() 39 | } 40 | -------------------------------------------------------------------------------- /graffiti/graph/memory_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 Red Hat, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy ofthe License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specificlanguage governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | 18 | package graph 19 | 20 | import ( 21 | "testing" 22 | ) 23 | 24 | func TestAddEdgeMissingNode(t *testing.T) { 25 | b, err := NewMemoryBackend() 26 | if err != nil { 27 | t.Error(err) 28 | } 29 | 30 | e := &Edge{ 31 | Parent: "aaa", 32 | Child: "bbb", 33 | graphElement: graphElement{ 34 | ID: GenID(), 35 | Host: "host", 36 | }, 37 | } 38 | 39 | if err := b.EdgeAdded(e); err == nil { 40 | t.Errorf("Edge inserted with missing nodes: %s", err) 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /graffiti/graph/traversal/token_string.go: -------------------------------------------------------------------------------- 1 | // Code generated by "stringer -type=Token tokens.go"; DO NOT EDIT. 2 | 3 | package traversal 4 | 5 | import "strconv" 6 | 7 | const _Token_name = "ILLEGALEOFWSIDENTCOMMADOTLEFTPARENTHESISRIGHTPARENTHESISSTRINGNUMBERGVEHASHASKEYHASNOTHASEITHEROUTINOUTVINVBOTHVOUTEINEBOTHEDEDUPWITHINWITHOUTMETADATASHORTESTPATHTONENEEBOTHCONTEXTREGEXLTGTLTEGTEINSIDEOUTSIDEBETWEENCOUNTRANGELIMITSORTVALUESKEYSSUMASCDESCIPV4RANGESUBGRAPHFOREVERNOWASSELECTTRUEFALSE" 8 | 9 | var _Token_index = [...]uint16{0, 7, 10, 12, 17, 22, 25, 40, 56, 62, 68, 69, 70, 71, 74, 80, 86, 95, 98, 100, 104, 107, 112, 116, 119, 124, 129, 135, 142, 150, 164, 166, 169, 173, 180, 185, 187, 189, 192, 195, 201, 208, 215, 220, 225, 230, 234, 240, 244, 247, 250, 254, 263, 271, 278, 281, 283, 289, 293, 298} 10 | 11 | func (i Token) String() string { 12 | if i < 0 || i >= Token(len(_Token_index)-1) { 13 | return "Token(" + strconv.FormatInt(int64(i), 10) + ")" 14 | } 15 | return _Token_name[_Token_index[i]:_Token_index[i+1]] 16 | } 17 | -------------------------------------------------------------------------------- /graffiti/graph/traversal/traversal_extension.go: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Red Hat, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy ofthe License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specificlanguage governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | 18 | package traversal 19 | 20 | // GremlinTraversalExtension interface for Gremlin language extension 21 | type GremlinTraversalExtension interface { 22 | ScanIdent(s string) (Token, bool) 23 | ParseStep(t Token, p GremlinTraversalContext) (GremlinTraversalStep, error) 24 | } 25 | -------------------------------------------------------------------------------- /graffiti/js/bootstrap.js: -------------------------------------------------------------------------------- 1 | var api = require("./api"); 2 | var client = new Client(); -------------------------------------------------------------------------------- /graffiti/js/otto.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 Red Hat, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy ofthe License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specificlanguage governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | 18 | var globals = this; 19 | 20 | function require(m) { 21 | var module = {} 22 | var keys = Object.keys(globals) 23 | for (var i in keys) { 24 | var key = keys[i] 25 | module[key] = globals[key] 26 | } 27 | return module; 28 | } 29 | 30 | Promise.prototype.finally = function (f) { 31 | return this.then(function (value) { 32 | return Promise.resolve(f()).then(function () { 33 | return value; 34 | }); 35 | }, function (err) { 36 | return Promise.resolve(f()).then(function () { 37 | throw err; 38 | }); 39 | }); 40 | }; 41 | -------------------------------------------------------------------------------- /graffiti/js/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "graffiti-api", 3 | "version": "0.0.1", 4 | "description": "Graffiti API", 5 | "main": "api.js", 6 | "dependencies": { 7 | "@formschema/native": "^1.1.1", 8 | "browser-or-node": "1.0.2", 9 | "browserify": "^16.2.3", 10 | "lodash.defaultsdeep": "^4.6.1", 11 | "najax": "1.0.3", 12 | "qs": "^6.9.1", 13 | "typescript": "^2.9.2", 14 | "vue-form-generator": "^2.3.4" 15 | }, 16 | "scripts": { 17 | "test": "echo \"Error: no test specified\" && exit 1" 18 | }, 19 | "author": "Sylvain Baubeau", 20 | "license": "Apache-2.0", 21 | "repository": { 22 | "type": "git", 23 | "url": "git+https://github.com/skydive-project/skydive.git" 24 | }, 25 | "bugs": { 26 | "url": "https://github.com/skydive-project/skydive/issues" 27 | }, 28 | "homepage": "https://github.com/skydive-project/skydive#readme" 29 | } 30 | -------------------------------------------------------------------------------- /graffiti/js/promise-done-7.0.4.min.js: -------------------------------------------------------------------------------- 1 | "function"!=typeof Promise.prototype.done&&(Promise.prototype.done=function(t,n){var o=arguments.length?this.then.apply(this,arguments):this;o.then(null,function(t){setTimeout(function(){throw t},0)})}); 2 | //# sourceMappingURL=/polyfills/promise-done-7.0.4.min.js.map -------------------------------------------------------------------------------- /graffiti/logging/no_syslog.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | /* 4 | * Copyright (C) 2018 Red Hat, Inc. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy ofthe License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specificlanguage governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | 20 | package logging 21 | 22 | import "errors" 23 | 24 | func NewSyslogBackend(protocol, address, tag string) (Backend, error) { 25 | return nil, errors.New("Syslog backend is only supported on Linux and Unix") 26 | } 27 | -------------------------------------------------------------------------------- /graffiti/service/service.go: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Red Hat, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy ofthe License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specificlanguage governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | 18 | package service 19 | 20 | // Type describes the service type 21 | type Type string 22 | 23 | func (t Type) String() string { 24 | return string(t) 25 | } 26 | -------------------------------------------------------------------------------- /graffiti/storage/storage.go: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 Red Hat, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy ofthe License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specificlanguage governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | 18 | package storage 19 | 20 | // EventListener storage event propagated 21 | type EventListener interface { 22 | OnStarted() 23 | } 24 | -------------------------------------------------------------------------------- /js/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "skydive-api", 3 | "version": "0.0.1", 4 | "description": "Skydive API", 5 | "main": "api.js", 6 | "dependencies": { 7 | "@formschema/native": "^1.1.1", 8 | "browser-or-node": "^1.0.2", 9 | "browserify": "^16.2.3", 10 | "lodash.defaultsdeep": "^4.6.1", 11 | "najax": "1.0.3", 12 | "qs": "^6.9.1", 13 | "typescript": "^2.9.2", 14 | "vue-form-generator": "^2.3.4", 15 | "graffiti-api": "file:../graffiti/js" 16 | }, 17 | "scripts": { 18 | "test": "echo \"Error: no test specified\" && exit 1" 19 | }, 20 | "author": "Sylvain Baubeau", 21 | "license": "Apache-2.0", 22 | "repository": { 23 | "type": "git", 24 | "url": "git+https://github.com/skydive-project/skydive.git" 25 | }, 26 | "bugs": { 27 | "url": "https://github.com/skydive-project/skydive/issues" 28 | }, 29 | "homepage": "https://github.com/skydive-project/skydive#readme" 30 | } 31 | -------------------------------------------------------------------------------- /netns/no_netns.go: -------------------------------------------------------------------------------- 1 | // +build !linux 2 | 3 | /* 4 | * Copyright (C) 2018 Red Hat, Inc. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy ofthe License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specificlanguage governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | 20 | package netns 21 | 22 | import "errors" 23 | 24 | // Context describes a NameSpace Context switch API 25 | type Context struct { 26 | } 27 | 28 | // Quit the NameSpace and go back to the original one 29 | func (n *Context) Quit() error { 30 | return nil 31 | } 32 | 33 | // Close the NameSpace 34 | func (n *Context) Close() { 35 | } 36 | 37 | // NewContext creates a new NameSpace context base on path 38 | func NewContext(path string) (*Context, error) { 39 | if path != "" { 40 | return nil, errors.New("Network namespaces are only supported on Linux") 41 | } 42 | 43 | return &Context{}, nil 44 | } 45 | -------------------------------------------------------------------------------- /openflow/protocol.go: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 Red Hat, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy ofthe License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specificlanguage governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | 18 | package openflow 19 | 20 | import ( 21 | "github.com/skydive-project/goloxi" 22 | ) 23 | 24 | // Protocol describes the immutable part of an OpenFlow protocol version 25 | type Protocol interface { 26 | String() string 27 | GetVersion() uint8 28 | DecodeMessage(data []byte) (goloxi.Message, error) 29 | NewHello(versionBitmap uint32) goloxi.Message 30 | NewEchoRequest() goloxi.Message 31 | NewEchoReply() goloxi.Message 32 | NewBarrierRequest() goloxi.Message 33 | } 34 | -------------------------------------------------------------------------------- /scripts/ci/build-copr.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if [ -z "$REF" ] || [ -z "$COPR_LOGIN" ] || [ -z "$COPR_TOKEN" ]; then 4 | echo "The environment variables REF, COPR_LOGIN and COPR_TOKEN need to be defined" 5 | exit 1 6 | fi 7 | 8 | set -v 9 | set -e 10 | 11 | TAG=`echo $REF | awk -F '/' '{print $NF}'` 12 | VERSION=`echo $TAG | tr -d [a-z]` 13 | [ -z "$VERSION" ] && TAG=HEAD || true 14 | COPR_USERNAME=skydive 15 | 16 | echo "--- COPR ---" 17 | sudo dnf -y install copr-cli rpm-build 18 | mkdir -p ~/.config 19 | cat > ~/.config/copr < []" % (sys.argv[0],)) 7 | sys.exit(1) 8 | 9 | changelog = open(sys.argv[1]).readlines() 10 | version = "latest" 11 | if len(sys.argv) > 2: 12 | version = sys.argv[2] 13 | 14 | start = 0 15 | end = -1 16 | 17 | for i, line in enumerate(changelog): 18 | if line.startswith("## "): 19 | if start == 0 and (version == "latest" or line.startswith("## [%s]" % (version,))): 20 | start = i 21 | elif start != 0: 22 | end = i 23 | break 24 | 25 | if start != 0: 26 | print(''.join(changelog[start+1:end]).strip()) 27 | -------------------------------------------------------------------------------- /scripts/ci/opencontrail-tests.nix: -------------------------------------------------------------------------------- 1 | { pkgs ? import {} 2 | , nixpkgsContrailPath ? pkgs.fetchFromGitHub { 3 | owner = "nlewo"; 4 | repo = "nixpkgs-contrail"; 5 | rev = "d1bcfa3527e838b6cbc542b4aac5a8dd47db90e3"; 6 | sha256 = "03kp134rbc7mmxf7vhbhp80a1dacbyj3q0db5mg3w7wmrkwvjmlc"; 7 | } 8 | }: 9 | 10 | let 11 | contrailPkgs = import nixpkgsContrailPath {}; 12 | 13 | skydiveTestFunctionals = ../../tests/functionals; 14 | 15 | testScript = '' 16 | # This is to wait until OpenContrail is ready 17 | $machine->waitUntilSucceeds("curl -s http://localhost:8083/Snh_ShowBgpNeighborSummaryReq | grep machine | grep -q Established"); 18 | $machine->succeed("${skydiveTestFunctionals} -test.run TestOpenContrail -standalone -agent.topology.probes=opencontrail"); 19 | ''; 20 | 21 | in 22 | contrailPkgs.contrail32.test.allInOne.override { inherit testScript; } 23 | // { inherit skydiveTestFunctionals; } 24 | -------------------------------------------------------------------------------- /scripts/ci/run-cdd-overview-tests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -v 4 | 5 | DIR="$(dirname "$0")" 6 | 7 | sudo iptables -F 8 | sudo iptables -P FORWARD ACCEPT 9 | for i in $(find /proc/sys/net/bridge/ -type f) ; do echo 0 | sudo tee $i ; done 10 | 11 | cd ${GOPATH}/src/github.com/skydive-project/skydive 12 | make install 13 | 14 | export ELASTICSEARCH=localhost:9201 15 | export SKYDIVE=${GOPATH}/bin/skydive 16 | export SKYDIVE_LOGGING_LEVEL=DEBUG 17 | 18 | . "$DIR/run-tests-utils.sh" 19 | es_setup && trap es_cleanup EXIT 20 | 21 | make test.functionals WITH_CDD=true TAGS=${TAGS} VERBOSE=true TIMEOUT=10m TEST_PATTERN=Overview 22 | status=$? 23 | 24 | cat /tmp/skydive-scale/{analyzer,agent}-?.log | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]//g" | perl -ne '$d=$1 if /^(\d+-\d+-\d+),/; $k{$d}.=$_; END{print $k{$_} for sort keys(%k);}' 25 | if [ $status -ne 0 ] ; then 26 | echo "test Scale TLS:${TLS} FLOW_PROTOCOL:${FLOW_PROTOCOL} failed return ${status}" 27 | exit $status 28 | fi 29 | 30 | set -e 31 | 32 | "${DIR}/convert-to-gif.sh" tests/overview.mp4 tests/overview-tmp.gif 33 | gifsicle -O3 tests/overview-tmp.gif -o tests/overview.gif -------------------------------------------------------------------------------- /scripts/ci/run-coverage.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -v 4 | 5 | if [ ! -d "${GOPATH}/src/github.com/skydive-project/skydive-ci" ] 6 | then 7 | echo "Could not find ${GOPATH}/src/github.com/skydive-project/skydive-ci" 8 | exit 1 9 | fi 10 | 11 | dir="$(dirname "$0")" 12 | 13 | go get -f -u github.com/axw/gocov/gocov 14 | go get -f -u github.com/mattn/goveralls 15 | go get -f -u golang.org/x/tools/cmd/cover 16 | 17 | sudo iptables -F 18 | sudo iptables -P FORWARD ACCEPT 19 | for i in $(find /proc/sys/net/bridge/ -type f) ; do echo 0 | sudo tee $i ; done 20 | 21 | set -e 22 | 23 | cd ${GOPATH}/src/github.com/skydive-project/skydive 24 | 25 | export ARGS="-graph.output ascii" 26 | ./coverage.sh --no-functionals --no-scale 27 | sudo ../skydive-ci/scripts/cleanup.sh snapshot 28 | sudo ../skydive-ci/scripts/cleanup.sh cleanup 29 | ./coverage.sh --no-units --no-scale 30 | sudo ../skydive-ci/scripts/cleanup.sh snapshot 31 | sudo ../skydive-ci/scripts/cleanup.sh cleanup 32 | ./coverage.sh --no-units --no-scale --orientdb 33 | sudo ../skydive-ci/scripts/cleanup.sh snapshot 34 | sudo ../skydive-ci/scripts/cleanup.sh cleanup 35 | ./coverage.sh --no-units --no-functionals --coveralls 36 | -------------------------------------------------------------------------------- /scripts/ci/run-devstack-tests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | set -v 5 | 6 | function vagrant_cleanup { 7 | vagrant destroy --force 8 | } 9 | [ "$KEEP_RESOURCES" = "true" ] || trap vagrant_cleanup EXIT 10 | 11 | dir="$(dirname "$0")" 12 | cd ${dir}/devstack 13 | vagrant up --no-provision --provider=libvirt && vagrant provision 14 | -------------------------------------------------------------------------------- /scripts/ci/run-functional-tests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -v 4 | set -e 5 | 6 | DIR="$(dirname "$0")" 7 | 8 | . "$DIR/run-tests-utils.sh" 9 | network_setup 10 | WITH_OVN=true WITH_OPENCONTRAIL=false tests_run 11 | exit $RETCODE 12 | -------------------------------------------------------------------------------- /scripts/ci/run-go-fmt.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -v 4 | 5 | dir="$(dirname "$0")" 6 | 7 | set -e 8 | 9 | cd ${GOPATH}/src/github.com/skydive-project/skydive 10 | 11 | make fmt 12 | make vet 13 | make check 14 | -------------------------------------------------------------------------------- /scripts/ci/run-helm-tests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -v 4 | set -e 5 | 6 | DIR="$(dirname "$0")" 7 | 8 | . "$DIR/run-tests-utils.sh" 9 | network_setup 10 | WITH_HELM=true 11 | TEST_PATTERN=Helm 12 | tests_run 13 | exit $RETCODE 14 | -------------------------------------------------------------------------------- /scripts/ci/run-istio-tests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -v 4 | set -e 5 | 6 | DIR="$(dirname "$0")" 7 | 8 | export no_proxy=$no_proxy,192.168.99.100 9 | 10 | . "$DIR/run-tests-utils.sh" 11 | network_setup 12 | WITH_K8S=true 13 | WITH_ISTIO=true 14 | TEST_PATTERN='(Istio|K8s)' 15 | tests_run 16 | exit $RETCODE 17 | -------------------------------------------------------------------------------- /scripts/ci/run-k8s-tests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -v 4 | set -e 5 | 6 | DIR="$(dirname "$0")" 7 | 8 | . "$DIR/run-tests-utils.sh" 9 | network_setup 10 | WITH_EBPF=true 11 | WITH_K8S=true 12 | TEST_PATTERN="K8s" 13 | tests_run 14 | exit $RETCODE 15 | -------------------------------------------------------------------------------- /scripts/ci/run-kolla-tests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | set -v 5 | 6 | dir="$(dirname "$0")" 7 | 8 | function vagrant_cleanup { 9 | vagrant destroy --force 10 | } 11 | [ "$KEEP_RESOURCES" = "true" ] || trap vagrant_cleanup EXIT 12 | 13 | make -f ${dir}/../../Makefile static 14 | cp $GOPATH/bin/skydive . 15 | make -f ${dir}/../../Makefile test.functionals.compile GOFLAGS="${GOFLAGS}" TAGS="${TAGS}" GORACE="history_size=5" WITH_NEUTRON=true VERBOSE=true 16 | cd ${dir}/kolla 17 | DEPLOYMENT_MODE=dev vagrant up --provider=libvirt 18 | vagrant destroy --force 19 | -------------------------------------------------------------------------------- /scripts/ci/run-opencontrail-tests.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | # Install Nix if not present 6 | if ! type -p nix >/dev/null 7 | then 8 | curl https://nixos.org/nix/install | sh 9 | . $HOME/.nix-profile/etc/profile.d/nix.sh 10 | fi 11 | 12 | make test.functionals.static TAGS="$TAGS opencontrail_tests" WITH_LIBVIRT=false 13 | 14 | # For development or debug purposes, the Contrail VM can 15 | # be launched in an interactive mode. 16 | # $ nix-build scripts/ci/opencontrail-tests.nix -A driver 17 | # This creates scripts that just run the VM. It is then possible to 18 | # ssh it to manually run the test suite. 19 | # For more information: https://nixos.org/nixos/manual/index.html#sec-running-nixos-tests 20 | nix-build scripts/ci/opencontrail-tests.nix --no-out-link \ 21 | --substituters "https://opencontrail.cachix.org https://cache.nixos.org" \ 22 | --option trusted-public-keys "opencontrail.cachix.org-1:QCsZCHATxFVRRHdilxc1qiV2QmiPV02NTs10oVkf+UQ= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" 23 | 24 | # Remove the test script from the store to save space 25 | nix-store --delete $(nix-build scripts/ci/opencontrail-tests.nix --no-out-link -A skydiveTestFunctionals) 26 | -------------------------------------------------------------------------------- /scripts/ci/run-ovnk8s-tests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -v 4 | set -e 5 | 6 | SCRIPT_FILE=$(realpath -s $0) 7 | DIR="$(dirname $SCRIPT_FILE)" 8 | 9 | . "$DIR/run-tests-utils.sh" 10 | 11 | OVN_ADDRESS="" 12 | 13 | ovnk8s_setup_start() { 14 | $DIR/ovnkube-setup.sh create 15 | $DIR/ovnkube-setup.sh start 16 | } 17 | 18 | ovnk8s_setup_stop() { 19 | $DIR/ovnkube-setup.sh stop 20 | $DIR/ovnkube-setup.sh delete 21 | } 22 | 23 | ovnk8s_setup_start 24 | OVN_NODE_IP=$(KUBECONFIG=$HOME/admin.conf kubectl get nodes -o wide | awk '/ovn-control-plane/{print $6}') 25 | export OVN_ADDRESS="tcp:${OVN_NODE_IP}:6641" 26 | export K8S_CLUSTER_NAME="kind-ovn" 27 | export K8S_NUM_NODES=3 28 | export KUBECONFIG=$HOME/admin.conf 29 | 30 | network_setup 31 | WITH_OVNK8S=true 32 | TEST_PATTERN='(OVNK8s|K8s)' 33 | tests_run 34 | 35 | ovnk8s_setup_stop 36 | 37 | exit $RETCODE 38 | 39 | -------------------------------------------------------------------------------- /scripts/ci/run-packaging-tests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -v 4 | set -e 5 | 6 | dir="$(dirname "$0")" 7 | 8 | cd ${GOPATH}/src/github.com/skydive-project/skydive 9 | make srpm 10 | rpmlint contrib/packaging/rpm/skydive.spec 11 | 12 | FULLVER=$(make -s version) 13 | VERSION=$(make -s version | cut -d '-' -f 1) 14 | TAG=$(make -s version | cut -d '-' -f 2- | tr '-' '.') 15 | for srpm in $(ls rpmbuild/SRPMS/skydive-${VERSION}*${TAG}.src.rpm) 16 | do 17 | for root in epel-7-x86_64 fedora-28-x86_64 fedora-29-x86_64 18 | do 19 | mock -r $root -D "fullver $FULLVER" --rebuild $srpm 20 | done 21 | done 22 | -------------------------------------------------------------------------------- /scripts/ci/run-scale.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -v 4 | 5 | DIR="$(dirname "$0")" 6 | 7 | sudo iptables -F 8 | sudo iptables -P FORWARD ACCEPT 9 | for i in $(find /proc/sys/net/bridge/ -type f) ; do echo 0 | sudo tee $i ; done 10 | 11 | cd ${GOPATH}/src/github.com/skydive-project/skydive 12 | make install 13 | 14 | export SKYDIVE_ANALYZERS=localhost:8082 15 | export ELASTICSEARCH=127.0.0.1:9201 16 | export TLS=true 17 | export SKYDIVE=${GOPATH}/bin/skydive 18 | export FLOW_PROTOCOL=${FLOW_PROTOCOL:-websocket} 19 | export SKYDIVE_LOGGING_LEVEL=DEBUG 20 | 21 | . "$DIR/run-tests-utils.sh" 22 | es_setup && trap es_cleanup EXIT 23 | 24 | make test.functionals WITH_SCALE=true TAGS=${TAGS} VERBOSE=true TIMEOUT=10m TEST_PATTERN=Scale EXTRA_ARGS="-logs=/tmp/skydive-scale/scale.log" 25 | status=$? 26 | 27 | sudo cat /tmp/skydive-scale/scale.log 28 | 29 | if [ $status -ne 0 ] ; then 30 | echo "test Scale TLS:${TLS} FLOW_PROTOCOL:${FLOW_PROTOCOL} failed return ${status}" 31 | exit $status 32 | fi 33 | 34 | exit 0 35 | -------------------------------------------------------------------------------- /scripts/ci/run-unit-tests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -v 4 | set -eo pipefail 5 | 6 | dir="$(dirname "$0")" 7 | 8 | cd ${GOPATH}/src/github.com/skydive-project/skydive 9 | make test GOFLAGS="${GOFLAGS}" TAGS="${TAGS}" VERBOSE=true TIMEOUT=5m COVERAGE=${COVERAGE} | tee $WORKSPACE/unit-tests.log 10 | go run github.com/tebeka/go2xunit -input $WORKSPACE/unit-tests.log -output $WORKSPACE/tests.xml 11 | sed -i 's/\x1b\[[0-9;]*m//g' $WORKSPACE/tests.xml 12 | 13 | make WITH_EBPF=true ebpf.test 14 | -------------------------------------------------------------------------------- /scripts/skydive_coverage.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ $1 = "compile" ] ; then 4 | make genlocalfiles 5 | go test -v -c -o /tmp/skydive_coverage $COVERFLAGS github.com/skydive-project/skydive/tests/coverage 6 | exit $? 7 | fi 8 | 9 | config="" 10 | command="" 11 | while test ${#} -gt 0 12 | do 13 | if [ $1 = "-c" ]; then 14 | config=$2 15 | fi 16 | if [ $1 = "agent" -o $1 = "analyzer" ]; then 17 | command=$1 18 | fi 19 | shift 20 | done 21 | 22 | /tmp/skydive_coverage -test.coverprofile=$COVERFILE -test.v -config=$config $command & 23 | pid=$(pgrep -f "/tmp/skydive_coverage -test.coverprofile=$COVERFILE -test.v -config=$config $command") 24 | if [ -n "$PIDFILE" ] ; then 25 | echo $pid > $PIDFILE 26 | fi 27 | wait $pid 28 | -------------------------------------------------------------------------------- /skydive.go: -------------------------------------------------------------------------------- 1 | //go:build !prof 2 | 3 | /* 4 | * Copyright (C) 2016 Red Hat, Inc. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy ofthe License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specificlanguage governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | 20 | package main 21 | 22 | import ( 23 | "github.com/skydive-project/skydive/cmd/skydive" 24 | ) 25 | 26 | func main() { 27 | skydive.RootCmd.Execute() 28 | } 29 | -------------------------------------------------------------------------------- /skydive_prof.go: -------------------------------------------------------------------------------- 1 | //go:build prof 2 | 3 | /* 4 | * Copyright (C) 2016 Red Hat, Inc. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy ofthe License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specificlanguage governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | 20 | package main 21 | 22 | import ( 23 | "github.com/skydive-project/skydive/cmd/skydive" 24 | "github.com/skydive-project/skydive/profiling" 25 | ) 26 | 27 | func main() { 28 | go profiling.Profile("/tmp/skydive-") 29 | 30 | skydive.RootCmd.Execute() 31 | } 32 | -------------------------------------------------------------------------------- /statics/ui/css/fake-mouse.css: -------------------------------------------------------------------------------- 1 | #FakeMousePointer { 2 | position: absolute; 3 | z-index: 9999999; 4 | width: 19px; 5 | height: 32px; 6 | background-image: url(img/pointer.png); 7 | } 8 | 9 | #FakeMousePointer.mouse-down { 10 | background-image: url(img/pointer-down.png); 11 | } 12 | -------------------------------------------------------------------------------- /statics/ui/css/images/ui-bg_flat_0_aaaaaa_40x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/statics/ui/css/images/ui-bg_flat_0_aaaaaa_40x100.png -------------------------------------------------------------------------------- /statics/ui/css/images/ui-bg_flat_75_ffffff_40x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/statics/ui/css/images/ui-bg_flat_75_ffffff_40x100.png -------------------------------------------------------------------------------- /statics/ui/css/images/ui-bg_glass_55_fbf9ee_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/statics/ui/css/images/ui-bg_glass_55_fbf9ee_1x400.png -------------------------------------------------------------------------------- /statics/ui/css/images/ui-bg_glass_65_ffffff_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/statics/ui/css/images/ui-bg_glass_65_ffffff_1x400.png -------------------------------------------------------------------------------- /statics/ui/css/images/ui-bg_glass_75_dadada_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/statics/ui/css/images/ui-bg_glass_75_dadada_1x400.png -------------------------------------------------------------------------------- /statics/ui/css/images/ui-bg_glass_75_e6e6e6_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/statics/ui/css/images/ui-bg_glass_75_e6e6e6_1x400.png -------------------------------------------------------------------------------- /statics/ui/css/images/ui-bg_glass_95_fef1ec_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/statics/ui/css/images/ui-bg_glass_95_fef1ec_1x400.png -------------------------------------------------------------------------------- /statics/ui/css/images/ui-bg_highlight-soft_75_cccccc_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/statics/ui/css/images/ui-bg_highlight-soft_75_cccccc_1x100.png -------------------------------------------------------------------------------- /statics/ui/css/images/ui-icons_222222_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/statics/ui/css/images/ui-icons_222222_256x240.png -------------------------------------------------------------------------------- /statics/ui/css/images/ui-icons_2e83ff_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/statics/ui/css/images/ui-icons_2e83ff_256x240.png -------------------------------------------------------------------------------- /statics/ui/css/images/ui-icons_454545_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/statics/ui/css/images/ui-icons_454545_256x240.png -------------------------------------------------------------------------------- /statics/ui/css/images/ui-icons_888888_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/statics/ui/css/images/ui-icons_888888_256x240.png -------------------------------------------------------------------------------- /statics/ui/css/images/ui-icons_cd0a0a_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/statics/ui/css/images/ui-icons_cd0a0a_256x240.png -------------------------------------------------------------------------------- /statics/ui/css/legend.css: -------------------------------------------------------------------------------- 1 | .topology-legend { 2 | position: absolute; 3 | bottom: 20px; 4 | right: 20px; 5 | background-color: #1e2126; 6 | border-radius: 4px; 7 | padding: 10px; 8 | color: white; 9 | text-align: right; 10 | min-width: 200px; 11 | max-width: 400px; 12 | } 13 | 14 | .topology-legend p { 15 | width: 300px; 16 | white-space: nowrap; 17 | overflow: hidden; 18 | text-overflow: ellipsis; 19 | float: left; 20 | clear: both; 21 | margin: 0; 22 | } 23 | -------------------------------------------------------------------------------- /statics/ui/css/themes/light/graph-layout.css: -------------------------------------------------------------------------------- 1 | text { 2 | fill: #fff; 3 | } 4 | 5 | .node rect { 6 | fill: #3e5482; 7 | } 8 | 9 | .links path.fabric { 10 | stroke: #111; 11 | } 12 | 13 | .selected circle { 14 | stroke: black; 15 | } 16 | 17 | .down circle { 18 | fill: #F9BEB9; /* light red */ 19 | } 20 | 21 | .group { 22 | fill: #d0d0d0; /* light grey */ 23 | stroke: #d0d0d0; 24 | } 25 | 26 | .groups .netns { 27 | fill: #b293d6; /* light purple */ 28 | stroke: #b293d6; 29 | } 30 | 31 | .groups .ovsbridge { 32 | fill: #78D4AD; /* light green */ 33 | stroke: #78D4AD; 34 | } 35 | 36 | .groups .fabric { 37 | fill: #FFCE71; /* light orange */ 38 | stroke: #FFCE71; 39 | } 40 | -------------------------------------------------------------------------------- /statics/ui/css/themes/light/legend.css: -------------------------------------------------------------------------------- 1 | .topology-legend { 2 | background-color: #7697ce; 3 | } 4 | -------------------------------------------------------------------------------- /statics/ui/css/themes/light/topology-options.css: -------------------------------------------------------------------------------- 1 | #topology-options-panel { 2 | background: #969ea09c; 3 | } 4 | 5 | #topology-options .trigger { 6 | background-color: rgba(77, 124, 138, 0.3); 7 | } 8 | 9 | #topology-options .trigger button { 10 | background-color: rgba(77, 124, 138, 0); 11 | } 12 | 13 | #topology-options .trigger button span { 14 | color: #fff; 15 | } 16 | 17 | .panel-actions .btn { 18 | background-color: #eee; 19 | color: #000; 20 | } -------------------------------------------------------------------------------- /statics/ui/css/tooltip.css: -------------------------------------------------------------------------------- 1 | .tooltip { 2 | display: block !important; 3 | pointer-events: none; 4 | padding: 4px; 5 | z-index: 10000; 6 | } 7 | 8 | .tooltip .tooltip-inner { 9 | background: white; 10 | color: black; 11 | border-radius: 5px; 12 | padding: 5px 10px 4px; 13 | opacity: 0.9; 14 | text-align: left; 15 | } 16 | 17 | .tooltip tooltip-arrow{ 18 | display: none; 19 | } 20 | 21 | .tooltip[aria-hidden='true'] { 22 | visibility: hidden; 23 | opacity: 0; 24 | transition: opacity .15s, visibility .15s; 25 | } 26 | 27 | .tooltip[aria-hidden='false'] { 28 | visibility: visible; 29 | opacity: 1; 30 | transition: opacity .15s; 31 | } 32 | -------------------------------------------------------------------------------- /statics/ui/css/transitions.css: -------------------------------------------------------------------------------- 1 | .slide-leave-active, 2 | .slide-enter-active { 3 | overflow: hidden; 4 | transition: .4s ease-in-out; 5 | } 6 | 7 | .slide-enter { 8 | transform: translateX(-100%); 9 | } 10 | 11 | .slide-leave-to { 12 | transform: translateX(0); 13 | } 14 | 15 | .rotate { 16 | -moz-transition: all 0.2s linear; 17 | -webkit-transition: all 0.2s linear; 18 | transition: all 0.2s linear; 19 | } 20 | 21 | .rotate.down { 22 | -moz-transform:rotate(90deg); 23 | -webkit-transform:rotate(90deg); 24 | transform:rotate(90deg); 25 | } 26 | -------------------------------------------------------------------------------- /statics/ui/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/statics/ui/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /statics/ui/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/statics/ui/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /statics/ui/img/blockdev.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/statics/ui/img/blockdev.png -------------------------------------------------------------------------------- /statics/ui/img/blockdevleaf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/statics/ui/img/blockdevleaf.png -------------------------------------------------------------------------------- /statics/ui/img/blockdevlvm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/statics/ui/img/blockdevlvm.png -------------------------------------------------------------------------------- /statics/ui/img/bridge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/statics/ui/img/bridge.png -------------------------------------------------------------------------------- /statics/ui/img/cluster.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/statics/ui/img/cluster.png -------------------------------------------------------------------------------- /statics/ui/img/collapse.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/statics/ui/img/collapse.gif -------------------------------------------------------------------------------- /statics/ui/img/configmap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/statics/ui/img/configmap.png -------------------------------------------------------------------------------- /statics/ui/img/container.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/statics/ui/img/container.png -------------------------------------------------------------------------------- /statics/ui/img/cronjob.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/statics/ui/img/cronjob.png -------------------------------------------------------------------------------- /statics/ui/img/daemonset.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/statics/ui/img/daemonset.png -------------------------------------------------------------------------------- /statics/ui/img/deployment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/statics/ui/img/deployment.png -------------------------------------------------------------------------------- /statics/ui/img/destinationrule.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/statics/ui/img/destinationrule.png -------------------------------------------------------------------------------- /statics/ui/img/docker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/statics/ui/img/docker.png -------------------------------------------------------------------------------- /statics/ui/img/endpoints.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/statics/ui/img/endpoints.png -------------------------------------------------------------------------------- /statics/ui/img/expand.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/statics/ui/img/expand.gif -------------------------------------------------------------------------------- /statics/ui/img/gateway.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/statics/ui/img/gateway.png -------------------------------------------------------------------------------- /statics/ui/img/host.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/statics/ui/img/host.png -------------------------------------------------------------------------------- /statics/ui/img/ingress.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/statics/ui/img/ingress.png -------------------------------------------------------------------------------- /statics/ui/img/intf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/statics/ui/img/intf.png -------------------------------------------------------------------------------- /statics/ui/img/istio.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/statics/ui/img/istio.png -------------------------------------------------------------------------------- /statics/ui/img/job.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/statics/ui/img/job.png -------------------------------------------------------------------------------- /statics/ui/img/k8s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/statics/ui/img/k8s.png -------------------------------------------------------------------------------- /statics/ui/img/lxd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/statics/ui/img/lxd.png -------------------------------------------------------------------------------- /statics/ui/img/media-inject.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/statics/ui/img/media-inject.png -------------------------------------------------------------------------------- /statics/ui/img/media-record.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/statics/ui/img/media-record.png -------------------------------------------------------------------------------- /statics/ui/img/minus-outline-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/statics/ui/img/minus-outline-16.png -------------------------------------------------------------------------------- /statics/ui/img/networkpolicy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/statics/ui/img/networkpolicy.png -------------------------------------------------------------------------------- /statics/ui/img/ns.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/statics/ui/img/ns.png -------------------------------------------------------------------------------- /statics/ui/img/openstack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/statics/ui/img/openstack.png -------------------------------------------------------------------------------- /statics/ui/img/ovn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/statics/ui/img/ovn.png -------------------------------------------------------------------------------- /statics/ui/img/persistentvolume.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/statics/ui/img/persistentvolume.png -------------------------------------------------------------------------------- /statics/ui/img/persistentvolumeclaim.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/statics/ui/img/persistentvolumeclaim.png -------------------------------------------------------------------------------- /statics/ui/img/pin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/statics/ui/img/pin.png -------------------------------------------------------------------------------- /statics/ui/img/plus-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/statics/ui/img/plus-16.png -------------------------------------------------------------------------------- /statics/ui/img/pod.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/statics/ui/img/pod.png -------------------------------------------------------------------------------- /statics/ui/img/pointer-down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/statics/ui/img/pointer-down.png -------------------------------------------------------------------------------- /statics/ui/img/pointer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/statics/ui/img/pointer.png -------------------------------------------------------------------------------- /statics/ui/img/port.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/statics/ui/img/port.png -------------------------------------------------------------------------------- /statics/ui/img/quotaspec.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/statics/ui/img/quotaspec.png -------------------------------------------------------------------------------- /statics/ui/img/quotaspecbinding.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/statics/ui/img/quotaspecbinding.png -------------------------------------------------------------------------------- /statics/ui/img/record.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/statics/ui/img/record.png -------------------------------------------------------------------------------- /statics/ui/img/record_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/statics/ui/img/record_red.png -------------------------------------------------------------------------------- /statics/ui/img/refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/statics/ui/img/refresh.png -------------------------------------------------------------------------------- /statics/ui/img/replicaset.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/statics/ui/img/replicaset.png -------------------------------------------------------------------------------- /statics/ui/img/replicationcontroller.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/statics/ui/img/replicationcontroller.png -------------------------------------------------------------------------------- /statics/ui/img/runc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/statics/ui/img/runc.png -------------------------------------------------------------------------------- /statics/ui/img/secret.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/statics/ui/img/secret.png -------------------------------------------------------------------------------- /statics/ui/img/service.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/statics/ui/img/service.png -------------------------------------------------------------------------------- /statics/ui/img/serviceentry.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/statics/ui/img/serviceentry.png -------------------------------------------------------------------------------- /statics/ui/img/skydive-logo-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/statics/ui/img/skydive-logo-16x16.png -------------------------------------------------------------------------------- /statics/ui/img/statefulset.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/statics/ui/img/statefulset.png -------------------------------------------------------------------------------- /statics/ui/img/storageclass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/statics/ui/img/storageclass.png -------------------------------------------------------------------------------- /statics/ui/img/switch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/statics/ui/img/switch.png -------------------------------------------------------------------------------- /statics/ui/img/trash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/statics/ui/img/trash.png -------------------------------------------------------------------------------- /statics/ui/img/veth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/statics/ui/img/veth.png -------------------------------------------------------------------------------- /statics/ui/img/virtualservice.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/statics/ui/img/virtualservice.png -------------------------------------------------------------------------------- /statics/ui/img/vm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/statics/ui/img/vm.png -------------------------------------------------------------------------------- /statics/ui/js/components/collapse.js: -------------------------------------------------------------------------------- 1 | /* jshint multistr: true */ 2 | 3 | Vue.component('collapse', { 4 | 5 | template: '\ 6 |
\ 7 |
\ 8 | \ 9 |
\ 10 |
\ 11 |
\ 12 | \ 13 |
\ 14 |
\ 15 |
\ 16 | ', 17 | 18 | data: function() { 19 | return { 20 | active: false 21 | }; 22 | }, 23 | 24 | props: { 25 | 26 | collapsed: { 27 | type: Boolean, 28 | required: true, 29 | default: true, 30 | } 31 | 32 | }, 33 | 34 | created: function() { 35 | this.active = !this.collapsed; 36 | }, 37 | 38 | ready: function() { 39 | if (this.active) { 40 | this.$emit('collapse-open', this.index); 41 | } 42 | }, 43 | 44 | methods: { 45 | 46 | toggle: function() { 47 | this.active = !this.active; 48 | if (this.active) { 49 | this.$emit('collapse-open', this.index); 50 | } else { 51 | this.$emit('collapse-close', this.index); 52 | } 53 | } 54 | 55 | } 56 | 57 | }); 58 | -------------------------------------------------------------------------------- /statics/ui/js/components/panel.js: -------------------------------------------------------------------------------- 1 | /* jshint multistr: true */ 2 | 3 | Vue.component('panel', { 4 | 5 | props: { 6 | 7 | title: { 8 | type: String, 9 | required: true, 10 | }, 11 | 12 | description: { 13 | type: String, 14 | required: false, 15 | }, 16 | 17 | collapsed: { 18 | type: Boolean, 19 | default: true, 20 | } 21 | 22 | }, 23 | 24 | template: '\ 25 |
\ 26 | \ 27 |

\ 28 | {{ title }}\ 29 | \ 30 | \ 31 | \ 32 | {{ description }}\ 33 |

\ 34 |
\ 35 |
\ 36 | Empty panel\ 37 |
\ 38 |
\ 39 |
\ 40 |
\ 41 | \ 42 |
\ 43 |
\ 44 | ', 45 | 46 | }); 47 | -------------------------------------------------------------------------------- /statics/ui/js/components/status.js: -------------------------------------------------------------------------------- 1 | /* jshint multistr: true */ 2 | 3 | var StatusComponent = { 4 | 5 | name: 'Status', 6 | 7 | mixins: [apiMixin, notificationMixin], 8 | 9 | template: '\ 10 |
\ 11 |
\ 12 |

Services Status

\ 13 | \ 14 |
\ 15 |
\ 16 | ', 17 | 18 | data: function() { 19 | return { 20 | status: null, 21 | }; 22 | }, 23 | 24 | created: function() { 25 | this.getStatus(); 26 | }, 27 | 28 | methods: { 29 | getStatus: function() { 30 | var self = this; 31 | $.ajax({ 32 | dataType: "json", 33 | url: '/api/status', 34 | contentType: "application/json; charset=utf-8", 35 | method: 'GET', 36 | }) 37 | .then(function(data) { 38 | self.status = data; 39 | }) 40 | .fail(function(e) { 41 | self.$error({message: 'Not able to get status, error: ' + e.responseText}); 42 | }); 43 | }, 44 | } 45 | }; 46 | -------------------------------------------------------------------------------- /statics/ui/js/components/topology-rules.js: -------------------------------------------------------------------------------- 1 | /* jshint multistr: true */ 2 | 3 | Vue.component('topology-rules', { 4 | template: '\ 5 |
\ 6 |
\ 7 | \ 11 | \ 15 |
\ 16 |
\ 17 | \ 18 | \ 19 |
\ 20 |
\ 21 | \ 22 | \ 23 |
\ 24 |
\ 25 | ', 26 | 27 | data: function() { 28 | return { 29 | rule: "node", 30 | }; 31 | }, 32 | }); 33 | -------------------------------------------------------------------------------- /statics/ui_v2/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ui_v2", 3 | "version": "0.1.4", 4 | "description": "Skydive Web UI v2", 5 | "author": "Sylvain Afchain", 6 | "devDependencies": { 7 | "@skydive-project/skydive-ui": ">=0.1.8" 8 | }, 9 | "scripts": { 10 | "prepare": "pwd;cp -R node_modules/@skydive-project/skydive-ui/dist/* ." 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /tests/bookinfo/bookinfo-ibmcloud-image-policy.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: securityenforcement.admission.cloud.ibm.com/v1beta1 2 | kind: ImagePolicy 3 | metadata: 4 | name: ibmcloud-image-policy 5 | spec: 6 | repositories: 7 | # This policy allows all images to be deployed into this namespace. 8 | - name: "*" 9 | policy: 10 | -------------------------------------------------------------------------------- /tests/bookinfo/bookinfo-netpol-deny.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.k8s.io/v1 2 | kind: NetworkPolicy 3 | metadata: 4 | name: deny 5 | spec: 6 | podSelector: {} 7 | policyTypes: 8 | - Ingress 9 | -------------------------------------------------------------------------------- /tests/bookinfo/bookinfo-netpol-details.yaml: -------------------------------------------------------------------------------- 1 | kind: NetworkPolicy 2 | apiVersion: networking.k8s.io/v1 3 | metadata: 4 | name: details 5 | labels: 6 | app: details 7 | spec: 8 | podSelector: 9 | matchLabels: 10 | app: details 11 | ingress: 12 | - from: 13 | - podSelector: 14 | matchLabels: 15 | app: productpage 16 | -------------------------------------------------------------------------------- /tests/bookinfo/bookinfo-netpol-ratings.yaml: -------------------------------------------------------------------------------- 1 | kind: NetworkPolicy 2 | apiVersion: networking.k8s.io/v1 3 | metadata: 4 | name: ratings 5 | labels: 6 | app: ratings 7 | spec: 8 | podSelector: 9 | matchLabels: 10 | app: ratings 11 | ingress: 12 | - from: 13 | - podSelector: 14 | matchLabels: 15 | app: reviews 16 | version: v2 17 | - from: 18 | - podSelector: 19 | matchLabels: 20 | app: reviews 21 | version: v3 22 | -------------------------------------------------------------------------------- /tests/bookinfo/bookinfo-netpol-reviews-v1.yaml: -------------------------------------------------------------------------------- 1 | kind: NetworkPolicy 2 | apiVersion: networking.k8s.io/v1 3 | metadata: 4 | name: reviews-v1 5 | labels: 6 | app: reviews 7 | version: v1 8 | spec: 9 | podSelector: 10 | matchLabels: 11 | app: reviews 12 | version: v1 13 | ingress: 14 | - from: 15 | - podSelector: 16 | matchLabels: 17 | app: productpage 18 | -------------------------------------------------------------------------------- /tests/bookinfo/bookinfo-netpol-reviews-v2.yaml: -------------------------------------------------------------------------------- 1 | kind: NetworkPolicy 2 | apiVersion: networking.k8s.io/v1 3 | metadata: 4 | name: reviews-v2 5 | labels: 6 | app: reviews 7 | version: v2 8 | spec: 9 | podSelector: 10 | matchLabels: 11 | app: reviews 12 | version: v2 13 | ingress: 14 | - from: 15 | - podSelector: 16 | matchLabels: 17 | app: productpage 18 | -------------------------------------------------------------------------------- /tests/bookinfo/bookinfo-netpol-reviews-v3.yaml: -------------------------------------------------------------------------------- 1 | kind: NetworkPolicy 2 | apiVersion: networking.k8s.io/v1 3 | metadata: 4 | name: reviews-v3 5 | labels: 6 | app: reviews 7 | version: v3 8 | spec: 9 | podSelector: 10 | matchLabels: 11 | app: reviews 12 | version: v3 13 | ingress: 14 | - from: 15 | - podSelector: 16 | matchLabels: 17 | app: productpage 18 | -------------------------------------------------------------------------------- /tests/coverage/coverage.go: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017 Red Hat, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy ofthe License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specificlanguage governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | 18 | package coverage 19 | 20 | import ( 21 | "github.com/skydive-project/skydive/cmd/skydive" 22 | ) 23 | 24 | func skdyiveCoverage() { 25 | skydive.RootCmd.Execute() 26 | } 27 | -------------------------------------------------------------------------------- /tests/coverage/coverage_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017 Red Hat, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy ofthe License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specificlanguage governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | 18 | package coverage 19 | 20 | import ( 21 | "flag" 22 | "testing" 23 | 24 | "github.com/skydive-project/skydive/cmd" 25 | ) 26 | 27 | // Skydive coverage bootstrap 28 | func TestCoverage(t *testing.T) { 29 | t.Log("TestCoverage") 30 | skdyiveCoverage() 31 | } 32 | 33 | func init() { 34 | var cfgFile string 35 | flag.StringVar(&cfgFile, "config", "", "configuration file") 36 | flag.Parse() 37 | 38 | cmd.CfgFiles = []string{cfgFile} 39 | } 40 | -------------------------------------------------------------------------------- /tests/istio/destinationrule-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: skydive-test-destinationrule-service 5 | labels: 6 | app: reviews.prod.svc.cluster.local 7 | spec: 8 | ports: 9 | - port: 9080 10 | name: http 11 | selector: 12 | app: reviews.prod.svc.cluster.local 13 | --- 14 | apiVersion: networking.istio.io/v1alpha3 15 | kind: DestinationRule 16 | metadata: 17 | name: skydive-test-destinationrule-service 18 | spec: 19 | host: reviews.prod.svc.cluster.local 20 | subsets: 21 | - name: v1 22 | labels: 23 | version: v1 24 | -------------------------------------------------------------------------------- /tests/istio/destinationrule-serviceentry.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.istio.io/v1alpha3 2 | kind: ServiceEntry 3 | metadata: 4 | name: skydive-test-destinationrule-serviceentry 5 | spec: 6 | hosts: 7 | - example.unix.local 8 | ports: 9 | - number: 80 10 | name: http 11 | protocol: HTTP 12 | --- 13 | apiVersion: networking.istio.io/v1alpha3 14 | kind: DestinationRule 15 | metadata: 16 | name: skydive-test-destinationrule-serviceentry 17 | spec: 18 | host: example.unix.local 19 | -------------------------------------------------------------------------------- /tests/istio/destinationrule.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.istio.io/v1alpha3 2 | kind: DestinationRule 3 | metadata: 4 | name: skydive-test-destinationrule 5 | spec: 6 | host: c 7 | subsets: 8 | - name: v1 9 | labels: 10 | version: v1 11 | - name: v2 12 | labels: 13 | version: v2 14 | -------------------------------------------------------------------------------- /tests/istio/gateway-virtualservice.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.istio.io/v1alpha3 2 | kind: Gateway 3 | metadata: 4 | name: skydive-test-gateway-virtualservice 5 | spec: 6 | selector: 7 | istio: ingressgateway 8 | servers: 9 | - port: 10 | number: 80 11 | name: http 12 | protocol: HTTP 13 | hosts: 14 | - "*" 15 | --- 16 | apiVersion: networking.istio.io/v1alpha3 17 | kind: VirtualService 18 | metadata: 19 | name: skydive-test-gateway-virtualservice 20 | spec: 21 | hosts: 22 | - reviews.prod.svc.cluster.local 23 | gateways: 24 | - skydive-test-gateway-virtualservice 25 | http: 26 | - route: 27 | - destination: 28 | host: reviews.prod.svc.cluster.local 29 | subset: v1 30 | -------------------------------------------------------------------------------- /tests/istio/gateway.yaml: -------------------------------------------------------------------------------- 1 | # Routes TCP traffic through the ingressgateway Gateway to service A. 2 | apiVersion: networking.istio.io/v1alpha3 3 | kind: Gateway 4 | metadata: 5 | name: skydive-test-gateway 6 | spec: 7 | selector: 8 | # DO NOT CHANGE THESE LABELS 9 | # The ingressgateway is defined in install/kubernetes/helm/istio/values.yaml 10 | # with these labels 11 | istio: ingressgateway 12 | servers: 13 | - port: 14 | number: 31400 15 | protocol: TCP 16 | name: tcp 17 | hosts: 18 | - a.istio-system.svc.cluster.local 19 | -------------------------------------------------------------------------------- /tests/istio/quotaspec.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: config.istio.io/v1alpha2 2 | kind: QuotaSpec 3 | metadata: 4 | name: skydive-test-quotaspec 5 | spec: 6 | rules: 7 | - match: 8 | - clause: 9 | api.operation: 10 | exact: getProducts 11 | quotas: 12 | - charge: 1 13 | quota: read-requests 14 | -------------------------------------------------------------------------------- /tests/istio/quotaspecbinding.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: config.istio.io/v1alpha2 2 | kind: QuotaSpecBinding 3 | metadata: 4 | name: skydive-test-quotaspecbinding 5 | spec: 6 | quotaSpecs: 7 | - name: bookinfo 8 | namespace: default 9 | services: 10 | - name: bookinfo 11 | namespace: default 12 | -------------------------------------------------------------------------------- /tests/istio/serviceentry.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.istio.io/v1alpha3 2 | kind: ServiceEntry 3 | metadata: 4 | name: skydive-test-serviceentry 5 | spec: 6 | hosts: 7 | - external.extsvc.com 8 | ports: 9 | - number: 1443 10 | name: extsvc-http 11 | protocol: HTTP # not HTTPS. 12 | -------------------------------------------------------------------------------- /tests/istio/virtualservice-pod.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.istio.io/v1alpha3 2 | kind: VirtualService 3 | metadata: 4 | name: skydive-test-virtualservice-pod 5 | spec: 6 | hosts: 7 | - reviews.prod.svc.cluster.local 8 | http: 9 | - route: 10 | - destination: 11 | host: reviews.prod.svc.cluster.local 12 | subset: v1 13 | weight: 90 14 | - destination: 15 | host: reviews.prod.svc.cluster.local 16 | subset: v2 17 | weight: 10 18 | --- 19 | apiVersion: v1 20 | kind: Pod 21 | metadata: 22 | name: podv1 23 | labels: 24 | app: reviews.prod.svc.cluster.local 25 | version: v1 26 | spec: 27 | containers: 28 | - name: nginx 29 | image: nginx 30 | ports: 31 | - containerPort: 80 32 | --- 33 | apiVersion: v1 34 | kind: Pod 35 | metadata: 36 | name: podv2 37 | labels: 38 | app: reviews.prod.svc.cluster.local 39 | version: v2 40 | spec: 41 | containers: 42 | - name: nginx 43 | image: nginx 44 | ports: 45 | - containerPort: 80 46 | -------------------------------------------------------------------------------- /tests/istio/virtualservice.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.istio.io/v1alpha3 2 | kind: VirtualService 3 | metadata: 4 | name: skydive-test-virtualservice 5 | spec: 6 | hosts: 7 | - service3.default.svc.cluster.local 8 | - uk.bookinfo.com 9 | - eu.bookinfo.com 10 | gateways: 11 | - my-gateway 12 | - mesh # applies to all the sidecars in the mesh 13 | http: 14 | - match: 15 | - headers: 16 | cookie: 17 | regex: "^(.*?;)?(user=dev-123)(;.*)?" 18 | route: 19 | - destination: 20 | port: 21 | number: 81 22 | host: service3.default.svc.cluster.local 23 | - match: 24 | - uri: 25 | prefix: /reviews/ 26 | route: 27 | - destination: 28 | port: 29 | number: 81 30 | host: service3.default.svc.cluster.local 31 | subset: v1 32 | weight: 80 33 | - destination: 34 | host: service3.default.svc.cluster.local 35 | subset: v2 36 | weight: 20 37 | -------------------------------------------------------------------------------- /tests/k8s/configmap.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | name: skydive-test-configmap 5 | namespace: default 6 | data: 7 | log_level: INFO 8 | -------------------------------------------------------------------------------- /tests/k8s/container.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Pod 3 | metadata: 4 | name: skydive-test-container 5 | spec: 6 | containers: 7 | - name: skydive-test-container 8 | image: nginx 9 | ports: 10 | - containerPort: 80 11 | volumeMounts: 12 | - name: skydive-test-container-workdir 13 | mountPath: /usr/share/nginx/html 14 | # These containers are run during pod initialization 15 | initContainers: 16 | - name: skydive-test-container-install 17 | image: busybox 18 | command: 19 | - wget 20 | - "-O" 21 | - "/work-dir/index.html" 22 | - http://kubernetes.io 23 | volumeMounts: 24 | - name: skydive-test-container-workdir 25 | mountPath: "/work-dir" 26 | dnsPolicy: Default 27 | volumes: 28 | - name: skydive-test-container-workdir 29 | emptyDir: {} 30 | -------------------------------------------------------------------------------- /tests/k8s/cronjob.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: batch/v1 2 | kind: CronJob 3 | metadata: 4 | name: skydive-test-cronjob 5 | spec: 6 | schedule: "*/1 * * * *" 7 | jobTemplate: 8 | spec: 9 | template: 10 | spec: 11 | containers: 12 | - name: hello 13 | image: busybox 14 | args: 15 | - /bin/sh 16 | - -c 17 | - date; echo Hello from the Kubernetes cluster 18 | restartPolicy: OnFailure 19 | 20 | -------------------------------------------------------------------------------- /tests/k8s/deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: skydive-test-deployment 5 | labels: 6 | app: nginx 7 | spec: 8 | replicas: 3 9 | selector: 10 | matchLabels: 11 | app: nginx 12 | template: 13 | metadata: 14 | labels: 15 | app: nginx 16 | spec: 17 | containers: 18 | - name: skydive-test-deployment-nginx 19 | image: nginx:1.7.9 20 | ports: 21 | - containerPort: 80 22 | -------------------------------------------------------------------------------- /tests/k8s/deployment_modern.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: skydive-test-deployment 5 | labels: 6 | app: nginx 7 | spec: 8 | replicas: 3 9 | selector: 10 | matchLabels: 11 | app: nginx 12 | template: 13 | metadata: 14 | labels: 15 | app: nginx 16 | spec: 17 | containers: 18 | - name: skydive-test-deployment-nginx 19 | image: nginx:1.7.9 20 | ports: 21 | - containerPort: 80 22 | -------------------------------------------------------------------------------- /tests/k8s/endpoints.yaml: -------------------------------------------------------------------------------- 1 | kind: Endpoints 2 | apiVersion: v1 3 | metadata: 4 | name: skydive-test-endpoints 5 | subsets: 6 | - addresses: 7 | - ip: 1.2.3.4 8 | ports: 9 | - port: 9376 10 | -------------------------------------------------------------------------------- /tests/k8s/ingress.yaml: -------------------------------------------------------------------------------- 1 | kind: Ingress 2 | apiVersion: networking.k8s.io/v1 3 | metadata: 4 | name: skydive-test-ingress 5 | spec: 6 | defaultBackend: 7 | service: 8 | name: skydive-test-ingress-testsvc 9 | port: 10 | number: 1080 11 | -------------------------------------------------------------------------------- /tests/k8s/ingress1.yaml: -------------------------------------------------------------------------------- 1 | kind: Ingress 2 | apiVersion: networking.k8s.io/v1 3 | metadata: 4 | name: skydive-test-ingress1 5 | spec: 6 | defaultBackend: 7 | service: 8 | name: skydive-test-ingress1 9 | port: 10 | number: 1080 11 | --- 12 | kind: Service 13 | apiVersion: v1 14 | metadata: 15 | name: skydive-test-ingress1 16 | spec: 17 | ports: 18 | - protocol: TCP 19 | port: 1080 20 | targetPort: 9376 21 | -------------------------------------------------------------------------------- /tests/k8s/job.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: batch/v1 2 | kind: Job 3 | metadata: 4 | name: skydive-test-job 5 | spec: 6 | template: 7 | metadata: 8 | name: countdown 9 | spec: 10 | containers: 11 | - name: skydive-test-job-counter 12 | image: centos:7 13 | command: 14 | - "bin/bash" 15 | - "-c" 16 | - "for i in 9 8 7 6 5 4 3 2 1 ; do echo $i ; done" 17 | restartPolicy: Never 18 | -------------------------------------------------------------------------------- /tests/k8s/namespace.yaml: -------------------------------------------------------------------------------- 1 | kind: Namespace 2 | apiVersion: v1 3 | metadata: 4 | name: skydive-test-namespace 5 | labels: 6 | name: skydive-test-namespace 7 | -------------------------------------------------------------------------------- /tests/k8s/networkpolicy-egress-allow.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Pod 3 | metadata: 4 | name: skydive-test-networkpolicy-egress-allow 5 | spec: 6 | containers: 7 | - name: nginx 8 | image: nginx 9 | ports: 10 | - containerPort: 80 11 | --- 12 | apiVersion: networking.k8s.io/v1 13 | kind: NetworkPolicy 14 | metadata: 15 | name: skydive-test-networkpolicy-egress-allow 16 | spec: 17 | podSelector: {} 18 | egress: 19 | - {} 20 | policyTypes: 21 | - Egress -------------------------------------------------------------------------------- /tests/k8s/networkpolicy-egress-deny.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Pod 3 | metadata: 4 | name: skydive-test-networkpolicy-egress-deny 5 | spec: 6 | containers: 7 | - name: nginx 8 | image: nginx 9 | ports: 10 | - containerPort: 80 11 | --- 12 | apiVersion: networking.k8s.io/v1 13 | kind: NetworkPolicy 14 | metadata: 15 | name: skydive-test-networkpolicy-egress-deny 16 | spec: 17 | podSelector: {} 18 | policyTypes: 19 | - Egress -------------------------------------------------------------------------------- /tests/k8s/networkpolicy-ingress-allow-pod.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Pod 3 | metadata: 4 | name: skydive-test-networkpolicy-ingress-allow-pod-to 5 | labels: 6 | app: skydive-test-networkpolicy-ingress-allow-pod-to 7 | spec: 8 | containers: 9 | - name: nginx 10 | image: nginx 11 | ports: 12 | - containerPort: 80 13 | --- 14 | apiVersion: v1 15 | kind: Pod 16 | metadata: 17 | name: skydive-test-networkpolicy-ingress-allow-pod-from 18 | labels: 19 | app: skydive-test-networkpolicy-ingress-allow-pod-from 20 | spec: 21 | containers: 22 | - name: nginx 23 | image: nginx 24 | ports: 25 | - containerPort: 80 26 | --- 27 | kind: NetworkPolicy 28 | apiVersion: networking.k8s.io/v1 29 | metadata: 30 | name: skydive-test-networkpolicy-ingress-allow-pod 31 | spec: 32 | podSelector: 33 | matchLabels: 34 | app: skydive-test-networkpolicy-ingress-allow-pod-to 35 | ingress: 36 | - from: 37 | - podSelector: 38 | matchLabels: 39 | app: skydive-test-networkpolicy-ingress-allow-pod-from 40 | -------------------------------------------------------------------------------- /tests/k8s/networkpolicy-ingress-allow-ports.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Pod 3 | metadata: 4 | name: skydive-test-networkpolicy-ingress-allow-ports-to 5 | labels: 6 | app: skydive-test-networkpolicy-ingress-allow-ports-to 7 | spec: 8 | containers: 9 | - name: nginx 10 | image: nginx 11 | ports: 12 | - containerPort: 80 13 | --- 14 | apiVersion: v1 15 | kind: Pod 16 | metadata: 17 | name: skydive-test-networkpolicy-ingress-allow-ports-from 18 | labels: 19 | app: skydive-test-networkpolicy-ingress-allow-ports-from 20 | spec: 21 | containers: 22 | - name: nginx 23 | image: nginx 24 | ports: 25 | - containerPort: 80 26 | --- 27 | kind: NetworkPolicy 28 | apiVersion: networking.k8s.io/v1 29 | metadata: 30 | name: skydive-test-networkpolicy-ingress-allow-ports 31 | spec: 32 | podSelector: 33 | matchLabels: 34 | app: skydive-test-networkpolicy-ingress-allow-ports-to 35 | ingress: 36 | - from: 37 | - podSelector: 38 | matchLabels: 39 | app: skydive-test-networkpolicy-ingress-allow-ports-from 40 | ports: 41 | - port: 80 42 | -------------------------------------------------------------------------------- /tests/k8s/networkpolicy-ingress-allow.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Pod 3 | metadata: 4 | name: skydive-test-networkpolicy-ingress-allow 5 | spec: 6 | containers: 7 | - name: nginx 8 | image: nginx 9 | ports: 10 | - containerPort: 80 11 | --- 12 | apiVersion: networking.k8s.io/v1 13 | kind: NetworkPolicy 14 | metadata: 15 | name: skydive-test-networkpolicy-ingress-allow 16 | spec: 17 | podSelector: {} 18 | ingress: 19 | - {} -------------------------------------------------------------------------------- /tests/k8s/networkpolicy-ingress-deny.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Pod 3 | metadata: 4 | name: skydive-test-networkpolicy-ingress-deny 5 | spec: 6 | containers: 7 | - name: nginx 8 | image: nginx 9 | ports: 10 | - containerPort: 80 11 | --- 12 | apiVersion: networking.k8s.io/v1 13 | kind: NetworkPolicy 14 | metadata: 15 | name: skydive-test-networkpolicy-ingress-deny 16 | spec: 17 | podSelector: {} 18 | policyTypes: 19 | - Ingress -------------------------------------------------------------------------------- /tests/k8s/networkpolicy-namespace.yaml: -------------------------------------------------------------------------------- 1 | 2 | kind: Namespace 3 | apiVersion: v1 4 | metadata: 5 | name: skydive-test-networkpolicy-namespace 6 | --- 7 | apiVersion: v1 8 | kind: Pod 9 | metadata: 10 | name: skydive-test-networkpolicy-namespace 11 | namespace: skydive-test-networkpolicy-namespace 12 | spec: 13 | containers: 14 | - name: nginx 15 | image: nginx 16 | ports: 17 | - containerPort: 80 18 | --- 19 | kind: NetworkPolicy 20 | apiVersion: networking.k8s.io/v1 21 | metadata: 22 | namespace: skydive-test-networkpolicy-namespace 23 | name: skydive-test-networkpolicy-namespace 24 | spec: 25 | podSelector: {} 26 | ingress: 27 | - {} -------------------------------------------------------------------------------- /tests/k8s/networkpolicy-pod.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Pod 3 | metadata: 4 | name: skydive-test-networkpolicy-pod 5 | labels: 6 | app: skydive-test-networkpolicy-pod 7 | spec: 8 | containers: 9 | - name: nginx 10 | image: nginx 11 | ports: 12 | - containerPort: 80 13 | --- 14 | apiVersion: networking.k8s.io/v1 15 | kind: NetworkPolicy 16 | metadata: 17 | name: skydive-test-networkpolicy-pod 18 | spec: 19 | podSelector: 20 | matchLabels: 21 | app: skydive-test-networkpolicy-pod 22 | ingress: 23 | - {} 24 | -------------------------------------------------------------------------------- /tests/k8s/networkpolicy.yaml: -------------------------------------------------------------------------------- 1 | kind: NetworkPolicy 2 | apiVersion: networking.k8s.io/v1 3 | metadata: 4 | namespace: default 5 | name: skydive-test-networkpolicy 6 | spec: 7 | podSelector: {} 8 | -------------------------------------------------------------------------------- /tests/k8s/persistentvolume.yaml: -------------------------------------------------------------------------------- 1 | kind: PersistentVolume 2 | apiVersion: v1 3 | metadata: 4 | name: skydive-test-persistentvolume 5 | labels: 6 | type: local 7 | spec: 8 | storageClassName: manual 9 | capacity: 10 | storage: 10Gi 11 | accessModes: 12 | - ReadWriteOnce 13 | hostPath: 14 | path: "/mnt/data" 15 | 16 | -------------------------------------------------------------------------------- /tests/k8s/persistentvolumeclaim.yaml: -------------------------------------------------------------------------------- 1 | kind: PersistentVolumeClaim 2 | apiVersion: v1 3 | metadata: 4 | name: skydive-test-persistentvolumeclaim 5 | spec: 6 | storageClassName: standard 7 | accessModes: 8 | - ReadWriteOnce 9 | resources: 10 | requests: 11 | storage: 3M 12 | -------------------------------------------------------------------------------- /tests/k8s/pod.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Pod 3 | metadata: 4 | name: skydive-test-pod 5 | spec: 6 | containers: 7 | - name: nginx 8 | image: nginx 9 | ports: 10 | - containerPort: 80 11 | -------------------------------------------------------------------------------- /tests/k8s/pv-claim.yaml: -------------------------------------------------------------------------------- 1 | kind: PersistentVolumeClaim 2 | apiVersion: v1 3 | metadata: 4 | name: task-pv-claim 5 | spec: 6 | storageClassName: standard 7 | accessModes: 8 | - ReadWriteOnce 9 | resources: 10 | requests: 11 | storage: 3Gi 12 | -------------------------------------------------------------------------------- /tests/k8s/pv-pod.yaml: -------------------------------------------------------------------------------- 1 | kind: Pod 2 | apiVersion: v1 3 | metadata: 4 | name: task-pv-pod 5 | spec: 6 | volumes: 7 | - name: task-pv-storage 8 | persistentVolumeClaim: 9 | claimName: task-pv-claim 10 | containers: 11 | - name: task-pv-container 12 | image: nginx 13 | ports: 14 | - containerPort: 80 15 | name: "http-server" 16 | volumeMounts: 17 | - mountPath: "/usr/share/nginx/html" 18 | name: task-pv-storage 19 | 20 | 21 | -------------------------------------------------------------------------------- /tests/k8s/pv-volume.yaml: -------------------------------------------------------------------------------- 1 | kind: PersistentVolume 2 | apiVersion: v1 3 | metadata: 4 | name: task-pv-volume 5 | labels: 6 | type: local 7 | spec: 8 | storageClassName: standard 9 | capacity: 10 | storage: 10Gi 11 | accessModes: 12 | - ReadWriteOnce 13 | hostPath: 14 | path: "/mnt/skydive-test-storage" 15 | -------------------------------------------------------------------------------- /tests/k8s/replicaset.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: ReplicaSet 3 | metadata: 4 | name: skydive-test-replicaset 5 | labels: 6 | app: guestbook 7 | tier: frontend 8 | spec: 9 | # this replicas value is default 10 | # modify it according to your case 11 | replicas: 3 12 | selector: 13 | matchLabels: 14 | tier: frontend 15 | matchExpressions: 16 | - {key: tier, operator: In, values: [frontend]} 17 | template: 18 | metadata: 19 | labels: 20 | app: guestbook 21 | tier: frontend 22 | spec: 23 | containers: 24 | - name: skydive-test-replicaset-php-redis 25 | image: gcr.io/google_samples/gb-frontend:v3 26 | resources: 27 | requests: 28 | cpu: 100m 29 | memory: 100Mi 30 | env: 31 | - name: GET_HOSTS_FROM 32 | value: dns 33 | # If your cluster config does not include a dns service, then to 34 | # instead access environment variables to find service host 35 | # info, comment out the 'value: dns' line above, and uncomment the 36 | # line below. 37 | # value: env 38 | ports: 39 | - containerPort: 80 40 | -------------------------------------------------------------------------------- /tests/k8s/replicationcontroller.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ReplicationController 3 | metadata: 4 | name: skydive-test-replicationcontroller 5 | spec: 6 | replicas: 3 7 | selector: 8 | app: skydive-test-replicationcontroller 9 | template: 10 | metadata: 11 | name: skydive-test-replicationcontroller 12 | labels: 13 | app: skydive-test-replicationcontroller 14 | spec: 15 | containers: 16 | - name: skydive-test-replicationcontroller 17 | image: nginx 18 | ports: 19 | - containerPort: 80 20 | -------------------------------------------------------------------------------- /tests/k8s/secret.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Secret 3 | metadata: 4 | name: skydive-test-secret 5 | namespace: default 6 | type: Opaque 7 | data: 8 | # echo -n 'admin' | base64 9 | # YWRtaW4= 10 | username: YWRtaW4= 11 | password: YWRtaW4= 12 | -------------------------------------------------------------------------------- /tests/k8s/service-pod.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: skydive-test-service-pod 5 | spec: 6 | selector: 7 | app: skydive-test-service-pod 8 | ports: 9 | - protocol: TCP 10 | port: 80 11 | targetPort: 9376 12 | --- 13 | apiVersion: v1 14 | kind: Pod 15 | metadata: 16 | name: skydive-test-service-pod 17 | labels: 18 | app: skydive-test-service-pod 19 | spec: 20 | containers: 21 | - name: nginx 22 | image: nginx 23 | ports: 24 | - containerPort: 9376 25 | -------------------------------------------------------------------------------- /tests/k8s/service.yaml: -------------------------------------------------------------------------------- 1 | kind: Service 2 | apiVersion: v1 3 | metadata: 4 | name: skydive-test-service 5 | spec: 6 | ports: 7 | - protocol: TCP 8 | port: 1080 9 | targetPort: 9376 10 | -------------------------------------------------------------------------------- /tests/k8s/statefulset.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: skydive-test-statefulset-nginx 5 | labels: 6 | app: skydive-test-statefulset-nginx 7 | spec: 8 | ports: 9 | - port: 80 10 | name: skydive-test-statefulset 11 | clusterIP: None 12 | selector: 13 | app: skydive-test-statefulset-nginx 14 | --- 15 | apiVersion: apps/v1 16 | kind: StatefulSet 17 | metadata: 18 | name: skydive-test-statefulset 19 | spec: 20 | serviceName: "skydive-test-statefulset-nginx" 21 | replicas: 2 22 | selector: 23 | matchLabels: 24 | app: skydive-test-statefulset-nginx 25 | template: 26 | metadata: 27 | labels: 28 | app: skydive-test-statefulset-nginx 29 | spec: 30 | containers: 31 | - name: skydive-test-statefulset-nginx 32 | image: k8s.gcr.io/nginx-slim:0.8 33 | ports: 34 | - containerPort: 80 35 | name: skydive-test-statefulset-web 36 | volumeMounts: 37 | - name: skydive-test-statefulset-www 38 | mountPath: /usr/share/nginx/html 39 | volumeClaimTemplates: 40 | - metadata: 41 | name: skydive-test-statefulset-www 42 | spec: 43 | accessModes: [ "ReadWriteOnce" ] 44 | resources: 45 | requests: 46 | storage: 1Gi 47 | -------------------------------------------------------------------------------- /tests/k8s/storageclass.yaml: -------------------------------------------------------------------------------- 1 | kind: StorageClass 2 | apiVersion: storage.k8s.io/v1 3 | metadata: 4 | namespace: kube-system 5 | name: skydive-test-storageclass 6 | annotations: 7 | storageclass.beta.kubernetes.io/is-default-class: "true" 8 | labels: 9 | addonmanager.kubernetes.io/mode: Reconcile 10 | 11 | provisioner: k8s.io/minikube-hostpath 12 | -------------------------------------------------------------------------------- /tests/libvirt/device.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | -------------------------------------------------------------------------------- /tests/libvirt/network.xml: -------------------------------------------------------------------------------- 1 | 2 | testnet 3 | d0e9964a-f91a-40c0-b769-a609aee41bf2 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /tests/pcaptraces/eth-ip4-arp-dns-req-http-google.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/tests/pcaptraces/eth-ip4-arp-dns-req-http-google.pcap -------------------------------------------------------------------------------- /tests/pcaptraces/lldp-detailed.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skydive-project/skydive/a4452f21475423ba507db191901357fec8ac98fe/tests/pcaptraces/lldp-detailed.pcap -------------------------------------------------------------------------------- /topology/probes/blockdev/no_blockdev.go: -------------------------------------------------------------------------------- 1 | // +build !linux 2 | 3 | /* 4 | * Copyright (C) 2019 Red Hat, Inc. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy ofthe License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specificlanguage governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | 20 | package blockdev 21 | 22 | import ( 23 | "github.com/skydive-project/skydive/probe" 24 | tp "github.com/skydive-project/skydive/topology/probes" 25 | ) 26 | 27 | // Init initializes a new topology block device probe 28 | func (p *ProbeHandler) Init(ctx tp.Context, bundle *probe.Bundle) (probe.Handler, error) { 29 | return nil, probe.ErrNotImplemented 30 | } 31 | -------------------------------------------------------------------------------- /topology/probes/docker/no_docker.go: -------------------------------------------------------------------------------- 1 | // +build !linux 2 | 3 | /* 4 | * Copyright (C) 2016 Red Hat, Inc. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy ofthe License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specificlanguage governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | 20 | package docker 21 | 22 | import ( 23 | "github.com/skydive-project/skydive/probe" 24 | tp "github.com/skydive-project/skydive/topology/probes" 25 | ) 26 | 27 | // NewProbe returns a new topology Docker probe 28 | func NewProbe(ctx tp.Context, bundle *probe.Bundle) (probe.Handler, error) { 29 | return nil, probe.ErrNotImplemented 30 | } 31 | 32 | // Register registers graph metadata decoders 33 | func Register() { 34 | } 35 | -------------------------------------------------------------------------------- /topology/probes/hardware/no_hardware.go: -------------------------------------------------------------------------------- 1 | // +build !linux 2 | 3 | /* 4 | * Copyright (C) 2018 Red Hat, Inc. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy ofthe License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specificlanguage governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | 20 | package hardware 21 | 22 | func getIsolatedCPUs() ([]int64, error) { 23 | return nil, nil 24 | } 25 | 26 | func getInstanceID() (string, error) { 27 | return "", nil 28 | } 29 | 30 | func getKernelCmd() (map[string]interface{}, error) { 31 | return nil, nil 32 | } 33 | -------------------------------------------------------------------------------- /topology/probes/istio/graph.go: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 IBM Corp. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy ofthe License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specificlanguage governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | 18 | package istio 19 | 20 | const ( 21 | // Manager is the manager value for Istio 22 | Manager = "istio" 23 | detailsField = "Istio" 24 | ) 25 | -------------------------------------------------------------------------------- /topology/probes/libvirt/no_libvirt.go: -------------------------------------------------------------------------------- 1 | //go:build !linux 2 | 3 | /* 4 | * Copyright (C) 2018 Orange 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy ofthe License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specificlanguage governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | 20 | package libvirt 21 | 22 | import ( 23 | "github.com/skydive-project/skydive/probe" 24 | tp "github.com/skydive-project/skydive/topology/probes" 25 | ) 26 | 27 | // NewProbe returns a new topology Libvirt probe 28 | func NewProbe(ctx tp.Context, bundle *probe.Bundle) (probe.Handler, error) { 29 | return nil, probe.ErrNotImplemented 30 | } 31 | 32 | // Register registers graph metadata decoders 33 | func Register() { 34 | } 35 | -------------------------------------------------------------------------------- /topology/probes/lldp/no_lldp.go: -------------------------------------------------------------------------------- 1 | //go:build !linux 2 | 3 | /* 4 | * Copyright (C) 2018 Red Hat, Inc. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy ofthe License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specificlanguage governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | 20 | package lldp 21 | 22 | import ( 23 | "github.com/skydive-project/skydive/probe" 24 | tp "github.com/skydive-project/skydive/topology/probes" 25 | ) 26 | 27 | // NewProbe returns a new LLDP probe 28 | func NewProbe(ctx tp.Context, bundle *probe.Bundle) (probe.Handler, error) { 29 | return nil, probe.ErrNotImplemented 30 | } 31 | 32 | // Register registers graph metadata decoders 33 | func Register() { 34 | } 35 | -------------------------------------------------------------------------------- /topology/probes/lldp/rawsockaddr_signed_int.go: -------------------------------------------------------------------------------- 1 | // +build linux,!ppc64le 2 | 3 | /* 4 | * Copyright (C) 2019 Red Hat, Inc. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy ofthe License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specificlanguage governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | 20 | package lldp 21 | 22 | import ( 23 | "net" 24 | "syscall" 25 | ) 26 | 27 | func rawSocketaddrFromMAC(mac net.HardwareAddr) (sockaddr syscall.RawSockaddr) { 28 | for i, n := range mac { 29 | sockaddr.Data[i] = int8(n) 30 | } 31 | return 32 | } 33 | -------------------------------------------------------------------------------- /topology/probes/lldp/rawsockaddr_unsigned_int.go: -------------------------------------------------------------------------------- 1 | // +build linux,ppc64le 2 | 3 | /* 4 | * Copyright (C) 2019 Red Hat, Inc. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy ofthe License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specificlanguage governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | 20 | package lldp 21 | 22 | import ( 23 | "net" 24 | "syscall" 25 | ) 26 | 27 | func rawSocketaddrFromMAC(mac net.HardwareAddr) (sockaddr syscall.RawSockaddr) { 28 | for i, n := range mac { 29 | sockaddr.Data[i] = uint8(n) 30 | } 31 | return 32 | } 33 | -------------------------------------------------------------------------------- /topology/probes/lxd/no_lxd.go: -------------------------------------------------------------------------------- 1 | //go:build !linux || !lxd 2 | 3 | /* 4 | * Copyright (C) 2018 Iain Grant 5 | * Copyright (C) 2018 Red Hat, Inc. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy ofthe License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specificlanguage governing permissions and 17 | * limitations under the License. 18 | * 19 | */ 20 | 21 | package lxd 22 | 23 | import ( 24 | "github.com/skydive-project/skydive/probe" 25 | tp "github.com/skydive-project/skydive/topology/probes" 26 | ) 27 | 28 | // NewProbe returns a new topology LXD probe 29 | func NewProbe(ctx tp.Context, bundle *probe.Bundle) (probe.Handler, error) { 30 | return nil, probe.ErrNotImplemented 31 | } 32 | 33 | // Register registers graph metadata decoders 34 | func Register() { 35 | } 36 | -------------------------------------------------------------------------------- /topology/probes/netlink/no_netlink.go: -------------------------------------------------------------------------------- 1 | //go:build !linux 2 | 3 | /* 4 | * Copyright (C) 2015 Red Hat, Inc. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy ofthe License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specificlanguage governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | 20 | package netlink 21 | 22 | import ( 23 | "github.com/skydive-project/skydive/probe" 24 | tp "github.com/skydive-project/skydive/topology/probes" 25 | ) 26 | 27 | // NewProbe returns a new topology netlink probe 28 | func NewProbe(ctx tp.Context, bundle *probe.Bundle) (probe.Handler, error) { 29 | return nil, probe.ErrNotImplemented 30 | } 31 | 32 | // Register registers graph metadata decoders 33 | func Register() { 34 | } 35 | -------------------------------------------------------------------------------- /topology/probes/netns/no_netns.go: -------------------------------------------------------------------------------- 1 | //go:build !linux 2 | 3 | /* 4 | * Copyright (C) 2018 Red Hat, Inc. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy ofthe License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specificlanguage governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | 20 | package netns 21 | 22 | import ( 23 | "github.com/skydive-project/skydive/probe" 24 | tp "github.com/skydive-project/skydive/topology/probes" 25 | ) 26 | 27 | // NewProbe returns a new network namespace probe 28 | func NewProbe(ctx tp.Context, bundle *probe.Bundle) (probe.Handler, error) { 29 | return nil, probe.ErrNotImplemented 30 | } 31 | -------------------------------------------------------------------------------- /topology/probes/opencontrail/no_opencontrail.go: -------------------------------------------------------------------------------- 1 | //go:build !linux || !opencontrail 2 | 3 | /* 4 | * Copyright (C) 2018 Orange, Inc. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy ofthe License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specificlanguage governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | 20 | package opencontrail 21 | 22 | import ( 23 | "github.com/skydive-project/skydive/probe" 24 | tp "github.com/skydive-project/skydive/topology/probes" 25 | ) 26 | 27 | // NewProbe returns a new OpenContrail topology probe 28 | func NewProbe(ctx tp.Context, bundle *probe.Bundle) (probe.Handler, error) { 29 | return nil, probe.ErrNotImplemented 30 | } 31 | 32 | // Register registers graph metadata decoders 33 | func Register() { 34 | } 35 | -------------------------------------------------------------------------------- /topology/probes/ovn/no_ovn.go: -------------------------------------------------------------------------------- 1 | //go:build !ovn 2 | 3 | /* 4 | * Copyright (C) 2019 Red Hat, Inc. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy ofthe License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specificlanguage governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | 20 | package ovn 21 | 22 | import ( 23 | "github.com/skydive-project/skydive/graffiti/graph" 24 | "github.com/skydive-project/skydive/probe" 25 | ) 26 | 27 | // NewProbe returns a new OVN topology probe 28 | func NewProbe(g *graph.Graph, address string, certFile string, keyFile string, cacertFile string) (probe.Handler, error) { 29 | return nil, probe.ErrNotImplemented 30 | } 31 | 32 | // Register registers graph metadata decoders 33 | func Register() { 34 | } 35 | -------------------------------------------------------------------------------- /topology/probes/ovn/ovnmodel/gen.go: -------------------------------------------------------------------------------- 1 | package ovnmodel 2 | 3 | //go:generate ../ovnmetagen/ovnmetagen -p ovnmodel -o . ovn-nb.ovsschema 4 | -------------------------------------------------------------------------------- /topology/probes/ovn/ovnmodel/types.go: -------------------------------------------------------------------------------- 1 | package ovnmodel 2 | 3 | // OVNLink describes a Link between two OVN tables 4 | type OVNLink struct { 5 | SourceTable string // source table name 6 | SourceField string // source field name 7 | DestTable string // destination table name 8 | DestField string // destination field table name 9 | Relationship string // relationship type 10 | } 11 | -------------------------------------------------------------------------------- /topology/probes/runc/no_runc.go: -------------------------------------------------------------------------------- 1 | //go:build !linux 2 | 3 | /* 4 | * Copyright (C) 2018 Red Hat, Inc. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy ofthe License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specificlanguage governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | 20 | package runc 21 | 22 | import ( 23 | "github.com/skydive-project/skydive/probe" 24 | tp "github.com/skydive-project/skydive/topology/probes" 25 | ) 26 | 27 | // NewProbe returns a new runc topology probe 28 | func NewProbe(ctx tp.Context, bundle *probe.Bundle) (probe.Handler, error) { 29 | return nil, probe.ErrNotImplemented 30 | } 31 | 32 | // Register registers graph metadata decoders 33 | func Register() { 34 | } 35 | -------------------------------------------------------------------------------- /topology/probes/socketinfo/no_socket_info.go: -------------------------------------------------------------------------------- 1 | //go:build !linux 2 | 3 | /* 4 | * Copyright (C) 2018 Red Hat, Inc. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy ofthe License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specificlanguage governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | 20 | package socketinfo 21 | 22 | import ( 23 | "github.com/skydive-project/skydive/probe" 24 | tp "github.com/skydive-project/skydive/topology/probes" 25 | ) 26 | 27 | // NewProbe returns a new socketinfo topology probe 28 | func NewProbe(ctx tp.Context, bundle *probe.Bundle) (probe.Handler, error) { 29 | return nil, probe.ErrNotImplemented 30 | } 31 | -------------------------------------------------------------------------------- /topology/probes/socketinfo/socket_info.go: -------------------------------------------------------------------------------- 1 | //go:build linux 2 | 3 | /* 4 | * Copyright (C) 2019 Red Hat, Inc. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy ofthe License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specificlanguage governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | 20 | package socketinfo 21 | 22 | import ( 23 | "github.com/skydive-project/skydive/probe" 24 | ) 25 | 26 | // ProbeHandler describes a probe that collects active connections 27 | type ProbeHandler struct { 28 | probe.Handler 29 | } 30 | -------------------------------------------------------------------------------- /topology/probes/socketinfo/socket_info_noebpf.go: -------------------------------------------------------------------------------- 1 | //go:build linux && !ebpf 2 | 3 | /* 4 | * Copyright (C) 2017 Red Hat, Inc. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy ofthe License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specificlanguage governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | 20 | package socketinfo 21 | 22 | import ( 23 | "github.com/skydive-project/skydive/probe" 24 | tp "github.com/skydive-project/skydive/topology/probes" 25 | ) 26 | 27 | // NewProbe returns a new socket info topology probe 28 | func NewProbe(ctx tp.Context, bundle *probe.Bundle) (probe.Handler, error) { 29 | return &ProbeHandler{ 30 | Handler: NewProcProbe(ctx), 31 | }, nil 32 | } 33 | -------------------------------------------------------------------------------- /topology/probes/vpp/no_vpp.go: -------------------------------------------------------------------------------- 1 | //go:build !linux || !vpp 2 | 3 | /* 4 | * Copyright (C) 2018 Red Hat, Inc. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy ofthe License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specificlanguage governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | 20 | package vpp 21 | 22 | import ( 23 | "github.com/skydive-project/skydive/probe" 24 | tp "github.com/skydive-project/skydive/topology/probes" 25 | ) 26 | 27 | // NewProbe returns a new VPP probe 28 | func NewProbe(ctx tp.Context, bundle *probe.Bundle) (probe.Handler, error) { 29 | return nil, probe.ErrNotImplemented 30 | } 31 | -------------------------------------------------------------------------------- /version/version.go: -------------------------------------------------------------------------------- 1 | package version 2 | 3 | import ( 4 | "fmt" 5 | "io" 6 | "os" 7 | ) 8 | 9 | // Package is the overall, canonical project import path under which the 10 | // package was built. 11 | var Package = "github.com/skydive-project/skydive" 12 | 13 | // Version indicates which version of the binary is running. 14 | var Version = "unknown" 15 | 16 | // FprintVersion outputs the version string to the writer, in the following 17 | // format, followed by a newline: 18 | // 19 | // 20 | // 21 | // For example, a binary "registry" built from github.com/docker/distribution 22 | // with version "v1.0.0" would print the following: 23 | // 24 | // skydive_agent github.com/skydive-project/skydive v1.0.0 25 | // 26 | func FprintVersion(w io.Writer) { 27 | fmt.Fprintln(w, os.Args[0], Package, Version) 28 | } 29 | 30 | // PrintVersion outputs the version information, from Fprint, to stdout. 31 | func PrintVersion() { 32 | FprintVersion(os.Stdout) 33 | } 34 | --------------------------------------------------------------------------------