-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Add SensiML notebook, based on TensorFlow notebook #1234
Closed
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Documentation | ||
README.md | ||
hooks | ||
test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Copyright (c) Jupyter Development Team. | ||
# Distributed under the terms of the Modified BSD License. | ||
ARG BASE_CONTAINER=jupyter/tensorflow-notebook | ||
FROM $BASE_CONTAINER | ||
|
||
LABEL maintainer="Jupyter Project <jupyter@googlegroups.com>" | ||
|
||
# Install SensiML and enable notebook extensions. | ||
RUN pip install --quiet --no-cache-dir \ | ||
'sensiml' && \ | ||
jupyter nbextension enable --py widgetsnbextension --sys-prefix && \ | ||
jupyter nbextension enable --py --sys-prefix bqplot && \ | ||
jupyter nbextension enable --py --sys-prefix qgrid && \ | ||
fix-permissions "${CONDA_DIR}" && \ | ||
fix-permissions "/home/${NB_USER}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[![docker pulls](https://img.shields.io/docker/pulls/jupyter/sensiml-notebook.svg)](https://hub.docker.com/r/jupyter/sensiml-notebook/) | ||
[![docker stars](https://img.shields.io/docker/stars/jupyter/sensiml-notebook.svg)](https://hub.docker.com/r/jupyter/sensiml-notebook/) | ||
[![image metadata](https://images.microbadger.com/badges/image/jupyter/sensiml-notebook.svg)](https://microbadger.com/images/jupyter/sensiml-notebook "jupyter/sensiml-notebook image metadata") | ||
|
||
# Jupyter Notebook Deep Learning Stack | ||
|
||
GitHub Actions in the https://github.com/jupyter/docker-stacks project builds and pushes this image | ||
to Docker Hub. | ||
|
||
Please visit the project documentation site for help using and contributing to this image and | ||
others. | ||
|
||
- [Jupyter Docker Stacks on ReadTheDocs](http://jupyter-docker-stacks.readthedocs.io/en/latest/index.html) | ||
- [Image Specifics :: Tensorflow](http://jupyter-docker-stacks.readthedocs.io/en/latest/using/specifics.html#sensiml) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
# Apply tags | ||
GIT_SHA_TAG=${GITHUB_SHA:0:12} | ||
docker tag $IMAGE_NAME "$DOCKER_REPO:$GIT_SHA_TAG" | ||
|
||
# Update index | ||
INDEX_ROW="|\`${BUILD_TIMESTAMP}\`|\`jupyter/${IMAGE_SHORT_NAME}:${GIT_SHA_TAG}\`|[Git diff](https://github.com/jupyter/docker-stacks/commit/${GITHUB_SHA})<br />[Dockerfile](https://github.com/jupyter/docker-stacks/blob/${GITHUB_SHA}/${IMAGE_SHORT_NAME}/Dockerfile)<br />[Build manifest](./${IMAGE_SHORT_NAME}-${GIT_SHA_TAG})|" | ||
sed "/|-|/a ${INDEX_ROW}" -i "${WIKI_PATH}/Home.md" | ||
|
||
# Build manifest | ||
MANIFEST_FILE="${WIKI_PATH}/manifests/${IMAGE_SHORT_NAME}-${GIT_SHA_TAG}.md" | ||
mkdir -p $(dirname "$MANIFEST_FILE") | ||
|
||
cat << EOF > "$MANIFEST_FILE" | ||
* Build datetime: ${BUILD_TIMESTAMP} | ||
* Docker image: ${DOCKER_REPO}:${GIT_SHA_TAG} | ||
* Docker image size: $(docker images ${IMAGE_NAME} --format "{{.Size}}") | ||
* Git commit SHA: [${GITHUB_SHA}](https://github.com/jupyter/docker-stacks/commit/${GITHUB_SHA}) | ||
* Git commit message: | ||
\`\`\` | ||
${COMMIT_MSG} | ||
\`\`\` | ||
|
||
## Python Packages | ||
|
||
\`\`\` | ||
$(docker run --rm ${IMAGE_NAME} python --version) | ||
\`\`\` | ||
|
||
\`\`\` | ||
$(docker run --rm ${IMAGE_NAME} conda info) | ||
\`\`\` | ||
|
||
\`\`\` | ||
$(docker run --rm ${IMAGE_NAME} conda list) | ||
\`\`\` | ||
|
||
## Apt Packages | ||
|
||
\`\`\` | ||
$(docker run --rm ${IMAGE_NAME} apt list --installed) | ||
\`\`\` | ||
EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Copyright (c) Jupyter Development Team. | ||
# Distributed under the terms of the Modified BSD License. | ||
import logging | ||
|
||
import pytest | ||
|
||
LOGGER = logging.getLogger(__name__) | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"name,command", | ||
[ | ||
( | ||
"Hello SensiML", | ||
"import sensiml;print(sensiml.name)", | ||
), | ||
( | ||
"Widget Modules Length", | ||
"import sensiml;print(len(dir(sensiml.widgets)) > 0)", | ||
), | ||
], | ||
) | ||
def test_sensiml(container, name, command): | ||
"""Basic SensiML tests""" | ||
LOGGER.info(f"Testing SensiML: {name} ...") | ||
c = container.run(tty=True, command=["start.sh", "python", "-c", command]) | ||
rv = c.wait(timeout=30) | ||
assert rv == 0 or rv["StatusCode"] == 0, f"Command {command} failed" | ||
logs = c.logs(stdout=True).decode("utf-8") | ||
LOGGER.debug(logs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Copyright (c) Jupyter Development Team. | ||
# Distributed under the terms of the Modified BSD License. | ||
import logging | ||
|
||
import pytest | ||
|
||
LOGGER = logging.getLogger(__name__) | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"name,command", | ||
[ | ||
( | ||
"Hello world", | ||
"import tensorflow as tf;print(tf.constant('Hello, TensorFlow'))", | ||
), | ||
( | ||
"Sum", | ||
"import tensorflow as tf;print(tf.reduce_sum(tf.random.normal([1000, 1000])))", | ||
), | ||
], | ||
) | ||
def test_tensorflow(container, name, command): | ||
"""Basic tensorflow tests""" | ||
LOGGER.info(f"Testing tensorflow: {name} ...") | ||
c = container.run(tty=True, command=["start.sh", "python", "-c", command]) | ||
rv = c.wait(timeout=30) | ||
assert rv == 0 or rv["StatusCode"] == 0, f"Command {command} failed" | ||
logs = c.logs(stdout=True).decode("utf-8") | ||
LOGGER.debug(logs) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.