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

Already on GitHub? Sign in to your account

Saving states via images #200

Merged
merged 5 commits into from May 22, 2017

Conversation

Projects
None yet
2 participants
Contributor

vchagaev commented May 16, 2017

Users will be able save theirs current states and restore them later using special link.

@anaderi

a general favour:

could you please fix URL to docker.md at /README.md ?

etc/base_config.py
@@ -14,6 +14,9 @@
c.Spawner.remove_containers = True
c.Spawner.tls_assert_hostname = False
c.Spawner.use_docker_client_env = True
+# give users an opportunity to restore any images via docker or not:
+# c.Spawner.user_images_check = False
@anaderi

anaderi May 19, 2017

Owner

maybe call it 'share_user_images'? and set to 'True' by default?

@vchagaev

vchagaev May 19, 2017

Contributor

It is true by default. In case you want toggle that just uncomment line.

share/static/html/home.html
@@ -21,6 +21,7 @@
{% else %}
<p>You don't have a repository with the same name. Do you want to <a id="push" class="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect mdl-button--colored small-button" href="/hub/home?do_fork=1">fork</a> it?</p>
{% endif %}
+ <p>Also you can save current state. You will be able easily restore your work later. Just <a id="commit" class="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect mdl-button--colored small-button" href="/hub/home?do_commit=1">commit</a> it!</p>
@anaderi

anaderi May 19, 2017

Owner

I'd call it 'save container', otherwise 'commit' looks like something git-related

share/static/html/home.html
- require(["home"]);
+ require(["home", "clipboard"], function (home, Clipboard) {
+ new Clipboard('.notify-url__button');
+ });
@anaderi

anaderi May 19, 2017

Owner

cool stuff! can you add the same copy-to-clipboard handlers to URLs of repo examples at the launch page?

@vchagaev

vchagaev May 19, 2017

Contributor

added "hand-made" copy-pase for examples))

everware/home_handler.py
+
+ self.log.info('Will commit %s' % url_with_image)
+
+ spawner.client.commit(
@anaderi

anaderi May 19, 2017

Owner

why do you call it synchronously? it will make the whole service unresponsive for all users until it stops. consider yield user.spawner.docker (see github_agent or home_handler for example)

@vchagaev

vchagaev May 19, 2017

Contributor

omg, my bad

@anaderi anaderi merged commit 5771528 into everware:master May 22, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment