-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #41 from ucsd-ets/tf+tensorboard
Merge tf+tensorboard branch. 1. tf & keras version issue 2. LD_LIBRARY_PATH 3. manifest bug fixed
- Loading branch information
Showing
20 changed files
with
238 additions
and
65 deletions.
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
6 changes: 0 additions & 6 deletions
6
images/datahub-base-notebook/scripts/install-python/install-nbcluster-status.sh
This file was deleted.
Oops, something went wrong.
11 changes: 5 additions & 6 deletions
11
images/datahub-base-notebook/scripts/install-python/install-nbgrader.sh
100644 → 100755
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 |
---|---|---|
@@ -1,11 +1,10 @@ | ||
#!/bin/sh -x | ||
pip install nbgrader==0.6.1 | ||
#!/bin/bash | ||
|
||
pip install nbgrader==0.8.1 | ||
|
||
jupyter nbextension install --symlink --sys-prefix --py nbgrader | ||
jupyter nbextension enable --sys-prefix --py nbgrader | ||
jupyter serverextension enable --sys-prefix --py nbgrader | ||
|
||
# Disable formgrader for default case, re-enable if instructor | ||
jupyter nbextension disable --sys-prefix formgrader/main --section=tree | ||
jupyter serverextension disable --sys-prefix nbgrader.server_extensions.formgrader | ||
jupyter nbextension disable --sys-prefix create_assignment/main | ||
jupyter labextension enable --level=system nbgrader | ||
jupyter server extension enable --system --py nbgrader |
10 changes: 0 additions & 10 deletions
10
images/datahub-base-notebook/scripts/install-python/install-nbmessages.sh
This file was deleted.
Oops, something went wrong.
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,5 @@ | ||
#!/bin/bash | ||
|
||
for script in /etc/datahub-profile.d/*.sh; do | ||
. "$script" | ||
done |
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,6 @@ | ||
#!/bin/bash | ||
|
||
# set systemwide env variables for Conda package: cudnn | ||
cudatoolkit=$(conda list 2> /dev/null | grep cudatoolkit | awk -F' ' '{ print $2 "-" $3 }') | ||
|
||
export LD_LIBRARY_PATH=/opt/conda/pkgs/cudatoolkit-$cudatoolkit/lib:${LD_LIBRARY_PATH} |
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,6 @@ | ||
#!/bin/bash | ||
|
||
# set systemwide env variables for Conda package: cudnn | ||
cudnn_version=$(conda list 2> /dev/null | grep cudnn | awk -F' ' '{ print $2 "-" $3 }') | ||
|
||
export LD_LIBRARY_PATH=/opt/conda/pkgs/cudnn-$cudnn_version/lib/:${LD_LIBRARY_PATH} |
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,39 @@ | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
name: gpu-test-job | ||
namespace: test-server | ||
spec: | ||
ttlSecondsAfterFinished: 0 | ||
template: | ||
spec: | ||
containers: | ||
- name: tensorflow-pytorch-tester | ||
image: | ||
resources: | ||
limits: | ||
cpu: "2" | ||
memory: 8Gi | ||
nvidia.com/gpu: "1" | ||
requests: | ||
cpu: "1" | ||
memory: 8Gi | ||
nvidia.com/gpu: "1" | ||
# command: ["python", "/job-script/script.py"] | ||
command: ["/bin/sh", "-c"] | ||
args: ["for script in /etc/datahub-profile.d/*.sh; do . \"$script\"; done; python /job-script/script.py"] | ||
env: | ||
- name: TF_CPP_MIN_LOG_LEVEL | ||
value: '3' | ||
volumeMounts: | ||
- mountPath: /job-script | ||
name: job-script | ||
volumes: | ||
- name: job-script | ||
configMap: | ||
name: config | ||
items: | ||
- key: "script.py" | ||
path: "script.py" | ||
restartPolicy: Never | ||
backoffLimit: 4 |
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,77 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": { | ||
"id": "SB93Ge748VQs" | ||
}, | ||
"source": [ | ||
"##### Check:\n", | ||
"1. tensorboard extention can be loaded.\n", | ||
"2. tf version and tf.keras version match" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": { | ||
"id": "6B95Hb6YVgPZ" | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"# Load the TensorBoard notebook extension\n", | ||
"%load_ext tensorboard" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import tensorflow as tf" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"assert tf.__version__ == tf.keras.__version__, \\\n", | ||
"f\"tensorflow {tf.__version__} and keras {tf.keras.__version__} versions don't match\"" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"colab": { | ||
"collapsed_sections": [], | ||
"name": "get_started.ipynb", | ||
"toc_visible": true | ||
}, | ||
"kernelspec": { | ||
"display_name": "Python 3.8.8 ('base')", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.8.8" | ||
}, | ||
"vscode": { | ||
"interpreter": { | ||
"hash": "d06a35f6432bcea124c520d36814be75a6dd5ed4335e0c829924d510b7f0b7dd" | ||
} | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 1 | ||
} |
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,46 @@ | ||
# Adapted from datascience-notebook/test/test_notebooks.py | ||
import logging | ||
|
||
import pytest | ||
import os | ||
|
||
LOGGER = logging.getLogger(__name__) | ||
THIS_DIR = os.path.dirname(os.path.realpath(__file__)) | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"test_file", | ||
["test_tf"], | ||
) | ||
def test_tf(container, test_file): | ||
""" test_tf.ipynb checks | ||
1. tensorboard extention can be loaded. | ||
2. tf version and tf.keras version match | ||
""" | ||
host_data_dir = os.path.join(THIS_DIR, "data") | ||
cont_data_dir = "/home/jovyan/data" | ||
output_dir = "/tmp" | ||
timeout_sec = 600 | ||
LOGGER.info(f"Test that {test_file} notebook can be executed ...") | ||
command = ( | ||
"jupyter nbconvert --to markdown " | ||
+ f"--ExecutePreprocessor.timeout={timeout_sec} " | ||
+ f"--output-dir {output_dir} " | ||
+ f"--execute {cont_data_dir}/{test_file}.ipynb" | ||
) | ||
|
||
""" container.ports.update({ | ||
"5132/tcp": 5132 | ||
}) """ | ||
|
||
c = container.run( | ||
volumes={host_data_dir: {"bind": cont_data_dir, "mode": "ro"}}, | ||
tty=True, | ||
command=["start.sh", "bash", "-c", command], | ||
) | ||
|
||
rv = c.wait(timeout=timeout_sec//10 + 10) | ||
logs = c.logs(stdout=True).decode("utf-8") | ||
LOGGER.debug(logs) | ||
print(logs) | ||
assert rv == 0 or rv["StatusCode"] == 0, f"Command {command} failed" |
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
Oops, something went wrong.