Skip to content

Commit

Permalink
Merge pull request #92 from EarthCubeInGeo/develop
Browse files Browse the repository at this point in the history
[MNT]: Release v2021.1.0
  • Loading branch information
ljlamarche committed Aug 11, 2021
2 parents 23ad0d7 + e9b16f1 commit c57a60b
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 28 deletions.
6 changes: 6 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@

.. :changelog:
2021.1.0 (2021-08-11)
+++++++++++++++++++++

- Update start jupyter command so that resen works with jupyter lab 3
- Fixes #85, a bug which caused downloading images to fail on windows computer because progress bars were not generated in a system agnostic way

2020.2.1 (2020-11-12)
+++++++++++++++++++++

Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Resen requires both python 3 and docker to be installed.

1. Install `Python 3 <https://www.python.org/>`_
2. Install `docker <https://docs.docker.com/install/>`_
3. Install Resen with pip ``pip install git+https://github.com/EarthCubeInGeo/resen.git@v2020.2.1``
3. Install Resen with pip ``pip install git+https://github.com/EarthCubeInGeo/resen.git@v2021.1.0``

Please refer to the :ref:`installation documentation <installation>` for more detailed instructions.

Expand Down
2 changes: 1 addition & 1 deletion docs/installation/installation.general.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ Resen

Install Resen from a python 3 environment using ``pip``::

