在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:jupyter-on-openshift/jupyter-notebooks开源软件地址:https://github.com/jupyter-on-openshift/jupyter-notebooks开源编程语言:Shell 79.7%开源软件介绍:Jupyter Notebooks for OpenShiftThis repository contains software to make it easier to use Jupyter Notebooks on OpenShift. This includes input source code for creating a minimal Jupyter notebook image using the Source-to-Image (S2I) build process. The image can be built in OpenShift, separately using the The minimal Jupyter notebook image can be deployed to create an empty Jupyter notebook workspace in OpenShift that you can work with. The same image, can also be used as an S2I builder to create customised Jupyter notebook images with additional Python packages installed, or notebook files preloaded. Use a stable version of this repositoryWhen using this repository, unless you are participating in the development and testing of the images produced from this repository, always use a tagged version. Do not use master or development branches as your builds or deployments could break across versions. You should therefore always use any files for creating images or templates from the required tagged version. These will reference the appropriate version. If you have created your own resource definitions to build from the repository, ensure that the Why not use Jupyter Project images?The Jupyter Project provides a number of images for notebooks on Docker Hub. These are:
The GitHub repository used to create these is: There are two problems with using these images with OpenShift. The first is that the images will not run out of the box on an OpenShift installation. This is because they have not been designed properly to work with an assigned user ID without additional configuration. One can use them, but you need to edit the deployment so that the container is run with an extra supplemental group with The second problem is the size of these images. The For most use cases, the variants of the above images for just Python, which are provided here will work as substitutes. The images here also have the added benefit of being able to be used as Source-to-Image (S2I) builders so you can easily incorporate notebook files and required packages into a derived new image. Importing the Minimal NotebookA pre-built version of the minimal notebook which is based on CentOS, can be found at on quay.io at: The name of the latest build version of this image is:
Although this image could be imported into an OpenShift cluster using
This is preferred, as it will create an image stream with tag corresponding to the Python version being used, with the underlying image reference referring to a specific version of the image on quay.io, rather than the latest build. This ensures that the version of the image doesn't change to a newer version of the image which you haven't tested. Once the image stream definition is loaded, the project it is loaded into should have the tagged image:
Building the Minimal NotebookInstead of using the pre-built version of the minimal notebook, you can build the minimal notebook from source code. You may want to do this where you need it to use a RHEL base image included with your OpenShift cluster, instead of CentOS. Do be aware though that certain third party system packages may not be available for RHEL if you need to extend the image. One known example of this is image/video processing libraries, which although they may be able to be added to a CentOS base image, do not work with RHEL. In order to build the minimal notebook image from source code in your OpenShift cluster use the command:
This will create a build configuration in your OpenShift project to build the minimal notebook image using the Python 3.6 S2I builder included with your OpenShift cluster. You can watch the progress of the build by running:
A tagged image Deploying the Minimal NotebookTo deploy the minimal notebook image run the following commands:
The Deployment should be quick if you build the minimal notebook from source code. If you used the image stream, the first deployment may be slow as the image will need to be pulled down from quay.io. You can monitor progress of the deployment if necessary by running:
Because the notebook instance is not exposed to the public network by default, you will need to expose it. To do this, and ensure that access is over a secure connection run:
To see the hostname which is assigned to the notebook instance, run:
Access the hostname shown using your browser and enter the password you used above. To delete the notebook instance when done, run:
Creating Custom Notebook ImagesTo create custom notebooks images, you can use the These are intended to mimic the images of the same name available from the Jupyter project. In the directories you will find a To use the S2I build process to create a custom image, you can then run the command:
If any build of a custom image fails because the default memory limit on builds in your OpenShift cluster is too small, you can increase the limit by running:
and start a new build by running:
If using the custom notebook image with JupyterHub running in OpenShift, you may also need to set the image lookup policy on the image stream created.
This is necessary so that the image stream reference in the pod definition created by JupyterHub will be able to resolve the name to that of the image stream. For the
When creating a custom notebook image, the directory in the Git repository the S2I build is run against can contain a As an additional example, if you want to create a custom notebook image which includes the notebooks from Jake Vanderplas' book found at: run:
Enabling JupyterLab InterfaceBy default the minimal notebook when deployed will start up with the classic Jupyter notebook web interface. If you prefer to use the newer JupyterLab web interface, it can be enabled by setting the
This indicates a preference only for what web interface is used. If you wish for a custom notebook to always be deployed using the JupyterLab interface regardless of what is expressed as a preference, you can use an environment variable set on the image. This is done by setting the
Set this to You can also set the
Using OpenShift TemplatesTo make it easier to build and deploy Jupyter Notebooks, a number of templates are provided. The templates are:
To load the templates run:
The templates can be used from the command line or from the web console. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论