Skip to content

Commit

Permalink
update PSA placement readme
Browse files Browse the repository at this point in the history
  • Loading branch information
hadik3r committed Nov 14, 2017
1 parent fd7f68b commit c5d9381
Show file tree
Hide file tree
Showing 13 changed files with 20 additions and 19 deletions.
39 changes: 20 additions & 19 deletions son-ssm-examples/PSA_placement/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Placement SSM Example (in progress)
An example of placement SSM taking care of service placement.
# PSA Pilot Placement SSM
Placement SSM to be used for PSA pilot.

## Requires
* Docker
Expand All @@ -9,7 +9,7 @@ An example of placement SSM taking care of service placement.
## Implementation
* Implemented in Python 3.4
* Dependencies: amqp-storm
* The main implementation can be found in: `son-ssm-examples/placement/placement.py`
* The main implementation can be found in: `son-ssm-examples/PSA_placement/placement/placement.py`

## How to run it

Expand All @@ -19,40 +19,41 @@ An example of placement SSM taking care of service placement.

* Run the placement SSM (in a Docker container):
* (do in `son-sm/`)
* `docker build -t sonssmservice1placement1 -f son-ssm-examples/placement/Dockerfile .`
* `docker run -it --rm --link broker:broker --name sonssmservice1placement1 sonssmservice1placement1`
* `docker build -t sonssmpsaplacement1 -f son-ssm-examples/PSA_placement/Dockerfile .`
* `docker run --name sonssmpsaplacement1 --net=sonata --network-alias=sonssmpsaplacement1 sonssmpsaplacement1`

* Or: Run the placement SSM (directly in your terminal not in a Docker container):
* (In `son-sm/son-sm-template/`)
* `python3.4 setup.py install`
* (In `son-sm/son-ssm-examples/placement/`)
* (In `son-sm/son-ssm-examples/PSA_placement/`)
* `python3.4 setup.py develop`
* (In `son-sm/`)
* `python3.4 son-ssm-examples/placement/placement/placement.py`
* `python3.4 son-ssm-examples/PSA_placement/placement/placement.py`

## How to test it
* Do the following; each in a separate terminal.
1. Run the SMR container
1. Run the fake_SMR
2. Run the placement container
3. In son-sm/son-ssm-examples/placement/test run python3.4 placementtrigger.py
3. In son-sm/son-ssm-examples/PSA_placement/placement/test run python3.4 placementtrigger.py

* The expected results are as follows:

* In the SMR terminal:
* In the placementtrigger terminal:

```
DEBUG:son-mano-specific-manager-registry:registration request received for: sonssmservice1placement1
INFO:son-mano-specific-manager-registry:sonssmservice1placement1 status: Placement decision was sent: {'placement': ['from_ssm']}
{'status': 'COMPLETED', 'mapping': {'vnfd2': {'vim': '1234'}, 'vnfd1': {'vim': '1234'}}, 'error': None}
```

* In placement terminal:

```
INFO:son-sm-base:Starting sonssmservice1placement1 ...
INFO:son-sm-base:sonssmservice1placement1 registered with uuid:d88f37a2-6ca4-47cb-a103-833f5fc29fb9
DEBUG:ssm-placement-1:Received registration ok event.
INFO:ssm-placement-1:Subscribed to placement.ssm.1234
WARNING:amqpstorm.channel:Received Basic.Cancel on consumer_tag: q.specific.manager.registry.ssm.registration.2e50cc94-abc8-4663-b1dc-91c12c6a10fa
INFO:ssm-placement-1:Placement request received: {cpu: '20', location: DE, memory: '30'}
INFO:ssm-placement-1:Placement decision was sent: {'placement': ['from_ssm']}
INFO:son-sm-base:Starting sonssmpsaplacement1 ...
INFO:son-sm-base:Sending registration request...
INFO:son-sm-base:sonssmpsaplacement1 registered with uuid:23345
DEBUG:PSA-ssm-placement:Received registration ok event.
INFO:PSA-ssm-placement:Subscribed to placement.ssm.1234
INFO:PSA-ssm-placement:Placement started
INFO:PSA-ssm-placement:Mapping algorithm started.
INFO:PSA-ssm-placement:Mapping succeeded: {'vnfd1': {'vim': '1234'}, 'vnfd2': {'vim': '1234'}}
INFO:PSA-ssm-placement:The mapping calculation has succeeded.
```
File renamed without changes.

0 comments on commit c5d9381

Please sign in to comment.