pip install git+https://github.com/EarthCubeInGeo/resen.git@v2020.2.0
pip install git+https://github.com/EarthCubeInGeo/resen.git@v2021.1.0
20 changes: 11 additions & 9 deletions docs/tutorials.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,28 @@ The InGeO team has collected a variety of `tutorials <https://github.com/EarthCu

4. Copy/paste the appropriate fetching command from the table below to download the tutorial, for example::

$ wget https://raw.githubusercontent.com/EarthCubeInGeo/resen-core/v2020.2.1/tutorials/GetStartedWithPython.ipynb
$ wget https://raw.githubusercontent.com/EarthCubeInGeo/resen-core/v2021.1.0/tutorials/GetStartedWithPython.ipynb

After downloading completes, the tutorial notebook should be visible in the navigation toolbar. By double-clicking, you can launch the jupyter notebook, read through descriptions, try example code, and even modify the notebook to try new things.

+----------------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+
| Tutorials | Fetch Command |
+========================================================================================================================================+========================================================================================================================+
| `GetStartedWithPython.ipynb <https://github.com/EarthCubeInGeo/resen-core/blob/v2020.2.1/tutorials/GetStartedWithPython.ipynb>`_ | ``wget https://raw.githubusercontent.com/EarthCubeInGeo/resen-core/v2020.2.1/tutorials/GetStartedWithPython.ipynb`` |
| `GetStartedWithPython.ipynb <https://github.com/EarthCubeInGeo/resen-core/blob/v2021.1.0/tutorials/GetStartedWithPython.ipynb>`_ | ``wget https://raw.githubusercontent.com/EarthCubeInGeo/resen-core/v2021.1.0/tutorials/GetStartedWithPython.ipynb`` |
+----------------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+
| `GetStartedWithJupyter.ipynb <https://github.com/EarthCubeInGeo/resen-core/blob/v2020.2.1/tutorials/GetStartedWithJupyter.ipynb>`_ | ``wget https://raw.githubusercontent.com/EarthCubeInGeo/resen-core/v2020.2.1/tutorials/GetStartedWithJupyter.ipynb`` |
| `GetStartedWithJupyter.ipynb <https://github.com/EarthCubeInGeo/resen-core/blob/v2021.1.0/tutorials/GetStartedWithJupyter.ipynb>`_ | ``wget https://raw.githubusercontent.com/EarthCubeInGeo/resen-core/v2021.1.0/tutorials/GetStartedWithJupyter.ipynb`` |
+----------------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+
| `GetStartedWithResen.ipynb <https://github.com/EarthCubeInGeo/resen-core/blob/v2020.2.1/tutorials/GetStartedWithReSEn.ipynb>`_ | ``wget https://raw.githubusercontent.com/EarthCubeInGeo/resen-core/v2020.2.1/tutorials/GetStartedWithReSEn.ipynb`` |
| `GetStartedWithResen.ipynb <https://github.com/EarthCubeInGeo/resen-core/blob/v2021.1.0/tutorials/GetStartedWithResen.ipynb>`_ | ``wget https://raw.githubusercontent.com/EarthCubeInGeo/resen-core/v2021.1.0/tutorials/GetStartedWithResen.ipynb`` |
+----------------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+
| `GeospacePackagesInResen.ipynb <https://github.com/EarthCubeInGeo/resen-core/blob/v2020.2.1/tutorials/GeospacePackagesInResen.ipynb>`_ | ``wget https://raw.githubusercontent.com/EarthCubeInGeo/resen-core/v2020.2.1/tutorials/GeospacePackagesInResen.ipynb`` |
| `GeospacePackagesInResen.ipynb <https://github.com/EarthCubeInGeo/resen-core/blob/v2021.1.0/tutorials/GeospacePackagesInResen.ipynb>`_ | ``wget https://raw.githubusercontent.com/EarthCubeInGeo/resen-core/v2021.1.0/tutorials/GeospacePackagesInResen.ipynb`` |
+----------------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+
| `CaseStudy.ipynb <https://github.com/EarthCubeInGeo/resen-core/blob/v2020.2.1/tutorials/CaseStudy.ipynb>`_ | ``wget https://raw.githubusercontent.com/EarthCubeInGeo/resen-core/v2020.2.1/tutorials/CaseStudy.ipynb`` |
| `CaseStudy.ipynb <https://github.com/EarthCubeInGeo/resen-core/blob/v2021.1.0/tutorials/CaseStudy.ipynb>`_ | ``wget https://raw.githubusercontent.com/EarthCubeInGeo/resen-core/v2021.1.0/tutorials/CaseStudy.ipynb`` |
+----------------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+
| `Intro-Swarm-viresclient.ipynb <https://github.com/EarthCubeInGeo/resen-core/blob/v2020.2.1/tutorials/Intro-Swarm-viresclient.ipynb>`_ | ``wget https://raw.githubusercontent.com/EarthCubeInGeo/resen-core/v2020.2.1/tutorials/Intro-Swarm-viresclient.ipynb`` |
| `Intro-Swarm-viresclient.ipynb <https://github.com/EarthCubeInGeo/resen-core/blob/v2021.1.0/tutorials/Intro-Swarm-viresclient.ipynb>`_ | ``wget https://raw.githubusercontent.com/EarthCubeInGeo/resen-core/v2021.1.0/tutorials/Intro-Swarm-viresclient.ipynb`` |
+----------------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+
| `ICON-Data-Demo.ipynb <https://github.com/EarthCubeInGeo/resen-core/blob/v2020.2.1/tutorials/ICON-Data-Demo.ipynb>`_ | ``wget https://raw.githubusercontent.com/EarthCubeInGeo/resen-core/v2020.2.1/tutorials/ICON-Data-Demo.ipynb`` |
| `ICON-Data-Demo.ipynb <https://github.com/EarthCubeInGeo/resen-core/blob/v2021.1.0/tutorials/ICON-Data-Demo.ipynb>`_ | ``wget https://raw.githubusercontent.com/EarthCubeInGeo/resen-core/v2021.1.0/tutorials/ICON-Data-Demo.ipynb`` |
+----------------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+
| `CitationHelper.ipynb <https://github.com/EarthCubeInGeo/resen-core/blob/v2020.2.1/tutorials/CitationHelper.ipynb>`_ | ``wget https://raw.githubusercontent.com/EarthCubeInGeo/resen-core/v2020.2.1/tutorials/CitationHelper.ipynb`` |
| `EmpiricalModels.ipynb <https://github.com/EarthCubeInGeo/resen-core/blob/v2021.1.0/tutorials/EmpiricalModels.ipynb>`_ | ``wget https://raw.githubusercontent.com/EarthCubeInGeo/resen-core/v2021.1.0/tutorials/EmpiricalModels.ipynb`` |
+----------------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+
| `CitationHelper.ipynb <https://github.com/EarthCubeInGeo/resen-core/blob/v2021.1.0/tutorials/CitationHelper.ipynb>`_ | ``wget https://raw.githubusercontent.com/EarthCubeInGeo/resen-core/v2021.1.0/tutorials/CitationHelper.ipynb`` |
+----------------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+
14 changes: 7 additions & 7 deletions docs/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This will open the resen tool::
| / _|\__ \ _|| .` |
|_|_\___|___/___|_|\_|

Resen 2020.2.1 -- Reproducible Software Environment
Resen 2021.1.0 -- Reproducible Software Environment

[resen] >>>

Expand Down Expand Up @@ -66,8 +66,8 @@ Setup a New Bucket
Next, the user is asked to specify the version of resen-core to use::

Please choose a version of resen-core.
Available versions: 2019.1.0, 2020.1.0, 2020.2.0
>>> Select a version: 2020.2.0
Available versions: 2019.1.0, 2020.1.0, 2021.1.0
>>> Select a version: 2021.1.0

Optionally, one may then specify a local directory to :ref:`mount <mounting>` into the bucket at ``/home/jovyan/mount``::

Expand Down Expand Up @@ -100,7 +100,7 @@ Setup a New Bucket
amber
=====

Resen-core Version: 2020.2.0
Resen-core Version: 2021.1.0
Status: running
Jupyter Token: e7a11fc1ea42a445807b4e24146b9908e1abff82bacbf6f2
Jupyter Port: 9002
Expand All @@ -122,7 +122,7 @@ Work with a Bucket

[resen] >>> list
Bucket Name Docker Image Status
amber 2020.2.0 running
amber 2021.1.0 running

If a bucket is running, it will consume system resources accordingly.

Expand All @@ -134,7 +134,7 @@ Work with a Bucket

[resen] >>> list
Bucket Name Docker Image Status
amber 2020.2.0 exited
amber 2021.1.0 exited

The bucket will still exist and can be restarted at any time, even after quitting and restarting resen.

Expand All @@ -146,7 +146,7 @@ Work with a Bucket

[resen] >>> status
Bucket Name Docker Image Status
amber 2020.2.0 running
amber 2021.1.0 running

4. Export bucket ``amber``::

Expand Down
2 changes: 1 addition & 1 deletion docs/version_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import fileinput

old_version = '2020.2.0'
new_version = '2020.2.1'
new_version = '2021.1.0'

for root, dirs, files in os.walk('..'):
for fn in files:
Expand Down
3 changes: 2 additions & 1 deletion resen/DockerHelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ def truncate_secs(delta_time, fmt=":%.2d"):
# get terminal dimensions
def get_terminal_dims():
"""Returns integers rows and columns of the terminal."""
return [int(x) for x in os.popen('stty size', 'r').read().split()]
terminal_size = os.get_terminal_size()
return terminal_size.lines, terminal_size.columns

# progress bar
def update_bar(sum_total,accumulated,t0,current_time, init_bar_chars=34):
Expand Down
18 changes: 11 additions & 7 deletions resen/Resen.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
from subprocess import Popen, PIPE # used for selinux detection
import platform # NEEDED FOR WINDOWS QUICK FIX
import requests
import glob


from .DockerHelper import DockerHelper
Expand Down Expand Up @@ -571,9 +572,10 @@ def stop_jupyter(self,bucket_name):

# form python command to stop jupyter and execute it
port = bucket['jupyter']['port']
python_cmd = 'from notebook.notebookapp import shutdown_server, list_running_servers; '
python_cmd += 'svrs = [x for x in list_running_servers() if x[\\\"port\\\"] == %s]; ' % (port)
python_cmd += 'sts = True if len(svrs) == 0 else shutdown_server(svrs[0]); print(sts)'
python_cmd = 'exec(\\\"try: from jupyter_server.serverapp import shutdown_server, list_running_servers\\n'
python_cmd += 'except: from notebook.notebookapp import shutdown_server, list_running_servers\\n'
python_cmd += 'svrs = [x for x in list_running_servers() if x[\\\\\\"port\\\\\\"] == %s]; ' % (port)
python_cmd += 'sts = True if len(svrs) == 0 else shutdown_server(svrs[0]); print(sts)\\\")'
command = "bash -cl '%s/bin/python -c \"%s \"'" % (envpath,python_cmd)
status = self.execute_command(bucket_name,command,detach=False)

Expand Down Expand Up @@ -862,13 +864,15 @@ def __get_valid_cores(self):
self.update_core_list()

# for each JSON file in core directory, read in list of cores
json_files = glob.glob(os.path.join(core_dir, '*.json'))

cores = []
for fn in os.listdir(core_dir):
for filename in sorted(json_files):
try:
with open(os.path.join(core_dir,fn),'r') as f:
with open(filename) as f:
cores.extend(json.load(f))
except json.decoder.JSONDecodeError:
print('WARNING: {} is not a valid JSON file! Skiping this file.'.format(fn))
except:
print(f'WARNING: Problem reading {filename}. Skipping.')

return cores

Expand Down
2 changes: 1 addition & 1 deletion resen/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
__version__ = '2020.2.1'
__version__ = '2021.1.0'

from .Resen import Resen

0 comments on commit c57a60b

Please sign in to comment.