diff --git a/GIDs b/GIDs index 96183f776323..178f477b5e58 100644 --- a/GIDs +++ b/GIDs @@ -242,7 +242,7 @@ owncast:*:299: backuppc:*:300: openvpn:*:301: netdata:*:302: -# free: 303 +h2oai:*:303: # free: 304 # free: 305 # free: 306 diff --git a/UIDs b/UIDs index bfff7a569e47..d156e5b5b799 100644 --- a/UIDs +++ b/UIDs @@ -247,7 +247,7 @@ owncast:*:299:299::0:0:& daemon:/nonexistent:/usr/sbin/nologin backuppc:*:300:300::0:0:BackupPC pseudo-user:/nonexistent:/usr/sbin/nologin openvpn:*:301:301::0:0:OpenVPN pseudo-user:/nonexistent:/usr/sbin/nologin netdata:*:302:302::0:0:NetData Daemon:/var/cache/netdata:/usr/sbin/nologin -# free: 303 +h2oai:*:303:303::0:0:H2O AI Daemon:/nonexistent:/usr/sbin/nologin # free: 304 # free: 305 # free: 306 diff --git a/math/Makefile b/math/Makefile index ca22db043f4d..6b317b76370c 100644 --- a/math/Makefile +++ b/math/Makefile @@ -347,6 +347,7 @@ SUBDIR += gri SUBDIR += grpn SUBDIR += gsl + SUBDIR += h2oai SUBDIR += half SUBDIR += hexcalc SUBDIR += heyoka diff --git a/math/h2oai/Makefile b/math/h2oai/Makefile new file mode 100644 index 000000000000..5491fbbe766f --- /dev/null +++ b/math/h2oai/Makefile @@ -0,0 +1,50 @@ +PORTNAME= h2oai +PORTVERSION= 3.34.0.3 +CATEGORIES= math java + +MAINTAINER= jpbeconne@free.fr +COMMENT= Fast Scalable Machine Learning API For Smarter Applications + +LICENSE= APACHE20 +LICENSE_FILE= ${WRKSRC}/LICENSE + +USES= python:3.8+ +USE_JAVA= yes +JAVA_VERSION= 1.8+ +JAVA_BUILD= yes +USE_GITHUB= yes +GH_ACCOUNT= h2oai +GH_PROJECT= h2o-3 +GH_TAGNAME= jenkins-3.34.0.3 +USERS= h2oai +GROUPS= h2oai +USE_RC_SUBR= h2oaid +BUILD_DEPENDS= node>0:www/node \ + gradle62>6:devel/gradle62 \ + R>=3.6:math/R \ + R-cran-RCurl>0:ftp/R-cran-RCurl \ + R-cran-jsonlite>0:converters/R-cran-jsonlite \ + R-cran-statmod>0:math/R-cran-statmod \ + R-cran-devtools>0:devel/R-cran-devtools \ + R-cran-testthat>0:devel/R-cran-testthat \ + ${PYTHON_PKGNAMEPREFIX}grip>0:www/py-grip@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}colorama>0:devel/py-colorama@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}future>0:devel/py-future@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}pip>0:devel/py-pip@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}tabulate>0:devel/py-tabulate@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}requests>0:www/py-requests@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}wheel>0:devel/py-wheel@${PY_FLAVOR} \ + npm>6:www/npm + +do-build: + @cd ${WRKSRC} && gradle62 --parallel clean build -x test + +do-install: + ${MKDIR} ${JAVASHAREDIR}/${PORTNAME} + (cd ${WRKSRC}/build && ${COPYTREE_SHARE} \* ${JAVASHAREDIR}/${PORTNAME}) + ${CHMOD} 555 ${JAVASHAREDIR}/${PORTNAME} + R CMD INSTALL ${WRKSRC}/h2o-r/R/src/contrib/h2o_3.34.0.99999.tar.gz + +post-install: + ${CAT} pkg-message +.include diff --git a/math/h2oai/distinfo b/math/h2oai/distinfo new file mode 100644 index 000000000000..62b7fa419976 --- /dev/null +++ b/math/h2oai/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1636627893 +SHA256 (h2oai-h2o-3-3.34.0.3-jenkins-3.34.0.3_GH0.tar.gz) = f7a4454b38f32b38eb523a32061140dc0e3eee6cbbc696a96baef6c56300f781 +SIZE (h2oai-h2o-3-3.34.0.3-jenkins-3.34.0.3_GH0.tar.gz) = 96667242 diff --git a/math/h2oai/files/h2oaid.in b/math/h2oai/files/h2oaid.in new file mode 100755 index 000000000000..8fa05a2f5b1f --- /dev/null +++ b/math/h2oai/files/h2oaid.in @@ -0,0 +1,69 @@ +#!/bin/sh +# +# $FreeBSD$ + +# PROVIDE: h2oaid +# REQUIRE: LOGIN +# KEYWORD: shutdown +# +# Add the following line to /etc/rc.conf to enable h2oaid: +# +# h2oaid_enable="YES" +# h2oaid_top_folder="" Top folder for diffrents H2O files (default /usr/local/h2oai) +# # optional +# h2oaid_java_options="" Java options for H2O +# h2oaid_h2o_options="" H2O options +# h2oaid_auth_options="" Authentication options +# + +. /etc/rc.subr + +# Set some defaults +h2oaid_enable=${h2oaid_enable:-"NO"} +h2oaid_top_folder=${h2oaid_top_folder:-"/usr/local/h2oai"} +h2oaid_data="-ice_root $h2oaid_top_folder/tmp -log_dir $h2oaid_top_folder/log -flow_dir $h2oaid_top_folder/flows" +h2oaid_flags="$h2oaid_data $h2oaid_h2o_options $h2oaid_auth_options" + +name=h2oaid +rcvar=h2oaid_enable +start_cmd="${name}_start" +status_cmd="${name}_status" +procname="/usr/local/openjdk8/bin/java" +pidfile="/var/run/$name.pid" + +h2oaid_start() +{ + if [ ! -d $h2oaid_top_folder/tmp ] + then + mkdir -p $h2oaid_top_folder/tmp + chown h2oai:h2oai $h2oaid_top_folder/tmp + fi + if [ ! -d $h2oaid_top_folder/log ] + then + mkdir -p $h2oaid_top_folder/log + chown h2oai:h2oai $h2oaid_top_folder/log + fi + if [ ! -d $h2oaid_top_folder/flows ] + then + mkdir -p $h2oaid_top_folder/flows + chown h2oai:h2oai $h2oaid_top_folder/flows + fi + su -m h2oai -c "/usr/local/bin/java $h2oaid_java_options -jar /usr/local/share/java/h2oai/h2o.jar $h2oaid_flags" > /var/log/h2oaid.log 2>&1 & + sleep 5 + echo $(ps -a -o 'pid,command' |grep -E 'openjdk.*h2o'|grep -v grep |cut -d " " -f1) >/var/run/$name.pid + echo "H2O AI started" +} + +h2oaid_status() +{ + h2o_pid=$(ps -a -o 'pid,command' |grep -E 'openjdk.*h2o'|grep -v grep |cut -d " " -f1) + if [ -z $h2o_pid ] + then + echo "H2O AI is not running" + else + echo "H2O AI is running with pid $h2o_pid and top folder $h2oaid_top_folder" + fi +} + +load_rc_config $name +run_rc_command "$1" diff --git a/math/h2oai/files/patch-gradle.properties b/math/h2oai/files/patch-gradle.properties new file mode 100644 index 000000000000..daef5c5da6a9 --- /dev/null +++ b/math/h2oai/files/patch-gradle.properties @@ -0,0 +1,9 @@ +--- gradle.properties.orig 2020-01-25 15:10:54 UTC ++++ gradle.properties +@@ -56,3 +56,6 @@ defaultHdfsDependency=hadoop-hdfs-client + defaultHiveExecVersion=1.1.0 + + defaultWebserverModule=h2o-jetty-8 ++ ++# Bower option ++h2o.web.allow.root=true diff --git a/math/h2oai/files/patch-h2o-r_build.gradle b/math/h2oai/files/patch-h2o-r_build.gradle new file mode 100644 index 000000000000..adf68f7e558c --- /dev/null +++ b/math/h2oai/files/patch-h2o-r_build.gradle @@ -0,0 +1,28 @@ +--- h2o-r/build.gradle.orig 2020-01-25 15:21:59 UTC ++++ h2o-r/build.gradle +@@ -39,14 +39,14 @@ task untar { + } + } + +-task gitbranch(type: Exec) { ++/*task gitbranch(type: Exec) { + commandLine getOsSpecificCommandLine(["git", "branch"]) + standardOutput = new ByteArrayOutputStream() + ext.output = { + if (standardOutput.toString().replace("\n", "").replace(' ','').split("\\*").length != 2) return "" + return standardOutput.toString().replace("\n", "").replace(' ','').split("\\*")[1] + } +-} ++}*/ + + task getRVersion(type: Exec) { + commandLine getOsSpecificCommandLine(['R', "--vanilla", "-q", "-e", "options(echo=FALSE);cat(paste(R.Version()\$major, R.Version()\$minor, collapse = '.', sep = '.'));"]) +@@ -216,7 +216,7 @@ task cleanUpSmokeTest { + } + + clean.dependsOn cleanUp, cleanUpSmokeTest +-setProperties.dependsOn gitbranch, getRVersion, pdflatex ++setProperties.dependsOn getRVersion, pdflatex + cpH2OAppJar.dependsOn setProperties + setDevPackageFiles.dependsOn cpH2OAppJar + setPackageFiles.dependsOn cpH2OAppJar diff --git a/math/h2oai/files/patch-h2o-web_package.json b/math/h2oai/files/patch-h2o-web_package.json new file mode 100644 index 000000000000..034ce61f14e0 --- /dev/null +++ b/math/h2oai/files/patch-h2o-web_package.json @@ -0,0 +1,11 @@ +--- h2o-web/package.json.orig 2020-01-25 14:52:31 UTC ++++ h2o-web/package.json +@@ -33,7 +33,7 @@ + "lodash": "^4.17.11", + "minimist": "^1.2.0", + "mkdirp": "^0.5.1", +- "puppeteer": "^1.10.0", ++ "puppeteer-core": "^1.10.0", + "request": "^2.88.0" + }, + "dependencies": {} diff --git a/math/h2oai/pkg-descr b/math/h2oai/pkg-descr new file mode 100644 index 000000000000..467a6449a77b --- /dev/null +++ b/math/h2oai/pkg-descr @@ -0,0 +1,9 @@ +H2O is an in-memory platform for distributed, scalable machine learning. H2O +uses familiar interfaces like R, Python, Scala, Java, JSON and the Flow +notebook/web interface, and works seamlessly with big data technologies like +Hadoop and Spark. H2O provides implementations of many popular algorithms such +as GBM, Random Forest, Deep Neural Networks, Word2Vec and Stacked Ensembles. +H2O is extensible so that developers can add data transformations and custom +algorithms of their choice and access them through all of those clients. + +WWW: https://www.h2o.ai/products/h2o/ diff --git a/math/h2oai/pkg-message b/math/h2oai/pkg-message new file mode 100644 index 000000000000..8bf58e9972e8 --- /dev/null +++ b/math/h2oai/pkg-message @@ -0,0 +1,8 @@ +[ +{ type: install + message:<