2020-04-14 19:00:51 +03:00
|
|
|
# CI Tools
|
2020-07-21 15:59:40 +03:00
|
|
|
|
2020-04-14 19:00:51 +03:00
|
|
|
This folder contains miscellaneous utilities for CI.
|
2024-02-11 23:52:47 +03:00
|
|
|
|
|
|
|
# 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
|
2024-11-13 01:04:46 +03:00
|
|
|
docker build \
|
|
|
|
-t runtime:latest \
|
2024-11-26 19:51:27 +03:00
|
|
|
-f tools/ci/docker/engine/Dockerfile \
|
|
|
|
--build-context docker-tools=tools/ci/docker/engine \
|
2024-11-13 01:04:46 +03:00
|
|
|
built-distribution/enso-engine-0.0.0-dev-linux-amd64/enso-0.0.0-dev
|
2024-02-11 23:52:47 +03:00
|
|
|
```
|
|
|
|
|
|
|
|
## Running
|
|
|
|
|
2024-11-13 01:04:46 +03:00
|
|
|
To start Language Server with a default configuration, run the built image and
|
|
|
|
mount the project directory:
|
2024-02-11 23:52:47 +03:00
|
|
|
|
|
|
|
```bash
|
2024-11-13 01:04:46 +03:00
|
|
|
docker run -it --rm \
|
|
|
|
--network=host \
|
|
|
|
--mount type=bind,src=~/Documents/enso-projects/NewProject,dst=/volumes/workspace/project_root \
|
|
|
|
runtime:latest
|
2024-02-11 23:52:47 +03:00
|
|
|
```
|
2024-08-15 16:04:53 +03:00
|
|
|
|
2024-11-26 19:51:27 +03:00
|
|
|
# Ydoc Docker
|
2024-08-15 16:04:53 +03:00
|
|
|
|
2024-11-26 19:51:27 +03:00
|
|
|
## Build Node.js container
|
2024-08-15 16:04:53 +03:00
|
|
|
|
2024-11-26 19:51:27 +03:00
|
|
|
To build a Node.js-based Ydoc, you need to first ensure that you have the
|
2024-08-15 16:04:53 +03:00
|
|
|
distributable sources:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
pnpm -r compile
|
|
|
|
```
|
|
|
|
|
|
|
|
the resulting artifacts are located in `app/ydoc-server-nodejs/dist` directory.
|
2024-11-26 19:51:27 +03:00
|
|
|
Having the right Node.js sources in place, one can now build the docker image:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
docker build -t ydoc-server-nodejs:latest -f tools/ci/docker/ydoc-server-nodejs/Dockerfile --build-context docker-tools=tools/ci/docker/ydoc-server-nodejs app/ydoc-server-nodejs
|
|
|
|
```
|
|
|
|
|
|
|
|
## Build Native Image container
|
|
|
|
|
|
|
|
Build the Native Image:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
sbt ydoc-server/buildNativeImage
|
|
|
|
```
|
|
|
|
|
|
|
|
Build the Docker image:
|
2024-08-15 16:04:53 +03:00
|
|
|
|
|
|
|
```bash
|
2024-11-26 19:51:27 +03:00
|
|
|
docker build -t ydoc-server-polyglot:latest --build-context native-image=lib/java/ydoc-server/target/native-image tools/ci/docker/ydoc-server-polyglot
|
2024-08-15 16:04:53 +03:00
|
|
|
```
|
|
|
|
|
|
|
|
## Running
|
|
|
|
|
2024-11-26 19:51:27 +03:00
|
|
|
Both images `ydoc-server-nodejs` and `ydoc-server-polyglot` are started the same
|
|
|
|
way:
|
2024-08-15 16:04:53 +03:00
|
|
|
|
|
|
|
- PORT - the port number under which Ydoc will be available
|
|
|
|
- HOSTNAME - the hostname under which Ydoc will be available
|
|
|
|
- LANGUAGE_SERVER_URL - the full url (with port number) of the language server
|
|
|
|
to connect to
|
|
|
|
|
|
|
|
```bash
|
|
|
|
docker run -it -e PORT=1234 -e HOSTNAME='0.0.0.0' -e LANGUAGE_SERVER_URL=ws://localhost:59876 ydoc-server-nodejs:latest
|
|
|
|
```
|
|
|
|
|
|
|
|
When correctly setup the network layer one can also hit Ydoc's healthcheck
|
|
|
|
endpoint:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
> curl http://${HOSTNAME}:${PORT}/_health
|
|
|
|
OK
|
|
|
|
```
|