Git Product home page Git Product logo

pt-instances-management's Introduction

PT Anywhere API

Web API for PacketTracer. This API is being developed as part of the FORGE project. For more information about PT Anywhere, please check its official website.

If you are you looking for a client-side application which uses this API check this project.

Check the application building and deploying instructions here. For other documentation, please go to our wiki frontpage.

pt-instances-management's People

Contributors

gomezgoiri avatar

Watchers

 avatar  avatar  avatar

Forkers

srivishnuk wieqli

pt-instances-management's Issues

Pre-create Packet Tracer containers

One of the main problems of creating Packet Tracer instances (i.e., Docker containers running PT) on demand it that it takes a long time to start them (see preliminary performance testing results).

This forces users to wait up to 15 seconds before start interacting with their widget. Furthermore, it makes unit testing unnecessarily slow.

An improvement would be to create containers before users demand them and then pause these containers (so they won't consume CPU, only memory) before they are needed.

Installation fails because of vcversioner

I have only been able to reproduce this error under the following circumstances.

  • Red Hat Enterprise Linux Server release 7.1 (Maipo)
  • pip 1.4.1 and 7.1.2
  • Behind a proxy, which is configured in environment variables.
[user@machine virtualenvdir]$ bin/pip install -e git+https://github.com/gomezgoiri/pt-instances-management.git#egg=ptinstancemanager
Obtaining ptinstancemanager from git+https://github.com/gomezgoiri/pt-instances-management.git#egg=ptinstancemanager
  Updating ./src/ptinstancemanager clone
  Running setup.py egg_info for package ptinstancemanager

(...)

Downloading/unpacking jsonschema>=2.5.1 (from flasgger->ptinstancemanager)
  Downloading jsonschema-2.5.1.tar.gz (50kB): 50kB downloaded
  Running setup.py egg_info for package jsonschema
    Download error on https://pypi.python.org/simple/vcversioner/: [Errno 1] _ssl.c:504: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol -- Some packages may not be found!
    Couldn't find index page for 'vcversioner' (maybe misspelled?)
    Download error on https://pypi.python.org/simple/: [Errno 1] _ssl.c:504: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol -- Some packages may not be found!
    No local packages or download links found for vcversioner
    Traceback (most recent call last):
      File "<string>", line 16, in <module>
      File "/data/user-data/agg96/sss/build/jsonschema/setup.py", line 44, in <module>
        vcversioner={"version_module_paths" : ["jsonschema/_version.py"]},
      File "/usr/lib64/python2.7/distutils/core.py", line 112, in setup
        _setup_distribution = dist = klass(attrs)
      File "/data/user-data/agg96/sss/lib/python2.7/site-packages/setuptools/dist.py", line 265, in __init__
        self.fetch_build_eggs(attrs.pop('setup_requires'))
      File "/data/user-data/agg96/sss/lib/python2.7/site-packages/setuptools/dist.py", line 289, in fetch_build_eggs
        parse_requirements(requires), installer=self.fetch_build_egg
      File "/data/user-data/agg96/sss/lib/python2.7/site-packages/pkg_resources.py", line 618, in resolve
        dist = best[req.key] = env.best_match(req, self, installer)
      File "/data/user-data/agg96/sss/lib/python2.7/site-packages/pkg_resources.py", line 862, in best_match
        return self.obtain(req, installer) # try and download/install
      File "/data/user-data/agg96/sss/lib/python2.7/site-packages/pkg_resources.py", line 874, in obtain
        return installer(requirement)
      File "/data/user-data/agg96/sss/lib/python2.7/site-packages/setuptools/dist.py", line 339, in fetch_build_egg
        return cmd.easy_install(req)
      File "/data/user-data/agg96/sss/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 617, in easy_install
        raise DistutilsError(msg)
    distutils.errors.DistutilsError: Could not find suitable distribution for Requirement.parse('vcversioner')
    Complete output from command python setup.py egg_info:
    Download error on https://pypi.python.org/simple/vcversioner/: [Errno 1] _ssl.c:504: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol -- Some packages may not be found!

Couldn't find index page for 'vcversioner' (maybe misspelled?)

Download error on https://pypi.python.org/simple/: [Errno 1] _ssl.c:504: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol -- Some packages may not be found!

No local packages or download links found for vcversioner

Traceback (most recent call last):

  File "<string>", line 16, in <module>

  File "/data/user-data/agg96/sss/build/jsonschema/setup.py", line 44, in <module>

    vcversioner={"version_module_paths" : ["jsonschema/_version.py"]},

  File "/usr/lib64/python2.7/distutils/core.py", line 112, in setup

    _setup_distribution = dist = klass(attrs)

  File "/data/user-data/agg96/sss/lib/python2.7/site-packages/setuptools/dist.py", line 265, in __init__

    self.fetch_build_eggs(attrs.pop('setup_requires'))

  File "/data/user-data/agg96/sss/lib/python2.7/site-packages/setuptools/dist.py", line 289, in fetch_build_eggs

    parse_requirements(requires), installer=self.fetch_build_egg

  File "/data/user-data/agg96/sss/lib/python2.7/site-packages/pkg_resources.py", line 618, in resolve

    dist = best[req.key] = env.best_match(req, self, installer)

  File "/data/user-data/agg96/sss/lib/python2.7/site-packages/pkg_resources.py", line 862, in best_match

    return self.obtain(req, installer) # try and download/install

  File "/data/user-data/agg96/sss/lib/python2.7/site-packages/pkg_resources.py", line 874, in obtain

    return installer(requirement)

  File "/data/user-data/agg96/sss/lib/python2.7/site-packages/setuptools/dist.py", line 339, in fetch_build_egg

    return cmd.easy_install(req)

  File "/data/user-data/agg96/sss/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 617, in easy_install

    raise DistutilsError(msg)

distutils.errors.DistutilsError: Could not find suitable distribution for Requirement.parse('vcversioner')

----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /data/user-data/agg96/sss/build/jsonschema

Reuse Packet Tracer instances

One of the main problems of creating Packet Tracer instances (i.e., Docker containers running PT) on demand it that it takes time to start them (see preliminary performance testing results).

This forces users to wait up to 15 seconds before start interacting with their widget. Furthermore, it makes unit testing unnecessarily slow.

However, now the PTAnywhere API opens base files with a given topology on session start. Opening a file takes much less time than creating a new container. Therefore reusing existing containers becomes desirable.

This feature is complementary to the one described in the issue #5.

Return container info for an allocation even if it is starting

Preferably allocations should use already running instances (#5). This will avoid waiting for its initialization.

However, if as a result of an allocation a new instance (i.e., container) is created, we could return it even if it is not ready (instead of an unavailability error as we do now). The client (JS app) is already prepared to wait for it anyway...

Manage topologies/scenarios through API

Creation, update and removal of available files to be opened in a container.

Stored data for each scenario/file:

  • Original URL (identifier).
  • File name on the host cache.

Then, the directory (cache) where the files are stored should be mounted in the containers.

Set timeout in critical celery tasks

We should define a timeout for certain operations (e.g., session creation). This way, we avoid the server from getting stuck (e.g., due to a high load).

If the task is not completed in the given time, we should:

  • Return a HTTP error.
  • Rollback any unfinished operation (e.g., instance allocation).

jsonschema version conflict when using run-api command

To solve issue #3 I started using jsonschema's version 2.4.0, which caused another conflict (with easy_install?) when using run-api command:

$ ptapi/bin/run-api -createdb -config config.ini
Traceback (most recent call last):
  File "/data/user-data/agg96/ptapi/bin/run-api", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/data/user-data/agg96/ptapi/lib/python2.7/site-packages/pkg_resources.py", line 3011, in <module>
    parse_requirements(__requires__), Environment()
  File "/data/user-data/agg96/ptapi/lib/python2.7/site-packages/pkg_resources.py", line 630, in resolve
    raise VersionConflict(dist,req) # XXX put more info here
pkg_resources.VersionConflict: (jsonschema 2.4.0 (/data/user-data/agg96/ptapi/lib/python2.7/site-packages), Requirement.parse('jsonschema>=2.5.1'))

functools32 not found when executing run-api

[user@host ~]$ /data/user-data/agg96/ptapi/bin/run-api -createdb -config /data/user-data/agg96/config.ini
Traceback (most recent call last):
File "/data/user-data/agg96/ptapi/bin/run-api", line 5, in
from pkg_resources import load_entry_point
File "/data/user-data/agg96/ptapi/lib/python2.7/site-packages/pkg_resources.py", line 3007, in
working_set.require(requires)
File "/data/user-data/agg96/ptapi/lib/python2.7/site-packages/pkg_resources.py", line 728, in require
needed = self.resolve(parse_requirements(requirements))
File "/data/user-data/agg96/ptapi/lib/python2.7/site-packages/pkg_resources.py", line 626, in resolve
raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: functools32

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.