Skip to content

Commit c5bbafc

Browse files
author
Jenny Palomino
authored
Merge pull request #1 from earthlab/master
Update jlpalomino fork from earthlab master
2 parents 2d82eae + 1545a51 commit c5bbafc

4 files changed

Lines changed: 85 additions & 20 deletions

File tree

README.md

Lines changed: 61 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
# earth-analytics-environment
2-
Welcome to the Earth Analytics Environment Repository! Here you will find a conda envt that can be installed on your computer using a ``.yml` file. You will also find a docker image that can be used to actually run the environment in a containerized environment.
2+
Welcome to the Earth Analytics Environment Repository! Here you will find a conda envt that can be installed on your computer using a `.yaml` file. You will also find a docker image that can be used to actually run the environment in a containerized environment.
3+
4+
5+
[![DOI](https://zenodo.org/badge/132847711.svg)](https://zenodo.org/badge/latestdoi/132847711)
36

47
[![Binder](https://mybinder.org/badge.svg)](https://mybinder.org/v2/gh/earthlab/earth-analytics-binder/master)
58

69
## Contributors:
710

811
* Leah A. Wasser
12+
* Tim Head
913
* Chris Holdgraf
1014
* Max Joseph
1115
* Martha Morrissey
@@ -14,20 +18,28 @@ Welcome to the Earth Analytics Environment Repository! Here you will find a cond
1418

1519
### 1. Install the Earth Lab Conda Environment on your Local Computer.
1620

17-
To begin, install the conda for Python 3.x. We suggest 3.6 now.
21+
To begin, install git and conda for Python 3.x (we suggest 3.6).
22+
23+
Installing git: https://git-scm.com/book/en/v2/Getting-Started-Installing-Git
24+
25+
Installing conda: https://www.anaconda.com/
26+
1827
We recommend installing geo-related dependencies with `conda-forge`. We
1928
have created a custom yaml list with all of the dependencies that you will
2029
need to run the lessons in this course. Follow
2130
these steps below to get your environment ready.
2231

2332
About Conda Environments: https://conda.io/docs/user-guide/tasks/manage-environments.html
2433

25-
An environment for conda has been created specifically for this course. To load this run:
34+
An environment for conda has been created specifically for this course. To load it, run:
2635

2736
`conda env create -f environment.yml`
2837

2938
* Note that it takes a bit of time to run this setup
30-
* Also note that for the code above to work, you need to be in the directory where the `environment.yml` file lives.
39+
* Also note that for the code above to work, you need to be in the directory where the `environment.yml` file lives (ex: cd earth-analytics-python-env).
40+
41+
To update this environment from a yaml file use:
42+
`conda env update -f environment.yml`
3143

3244
To manage your conda environments, use the following commands:
3345

@@ -36,17 +48,27 @@ To manage your conda environments, use the following commands:
3648

3749
#### Activate the environment that you'd like to use
3850

39-
`source activate myenv-name`
51+
On Mac or Linux:
4052

41-
In our case, the environment that we are using is called: `earth-analytics-python`. This name is
42-
defined in the `environment.yml` file. Thus you'd type:
53+
```
54+
source activate earth-analytics-python
55+
```
4356

44-
`source activate earth-analytics-python`
57+
On Windows:
58+
59+
```
60+
activate earth-analytics-python
61+
```
4562

46-
to activate it once it's installed.
63+
The environment name is `earth-analytics-python` as
64+
defined in the `environment.yml` file.
4765

4866
## Docker Build
4967

68+
[![Docker Automated build](https://img.shields.io/docker/automated/earthlab/earth-analytics-python-env.svg)](https://hub.docker.com/r/earthlab/earth-analytics-python-env/)
69+
70+
[![Docker Build Status](https://img.shields.io/docker/build/earthlab/earth-analytics-python-env.svg)](https://hub.docker.com/r/earthlab/earth-analytics-python-env/)
71+
5072
To run a docker container you need to do the following:
5173

5274
1. [Install docker](https://docs.docker.com/install/) and make sure it is running.
@@ -55,21 +77,43 @@ To run a docker container you need to do the following:
5577
Run the following lines to build the docker image locally:
5678

5779
```
58-
cd earth-analytics-binder
59-
docker build -t earthlab/earth-analytics .
60-
docker run -it -p 8888:8888 earthlab/earth-analytics
80+
cd earth-analytics-python-env
81+
docker build -t earthlab/earth-analytics-python-env .
82+
docker run -it -p 8888:8888 earthlab/earth-analytics-python-env
6183
6284
```
6385

6486
3. Run the image.
6587

66-
To run your earth-analytics image you use the following code:
88+
To run your earth-analytics image, use the following code:
6789

68-
`docker run -it -p 8888:8888 earthlab/earth-analytics`
90+
`docker run --hostname localhost -it -p 8888:8888 earthlab/earth-analytics-python-env`
6991

70-
NOTE: `earthlab/earth-analytics` is the name of this image as built above. To
71-
view all images on your computer type
72-
`docker images -all`
92+
NOTE: `earthlab/earth-analytics-python-env` is the name of this image as built above. To
93+
view all images on your computer, type
94+
`docker images --all`
7395

7496
One you run your image, you will be given a URL at the command line. Paste that puppy
7597
into your browser to run jupyter with the earth analytics environment installed!!
98+
99+
## Updating the Earth Analytics Environment
100+
101+
If you wish to update the earth analytics environment, do the following.
102+
103+
1. make a **PR** with changes to master
104+
2. **think** about your changes - don't do silly things or break things :)
105+
3. **merge** the PR into the master branch
106+
4. Check & wait till [Dockerhub](https://hub.docker.com/r/earthlab/earth-analytics-python-env/tags/) has built the image for the merging of the **PR** you can see builds in progress, [here](https://hub.docker.com/r/earthlab/earth-analytics-python-env/builds/)
107+
5. Finally, once the build is complete you can then you can update hub-ops repo with the newly tagged image.
108+
109+
## Important Notes
110+
If the update the `earthpy` package, you must specify the commit number that you
111+
wish to build `earthpy` against. This will ensure that the docker image
112+
automagically rebuilds using the latest version of `earthpy`
113+
114+
like this: `- git+https://github.com/earthlab/earthpy.git@283683affac9e46b1690c7913ebd2621c82ba43a`
115+
116+
This PR should kick off a rebuild of the docker image. But that docker image will
117+
not be usable until it's built off of the master branch.
118+
119+
NOTE 2: The DockerHub build actually takes forever and ever. So it's best to check out the build status rather than assuming it's built.

