Skip to content
This repository was archived by the owner on Sep 3, 2022. It is now read-only.

Adding a Python 3 Kernel to Datalab. #1344

Merged
merged 7 commits into from
May 1, 2017
Merged

Adding a Python 3 Kernel to Datalab. #1344

merged 7 commits into from
May 1, 2017

Conversation

chmeyers
Copy link
Contributor

@chmeyers chmeyers commented Apr 28, 2017

Installs Python 3 and py3 versions of our supported packages,
including the python3 jupyter kernel, and adds a dropdown to
the notebook page to allow users to switch kernels.

Docker Image size goes from 1.734GB -> 2.507GB, almost all of which is due to the size of the python3 packages. I've added a "py2 only" container build in case someone needs the smaller image.

Fixes #902

Somewhat based on yebrahim's py3 branch:
master...yebrahim:yebrahim/py3

Installs Python 3 and py3 versions of our supported packages,
including the python3 jupyter kernel, and adds a dropdown to
the notebook page to allow users to switch kernels.
@chmeyers chmeyers requested a review from yebrahim April 28, 2017 17:42
Copy link
Contributor

@yebrahim yebrahim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it looks good overall, except for a few UI things I think must've broken.

Are we ready to make these changes though?

pip3 install -U --upgrade-strategy only-if-needed --no-cache-dir seaborn==0.7.0 && \
pip3 install -U --upgrade-strategy only-if-needed --no-cache-dir PyYAML==3.11 && \
pip3 install -U --upgrade-strategy only-if-needed --no-cache-dir six==1.10.0 && \
# Install notebook after ipywidgets, and keep it pinned to 4.2.3, higher versions may
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment should move down to line 136?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or be removed entirely, since we have a comment below explaining we're overriding this anyway.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -0,0 +1,175 @@
# Copyright 2015 Google Inc. All rights reserved.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No changes here from the original Dockerfile, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is just a branch.

@@ -32,3 +32,4 @@ fi

trap 'rm -rf pydatalab' exit
docker build ${DOCKER_BUILD_ARGS} -t datalab-base .
docker build ${DOCKER_BUILD_ARGS} -t datalab-base-py2 -f Dockerfile.py2 .
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This script is used for local development only, not release, so we should just put datalab-base here, and maybe add an optional argument to also build datalab-base-py2.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -34,6 +34,7 @@ fi
cd $(dirname $0)

cat Dockerfile.in | sed $VERSION_SUBSTITUTION | sed $COMMIT_SUBSTITUTION > Dockerfile
cat Dockerfile.in | sed $VERSION_SUBSTITUTION | sed $COMMIT_SUBSTITUTION | sed "s/datalab-base/datalab-base-py2/" > Dockerfile.py2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as above for this file, I think we should only build the py2py3 docker file for local development, and have the py2 image built on demand.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

<span class="toolbar-text">Kernel: </span>
<span id="currentKernelName"></span>
</button>
<ul class="dropdown-menu" id="kernelSelectorDropdown">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add a screenshot for this to start discussion on the design? I didn't actually put much thought into how usable this is at the time I made those changes, it was the simplest thing to do for switching kernels.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -161,6 +161,15 @@
<li id="interruptKernelButton"><a href="#">Interrupt Execution</a></li>
</ul>
</div>
<div class="btn-group">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding another button to the toolbar will likely need changes to the minimum width of screen, and the media size decorators.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@chmeyers
Copy link
Contributor Author

Screenshot of UX:
image

Copy link
Contributor

@yebrahim yebrahim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@chmeyers chmeyers merged commit f1160b0 into master May 1, 2017
@chmeyers chmeyers deleted the chmeyers-python3 branch May 1, 2017 18:01
@chmeyers
Copy link
Contributor Author

chmeyers commented May 2, 2017

Did some investigation with the first official build that has this.

Docker image compressed on GCR is 790MB vs 566 MB for the previous version. Expectation is that initial startup time for VMs is increased by ~15s.

RAM usage didn't seem to change significantly, this and the previous version appeared to use within tens of MB of each other.

@nikhilk
Copy link
Contributor

nikhilk commented May 2, 2017

That's good to hear that there are no immediate significant issues.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants