Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .bazelproject
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
directories:
.

targets:
//java/com/revolutionanalytics/hadoop/hdfs:rhdfs_lib
//pkg:rhdfs
33 changes: 31 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,35 @@
# Ignore backup files.
*~

# Ignore Vim swap files.
.*.swp

# Ignore files generated by IDEs.
/.classpath
/.factorypath
/.idea/
/.project
/.settings
/.vscode/
/bazel.iml

# Ignore all bazel-* symlinks. There is no full list since this can change
# based on the name of the directory bazel is cloned into.
/bazel-*

# Ignore outputs generated during Bazel bootstrapping.
/output/

# Dependency Analysis
graph.in
graph.png

# R Artifacts
.RData
.Rhistory
.Rproj.user
*.Rproj

*.orig
pkg/rhdfs.bin.Rcheck
*.log
pkg/..Rcheck
pkg.Rcheck
27 changes: 27 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
dist: trusty

addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- wget
- pkg-config

before_install:
- wget https://github.com/bazelbuild/bazel/releases/download/0.11.0/bazel_0.11.0-linux-x86_64.deb
- sudo dpkg -i bazel_0.11.0-linux-x86_64.deb
- sudo sh -c 'echo "deb http://cran.rstudio.com/bin/linux/ubuntu trusty/" >> /etc/apt/sources.list'
- gpg --keyserver keyserver.ubuntu.com --recv-key E084DAB9
- gpg -a --export E084DAB9 | sudo apt-key add -
- wget http://archive.cloudera.com/cdh5/cdh/5/hadoop-2.6.0-cdh5.13.0.tar.gz
- sudo tar xvf hadoop-2.6.0-cdh5.13.0.tar.gz -C /opt
- sudo apt-get update
- sudo apt-get -y install r-base
- sudo R CMD javareconf
- sudo R --quiet -e 'install.packages("rJava", type="source", repos="http://cran.us.r-project.org")'
- sudo apt-get install -y texlive-base texlive-extra-utils texlive-latex-base texlive-latex-recommended texlive-generic-recommended
env:
- HADOOP_CMD="/opt/hadoop-2.6.0-cdh5.13.0/bin/hadoop"
script:
- bazel build //...
23 changes: 20 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,21 @@
rhdfs
=====
# rhdfs

