Code Monkey home page Code Monkey logo

ncar-python-tutorial's Introduction

CircleCI

NCAR Python Tutorial


Setup

This tutorial covers the installation and setup of a Python environment on:

  • Cheyenne
  • Casper
  • CGD's Hobart
  • Personal laptop/desktop with a UNIX-variant Operating System

NOTE: For windows users, setup scripts provided in this repository don't work on Windows machines for the time being.

Step 1: Clone NCAR Python Tutorial Repository

Run the following commmand to clone this repo to your system(e.g. cheyenne, casper, your laptop, etc...):

git clone https://github.com/NCAR/ncar-python-tutorial.git

Step 2: Install Miniconda and Create Environments

  • Change directory to the cloned repository

    cd ncar-python-tutorial
  • Run the configure script:

    NOTE: Be prepared for the script to take up to 15 minutes to complete.

    ./setup/configure
$ ./setup/configure --help
usage: configure [-h] [--clobber] [--download] [--prefix PREFIX]

Set up tutorial environment.

optional arguments:
  -h, --help            show this help message and exit
  --clobber, -c         Whether to clobber existing environment (default:
                        False)
  --download, -d        Download tutorial data without setting environment up
                        (default: False)
  --prefix PREFIX, -p PREFIX
                        Miniconda3 install location)

Default values for --prefix argument are:

  • Personal laptop / Hobart: $HOME/miniconda3
  • Cheyenne or Casper: /glade/work/$USER/miniconda3

NOTE: In case the default prefix is not appropriate for you (due to limited storage), feel free to specify a different miniconda install location. For instance, this install location may be a project workspace on a shared filesystem like GLADE or Hobart's filesystem.

The configure script does the following:

  • Install conda package manager if it is unable to find an existing installation. Otherwise, it will update the base environment
  • Create or Update python-tutorial conda environment.
  • Download data if not on Cheyenne or Casper or Hobart. If on Cheyenne or Casper or Hobart, create soft-links to an existing/local data repository.

Step 3: Close and re-open your current shell

For changes to take effect, close and re-open your current shell.

Step 4: Run the Setup Verification Script

  • Check that conda info runs successfully:

    conda info
  • From the ncar-python-tutorial directory, activate python-tutorial conda environment:

    conda activate python-tutorial
  • Run the setup verification script to confirm that everything is working as expected:

    cd ncar-python-tutorial
    ./setup/check_setup

    This step should print "Everything looks good!".


Launch Jupyter Lab

1. Cheyenne or DAV via JupyterHub (Recommended)

To use the Cheyenne or DAV compute nodes,we recommend using JupyterLab via NCAR's JupyterHub deployment.

Open your preferred browser (Chrome, Firefox, Safari, etc...) on your local machine, and head over to https://jupyterhub.ucar.edu/.

You will need to authenticate with either your yubikey or your DUO mobile app

2. Cheyenne or DAV via SSH Tunneling

In case you are having issues with jupyterhub.ucar.edu, we've provided utility scripts for launching JupyterLab on both Cheyenne and Casper via SSH Tunneling:

conda activate base
./setup/jlab/jlab-ch # on Cheyenne
./setup/jlab/jlab-dav # on Casper

3. Hobart via SSH Tunneling

For those interested in running JupyterLab on CGD's Hobart, you will need to use SSH tunneling script provided in setup/jlab/jlab-hobart

conda activate base
./setup/jlab/jlab-hobart
$ ./setup/jlab/jlab-hobart --help
Usage: launch dask
Possible options are:
 -w,--walltime: walltime [default: 08:00:00]
 -q,--queue: queue [default: medium]
 -d,--directory: notebook directory
 -p,--port: [default: 8888]

4. Personal Laptop

For those interested in running JupyterLab on their local machine, you can simply run the following command, and follow the printed instructions on the console:

conda activate base
jupyter lab

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.