Minor cleanups to docker image (#8925)

* Minor cleanups to docker image

* format

* nit
This commit is contained in:
Hubert Plociniczak 2024-02-11 21:52:47 +01:00 committed by GitHub
parent aed59d316d
commit b00dc9e9c0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 51 additions and 9 deletions

2
.github/CODEOWNERS vendored
View File

@ -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

View File

@ -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

View File

@ -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 <my-custom-name> -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 <my-custom-name>
```

19
tools/ci/docker/Dockerfile Normal file → Executable file
View File

@ -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"]

View File

@ -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" "$@"