Skip to content
This repository has been archived by the owner on Dec 19, 2024. It is now read-only.

Commit

Permalink
EDA tools socket server (#3)
Browse files Browse the repository at this point in the history
* initial commit

* docker run as specific user/group

* #242 support for virtual directories

* #242 updated readme

* #242

* #242 updated docker-compose

* #242 updated docker-compose

* #242 updated docker-compose

* #242 updated docker-compose

* #242 updated docker-compose

* #242 updated docker-compose
  • Loading branch information
arawinters authored Jan 27, 2022
1 parent c2c9fd5 commit 7a1dae2
Show file tree
Hide file tree
Showing 18 changed files with 2,492 additions and 29 deletions.
37 changes: 36 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,32 @@
# dependencies
/node_modules

# IDEs and editors
/.idea
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

# misc
/.angular/cache
/.sass-cache
/connect.lock
/coverage
/libpeerconnection.log
npm-debug.log
yarn-error.log
testem.log
/typings
.env
.github/
docs/
.DS_Store
Expand All @@ -12,4 +41,10 @@ LICENSE
Makefile
PULL_REQUEST_TEMPLATE.md
README.md
requirements.txt

# System Files
.DS_Store
Thumbs.db

# Sub repos
/.gitmodules
35 changes: 35 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,36 @@
# dependencies
/node_modules

# IDEs and editors
/.idea
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

# misc
/.angular/cache
/.sass-cache
/connect.lock
/coverage
/libpeerconnection.log
npm-debug.log
yarn-error.log
testem.log
/typings
.env

# System Files
.DS_Store
Thumbs.db

# Sub repos
/.gitmodules
20 changes: 1 addition & 19 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

- Thing 5
- Thing 4

## [1.0.1] - yyyy-mm-dd

### Added to 1.0.1

- Thing 3

### Fixed in 1.0.1

- Thing 2

## [1.0.0] - yyyy-mm-dd

### Added to 1.0.0

- Thing 2
- Thing 1
- initial release
66 changes: 59 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,84 @@ ENV REFRESHED_AT=2022-01-06

LABEL Name="senzing/entity-search-web-app-console" \
Maintainer="[email protected]" \
Version="0.0.0"
Version="1.0.0"

HEALTHCHECK CMD ["/app/healthcheck.sh"]

# Run as "root" for system installation.

USER root

# Install packages via PIP.
# Install packages via apt.

RUN apt-get update \
&& apt-get -y install \
build-essential \
elfutils \
fio \
htop \
iotop \
ipython3 \
itop \
less \
libpq-dev \
net-tools \
odbc-postgresql \
procps \
pstack \
python-dev \
python-pyodbc \
python-setuptools \
strace \
telnet \
tree \
unixodbc \
unixodbc-dev \
vim \
zip

# Install Nodejs
RUN apt-get -y install curl software-properties-common \
&& curl -sL https://deb.nodesource.com/setup_16.x | bash -

RUN apt-get -yq install \
nodejs \
&& npm install -g npm \
&& node -v

# Remove old lists
RUN rm -rf /var/lib/apt/lists/*

# Install packages via pip.

COPY requirements.txt ./
RUN pip3 install --upgrade pip \
&& pip3 install -r requirements.txt \
&& rm requirements.txt

# Install packages via apt.

# Copy files from repository.

COPY ./rootfs /
COPY ./run /app/run
COPY package.json /app
COPY package-lock.json /app

# Install packages via npm
WORKDIR /app
#RUN npm install -g npm
RUN npm i --production

# update npm vulnerabilites
#RUN npm -g uninstall npm
#RUN rm -fr /usr/local/lib/node_modules/npm

# Make non-root container.

RUN addgroup --gid 1004 consoleusers \
&& useradd -u 1001 -g 1004 -m senzing -s /bin/bash
USER 1001

# Runtime execution.

WORKDIR /app
CMD ["/app/sleep-infinity.sh"]
ENTRYPOINT [ "node" ]
CMD ["./run/xterm"]
#CMD ["/app/sleep-infinity.sh"]
2 changes: 1 addition & 1 deletion PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Which issue does this address

Issue number: #nnn
resolves #nnn

## Why was change needed

Expand Down
81 changes: 80 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,80 @@
# entity-search-web-app-console
# entity-search-web-app-console

## Synopsis

The `senzing/entity-search-web-app-console` docker image is used for creating
a running Docker container configured to run Senzing programs and utilities through the entity-search-web-app's xterm console(/admin/console). For security and modularity reasons the web based console is a separate container from the webapp itself.

## Overview

The default behavior when running `docker run` is for the container to spin up a PTY and serve up a bidirection websocket server to allow the webapp to send and recieve input to that PTY.

### Prerequisite software

The following software programs need to be installed:

1. [docker](https://github.com/Senzing/knowledge-base/blob/master/HOWTO/install-docker.md)
2. [docker-compose](https://github.com/Senzing/knowledge-base/blob/master/HOWTO/install-docker-compose.md)

### Pull latest docker images

1. Pull the latest release of this app from [Docker Hub](https://hub.docker.com/r/senzing/entity-search-web-app-console).
Example:

```console
sudo docker pull senzing/entity-search-web-app-console
```

### Configuration

#### Environment Variables

- `SENZING_CONSOLE_SERVER_PORT` is the port to run the xterm server on.
- `SENZING_CONSOLE_SERVER_URL` is the full url that the console server should respond to.
So if your console server is running on port `2370` it would be `https://mydomain:2730`. If you are running behind a virtual path like `/app/console` it would be `https://mydomain:2730/app/console`. This variable has to be mirrored in the configuration of the (entity-search-web-app)[https://github.com/Senzing/entity-search-web-app] configuration. If misconfigured the console functionality will not be available in the UI.

#### Cmdline Switches

- `webServerPortNumber` is the port to run the xterm server on.
- `confServerPortNumber` is the full url that the console server should respond to.
So if your console server is running on port `2370` it would be `https://mydomain:2730`. If you are running behind a virtual path like `/app/console` it would be `https://mydomain:2730/app/console`. This variable has to be mirrored in the configuration of the (entity-search-web-app)[https://github.com/Senzing/entity-search-web-app] configuration. If misconfigured the console functionality will not be available in the UI.

### Air Gapped Environments

Obviously if your deployment environment is highly restricted you're probably going
to run in to issues downloading the latest images from that context.
Please refer to
"[Install docker image in an air-gapped environment](https://github.com/Senzing/knowledge-base/blob/master/HOWTO/install-docker-image-in-air-gapped-enviroment.md)"
for how to procedure regarding this use-case.

The short version is find a machine with network access, then:

1. Pull the docker images you need to that machine.
2. Package them as a tar file. Example:

```console
sudo docker save senzing/entity-search-web-app-console --output senzing-entity-search-web-app-console-latest.tar
```

3. Copy that to the deployment machine.
4. Load via

```console
sudo docker load --input senzing-entity-search-web-app-console-latest.tar
```

### Building from Source

1. Build the web app console.
Example:

```console
sudo docker build --tag senzing/entity-search-web-app-console .
```

2. Run the app.
Example:

```console
sudo docker-compose up
```
Loading

0 comments on commit 7a1dae2

Please sign in to comment.