A package that allows R developers to use Hadoop HDFS, developed as part of the RHadoop project. Please see the [RHadoop wiki](https://github.com/RevolutionAnalytics/RHadoop/wiki) for information.
This repository provides an R package for interacting with Hadoop Distributed File System (HDFS).

[![Build Status](https://travis-ci.org/bowlofstew/rhdfs.svg?branch=master)](https://github.com/bowlofstew/rhdfs)

## Documentation

[Requirements](docs/REQUIREMENTS.md)

[Compilation](docs/COMPILATION.md)

[CRAN](docs/CRAN.md)

[Dependency Analysis](docs/DEPENDENCIES.md)

[IntelliJ](docs/INTELLIJ.md)

## Author(s)

Stewart Henderson <stewart.henderson@protonmail.com>
50 changes: 50 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
workspace(name = "rhdfs")

# Bazel Rules
RULES_R_COMMIT="6c6a0536c829e59c1ddcb3a96df0376342f66bf9"

git_repository(
name = "com_grail_rules_r",
remote = "https://github.com/grailbio/rules_r.git",
commit = RULES_R_COMMIT,
)

# Java, Maven Dependencies
maven_jar(
name = "org_apache_hadoop_hadoop_core",
artifact = "org.apache.hadoop:hadoop-core:1.2.1",
)

# R Dependencies
CRAN_BASE_URL="https://cloud.r-project.org/src/contrib"
CRAN_PACKAGE="tar.gz"
RJAVA_VERSION="0.9-9"
DBI_VERSION="0.8"
BIGLM_VERSION="0.9-1"

new_http_archive(
name = "R_rJava",
build_file = "cran/BUILD.rJava",
strip_prefix = "rJava",
urls = [
"{}/rJava_{}.{}".format(CRAN_BASE_URL, RJAVA_VERSION, CRAN_PACKAGE)
],
)

new_http_archive(
name = "R_DBI",
build_file = "cran/BUILD.DBI",
strip_prefix = "DBI",
urls = [
"{}/DBI_{}.{}".format(CRAN_BASE_URL, DBI_VERSION, CRAN_PACKAGE)
],
)

new_http_archive(
name = "R_biglm",
build_file = "cran/BUILD.biglm",
strip_prefix = "biglm",
urls = [
"{}/biglm_{}.{}".format(CRAN_BASE_URL, BIGLM_VERSION, CRAN_PACKAGE)
],
)
Binary file removed build/rhdfs_1.0.5.tar.gz
Binary file not shown.
Binary file removed build/rhdfs_1.0.6.tar.gz
Binary file not shown.
Binary file removed build/rhdfs_1.0.6.zip
Binary file not shown.
Binary file removed build/rhdfs_1.0.7.tar.gz
Binary file not shown.
Binary file removed build/rhdfs_1.0.7.zip
Binary file not shown.
Binary file removed build/rhdfs_1.0.8.tar.gz
Binary file not shown.
Binary file removed build/rhdfs_1.0.8.zip
Binary file not shown.
15 changes: 15 additions & 0 deletions cran/BUILD.DBI
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# https://cran.r-project.org/web/packages/DBI/index.html

load("@com_grail_rules_r//R:defs.bzl", "r_pkg")

package(default_visibility = ["//visibility:public"])

r_pkg(
name = "DBI",
srcs = glob(
["**"],
exclude = [],
),
lazy_data = True,
deps = [],
)
17 changes: 17 additions & 0 deletions cran/BUILD.biglm
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# https://cran.r-project.org/web/packages/biglm/index.html

load("@com_grail_rules_r//R:defs.bzl", "r_pkg")

package(default_visibility = ["//visibility:public"])

r_pkg(
name = "biglm",
srcs = glob(
["**"],
exclude = [],
),
lazy_data = True,
deps = [
"@R_DBI//:DBI",
],
)
15 changes: 15 additions & 0 deletions cran/BUILD.rJava
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# https://cran.r-project.org/web/packages/rJava/index.html

load("@com_grail_rules_r//R:defs.bzl", "r_pkg")

package(default_visibility = ["//visibility:public"])

r_pkg(
name = "rJava",
srcs = glob(
["**"],
exclude = [],
),
lazy_data = True,
deps = [],
)
8 changes: 8 additions & 0 deletions docs/COMPILATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Compilation

In order to compile the package, execute the command, `bazel build //...` and this
will build the R package and its Java dependency.

## Author(s)

Stewart Henderson <stewart.henderson@protonmail.com>
11 changes: 11 additions & 0 deletions docs/CRAN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Publishing to CRAN

1. Execute the command, `bazel build //..`.

2. From the top level project directory, execute the command, `R CMD check --as-cran pkg/`

3. In a web browser, navigate to `http://cran.r-project.org/submit.html` and create a submission for your package.

## Author(s)

Stewart Henderson <stewart.henderson@protonmail.com>
19 changes: 19 additions & 0 deletions docs/DEPENDENCIES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Dependency Analysis

In order to perform a dependency analysis of the project, you will need to meet an extra requirement of:

* [GraphViz Dot Compiler](https://www.graphviz.org/)

Once the dependency is satisified, you can execute the following commands to create a depedency graph:

bazel query 'deps(//pkg:rhdfs)' --output graph > graph.in

dot -Tpng < graph.in > graph.png

## Depdendency Graph

![Image of Yaktocat](resources/dependencies.png)

## Author(s)

Stewart Henderson <stewart.henderson@protonmail.com>
7 changes: 7 additions & 0 deletions docs/INTELLIJ.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# IntelliJ

[Jetbrain's IntelliJ](https://www.jetbrains.com/idea/) is supported for this project with the [Bazel plugin](https://github.com/bazelbuild/intellij).

## Author(s)

Stewart Henderson <stewart.henderson@protonmail.com>
17 changes: 17 additions & 0 deletions docs/REQUIREMENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Requirements

## Compilation Requirements

The basic project requirements are as follows:

* [JDK](https://java.com/en/download/)

* [Bazel](https://bazel.build/)

* [R](https://www.r-project.org/)

* [Tex]()

## Author(s)

Stewart Henderson <stewart.henderson@protonmail.com>
Binary file added docs/resources/dependencies.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 0 additions & 3 deletions java/build.num

This file was deleted.

68 changes: 0 additions & 68 deletions java/build.xml

This file was deleted.

16 changes: 16 additions & 0 deletions java/com/revolutionanalytics/hadoop/hdfs/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package(default_visibility = ["//visibility:public"])

SOURCES = glob(
["**"],
exclude = [
"BUILD",
],
)

java_library(
name = "rhdfs_lib",
srcs = SOURCES,
deps = [
"@org_apache_hadoop_hadoop_core//jar"
],
)
Binary file removed java/rhdfs.jar
Binary file not shown.
25 changes: 25 additions & 0 deletions pkg/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package(default_visibility = ["//visibility:public"])

load("@com_grail_rules_r//R:defs.bzl", "r_package")

r_package(
pkg_name = "rhdfs",
pkg_srcs = glob(
["**"],
exclude = [
"BUILD",
"README.md",
".gitignore",
".Rbuildignore",
"rplatform.Rproj",
".Rproject.user"
],
),
pkg_deps = [
"@R_rJava//:rJava",
"@R_biglm//:biglm",
],
pkg_suggested_deps = [
"//java/com/revolutionanalytics/hadoop/hdfs:rhdfs_lib"
]
)
Loading