Skip to content

Commit 5227022

Browse files
authored
Merge pull request #513 from idaholab/fix/docker
Fix/docker
2 parents 82c5deb + 7720cdd commit 5227022

File tree

14 files changed

+704
-552
lines changed

14 files changed

+704
-552
lines changed

Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ RUN corepack enable # enables the yarn commands
3434
RUN mkdir -p /srv/deeplynx
3535
WORKDIR /srv/deeplynx
3636

37-
COPY . .
37+
# Must be specific for dedicated agent pool to find files
38+
COPY /Deep-Lynx /srv/deeplynx
3839

3940
# triple check we're not pulling in node_modules from the host system
4041
RUN rm -rf /srv/deeplynx/server/node_modules
@@ -57,7 +58,7 @@ RUN npm update --location=global
5758
RUN npm install pm2 --location=global
5859

5960
COPY --from=build /srv/deeplynx/server /srv/deeplynx/server
60-
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
61+
COPY Deep-Lynx/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
6162

6263
EXPOSE 8090
6364
CMD /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf

Dockerfile.dev

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
FROM rust:alpine as build
2+
3+
ENV RUSTFLAGS="-C target-feature=-crt-static"
4+
ENV RUN_MODE="build"
5+
# these settings are needed for the admin web gui build, these variables are all baked into the Vue application and thus
6+
# are available to any end user that wants to dig deep enough in the webpage - as such we don't feel it a security risk
7+
# to have these env variables available to anyone running the history commmand on the container/image
8+
ENV VUE_APP_BUNDLED_BUILD="true"
9+
ENV VUE_APP_DEEP_LYNX_API_URL="http://localhost:8090"
10+
ENV VUE_APP_DEEP_LYNX_API_AUTH_METHOD="token"
11+
ENV VUE_APP_TIME_SERIES_ENABLED="true"
12+
# you must include the trailing /# - because the bundled admin web app will be in hash mode, not history
13+
ENV VUE_APP_APP_URL="http://localhost:8090/#"
14+
# this should be an alphanumeric random string of at least 15 characters
15+
ENV VUE_APP_DEEP_LYNX_APP_ID="root"
16+
17+
# turn off jobs on the main thread as this spins up PM2 with the worker
18+
ENV RUN_JOBS=false
19+
# set the default db to the one we'd see in the docker compose
20+
ENV CORE_DB_CONNECTION_STRING=postgresql://postgres:root@postgres:5432/deep_lynx_dev
21+
22+
# Add missing packages
23+
RUN apk --no-check-certificate add wget ca-certificates
24+
25+
# Configure certs below
26+
27+
28+
RUN apk update
29+
RUN apk add --no-cache build-base musl-dev openssl openssl-dev
30+
RUN apk update add --update nodejs=21.7.3
31+
RUN apk add --update npm
32+
RUN npm config set strict-ssl false
33+
# Install corepack separately so it is found during builds.
34+
RUN npm install -g corepack @napi-rs/cli # this is needed for the Rust/Node library interopt
35+
RUN npm install npm@latest --location=global
36+
RUN npm update --location=global
37+
RUN npm install cargo-cp-artifact --location=global
38+
RUN corepack enable # enables the yarn commands
39+
40+
RUN mkdir -p /srv/deeplynx
41+
WORKDIR /srv/deeplynx
42+
43+
44+
COPY . .
45+
46+
# triple check we're not pulling in node_modules from the host system
47+
RUN rm -rf /srv/deeplynx/server/node_modules
48+
RUN rm -rf /srv/deeplynx/ui/AdminWebApp/node_modules
49+
RUN rm -rf /srv/deeplynx/ui/WebGLViewer/node_modules
50+
51+
WORKDIR /srv/deeplynx/server
52+
RUN yarn install;
53+
RUN yarn run build;
54+
55+
FROM node:alpine as production
56+
ENV DEVELOPMENT_MODE=false
57+
58+
# Add missing packages
59+
RUN apk --no-check-certificate add wget ca-certificates
60+
61+
# Configure certs below
62+
63+
64+
RUN apk update && apk add --no-cache supervisor openssl
65+
RUN mkdir -p /srv/deeplynx/server
66+
67+
# need pm2 to run legacy server
68+
RUN npm install npm@latest --location=global
69+
RUN npm update --location=global
70+
RUN npm install pm2 --location=global
71+
72+
COPY --from=build /srv/deeplynx/server /srv/deeplynx/server
73+
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
74+
75+
EXPOSE 8090
76+
CMD /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf

docker-compose.local.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
version: "3.9"
2+
services:
3+
deep-lynx:
4+
build:
5+
dockerfile: Dockerfile.dev
6+
restart: on-failure
7+
depends_on:
8+
- postgres
9+
ports:
10+
- "8090:8090"
11+
env_file:
12+
- "./.docker-env"
13+
postgres:
14+
environment:
15+
- POSTGRES_PASSWORD=root
16+
- POSTGRES_DB=deep_lynx_dev
17+
image: "library/postgres:16.3"
18+
ports:
19+
- "5432:5432"
20+
redis:
21+
image: "redis/redis-stack:6.2.6-v9"
22+
ports:
23+
- "6379:6379"
24+
- "8001:8001"

server/NodeLibraries/deeplynx/Cargo.toml

Lines changed: 3 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ crate-type = ["cdylib"]
88

