Skip to content
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

Example prop #1762

Merged
merged 5 commits into from
Apr 25, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
12 changes: 6 additions & 6 deletions conf/byzer.properties
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ byzer.server.mode=server

# spark properties
spark.master=local[*]
spark.driver.memory=2g
spark.sql.hive.thriftServer.singleSession=true
spark.kryoserializer.buffer=256k
spark.kryoserializer.buffer.max=1024m
#spark.driver.memory=2g
#spark.sql.hive.thriftServer.singleSession=true
#spark.kryoserializer.buffer=256k
#spark.kryoserializer.buffer.max=1024m
#spark.sql.shuffle.partitions=1
spark.serializer=org.apache.spark.serializer.KryoSerializer
spark.scheduler.mode=FAIR
#spark.serializer=org.apache.spark.serializer.KryoSerializer
#spark.scheduler.mode=FAIR
#spark.hadoop.mapreduce.job.run-local=true
#spark.driver.maxResultSize=2g
#spark.sql.codegen.wholeStage=true
Expand Down
13 changes: 13 additions & 0 deletions conf/byzer.properties.all-in-one.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# override example for all-in-one package

streaming.master=local[*]
streaming.name=Byzer-lang-desktop
streaming.rest=true
streaming.thrift=false
streaming.platform=spark
streaming.spark.service=true
streaming.job.cancel=true
streaming.datalake.path=./data/
streaming.driver.port=9003
streaming.enableHiveSupport=false
streaming.plugin.clzznames=tech.mlsql.plugins.ds.MLSQLExcelApp,tech.mlsql.plugins.assert.app.MLSQLAssert,tech.mlsql.plugins.shell.app.MLSQLShell,tech.mlsql.plugins.ext.ets.app.MLSQLETApp,tech.mlsql.plugins.mllib.app.MLSQLMllib
18 changes: 18 additions & 0 deletions conf/byzer.properties.server.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# override example for server package

streaming.master=local[*]
streaming.name=Byzer-lang-server
streaming.rest=true
streaming.thrift=false
streaming.platform=spark
streaming.spark.service=true
streaming.driver.port=9003
streaming.enableHiveSupport=false

spark.master=local[*]
spark.driver.memory=2g
spark.scheduler.mode=FAIR
spark.sql.hive.thriftServer.singleSession=true
spark.kryoserializer.buffer=256k
spark.kryoserializer.buffer.max=1024m
spark.serializer=org.apache.spark.serializer.KryoSerializer
28 changes: 19 additions & 9 deletions dev/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,14 @@ function prepareProp() {

BYZER_PROP=$($BYZER_HOME/bin/get-properties.sh -byzer)
SPARK_PROP=$($BYZER_HOME/bin/get-properties.sh -spark)
ALL_PROP=$(BYZER_HOME/bin/get-properties.sh -args)
}

function start(){
clearRedundantProcess

# check $BYZER_HOME
[[ -z ${BYZER_HOME} ]] && quit "{BYZER_HOME} is not set, exit"
[[ -z ${BYZER_HOME} ]] && quit "{BYZER_HOME} is not set, exit"
if [ -f "${BYZER_HOME}/pid" ]; then
PID=$(cat ${BYZER_HOME}/pid)
if ps -p $PID > /dev/null; then
Expand All @@ -105,7 +106,7 @@ function start(){
# check $SPARK_HOME
if [ $BYZER_SERVER_MODE == "server" ]; then
# only in server mode need check spark home
[[ -z ${SPARK_HOME} ]] && quit "{SPARK_HOME} is not set, exit"
[[ -z ${SPARK_HOME} ]] && quit "{SPARK_HOME} is not set, exit"
fi

${BYZER_HOME}/bin/check-env.sh || exit 1
Expand All @@ -129,13 +130,22 @@ function start(){
echo "${EXT_JARS}"

cd $BYZER_HOME/
nohup $SPARK_HOME/bin/spark-submit --class streaming.core.StreamingApp \
--jars ${JARS} \
--conf "spark.driver.extraClassPath=${EXT_JARS}" \
--driver-java-options "-Dlog4j.configuration=${BYZER_LOG_PATH}" \
$SPARK_PROP \
$MAIN_JAR_PATH \
$BYZER_PROP >> ${BYZER_HOME}/logs/byzer.out & echo $! >> ${BYZER_HOME}/pid

if [[ $BYZER_SERVER_MODE = "all-in-one" ]]; then
nohup ${BYZER_HOME}/jdk8/bin/java -cp ${BYZER_HOME}/main/${MAIN_JAR}:${BYZER_HOME}/spark/*:${BYZER_HOME}/libs/*:${BYZER_HOME}/plugin/* \
tech.mlsql.example.app.LocalSparkServiceApp \
$ALL_PROP >> ${BYZER_HOME}/logs/byzer.out \
& echo $! >> ${BYZER_HOME}/pid
ZhengshuaiPENG marked this conversation as resolved.
Show resolved Hide resolved

elif [[ $BYZER_SERVER_MODE = "server" ]]; then
nohup $SPARK_HOME/bin/spark-submit --class streaming.core.StreamingApp \
--jars ${JARS} \
--conf "spark.driver.extraClassPath=${EXT_JARS}" \
--driver-java-options "-Dlog4j.configuration=${BYZER_LOG_PATH}" \
$SPARK_PROP \
$MAIN_JAR_PATH \
$BYZER_PROP >> ${BYZER_HOME}/logs/byzer.out & echo $! >> ${BYZER_HOME}/pid
fi

sleep 3
clearRedundantProcess
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ public class ByzerConfigCLI {

private final static String BYZER_CONF_TEMP = "-%s %s";

private final static String ARGS_CONF_TEMP = "-%s %s ";

public static void main(String[] args) {
execute(args);
Unsafe.systemExit(0);
Expand All @@ -51,7 +53,7 @@ public static void execute(String[] args) {

String key = args[0].trim();
if (key.equals("-byzer")) {
// get all properties
// get byzer properties
for (Map.Entry<Object, Object> entry : config.entrySet()) {
String entryKey = (String) entry.getKey();
if (entryKey.startsWith("streaming") || entryKey.startsWith("spark.mlsql")) {
Expand All @@ -60,15 +62,24 @@ public static void execute(String[] args) {
}
}
} else if (key.equals("-spark")) {
// get all properties
// get spark properties
for (Map.Entry<Object, Object> entry : config.entrySet()) {
String entryKey = (String) entry.getKey();
if (entryKey.startsWith("spark") && !entryKey.startsWith("spark.mlsql")) {
String prop = String.format(SPARK_CONF_TEMP, entryKey, entry.getValue());
System.out.println(prop);
}
}
} else if (!key.endsWith(".")) {
} else if (key.equals("-args")) {
ZhengshuaiPENG marked this conversation as resolved.
Show resolved Hide resolved
// get all properties
StringBuffer prop = new StringBuffer("");
for (Map.Entry<Object, Object> entry : config.entrySet()) {
String entryKey = (String) entry.getKey();
prop.append(String.format(ARGS_CONF_TEMP, entryKey, entry.getValue()));
}
System.out.println(prop);
}
else if (!key.endsWith(".")) {
String value = config.getProperty(key);
if (value == null) {
value = "";
Expand Down