mirror of
https://github.com/Telecominfraproject/oopt-gnpy.git
synced 2026-01-27 10:21:48 +00:00
docker image update + readme
This commit is contained in:
@@ -1,3 +1,3 @@
|
||||
#!/bin/bash
|
||||
cp -nr /oopt-gnpy/gnpy/example-data /shared
|
||||
cp -nr /opt/application/oopt-gnpy/gnpy/example-data /shared
|
||||
exec "$@"
|
||||
|
||||
19
Dockerfile
19
Dockerfile
@@ -1,8 +1,15 @@
|
||||
FROM python:3.7-slim
|
||||
COPY . /oopt-gnpy
|
||||
WORKDIR /oopt-gnpy
|
||||
RUN apt update; apt install -y git
|
||||
RUN pip install .
|
||||
WORKDIR /shared/example-data
|
||||
ENTRYPOINT ["/oopt-gnpy/.docker-entry.sh"]
|
||||
WORKDIR /opt/application/oopt-gnpy
|
||||
RUN mkdir -p /shared/example-data \
|
||||
&& groupadd gnpy \
|
||||
&& useradd -g gnpy -m gnpy \
|
||||
&& apt-get update \
|
||||
&& apt-get install git -y \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
COPY . /opt/application/oopt-gnpy
|
||||
WORKDIR /opt/application/oopt-gnpy
|
||||
RUN pip install . \
|
||||
&& chown -Rc gnpy:gnpy /opt/application/oopt-gnpy /shared/example-data
|
||||
USER gnpy
|
||||
ENTRYPOINT ["/opt/application/oopt-gnpy/.docker-entry.sh"]
|
||||
CMD ["/bin/bash"]
|
||||
|
||||
19
README.rst
19
README.rst
@@ -128,6 +128,25 @@ As a result transponder type is not part of the network info. it is related to t
|
||||
|
||||
The current version includes a spectrum assigment features that enables to compute a candidate spectrum assignment for each service based on a first fit policy. Spectrum is assigned based on service specified spacing value, path_bandwidth value and selected mode for the transceiver. This spectrum assignment includes a basic capacity planning capability so that the spectrum resource is limited by the frequency min and max values defined for the links. If the requested services reach the link spectrum capacity, additional services feasibility are computed but marked as blocked due to spectrum reason.
|
||||
|
||||
REST API (experimental)
|
||||
-----------------------
|
||||
``gnpy`` provides an experimental api for requesting several paths at once. It is based on Flask server.
|
||||
You can run it through command line or Docker.
|
||||
|
||||
.. code-block:: shell-session
|
||||
|
||||
$ gnpy-rest
|
||||
|
||||
.. code-block:: shell-session
|
||||
|
||||
$ docker run -p 8080:8080 -dit xxxx gnpy-rest
|
||||
|
||||
After starting the api server, you can lauch a request
|
||||
|
||||
.. code-block:: shell-session
|
||||
|
||||
$ curl -v -X POST -H "Content-Type: application/json" -d @<PATH_TO_JSON_REQUEST_FILE> http://localhost:8080/api/v1/path-computation
|
||||
|
||||
|
||||
Contributing
|
||||
------------
|
||||
|
||||
@@ -165,7 +165,7 @@ def _init_app():
|
||||
def main():
|
||||
_init_logger()
|
||||
_init_app()
|
||||
app.run(port=8080)
|
||||
app.run(host='0.0.0.0', port=8080)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
Reference in New Issue
Block a user