Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion GUI/src/vast/desktop/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
libxcb-randr0 && rm -rf /var/lib/apt/lists/*

# # ───────── optional CA certs ─────────
COPY certs /app/certs
#COPY certs /app/certs
RUN if [ -d ./certs ] && [ "$(ls ./certs/*.crt 2>/dev/null)" ]; then \
echo "Configuring NetFree certificates..."; \
cp ./certs/*.crt /usr/local/share/ca-certificates/; \
Expand Down
2 changes: 1 addition & 1 deletion GUI/src/vast/gateway/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ WORKDIR /app
ARG USE_NETFREE=true

RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates curl && rm -rf /var/lib/apt/lists/*
COPY certs /app/certs
#COPY certs /app/certs
# System CA + add NetFree certs
RUN if [ "$USE_NETFREE" = "true" ] && [ -d ./certs ] && [ "$(ls ./certs/*.crt 2>/dev/null)" ]; then \
echo "Configuring NetFree certificates..."; \
Expand Down
2 changes: 1 addition & 1 deletion GUI/src/vast/runner/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ WORKDIR /app
ARG USE_NETFREE=true

RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates curl && rm -rf /var/lib/apt/lists/*
COPY certs /app/certs
#COPY certs /app/certs
# System CA + add NetFree certs
RUN if [ "$USE_NETFREE" = "true" ] && [ -d ./certs ] && [ "$(ls ./certs/*.crt 2>/dev/null)" ]; then \
echo "Configuring NetFree certificates..."; \
Expand Down
2 changes: 1 addition & 1 deletion GUI/src/vast/services/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ENV PYTHONDONTWRITEBYTECODE=1 PYTHONUNBUFFERED=1
WORKDIR /app
# # System CA + NetFree
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates curl && rm -rf /var/lib/apt/lists/*
COPY certs/*.crt /usr/local/share/ca-certificates/
#COPY certs/*.crt /usr/local/share/ca-certificates/
RUN update-ca-certificates || true
ENV SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt \
REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt \
Expand Down
44 changes: 42 additions & 2 deletions RelDB/build_tables/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,47 @@ CREATE TABLE IF NOT EXISTS inference_logs (
image_url TEXT
);

-- Ripeness predictions table
CREATE TABLE IF NOT EXISTS ripeness_predictions (
id BIGSERIAL PRIMARY KEY,
inference_log_id BIGINT NOT NULL REFERENCES inference_logs(id) ON DELETE CASCADE,
ts TIMESTAMPTZ NOT NULL DEFAULT NOW(),
ripeness_label TEXT NOT NULL CHECK (ripeness_label IN ('ripe', 'unripe', 'overripe')),
ripeness_score DOUBLE PRECISION NOT NULL,
model_name TEXT NOT NULL,
run_id UUID NOT NULL,
device_id TEXT REFERENCES devices(device_id),
UNIQUE (inference_log_id)
);

-- Create indexes for ripeness_predictions
CREATE INDEX IF NOT EXISTS ix_ripeness_inflog ON ripeness_predictions(inference_log_id);
CREATE INDEX IF NOT EXISTS ix_ripeness_ts ON ripeness_predictions(ts);
CREATE INDEX IF NOT EXISTS ix_ripeness_device ON ripeness_predictions(device_id);
CREATE INDEX IF NOT EXISTS ix_ripeness_run ON ripeness_predictions(run_id);

-- Weekly ripeness rollups table
CREATE TABLE IF NOT EXISTS ripeness_weekly_rollups_ts (
id BIGSERIAL PRIMARY KEY,
ts TIMESTAMPTZ NOT NULL DEFAULT NOW(),
window_start TIMESTAMPTZ NOT NULL,
window_end TIMESTAMPTZ NOT NULL,
fruit_type TEXT NOT NULL,
device_id TEXT REFERENCES devices(device_id),
run_id UUID NOT NULL,
cnt_total INTEGER NOT NULL,
cnt_ripe INTEGER NOT NULL,
cnt_unripe INTEGER NOT NULL,
cnt_overripe INTEGER NOT NULL,
pct_ripe DOUBLE PRECISION NOT NULL
);

-- Create indexes for ripeness_weekly_rollups_ts
CREATE INDEX IF NOT EXISTS ix_rwrt_ts ON ripeness_weekly_rollups_ts(ts);
CREATE INDEX IF NOT EXISTS ix_rwrt_fruit_ts ON ripeness_weekly_rollups_ts(fruit_type, ts);
CREATE INDEX IF NOT EXISTS ix_rwrt_device ON ripeness_weekly_rollups_ts(device_id);
CREATE INDEX IF NOT EXISTS ix_rwrt_run ON ripeness_weekly_rollups_ts(run_id);

-- Sensor event logs table.
CREATE TABLE IF NOT EXISTS event_logs_sensors(
id bigserial PRIMARY KEY,
Expand Down Expand Up @@ -252,8 +293,6 @@ CREATE TABLE IF NOT EXISTS public.sensor_anomalies (
inserted_at TIMESTAMPTZ NOT NULL DEFAULT now()
);



CREATE TABLE IF NOT EXISTS public.sensor_zone_stats (
id BIGSERIAL PRIMARY KEY,
zone VARCHAR(128) NOT NULL,
Expand Down Expand Up @@ -372,6 +411,7 @@ CREATE INDEX IF NOT EXISTS ix_task_thresholds_updated_at ON task_thresholds (upd

-- === Indexes for performance optimization ===

>>>>>>> origin/main

CREATE INDEX IF NOT EXISTS ix_sensor_anomalies_ts_brin
ON public.sensor_anomalies USING BRIN (ts);
Expand Down
Loading