Merge "OAuth2 support"
[pti/o2.git] / docs / developer-guide.rst
1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2 .. SPDX-License-Identifier: CC-BY-4.0
3 .. Copyright (C) 2021 Wind River Systems, Inc.
4
5 Developer-Guide
6 ===============
7
8 .. contents::
9    :depth: 3
10    :local:
11
12
13 This project implements a reference implementation for O-RAN O2 IMS and DMS to expose the INF platform to SMO with the O2 interface.
14
15 To contribute to this project, you are supposed to be familiar with the INF platform as well as O-RAN O2 interface specifications:
16
17 - `O-RAN SC INF platfrom`_
18 - `O-RAN O2 interface`_
19
20 .. _`O-RAN SC INF platfrom`: https://docs.o-ran-sc.org/en/latest/projects.html#infrastructure-inf
21 .. _`O-RAN O2 interface`: https://oranalliance.atlassian.net/wiki/spaces/COWG/overview
22
23
24
25 1. Prerequisite for building environment
26 ----------------------------------------
27
28 * A ubuntu 18.04 host is sufficient to build o2 projects
29
30 .. code:: shell
31
32   # clone code from gerrit repo
33   $ git clone "https://gerrit.o-ran-sc.org/r/pti/o2" && (cd "o2" && mkdir -p .git/hooks && curl -Lo `git rev-parse --git-dir`/hooks/commit-msg https://gerrit.o-ran-sc.org/r/tools/hooks/commit-msg; chmod +x `git rev-parse --git-dir`/hooks/commit-msg)
34   # run unit tests
35   $ sudo apt-get install tox
36   $ tox -e flake8
37   $ tox -e code
38
39
40 2. Local test with docker-compose
41 ---------------------------------
42
43 * To test with docker-compose, a docker engine is supposed to be installed as well
44
45 .. code:: shell
46
47   $ docker-compose build
48   $ docker-compose up -d
49   $ docker-compose run --rm --no-deps --entrypoint=pytest api /tests/unit /tests/integration
50
51
52 3. Test with INF platform
53 -------------------------
54
55 * To test with INF platform, you should install INF platform first, by default you will be able to use the 'admin' user
56
57 .. code:: shell
58
59   $ source ./admin_openrc.sh
60   $ export |grep OS_AUTH_URL
61   $ export |grep OS_USERNAME
62   $ export |grep OS_PASSWORD
63   $ docker-compose run --rm --no-deps --entrypoint=pytest api /tests/integration-ocloud --log-level=DEBUG --log-file=/tests/debug.log
64
65 4. Tear down docker containers
66 ------------------------------
67
68 .. code:: shell
69
70   $ docker-compose down --remove-orphans