An early version of JupyterHub is now available within the SAIL Databank for a limited number of users. As our collective experience of working with JupyterHub evolves and our technical offering, this guide will get updated in line with it.
Table of Contents |
---|
Getting started
- Note: Access to JupyterHub is only available for users on projects that have paid for additional processing power.
- If you have requested JupyterHub and this has been confirmed you will need to log on to the SAIL Gateway as normal. Once within the Windows 10 environment, open up your Browser and navigate to - http://jupyterhub.sail.k8s.chi.swan.ac.uk/
- You may be prompted with an error message warning you that the site is not safe, we wish to assure you that it is safe but whilst in development, this site will appear to be unsafe. Please follow the browsers navigation options as detailed below
...
The notebooks are set up to be able to pull and push to the SAIL Gitlab. You can set this up how you set it up on your SAIL Desktop (see How to use GITLAB within SeRP, and instructions on the internal SAIL wiki).
Getting files from your SAIL desktop into your JupyterHub notebook
There are two options for moving files from your SAIL desktop and into your Jupyterhub Notebook.
- If the file is under 8mb you can simply drag and drop it into the browser window.
- Or you can sync it via GitLab (very much the recommended option).
For files too large to choose either of these options, please log a ticket with the Helpdesk and we will help to find a solution for you.
Getting files from JupyterHub onto your SAIL desktop
As above, you have 2 options:
- Sync via Gitlab (recommended)
- Right-click on the thing you want to download and click 'Download'.
Seeing 'hidden' files and folders
File and folder names that start with a leading '.' are hidden by default in Jupyter. To view them in the file tree select 'View' → 'Show hidden files' from the top menu.
Changing your theme
We have pre-installed a number of Jupyter themes. You can change your theme by selecting 'Settings' → 'Theme' → pick a theme from the list. You will find 'Settings' in the top menu.
Connecting to DB2
The notebooks all have the necessary drivers and libraries for connection to DB2 pre-installed.
The following are some code examples showing how you can connect directly to DB2.
Python
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
import ibm_db
db = 'PR_SAIL'
hostname = 'db2.database.ukserp.ac.uk'
port = '60070'
protocol = 'TCPIP'
uid = 'YOUR USERNAME HERE'
pwd = 'YOUR PASSWORD HERE'
security = 'ssl'
ssl_client_keystoredb = '/db2conn/chi.kdb'
ssl_client_keystash = '/db2conn/chi.sth'
conn_str = ("DATABASE={0};"
"HOSTNAME={1};"
"PORT={2};"
"PROTOCOL={3};"
"Security={4};"
"UID={5};"
"PWD={6};"
"SSLClientKeystoredb={7};"
"SSLClientKeystash={8};").format(db, hostname, port, protocol, uid, pwd, ssl_client_keystoredb, ssl_client_keystash)
conn = ibm_db.connect(conn_str, '', '')
stmt = ibm_db.exec_immediate(conn, "SELECT * FROM syscat.tables LIMIT 3")
print "Number of affected rows: ", ibm_db.num_rows(stmt) |
Alternative Python option:
R
TBC
Related articles
Content by Label | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
...