-
Notifications
You must be signed in to change notification settings - Fork 8
Trying docker #94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
henrykironde
wants to merge
4
commits into
weecology:master
Choose a base branch
from
henrykironde:gen
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Trying docker #94
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,41 +1,37 @@ | ||
| language: r | ||
| cache: | ||
| - packages | ||
| - pip | ||
| sudo: required | ||
| dist: "trusty" | ||
| warnings_are_errors: false | ||
|
|
||
| addons: | ||
| apt: | ||
| packages: | ||
| - libgsl0-dbg | ||
| - libgsl0-dev | ||
| - libgsl0ldbl | ||
| - "python3" | ||
| - "python3-pip" | ||
| update: true | ||
| services: | ||
| - docker | ||
|
|
||
| before_install: | ||
| - sudo apt-get update -qq | ||
| - sudo apt-get install libudunits2-dev | ||
| - sudo apt-get install python3 | ||
| - sudo pip3 install --upgrade pip | ||
| - sudo pip3 install git+https://git@github.com/weecology/retriever.git --user | ||
| # Set up environment and create required images | ||
| # If no error don't print output | ||
| - docker build . -t matss > /dev/null | ||
| script: | ||
| # Load packages and install the required packages | ||
| # Install retriever from source and run tests | ||
| # - docker run matss /bin/sh -c 'Rscript load_and_test.R' | ||
|
|
||
| - docker run matss Rscript load_and_test.R | ||
|
|
||
|
|
||
| matrix: | ||
| include: | ||
| - r: devel | ||
| - r: release | ||
| after_success: | ||
| - R CMD INSTALL . | ||
| - Rscript -e 'pkgdown::build_site()' | ||
| - Rscript -e 'covr::codecov()' | ||
| deploy: | ||
| provider: pages | ||
| skip-cleanup: true | ||
| github-token: $GITHUB_PAT | ||
| keep-history: true | ||
| local-dir: docs | ||
| on: | ||
| branch: master | ||
| # matrix: | ||
| # include: | ||
| # - r: devel | ||
| # - r: release | ||
| # after_success: | ||
| # - R CMD INSTALL . | ||
| # - Rscript -e 'pkgdown::build_site()' | ||
| # - Rscript -e 'covr::codecov()' | ||
| # deploy: | ||
| # provider: pages | ||
| # skip-cleanup: true | ||
| # github-token: $GITHUB_PAT | ||
| # keep-history: true | ||
| # local-dir: docs | ||
| # on: | ||
| # branch: master |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| FROM rocker/tidyverse:latest | ||
|
|
||
| MAINTAINER Weecology "https://github.com/weecology/rdataretriever" | ||
|
|
||
| # Write enviromental options to config files | ||
| RUN echo "options(repos='https://cran.mtu.edu/')" >> ~/.Rprofile | ||
| RUN echo "options(repos='https://cran.mtu.edu/')" >> ~/.Renviron | ||
| RUN echo "R_LIBS=\"/usr/lib/R/library\"">> ~/.Rprofile | ||
| RUN echo "R_LIBS=\"/usr/lib/R/library\"">> ~/.Renviron | ||
| RUN echo "R_LIBS_USER=\"/usr/lib/R/library\"">> ~/.Renviron | ||
|
|
||
| RUN apt-get update | ||
| RUN apt-get install -y build-essential --allow-downgrades --allow-remove-essential --allow-change-held-packages | ||
| RUN apt-get install -y wget git locales locales-all --allow-downgrades --allow-remove-essential --allow-change-held-packages | ||
| RUN apt-get install -y postgresql-client mysql-client --allow-downgrades --allow-remove-essential --allow-change-held-packages | ||
|
|
||
| RUN apt-get install -y libgsl0-dbg libgsl0-dev | ||
| RUN apt-get install -y libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev | ||
|
|
||
| # RUN apt-get install --allow libgsl0ldbl # not available | ||
|
|
||
| # Set encoding | ||
| ENV LC_ALL en_US.UTF-8 | ||
| ENV LANG en_US.UTF-8 | ||
| ENV LANGUAGE en_US.UTF-8 | ||
|
|
||
| # Remove python2 and install python3 | ||
| RUN apt-get remove -y python && apt-get install -y python3 python3-pip curl | ||
| RUN rm -f /usr/bin/python && ln -s /usr/bin/python3 /usr/bin/python | ||
| RUN rm -f /usr/bin/pip && ln -s /usr/bin/pip3 /usr/bin/pip | ||
|
|
||
|
|
||
|
|
||
| RUN echo "export PATH="/usr/bin/python:$PATH"" >> ~/.profile | ||
| RUN echo "export PYTHONPATH="/usr/bin/python:$PYTHONPATH"" >> ~/.profile | ||
| RUN echo "export PGPASSFILE="~/.pgpass"" >> ~/.profile | ||
|
|
||
| # Add permissions to config files | ||
| RUN chmod 0644 ~/.Renviron | ||
| RUN chmod 0644 ~/.Rprofile | ||
| RUN chmod 0644 ~/.profile | ||
|
|
||
| # Install retriever python package | ||
| RUN pip install git+https://git@github.com/weecology/retriever.git | ||
| RUN retriever ls > /dev/null | ||
| RUN pip install psycopg2 pymysql > /dev/null | ||
| RUN R_RETICULATE_PYTHON="/usr/bin/python" | echo $R_RETICULATE_PYTHON >> ~/.Renviron | ||
|
|
||
| COPY . ./MATSS | ||
| # Use entrypoint to run more configurations. | ||
| # set permissions. | ||
| # entrypoint.sh will set out config files | ||
| # RUN chmod 0755 MATSS/cli_tools/entrypoint.sh | ||
| # ENTRYPOINT ["/cli_tools/entrypoint.sh"] | ||
|
|
||
| WORKDIR ./MATSS | ||
|
|
||
| # Change permissions to config files | ||
| # Do not run these cmds before Entrypoint. | ||
| # RUN chmod 600 cli_tools/.pgpass | ||
| # RUN chmod 600 cli_tools/.my.cnf | ||
|
|
||
| CMD ["bash", "-c", "retriever -v"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| [client] | ||
| user="travis" | ||
| password="Password12!" | ||
| host="mysqldb" | ||
| port="3306" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| pgdb:*:testdb:postgres:Password12! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| # #!/bin/sh | ||
| # set -e | ||
|
|
||
| # # Copy config files to $HOME | ||
| # cp -r /MATSS/cli_tools/.pgpass ~/ | ||
| # cp -r /MATSS/cli_tools/.my.cnf ~/ | ||
|
|
||
| # exec "$@" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| # Used for continous testing platform | ||
| # Install analysis packages using pacman | ||
| # Pacman will load the packages and install | ||
| # the packaes not available | ||
|
|
||
| library(devtools) | ||
| # Install pacman if it isn't already installed | ||
| if ("pacman" %in% rownames(installed.packages()) == FALSE) install.packages("pacman") | ||
| # suppressMessages(install.packages("RMariaDB", quiet = TRUE)) | ||
| suppressMessages( | ||
| pacman::p_load(devtools, RCurl, readr, rmarkdown, | ||
| testthat, tidyverse, RSQLite, | ||
| # DBI, RPostgreSQL, | ||
| magrittr, ggplot2, lubridate, | ||
| dplyr, tidyr, RSQLite, forecast, | ||
| networkD3, here, tibble, rlang) | ||
| ) | ||
|
|
||
| # Install GitHub packages | ||
|
|
||
| devtools::install_github("weecology/portalr") | ||
| devtools::install_github("ropensci/drake") | ||
| devtools::install_github("rstudio/reticulate") | ||
| devtools::install_github("ropensci/rdataretriever") | ||
| devtools::install_github("r-lib/usethis") | ||
| devtools::install_github("weecology/LDATS") | ||
| library(devtools) | ||
| library(portalr) | ||
| library(drake) | ||
| library(reticulate) | ||
| library(rdataretriever) | ||
| library(usethis) | ||
| library(LDATS) | ||
| install.packages(".", repos = NULL, type="source") | ||
| # Test package | ||
| # test_dir("tests/testthat", reporter = c("check", "progress")) | ||
|
|
||
| # Try old way | ||
| # This will not work well for reporting and fail/pass | ||
| devtools::test() | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dont mind the
cli_toolsfolder, we shall remove it