Skip to content

Commit

Permalink
Devel 2.5.3 (#20)
Browse files Browse the repository at this point in the history
* Fix docker build command

* Include conda env from antonio

* Added mamba doc for recipe

* Update dockerfile to 1.5.0

* Update README (conda as preferred install method)

* upgraded docker to 1.5.1 (added python packages)

* Added python dependencies and using mambabuild

* Change channel order in conda install command

Setting conda-forge as primary channel avoids conflicts with the default channel

* reduced meta.yml dependencies

* Update README.md

Include additional aid for jupyter notebook installation in new climate4r dedicated environments

* Update README.md

* Generated Dockerfile for 1.5.0

* updated conda to 1.5.1

* Updated README

* using r- packages instead of install.R

* The first release based only on conda packages

* Fix build string

* Relaxing R and Python version specification

* Preparing release v2.5.3

Co-authored-by: zequihg50 <[email protected]>
Co-authored-by: Jesus Fernandez <[email protected]>
Co-authored-by: Jesus Fernandez <[email protected]>
Co-authored-by: Joaquin Bedia <[email protected]>
  • Loading branch information
5 people authored Aug 9, 2021
1 parent a18ef5a commit 8a02b51
Show file tree
Hide file tree
Showing 13 changed files with 139 additions and 285 deletions.
14 changes: 12 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
FROM santandermetgroup/climate4r:1.4.1
FROM jupyter/base-notebook:latest

COPY --chown=jovyan:users notebooks /home/$NB_USER/notebooks
USER root
RUN apt-get update && apt-get install -y xorg git

USER $NB_USER
RUN conda install mamba -y -n base -c conda-forge && \
mamba install -y -c conda-forge -c r -c defaults -c santandermetgroup \
r-climate4r=2.5.3 \
xarray pandas matplotlib cartopy netcdf4 cftime dask iris \
jupyter_contrib_nbextensions jupyter_nbextensions_configurator r-irkernel && \
chown -R jovyan:users /home/jovyan && \
R --vanilla -e 'IRkernel::installspec()'
46 changes: 26 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,33 @@ Moreover, there is a [notebook repository](https://github.com/SantanderMetGroup/

## Installation

The `climate4R` framework relies on a wealth of other R packages and bindings to third-party libraries. Therefore, the recommended installation is through the conda package below, which ensures the proper installation of all dependencies.

### Installation using miniconda:

[Miniconda](https://docs.conda.io/en/latest/miniconda.html) is a free minimal installer for conda. The [conda recipe](conda) installs an up-to-date version of the different packages composing the `climate4R` framework, along with the associated library dependencies (udunits, openjdk, netcdf Java etc.), avoiding potential problems like the R-java configuration etc. Note that the appropriate miniconda distribution must be installed (go to the [miniconda installers page](https://docs.conda.io/en/latest/miniconda.html)) before running the following commands. We recommend starting from a clean environment (named climate4R in this example):

```bash
conda create --name climate4R
conda activate climate4R
```

In this environment, install `climate4R` by issuing:

```bash
conda install -c conda-forge -c r -c defaults -c santandermetgroup climate4r
```

Activate the conda environment to work with climate4R. Deactivate the environment with:

```bash
conda deactivate
```

### Direct package installation from github:

Individual packages can be installed directly from the github sources.

``` r
> library(devtools)
> install_github(c("SantanderMetGroup/loadeR.java",
Expand All @@ -60,26 +85,7 @@ Moreover, there is a [notebook repository](https://github.com/SantanderMetGroup/
"SantanderMetGroup/downscaleR"))
```

### Installation using miniconda:

[Miniconda](https://docs.conda.io/en/latest/miniconda.html) is a free minimal installer for conda. Using the [conda recipe](https://github.com/SantanderMetGroup/climate4R/tree/master/conda) it is possible to install an up-to-date version of the different packages composing the `climate4R` framework, and all the associated library dependencies (udunits, openjdk, netcdf Java etc.), avoiding some possible problems like the R-java configuration etc. Note that the appropriate miniconda distribution must be installed before running the command (go to the [miniconda installers page](https://docs.conda.io/en/latest/miniconda.html)):

```bash
# create a conda environment
conda create --name nameofmycondaenvironment
# activate the environment
conda activate nameofmycondaenvironment
# install climate4R
conda install -c defaults -c r -c conda-forge -c santandermetgroup climate4r
```
Activate the conda environment to work with climate4R. To deactivate the environment run the following:

```bash
# deactivate the environment
conda deactivate nameofmycondaenvironment
```

### NOTE: installation of specific package versions
#### NOTE: installation of specific package versions

In case a particular paper notebook is to be replicated, the installation of specific version tags can be done by just explicitly indicating the tag number in the repo name. For example:

Expand Down
26 changes: 0 additions & 26 deletions conda-base/README.md

This file was deleted.

18 changes: 0 additions & 18 deletions conda-base/build.sh

This file was deleted.

52 changes: 0 additions & 52 deletions conda-base/get-last-release.sh

This file was deleted.

29 changes: 0 additions & 29 deletions conda-base/meta.yaml

This file was deleted.

24 changes: 0 additions & 24 deletions conda-full/README.md

This file was deleted.

36 changes: 0 additions & 36 deletions conda-full/build.sh

This file was deleted.

55 changes: 0 additions & 55 deletions conda-full/meta.yaml

This file was deleted.

43 changes: 43 additions & 0 deletions conda/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Conda recipe for climate4R metapackage

## Installing climate4R conda metapackage

```bash
conda install -c conda-forge -c r -c defaults -c santandermetgroup r-climate4r
```

***
_Note for jupyter notebook users_: From a dedicated environment, to run notebooks using climate4R include it as:

```bash
conda install -c conda-forge -c r -c defaults -c santandermetgroup r-climate4r
jupyter r-irkernel
```

in order to include jupyter notebooks in your newly created environment
***

## Building climate4R conda metapackage

```bash
conda build -c conda-forge -c r -c defaults -c santandermetgroup .
anaconda login
anaconda upload -u SantanderMetGroup PATH_TO_TAR_BZ2
```

## ToDo, explore mamba and boa

[mamba](https://github.com/mamba-org/mamba) and [boa](https://github.com/mamba-org/boa)

Install:

```bash
conda install mamba -n base -c conda-forge
```

Build:

```bash
rm -rf ${HOME}/miniconda3/conda-bld/src_cache
conda mambabuild -c conda-forge -c r -c defaults -c santandermetgroup . &>log &
```
Loading

0 comments on commit 8a02b51

Please sign in to comment.