Commit 1f017d0b authored by Kostis Trantzas's avatar Kostis Trantzas
Browse files

Main documentation refreshing/housekeeping. It is focused on a smoother installation guide.

parent 8cde6dcb
Loading
Loading
Loading
Loading
Loading
+38 −38
Original line number Diff line number Diff line

# Developing

Openslice backend services are mainly implemented with Java 17 or above and Spring boot.
OpenSlice backend services are mainly implemented with Java 17 or above and Spring boot.

Openslice uses various subsystems and depending on the module would you like to work, other subsystems must be present (you can disable them though in the code, e.g. at application.yml file)
OpenSlice uses various subsystems and depending on the module would you like to work, other subsystems must be present (you can disable them though in the code, e.g. at docker-compose.yaml file).

To get the latest development branch:
```
```bash
wget https://labs.etsi.org/rep/osl/code/org.etsi.osl.main/-/raw/develop/compose/deploy.sh 
sudo ./deploy.sh develop  [or replace develop with other branch name]
sudo ./deploy.sh develop  #[or replace develop with other branch name]
```

## Slack

* Slack: https://openslice.slack.com

## General subsystems
You may follow the [installation process](https://osl.etsi.org/documentation/develop/deployment/), as described at "develop" tagged documentation.

- Docker and Docker Compose should be installed in your development environment
To work on a specific subsystem e.g. org.etsi.osl.tmf.api, you must:

### Consul
consul service registry should be up and running. You can launch consul with docker: 
`sudo docker run -d --name consul -p 8500:8500 -p 8600:8600 consul`
1a - Deploy only the core necessary subsystems through:
```bash
sudo docker compose --profile dev down;sudo docker compose --profile dev up -d --build
```
> Note **--profile dev** that will only deploy the core dependency subsystems, instead   of the whole OpenSlice.

### ActiveMQ
ActiveMQ is our messaging system. You can launch an instance of ActiveMQ:
`sudo docker run --name='activemq' -d -e 'ACTIVEMQ_NAME=amqp-srv1' -e 'ACTIVEMQ_REMOVE_DEFAULT_ACCOUNT=true' -e 'ACTIVEMQ_ADMIN_LOGIN=admin' -e 'ACTIVEMQ_ADMIN_PASSWORD=admin' -e 'ACTIVEMQ_WRITE_LOGIN=producer_login' -e 'ACTIVEMQ_WRITE_PASSWORD=producer_password' -e 'ACTIVEMQ_READ_LOGIN=consumer_login' -e 'ACTIVEMQ_READ_PASSWORD=consumer_password' -e 'ACTIVEMQ_JMX_LOGIN=jmx_login' -e 'ACTIVEMQ_JMX_PASSWORD=jmx_password' -e 'ACTIVEMQ_STATIC_TOPICS=topic1;topic2;topic3' -e 'ACTIVEMQ_STATIC_QUEUES=queue1;queue2;queue3' -e 'ACTIVEMQ_MIN_MEMORY=1024' -e  'ACTIVEMQ_MAX_MEMORY=4096' -e 'ACTIVEMQ_ENABLED_SCHEDULER=true' -v /home/ctranoris/testcompose/data/activemq:/data/activemq -v /var/log/activemq:/var/log/activemq -p 8161:8161 -p 61616:61616 -p 61613:61613 webcenter/activemq:5.14.3`
1b - Or alternatively, commend out the respective container from the docker-compose.yaml file, so as to deploy the whole OpenSlice, except the subsystem you want to work on, following the provided installation steps.

### MySQL server
We use mysql as a storage DB. Please make sure that you have it installed in your system. There are instructions on internet how to install it. Check also our docker-compose installation script
2 - Clone the respective repository, e.g. https://labs.etsi.org/rep/osl/code/org.etsi.osl.tmf.api/-/tree/develop

3 - Code :)

## Oauth server
## General requirements

Keycloak is used as the authentication server.
- Docker should be installed in your development environment
- Run the core subsystems (see above sections)

> Note: Please check the Post installation steps -> Keycloak at localhost, at [Deployment/Installation](../deployment.md), if you are developing in a local environment

## Slack

## VNF/NSD Catalog Management and NSD Deployment API service 
Feel free to join OpenSlice [Slack](https://openslice.slack.com) for any development oriented questions

Clone the repository: https://github.com/openslice/org.etsi.osl.portal.api
## Examples on developing on specific subsystems

Check the application.yml file. Default port is 13080. Especially the datasource username/password, server port.
### VNF/NSD Catalog Management and NSD Deployment API service 

make sure that the General subsystems are up and running as well as the OAuth server
Clone the repository: https://labs.etsi.org/rep/osl/code/org.etsi.osl.portal.api/-/tree/develop

run it with `mvn spring-boot:run`
Check the docker-compose.yml file. Default port is 13080. Check specifically the datasource username/password, server port.

You can check your consul server if it registered. 
Make sure that the core subsystems are up and running.

### Swagger API
Swagger API of the service is at `http://localhost:13000/osapi/swagger-ui/`. You can try there various REST actions and authenticate via the OAuth server
Execute it with 
```bash
mvn spring-boot:run
```

For verification, Swagger API of the service is at `http://localhost:13000/osapi/swagger-ui/index.html`. 

## VNF/NSD Catalog Management and NSD Deployment WEB UI service 
There, you may try there various REST actions and authenticate via the OAuth server without the use of the UI.

The Web UI is written in AngularJS

Clone the repository: https://github.com/openslice/org.etsi.osl.portal.web
### VNF/NSD Catalog Management and NSD Deployment WEB UI service 

by default the project org.etsi.osl.portal.api exposes the folder ../org.etsi.osl.portal.web/src/ in a folder testweb (Check class MvcConfig.java in org.etsi.osl.portal.api) for development. (In production nginx is used). Point your browser to `http://localhost:13000/osapi/testweb/index.html/`
The Web UI is written in AngularJS.

Clone the repository: https://labs.etsi.org/rep/osl/code/org.etsi.osl.portal.web/-/tree/develop

---
By default the project org.etsi.osl.portal.api exposes the folder ../org.etsi.osl.portal.web/src/ in a folder testweb (Check class MvcConfig.java in org.etsi.osl.portal.api) for development. (In production nginx is used). Point your browser to `http://localhost:13000/osapi/testweb/index.html/`

## Version/release management

Check this nice article on how we develop and release versions
Check this nice article on how we develop and release versions.

https://nvie.com/posts/a-successful-git-branching-model/

We develop in the develop branch
We develop in the develop branch and follow a issue driven development model.

---
## Wishlist

Check also our wishlist of new features. You can add your own
Check also our wishlist of new features. You can add your own.

See [Wishlist](./wishlist.md)
See [Wishlist](./wishlist.md).