Skip to content

Instantly share code, notes, and snippets.

@pgilad
Created July 14, 2019 05:37
Show Gist options
  • Save pgilad/37f665ddd0f0af2b08438af79224c4c5 to your computer and use it in GitHub Desktop.
Save pgilad/37f665ddd0f0af2b08438af79224c4c5 to your computer and use it in GitHub Desktop.
Apache Zeppelin Brew Formula 0.7.3 (for AWS Glue compatibility)
class ApacheZeppelin < Formula
desc "Web-based notebook that enables interactive data analytics"
homepage "https://zeppelin.apache.org"
url "http://archive.apache.org/dist/zeppelin/zeppelin-0.7.3/zeppelin-0.7.3-bin-all.tgz"
sha256 "7e657df51ecfd4aad39d42f8578409692244d36b2da92b5dbd3b6957b829bf58"
head "https://github.com/apache/zeppelin.git"
bottle :unneeded
def install
rm_f Dir["bin/*.cmd"]
libexec.install Dir["*"]
bin.write_exec_script Dir["#{libexec}/bin/*"]
end
test do
begin
ENV["ZEPPELIN_LOG_DIR"] = "logs"
ENV["ZEPPELIN_PID_DIR"] = "pid"
ENV["ZEPPELIN_CONF_DIR"] = "#{testpath}/conf"
conf = testpath/"conf"
conf.mkdir
(conf/"zeppelin-env.sh").write <<~EOS
export ZEPPELIN_WAR_TEMPDIR="#{testpath}/webapps"
export ZEPPELIN_PORT=9999
export ZEPPELIN_NOTEBOOK_DIR="#{testpath}/notebooks"
export ZEPPELIN_MEM="-Xms256m -Xmx1024m -XX:MaxPermSize=256m"
EOS
ln_s "#{libexec}/conf/log4j.properties", conf
ln_s "#{libexec}/conf/shiro.ini", conf
system "#{bin}/zeppelin-daemon.sh", "start"
begin
sleep 25
json_text = shell_output("curl -s http://localhost:9999/api/notebook/")
assert_equal JSON.parse(json_text)["status"], "OK"
ensure
system "#{bin}/zeppelin-daemon.sh", "stop"
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment