-
Notifications
You must be signed in to change notification settings - Fork 15
Conversation
PR Review ChecklistDo not edit the content of this comment. The PR reviewer should simply update this comment by ticking each review item below, as they get completed. Trivial Change
Code
Architecture
|
cfe8002
to
05f07ed
Compare
if [ $DEBUG ]; then | ||
exec $JAVA_BIN ${JAVAOPTS} -ea -cp "${CLASSPATH}" -Dtypedb.dir="${TYPEDB_HOME}" \ | ||
${TYPEDB_SERVER_CLASS} "${@:2}" | ||
else | ||
exec $JAVA_BIN ${JAVAOPTS} -cp "${CLASSPATH}" -Dtypedb.dir="${TYPEDB_HOME}" \ | ||
${TYPEDB_SERVER_CLASS} "${@:2}" | ||
fi | ||
else | ||
echo "Invalid argument: $1. Possible commands are: " | ||
echo " Server: typedb server [--help]" | ||
echo " Enterprise: typedb enterprise [--help]" | ||
echo " Console: typedb console [--help]" | ||
exit 1 | ||
fi | ||
CLASSPATH="${TYPEDB_SERVER_DIR}/conf/:${TYPEDB_SERVER_LIB_DIR}/*" | ||
|
||
# exec replaces current shell process with java so no commands after these ones will ever get executed | ||
exec ${JAVA_BIN} ${JAVAOPTS} ${EXTRAOPTS} -cp "${CLASSPATH}" -Dtypedb.dir="${TYPEDB_HOME}" ${TYPEDB_SERVER_CLASS} "${@:2}" | ||
;; |
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.
Compresed and replaced the "if debug add flag" switch with more idiomatic and extensible EXTRAOPTS
variable
@@ -20,77 +20,88 @@ IF %TYPEDB_HOME:~-1%==\ SET TYPEDB_HOME=%TYPEDB_HOME:~0,-1% | |||
|
|||
where java >NUL 2>NUL | |||
if %ERRORLEVEL% GEQ 1 ( | |||
echo Java is not installed on this machine. | |||
echo TypeDB needs Java 11+ in order to run. See the following setup guide: http://docs.vaticle.com/docs/get-started/setup-guide |
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.
Obsolete link
start java %CONSOLE_JAVAOPTS% -cp "%G_CP%" -Dtypedb.dir="%TYPEDB_HOME%" com.vaticle.typedb.console.TypeDBConsole %2 %3 %4 %5 %6 %7 %8 %9 | ||
java %CONSOLE_JAVAOPTS% -cp "%G_CP%" -Dtypedb.dir="%TYPEDB_HOME%" com.vaticle.typedb.console.TypeDBConsole %2 %3 %4 %5 %6 %7 %8 %9 |
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.
console
is a CLI which should stay in the host command prompt
start java %SERVER_JAVAOPTS% -cp "%G_CP%" -Dtypedb.dir="%TYPEDB_HOME%" com.vaticle.typedb.core.server.TypeDBServer %2 %3 %4 %5 %6 %7 %8 %9 | ||
if "%2"=="--help" ( | ||
java %SERVER_JAVAOPTS% -cp "%G_CP%" -Dtypedb.dir="%TYPEDB_HOME%" com.vaticle.typedb.core.server.TypeDBServer %2 %3 %4 %5 %6 %7 %8 %9 | ||
) else ( | ||
start cmd /c java %SERVER_JAVAOPTS% -cp "%G_CP%" -Dtypedb.dir="%TYPEDB_HOME%" com.vaticle.typedb.core.server.TypeDBServer %2 %3 %4 %5 %6 %7 %8 %9 ^|^| pause | ||
) | ||
goto exit |
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.
Two changes here:
typedb server --help
(as suggested by the usage print) no longer opens a new window, but rather prints the help in the current cmd window- otherwise, we use
start cmd /c [...] ^|^| pause
which prevents the window from automatically closing if (and only if) the server encounters an error and stops with a non-zero exit code, so that the user has a chance to read the log.Ctrl+C
still shuts down the server and closes the window without triggeringpause
.
## Usage and product changes We update to the updated entry point for the assembled TypeDB Core, which omits `console` from the usage help if it is not present to avoid confusion. See #6942 for more details. The command to boot up the server (unchanged): ``` typedb server --server.address=<address> ``` The command to boot up the console: ``` typedb console --core=<address> ``` We also improve the UX of the windows version of the entry point. Console no longer opens in a new window, `--help` is printed inline as expected, and in the event of the server failure, the logs are displayed to the user. See vaticle/typedb-common#158 for more details.
What is the goal of this PR?
We provide a single
server
entry point for starting up both core and enterprise server, whichever happens to be installed. We also omitserver
orconsole
from the usage help if it is not present to avoid confusion. See vaticle/typedb#6942 for more details.We also improve the UX of the windows version of the entry point. Console no longer opens in a new window,
--help
is printed inline as expected, and in the event of the server failure, the logs are displayed to the user.