Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement restart command (Closes #98) #393

Merged
merged 2 commits into from
Sep 8, 2014
Merged

Implement restart command (Closes #98) #393

merged 2 commits into from
Sep 8, 2014

Conversation

marksteve
Copy link

No description provided.

@d11wtq
Copy link

d11wtq commented Aug 8, 2014

Thanks for this. Looks nice and straightforward. Would you mind adding a short integration test?

@marksteve
Copy link
Author

👌

@marksteve
Copy link
Author

@d11wtq Rebased with master :)

@d11wtq
Copy link

d11wtq commented Aug 10, 2014

LGTM 👍

@aanand
Copy link

aanand commented Aug 11, 2014

This doesn't seem to preserve links for me. If I run the homepage example:

$ fig up -d
Recreating homepage_redis_1...
Recreating homepage_web_1...

$ curl boot2docker:5000
Hello World! I have been seen 7 times.

$ fig restart
Restarting homepage_web_1...
Restarting homepage_redis_1...

$ curl boot2docker:5000
...error output...

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1836, in __call__
    return self.wsgi_app(environ, start_response)
  File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1820, in wsgi_app
    response = self.make_response(self.handle_exception(e))
  File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1403, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1817, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1477, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1381, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1475, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1461, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/code/app.py", line 9, in hello
    redis.incr('hits')
  File "/usr/local/lib/python2.7/site-packages/redis/client.py", line 842, in incr
    return self.execute_command('INCRBY', name, amount)
  File "/usr/local/lib/python2.7/site-packages/redis/client.py", line 534, in execute_command
    connection.send_command(*args)
  File "/usr/local/lib/python2.7/site-packages/redis/connection.py", line 532, in send_command
    self.send_packed_command(self.pack_command(*args))
  File "/usr/local/lib/python2.7/site-packages/redis/connection.py", line 508, in send_packed_command
    self.connect()
  File "/usr/local/lib/python2.7/site-packages/redis/connection.py", line 412, in connect
    raise ConnectionError(self._error_message(e))
ConnectionError: Error 113 connecting to redis_1:6379. No route to host.

Is the order of restarting wrong?

Signed-off-by: Mark Steve Samson <hello@marksteve.com>
@marksteve
Copy link
Author

@aanand Oops. Just followed the kill method. Removed the reversed call.

@aanand
Copy link

aanand commented Aug 13, 2014

LGTM

@aanand
Copy link

aanand commented Aug 13, 2014

Hm, strike that - getting an integration test failure.

$ nosetests tests.integration.cli_test:CLITestCase.test_restart
F
======================================================================
FAIL: test_restart (tests.integration.cli_test.CLITestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/aanand/work/orchard/fig/tests/integration/cli_test.py", line 201, in test_restart
    self.assertEqual(len(containers), 1)
AssertionError: 0 != 1
-------------------- >> begin captured logging << --------------------
requests.packages.urllib3.connectionpool: INFO: Starting new HTTP connection (1): 192.168.59.103
requests.packages.urllib3.connectionpool: DEBUG: "POST /v1.12/images/create?tag=latest&fromImage=busybox HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "GET /v1.12/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "GET /v1.12/images/json?only_ids=0&all=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: INFO: Starting new HTTP connection (1): 192.168.59.103
requests.packages.urllib3.connectionpool: DEBUG: "GET /v1.12/containers/json?all=1&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 None
requests.packages.urllib3.connectionpool: DEBUG: "POST /v1.12/containers/create?name=simplefigfile_simple_1 HTTP/1.1" 201 90
requests.packages.urllib3.connectionpool: DEBUG: "GET /v1.12/containers/d1ddd9ceff1f1be60dfbe3ce3fd66a7b7445b3d97f350a30c0dd279b15c10d52/json HTTP/1.1" 200 1350
requests.packages.urllib3.connectionpool: INFO: Starting new HTTP connection (1): 192.168.59.103
requests.packages.urllib3.connectionpool: DEBUG: "GET /v1.12/containers/json?all=0&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 2
requests.packages.urllib3.connectionpool: DEBUG: "GET /v1.12/containers/json?all=0&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 2
requests.packages.urllib3.connectionpool: DEBUG: "GET /v1.12/containers/json?all=0&limit=-1&trunc_cmd=1&size=0 HTTP/1.1" 200 2
--------------------- >> end captured logging << ---------------------

----------------------------------------------------------------------
Ran 1 test in 4.259s

FAILED (failures=1)

Signed-off-by: Mark Steve Samson <hello@marksteve.com>
@marksteve
Copy link
Author

@aanand Sorry. Forgot that CI was no longer running integration tests. I didn't try testing locally :P Fixed the test.

@aanand
Copy link

aanand commented Aug 14, 2014

LGTM

@prologic
Copy link

+1

@marksteve
Copy link
Author

Ping

@bfirsh
Copy link

bfirsh commented Sep 8, 2014

LGTM

bfirsh added a commit that referenced this pull request Sep 8, 2014
Implement restart command (Closes #98)
@bfirsh bfirsh merged commit ce8ef23 into docker:master Sep 8, 2014
yuval-k pushed a commit to yuval-k/compose that referenced this pull request Apr 10, 2015
Implement restart command (Closes docker#98)
Signed-off-by: Yuval Kohavi <yuval.kohavi@gmail.com>
xulike666 pushed a commit to xulike666/compose that referenced this pull request Jan 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants