From 399fa5edfe77c8203cd01c849f328e2eaf5eede6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Wa=C5=9Bko?= Date: Mon, 12 Jul 2021 13:58:13 +0200 Subject: [PATCH] Update Dockerfile for Integrating Editions with Cloud (#1848) --- docs/libraries/editions.md | 15 +++++++++++---- tools/ci/docker/Dockerfile | 23 ++++++++++++++++++++++- 2 files changed, 33 insertions(+), 5 deletions(-) diff --git a/docs/libraries/editions.md b/docs/libraries/editions.md index d7b5d080e7..038c9522d0 100644 --- a/docs/libraries/editions.md +++ b/docs/libraries/editions.md @@ -157,10 +157,17 @@ names, but it can refer to other editions by their names (when extending them). These editions are resolved using the logic below: 1. Each `` corresponds to a file `.yaml`. -2. First, the directory `/editions` is scanned for a matching edition - file. -3. If none is found above, the directory `$ENSO_DATA_DIRECTORY/editions` is - checked. +2. First, the custom edition search paths are scanned for a matching edition + file. These paths can be defined by the `ENSO_EDITION_PATH` environment + variable. If it is not defined, it defaults to `/editions`. +3. If none is found above, the cached/bundled edition search paths are checked. + These consist of the directory `$ENSO_DATA_DIRECTORY/editions`, `editions` + directories in installed engines and the `editions` directory in the + currently running engine. + +By default, downloaded editions are downloaded to +`$ENSO_DATA_DIRECTORY/editions`, but also editions bundled with any available +engines can be loaded. See [The Enso Distribution](../distribution/distribution.md) for definitions of the directories. diff --git a/tools/ci/docker/Dockerfile b/tools/ci/docker/Dockerfile index 551f74f4ba..b56371234b 100644 --- a/tools/ci/docker/Dockerfile +++ b/tools/ci/docker/Dockerfile @@ -6,14 +6,35 @@ ENV LOG_LEVEL=INFO RUN useradd -u 2000 -c 'Enso Developer' -U -M ensodev +# /opt/enso is the present engine distribution. +# /opt/workdir is a directory for temporary runtime files and logs. +# /volumes/workspace is the root of the mounted workspace which contains all data that must persist when the project is reopened. +# /volumes/workspace/project_root contains the project package. +# /volumes/workspace/data_root contains the data root of the Enso distribution, this is where cached libraries will be located. +# /volumes/workspace/config contains configuration files, currently these are not really used in the Cloud. +# /volumes/workspace/home contains the ENSO_HOME directory, where locally created libraries will be placed. +# Currently, only the /volumes/workspace/project_root needs to be initialized with the project structure when the project is created. +# All other directories are created on-demand. + ADD bin /opt/enso/bin ADD component /opt/enso/component ADD lib /opt/enso/lib ADD editions /opt/enso/editions +RUN mkdir /opt/enso/work +RUN mkdir /opt/enso/logs + +ENV ENSO_DATA_DIRECTORY=/volumes/workspace/data_root +ENV ENSO_CONFIG_DIRECTORY=/volumes/workspace/config +ENV ENSO_RUNTIME_DIRECTORY=/opt/enso/work +ENV ENSO_LOG_DIRECTORY=/opt/enso/logs +ENV ENSO_HOME=/volumes/workspace/home + RUN chown -hR ensodev:ensodev /opt/enso RUN chmod -R u=rX,g=rX /opt/enso RUN chmod a+x /opt/enso/bin/* +RUN chmod a+rw /opt/enso/work +RUN chmod a+rw /opt/enso/logs RUN mkdir -p /volumes RUN chown -hR ensodev:ensodev /volumes @@ -28,4 +49,4 @@ ENTRYPOINT [ "/opt/enso/bin/docker-entrypoint.sh" ] EXPOSE 30001 EXPOSE 30002 -CMD ["--server", "--daemon", "--rpc-port", "30001", "--data-port", "30002", "--root-id", "00000000-0000-0000-0000-000000000001", "--path", "/volumes/workspace", "--interface", "0.0.0.0"] +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"]