99
[dependencies]
1010
# Default enable napi4 feature, see https://nodejs.org/api/n-api.html#node-api-version-matrix
11-
napi = { version = "2.16.6", default-features = false, features = [
11+
napi = { version = "2.16.16", default-features = false, features = [
1212
"napi4",
1313
"chrono",
1414
"tokio_rt",
@@ -38,65 +38,25 @@ csv-async = { version = "1.3.0", features = ["tokio", "tokio-stream"] }
3838
futures = { version = "0.3.30", features = [] }
3939
futures-util = "0.3.30"
4040
tokio-util = { version = "0.7.11", features = ['compat', "io-util", "io"] }
41-
serial_test = "3.1.1"
4241
indexmap = "2.2.6"
43-
include_dir = "0.7.3"
4442
chrono = { version = "0.4.38", features = ["serde"] }
45-
uuid = { version = "1.8.0", features = ["serde", "fast-rng", "v4"] }
4643
validator = { version = "0.18.1", features = ["derive"] }
47-
rand = "0.9.0-alpha.1"
48-
bytes = "1.6.0"
4944
csv = "1.3.0"
50-
tracing = "0.1.40"
51-
tracing-subscriber = "0.3.18"
52-
proc-macro2 = "1.0.83"
5345
sha2 = "0.9.9"
5446
base64 = { version = "0.22.1", features = ["default", "std"] }
55-
polars = { version = "0.40.0", features = [
47+
polars = { version = "0.46.0", features = [
5648
"strings",
57-
"performant",
5849
"lazy",
5950
"sql",
60-
"streaming",
61-
"temporal",
62-
"object",
63-
"cse",
64-
"serde",
65-
"serde-lazy",
66-
"dynamic_group_by",
67-
"partition_by",
68-
"rows",
69-
"is_between",
70-
"list_to_struct",
71-
"list_eval",
72-
"cov",
73-
] }
74-
polars-arrow = { version = "0.40.0", features = ["arrow_rs"] }
75-
arrow = { version = "51.0.0" }
76-
reqwest = { version = "0.11.13", features = [
77-
"stream",
78-
"multipart",
79-
"json",
80-
"blocking",
8151
] }
52+
arrow = { version = "54.2.1" }
8253
object_store = { version = "0.10.2", features = ["azure"] }
83-
lazy_static = "1.5.0"
8454
url = "2.5.2"
8555
datafusion = { version = "41.0.0" }
86-
warp = "0.3.6"
87-
env_logger = "0.10.1"
88-
log = "0.4.20"
89-
futures-executor = "0.3.29"
90-
regex = "1.10.2"
91-
async-trait = "*"
92-
arrow-cast = "47.0.0"
93-
parquet = "47.0.0"
94-
anstyle = "1.0.6"
9556
short-uuid = "0.1.2"
9657
dotenvy = "0.15.7"
9758
connection-string = "0.2.0"
9859
azure_storage_blobs = "0.20.0"
99-
azure_core = "0.20.0"
10060
azure_storage = "0.20.0"
10161

10262
[build-dependencies]

server/NodeLibraries/deeplynx/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "deeplynx",
3-
"version": "1.7.1",
3+
"version": "1.7.2",
44
"main": "index.js",
55
"types": "index.d.ts",
66
"napi": {

server/NodeLibraries/deeplynx/src/snapshot/generator.rs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -122,25 +122,25 @@ impl SnapshotGenerator {
122122
metatype_uuid.push(n.metatype_uuid);
123123
}
124124

125-
let ids: Series = Series::new("id", ids);
126-
let container_ids: Series = Series::new("container_id", container_ids);
127-
let metatype_ids: Series = Series::new("metatype_id", metatype_ids);
128-
let datasource_ids: Series = Series::new("data_source_id", data_source_ids);
129-
let original_data_ids: Series = Series::new("original_data_id", original_data_ids);
130-
let properties: Series = Series::new("properties", properties);
131-
let metatype_names: Series = Series::new("metatype_name", metatype_name);
132-
let metatype_uuid: Series = Series::new("metatype_uuid", metatype_uuid);
125+
let ids: Series = Series::new("id".into(), ids);
126+
let container_ids: Series = Series::new("container_id".into(), container_ids);
127+
let metatype_ids: Series = Series::new("metatype_id".into(), metatype_ids);
128+
let datasource_ids: Series = Series::new("data_source_id".into(), data_source_ids);
129+
let original_data_ids: Series = Series::new("original_data_id".into(), original_data_ids);
130+
let properties: Series = Series::new("properties".into(), properties);
131+
let metatype_names: Series = Series::new("metatype_name".into(), metatype_name);
132+
let metatype_uuid: Series = Series::new("metatype_uuid".into(), metatype_uuid);
133133

134134
// build the actual dataframe
135135
let df = DataFrame::new(vec![
136-
ids,
137-
container_ids,
138-
metatype_ids,
139-
datasource_ids,
140-
original_data_ids,
141-
properties,
142-
metatype_names,
143-
metatype_uuid,
136+
ids.into(),
137+
container_ids.into(),
138+
metatype_ids.into(),
139+
datasource_ids.into(),
140+
original_data_ids.into(),
141+
properties.into(),
142+
metatype_names.into(),
143+
metatype_uuid.into(),
144144
])?;
145145

146146
// sort the frame in place, so we have faster lookups on common fields

0 commit comments

Comments
 (0)