forked from kubeflow/kubeflow
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add notebook-server-jupyter-pytorch dockerfiles and CI/CD (kubeflow#5626
) * Add pytorch base images * cleanup jupyter pytorch notebook image * rename jupyter pytorch dockerfiles * fix typo Co-authored-by: Mathew Wicks <thesuperzapper@users.noreply.github.com>
- Loading branch information
1 parent
b3fe73b
commit 8dea170
Showing
10 changed files
with
121 additions
and
1 deletion.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
components/example-notebook-servers/jupyter-pytorch/cpu.Dockerfile
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 @@ | ||
FROM public.ecr.aws/j1r0q0g6/notebooks/notebook-servers/jupyter:master-b3fe73b2 | ||
|
||
# install - requirements.txt | ||
COPY --chown=jovyan:users requirements-cpu.txt /tmp/requirements.txt | ||
RUN python3 -m pip install -r /tmp/requirements.txt --quiet --no-cache-dir -f https://download.pytorch.org/whl/torch_stable.html \ | ||
&& rm -f /tmp/requirements.txt |
11 changes: 11 additions & 0 deletions
11
components/example-notebook-servers/jupyter-pytorch/cuda.Dockerfile
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,11 @@ | ||
FROM public.ecr.aws/j1r0q0g6/notebooks/notebook-servers/jupyter:master-b3fe73b2 | ||
|
||
# nvidia configs | ||
ENV NVIDIA_VISIBLE_DEVICES all | ||
ENV NVIDIA_DRIVER_CAPABILITIES compute,utility | ||
ENV LD_LIBRARY_PATH /usr/local/nvidia/lib:/usr/local/nvidia/lib64 | ||
|
||
# install - requirements.txt | ||
COPY --chown=jovyan:users requirements-cuda.txt /tmp/requirements.txt | ||
RUN python3 -m pip install -r /tmp/requirements.txt --quiet --no-cache-dir -f https://download.pytorch.org/whl/torch_stable.html \ | ||
&& rm -f /tmp/requirements.txt |
3 changes: 3 additions & 0 deletions
3
components/example-notebook-servers/jupyter-pytorch/requirements-cpu.txt
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,3 @@ | ||
torch==1.7.1+cpu | ||
torchvision==0.8.2+cpu | ||
torchaudio==0.7.2 |
3 changes: 3 additions & 0 deletions
3
components/example-notebook-servers/jupyter-pytorch/requirements-cuda.txt
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,3 @@ | ||
torch==1.7.1+cu110 | ||
torchvision==0.8.2+cu110 | ||
torchaudio==0.7.2 |
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
17 changes: 17 additions & 0 deletions
17
py/kubeflow/kubeflow/cd/notebook_servers/notebook_server_jupyter_pytorch.py
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,17 @@ | ||
""""Argo Workflow for building the notebook-server-jupyter-pytorch OCI images using Kaniko""" | ||
from kubeflow.kubeflow.cd import config, kaniko_builder | ||
|
||
|
||
def create_workflow(name=None, namespace=None, bucket=None, **kwargs): | ||
""" | ||
Args: | ||
name: Name to give to the workflow. This can also be used to name | ||
things associated with the workflow. | ||
""" | ||
builder = kaniko_builder.Builder(name=name, namespace=namespace, bucket=bucket, **kwargs) | ||
|
||
return builder.build(dockerfile="components/example-notebook-servers/jupyter-pytorch/cpu.Dockerfile", | ||
context="components/example-notebook-servers/jupyter-pytorch/", | ||
destination=config.NOTEBOOK_SERVER_JUPYTER_PYTORCH, | ||
second_dockerfile="components/example-notebook-servers/jupyter-pytorch/cuda.Dockerfile", | ||
second_destination=config.NOTEBOOK_SERVER_JUPYTER_PYTORCH_CUDA) |
5 changes: 5 additions & 0 deletions
5
py/kubeflow/kubeflow/cd/notebook_servers/notebook_server_jupyter_pytorch_runner.py
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 @@ | ||
# This file is only intended for development purposes | ||
from kubeflow.kubeflow.cd import base_runner | ||
|
||
base_runner.main(component_name="notebook_servers.notebook_server_jupyter_pytorch", | ||
workflow_name="nb-j-pt-build") |
53 changes: 53 additions & 0 deletions
53
py/kubeflow/kubeflow/ci/notebook_servers/notebook_server_jupyter_pytorch_tests.py
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,53 @@ | ||
""""Argo Workflow for testing the notebook-server-jupyter-pytorch OCI images""" | ||
from kubeflow.kubeflow.ci import workflow_utils | ||
from kubeflow.testing import argo_build_util | ||
|
||
|
||
class Builder(workflow_utils.ArgoTestBuilder): | ||
def __init__(self, name=None, namespace=None, bucket=None, | ||
test_target_name=None, **kwargs): | ||
super().__init__(name=name, namespace=namespace, bucket=bucket, | ||
test_target_name=test_target_name, **kwargs) | ||
|
||
def build(self): | ||
"""Build the Argo workflow graph""" | ||
workflow = self.build_init_workflow(exit_dag=False) | ||
task_template = self.build_task_template() | ||
|
||
# Test building notebook-server-jupyter-pytorch images using Kaniko | ||
dockerfile = ("%s/components/example-notebook-servers" | ||
"/jupyter-pytorch/cpu.Dockerfile") % self.src_dir | ||
context = "dir://%s/components/example-notebook-servers/jupyter-pytorch/" % self.src_dir | ||
destination = "notebook-server-jupyter-pytorch-cpu-test" | ||
|
||
kaniko_task = self.create_kaniko_task(task_template, dockerfile, | ||
context, destination, no_push=True) | ||
argo_build_util.add_task_to_dag(workflow, | ||
workflow_utils.E2E_DAG_NAME, | ||
kaniko_task, [self.mkdir_task_name]) | ||
|
||
dockerfile_cuda = ("%s/components/example-notebook-servers" | ||
"/jupyter-pytorch/cuda.Dockerfile") % self.src_dir | ||
destination_cuda = "notebook-server-jupyter-pytorch-cuda-test" | ||
|
||
kaniko_task_cuda = self.create_kaniko_task(task_template, dockerfile_cuda, | ||
context, destination_cuda, no_push=True) | ||
argo_build_util.add_task_to_dag(workflow, | ||
workflow_utils.E2E_DAG_NAME, | ||
kaniko_task_cuda, [self.mkdir_task_name]) | ||
|
||
# Set the labels on all templates | ||
workflow = argo_build_util.set_task_template_labels(workflow) | ||
|
||
return workflow | ||
|
||
|
||
def create_workflow(name=None, namespace=None, bucket=None, **kwargs): | ||
""" | ||
Args: | ||
name: Name to give to the workflow. This can also be used to name | ||
things associated with the workflow. | ||
""" | ||
builder = Builder(name=name, namespace=namespace, bucket=bucket, **kwargs) | ||
|
||
return builder.build() |
5 changes: 5 additions & 0 deletions
5
py/kubeflow/kubeflow/ci/notebook_servers/notebook_server_jupyter_pytorch_tests_runner.py
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 @@ | ||
# This file is only intended for development purposes | ||
from kubeflow.kubeflow.ci import base_runner | ||
|
||
base_runner.main(component_name="notebook_servers.notebook_server_jupyter_pytorch_tests", | ||
workflow_name="nb-j-pt-tests") |
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