environment.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ dependencies:
99
- pyqt
1010
- seaborn
1111

12+
# Extensions
13+
- autopep8
14+
1215
# Geo stuff
1316
- rasterstats
1417
- geopy
@@ -21,9 +24,16 @@ dependencies:
2124
- folium
2225
- scikit-image
2326
- gdal
27+
- libgdal
28+
- kealib
2429
- geocoder
2530
- geojson
2631

32+
# Natural language processing
33+
- tweepy
34+
- nltk
35+
- textblob
36+
2737
# Jupyter Environment
2838
- notebook
2939
- ipython
@@ -38,9 +48,10 @@ dependencies:
3848
- nbgrader
3949
- nbclean
4050
- mne
41-
- sklearn
4251
- tqdm
4352
- kiwisolver
53+
# EA tools via pip
4454
- mapboxgl
45-
- git+https://github.com/geopandas/geopandas.git
46-
- git+https://github.com/earthlab/earthpy.git
55+
- sklearn
56+
- hydrofunctions
57+
- git+https://github.com/earthlab/earthpy.git@ad143d31ab4386eba93080a1803fea291d8ed684

hooks/build

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
3+
SHA=`git rev-parse --short HEAD`
4+
5+
docker build -t earthlab/earth-analytics-python-env:$SHA .

hooks/push

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
3+
SHA=`git rev-parse --short HEAD`
4+
5+
docker push earthlab/earth-analytics-python-env:$SHA

0 commit comments

Comments
 (0)