Giter VIP home page Giter VIP logo

nata's Introduction

nata's People

Contributors

a-r-g-v avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

nata's Issues

AttributeError: 'NoneType' object has no attribute '__dict__'

$ nata service switch apiserver-develop apiserver-develop7a7867
nata app delete Waiting for operation to finish...
done.
Traceback (most recent call last):
  File "/usr/local/bin/nata", line 9, in <module>
    load_entry_point('nata==0.1', 'console_scripts', 'nata')()
  File "/usr/local/lib/python2.7/dist-packages/nata-0.1-py2.7.egg/nata/__init__.py", line 92, in main
    parser()
  File "/usr/local/lib/python2.7/dist-packages/nata-0.1-py2.7.egg/nata/__init__.py", line 81, in parser
    service_parser()
  File "/usr/local/lib/python2.7/dist-packages/nata-0.1-py2.7.egg/nata/__init__.py", line 53, in service_parser
    ServiceUseCase.switch(sys.argv[3], sys.argv[4])
  File "/usr/local/lib/python2.7/dist-packages/nata-0.1-py2.7.egg/nata/usecases.py", line 105, in switch
    ServiceMapper.update(service)
  File "/usr/local/lib/python2.7/dist-packages/nata-0.1-py2.7.egg/nata/mappers.py", line 124, in update
    AppMapper.update(app)
  File "/usr/local/lib/python2.7/dist-packages/nata-0.1-py2.7.egg/nata/mappers.py", line 214, in update
    elif key in app_record.__dict__:
AttributeError: 'NoneType' object has no attribute '__dict__'
zsh: exit 1     nata service switch apiserver-develop apiserver-develop7a7867

Support Rolling Update

backendServices().getHealth() を見ながら,100%を維持しながら古いインスタンスを消していく.

Mappers を実装する

  • AppMapper
  • LbMapper
  • ServiceMapper

Mapper が Resource を管理するかどうかも検討する

always Image None

$ nata app list
+----------------+----------+---------+-------+---------------+
|      name      | service  | primary | image |  created_date |
+----------------+----------+---------+-------+---------------+
| test-app59b9b5 | test-app |   Yes   |  None | 5 minutes ago |
| test-app8b1a27 | test-app |    No   |  None | 3 minutes ago |
+----------------+----------+---------+-------+---------------+

Service を削除した時に App をいつ消すか

======================================================================
ERROR: test_service (tests.test_usecases.UsecaseTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/debian/nata/tests/test_usecases.py", line 73, in test_service
    ServiceUseCase.delete('push7-test-service-uc')
  File "/home/debian/nata/nata/usecases.py", line 62, in delete
    ServiceMapper.delete(service)
  File "/home/debian/nata/nata/mappers.py", line 58, in delete
    session.commit()
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/scoping.py", line 157, in do
    return getattr(self.registry(), name)(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/session.py", line 874, in commit
    self.transaction.commit()
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/session.py", line 461, in commit
    self._prepare_impl()
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/session.py", line 441, in _prepare_impl
    self.session.flush()
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/session.py", line 2136, in flush
    self._flush(objects)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/session.py", line 2254, in _flush
    transaction.rollback(_capture_exception=True)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/util/langhelpers.py", line 60, in __exit__
    compat.reraise(exc_type, exc_value, exc_tb)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/session.py", line 2218, in _flush
    flush_context.execute()
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/unitofwork.py", line 386, in execute
    rec.execute(self)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/unitofwork.py", line 545, in execute
    uow
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/persistence.py", line 172, in save_obj
    mapper, table, update)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/persistence.py", line 726, in _emit_update_statements
    execute(statement, multiparams)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 945, in execute
    return meth(self, multiparams, params)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/sql/elements.py", line 263, in _execute_on_connection
    return connection._execute_clauseelement(self, multiparams, params)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1053, in _execute_clauseelement
    compiled_sql, distilled_params
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1189, in _execute_context
    context)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1393, in _handle_dbapi_exception
    exc_info
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/util/compat.py", line 202, in raise_from_cause
    reraise(type(exception), exception, tb=exc_tb, cause=cause)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1182, in _execute_context
    context)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/default.py", line 462, in do_execute
    cursor.execute(statement, parameters)
IntegrityError: (sqlite3.IntegrityError) NOT NULL constraint failed: app.serviceno [SQL: u'UPDATE app SET serviceno=? WHERE app.no = ?'] [parameters: (None, 3)]

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.