diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 4c66cc8697ed..00d299574a39 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -36,7 +36,7 @@ Cargo.toml /distribution/ @4e6 @jdunkerley @radeusgd @GregoryTravis @AdRiley /engine/ @4e6 @jaroslavtulach @hubertp @Akirathan /project/ @4e6 @jaroslavtulach @hubertp -/tools/ @4e6 @jaroslavtulach @radeusgd +/tools/ @4e6 @jaroslavtulach @radeusgd @hubertp # Enso Libraries # This section should be amended once the engine moves to /app/engine diff --git a/engine/language-server/src/main/scala/org/enso/languageserver/boot/LanguageServerComponent.scala b/engine/language-server/src/main/scala/org/enso/languageserver/boot/LanguageServerComponent.scala index f10f8cc69360..e280157b904e 100644 --- a/engine/language-server/src/main/scala/org/enso/languageserver/boot/LanguageServerComponent.scala +++ b/engine/language-server/src/main/scala/org/enso/languageserver/boot/LanguageServerComponent.scala @@ -95,7 +95,7 @@ class LanguageServerComponent(config: LanguageServerConfig, logLevel: Level) } _ <- Future { logger.info( - s"Started server at json:${config.interface}${config.rpcPort}, ${config.secureRpcPort + s"Started server at json:${config.interface}:${config.rpcPort}, ${config.secureRpcPort .map(p => s"secure-jsons:${config.interface}$p") .getOrElse("")}, " + s"binary:${config.interface}:${config.dataPort}${config.secureDataPort diff --git a/tools/ci/README.md b/tools/ci/README.md index 78985663de71..05922fbd832d 100644 --- a/tools/ci/README.md +++ b/tools/ci/README.md @@ -1,3 +1,26 @@ # CI Tools This folder contains miscellaneous utilities for CI. + +# Docker + +## Building + +A custom docker image requires a certain number of directories to be present +from a desired _edition_. The root directory of the docker build context can be +provided in the `docker build` command: + +```bash +docker build -t -f tools/ci/docker/DockerFile --build-context docker-tools=tools/ci/docker built-distribution/enso-engine-$VERSION-linux-amd64/enso-$VERSION +``` + +where for a locally built distribution on Linux it would be `VERSION=0.0.0-dev`. + +## Running + +To start Language Server with a default configuration simply run the built image +with the chosen name: + +```bash +docker run -t +``` diff --git a/tools/ci/docker/Dockerfile b/tools/ci/docker/Dockerfile old mode 100644 new mode 100755 index 8d919ce18913..b1b2f2dd3788 --- a/tools/ci/docker/Dockerfile +++ b/tools/ci/docker/Dockerfile @@ -2,7 +2,11 @@ FROM ghcr.io/graalvm/jdk-community:21 USER root -ENV LOG_LEVEL=INFO +ARG LOG_LEVEL=info +ARG RPC_PORT=30001 +ARG DATA_PORT=30002 +ARG PRINT_VERSION=0 +ARG JAVA_OPTS="-XX:MaxRAMPercentage=90.0 -XX:InitialRAMPercentage=90.0" RUN useradd -u 2000 -c 'Enso Developer' -U -m ensodev @@ -39,6 +43,7 @@ RUN chmod a+rw /opt/enso/logs RUN mkdir -p /volumes RUN chown -hR ensodev:ensodev /volumes RUN chmod -R u=rwX,g=rwX /volumes +COPY --from=docker-tools docker-entrypoint.sh /opt/enso/bin/ USER ensodev:ensodev @@ -46,7 +51,13 @@ WORKDIR /opt/enso ENTRYPOINT [ "/opt/enso/bin/docker-entrypoint.sh" ] -EXPOSE 30001 -EXPOSE 30002 +ENV RPC_PORT=${RPC_PORT} +ENV DATA_PORT=${DATA_PORT} +ENV LOG_LEVEL=${LOG_LEVEL} +ENV PRINT_VERSION=${PRINT_VERSION} +ENV JAVA_OPTS=${JAVA_OPTS} -CMD ["--server", "--daemon", "--rpc-port", "30001", "--data-port", "30002", "--root-id", "00000000-0000-0000-0000-000000000001", "--path", "/volumes/workspace/project_root", "--interface", "0.0.0.0"] +EXPOSE ${RPC_PORT} +EXPOSE ${DATA_PORT} + +CMD ["--server", "--daemon", "--path", "/volumes/workspace/project_root"] diff --git a/tools/ci/docker/docker-entrypoint.sh b/tools/ci/docker/docker-entrypoint.sh index 70bc6f911e70..1214246382b7 100755 --- a/tools/ci/docker/docker-entrypoint.sh +++ b/tools/ci/docker/docker-entrypoint.sh @@ -1,8 +1,16 @@ #!/bin/bash set -e -echo "Starting Enso Runtime in version" +if [ "$PRINT_VERSION" == "1" ]; then + /opt/enso/bin/enso --version +fi -/opt/enso/bin/enso --version +if [ "$LS_ROOT_ID" == "" ]; then + LS_ROOT_ID="00000000-0000-0000-0000-000000000001" +fi -/opt/enso/bin/enso --log-level $LOG_LEVEL "$@" +if [ "$INTERFACE" == "" ]; then + INTERFACE="0.0.0.0" +fi + +/opt/enso/bin/enso --log-level "$LOG_LEVEL" --rpc-port $RPC_PORT --data-port $DATA_PORT --root-id "$LS_ROOT_ID" --interface "$INTERFACE" "$@"