Skip to content

Commit

Permalink
Update tator to 24.04 base image
Browse files Browse the repository at this point in the history
  • Loading branch information
jrtcppv committed Jan 2, 2025
1 parent 45ff4ed commit cb998db
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 60 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ tator-image:

.PHONY: ui-image
ui-image:
cd ui && npm install && npm run build && cd ..
cd ui && npm install && npm run build && npm prune --production && cd ..
DOCKER_BUILDKIT=1 docker build --pull --build-arg GIT_VERSION=$(GIT_VERSION) --network host -t $(REGISTRY)/tator_ui:$(GIT_VERSION) -f containers/tator_ui/Dockerfile . || exit 255

.PHONY: postgis-image
Expand Down
34 changes: 0 additions & 34 deletions api/main/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@

from django.conf import settings

from elasticsearch import Elasticsearch
from elasticsearch.helpers import streaming_bulk

logger = logging.getLogger(__name__)

""" Utility scripts for data management in django-shell """
Expand Down Expand Up @@ -236,37 +233,6 @@ def fixVideoDims(project):
print(f"Error on {video.pk}")


def clearOldFilebeatIndices():
es = Elasticsearch([os.getenv("ELASTICSEARCH_HOST")])
for index in es.indices.get("filebeat-*"):
tokens = str(index).split("-")
if len(tokens) < 3:
continue
dt = parse(tokens[2])
delta = datetime.datetime.now() - dt
if delta.days > 7:
logger.info(f"Deleting old filebeat index {index}")
es.indices.delete(str(index))


def make_sections():
for project in Project.objects.all().iterator():
es = Elasticsearch([os.getenv("ELASTICSEARCH_HOST")])
result = es.search(
index=f"project_{project.pk}",
body={
"size": 0,
"aggs": {"sections": {"terms": {"field": "tator_user_sections", "size": 1000}}},
},
stored_fields=[],
)
for section in result["aggregations"]["sections"]["buckets"]:
Section.objects.create(
project=project, name=section["key"], tator_user_sections=section["key"]
)
logger.info(f"Created section {section['key']} in project {project.pk}!")


def make_resources():
# Function to build resource objects from paths.
def _resources_from_paths(paths):
Expand Down
2 changes: 1 addition & 1 deletion containers/svt_transcoder
Submodule svt_transcoder updated 1 files
+5 −5 Dockerfile
28 changes: 9 additions & 19 deletions containers/tator/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:22.04
FROM ubuntu:24.04
MAINTAINER CVision AI <[email protected]>

ARG APT_REPO_HOST=http://archive.ubuntu.com/ubuntu/
Expand All @@ -8,43 +8,33 @@ RUN sed -i "s;http://archive.ubuntu.com/ubuntu/;${APT_REPO_HOST};" /etc/apt/sour
# Install apt packages
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
cron \
curl \
ffmpeg \
gcc \
git \
libffi-dev \
libgdal-dev \
libgraphviz-dev \
python3 \
python3-dev \
python3-magic \
python3-venv \
python3-pip \
python3-setuptools \
vim \
libgdal-dev \
libmagic-dev \
wget \
xdot \
xmlsec1 \
postgresql-client-14 \
postgresql-client \
redis-tools \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

# Install pip packages
RUN python3 -m pip --no-cache-dir --timeout=1000 install --upgrade pip
RUN python3 -m venv tator
COPY containers/tator/requirements.txt requirements.txt
RUN pip3 --no-cache-dir --timeout=1000 install -r requirements.txt
RUN . tator/bin/activate && pip --no-cache-dir --timeout=1000 install --upgrade pip && pip --no-cache-dir --timeout=1000 install -r requirements.txt
RUN rm requirements.txt
ENV PATH="/tator/bin:$PATH"

# Get acme_tiny.py for certificate renewal
WORKDIR /
COPY containers/tator/md5sum_checks.txt checks.txt
RUN wget https://raw.githubusercontent.com/diafygi/acme-tiny/4.1.0/acme_tiny.py

# Install kubectl
RUN wget https://storage.googleapis.com/kubernetes-release/release/v1.16.9/bin/linux/amd64/kubectl
RUN md5sum --check checks.txt
RUN chmod +x kubectl
RUN mv kubectl /usr/local/bin/.

WORKDIR /tator_online
# Copy over the project
COPY api/main /tator_online/main
Expand Down
1 change: 1 addition & 0 deletions containers/tator/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ pyjwt[crypto]==2.5.0
pytest-django==4.8.0
pytest-xdist==3.5.0
python-dateutil==2.8.2
python-magic==0.4.27
pyyaml==6.0.1
rawpy==0.19.1
redis==5.0.3
Expand Down
13 changes: 8 additions & 5 deletions containers/tator_client/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ RUN sed -i "s;http://archive.ubuntu.com/ubuntu/;${APT_REPO_HOST};" /etc/apt/sour
# Install apt packages
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
python3 python3-pip \
python3-setuptools git vim curl unzip wget \
fastjar libsm6 libxext6 libxrender1 libx265-199 libx264-163 \
python3 \
python3-venv \
python3-pip \
python3-setuptools \
fastjar libsm6 libxext6 libxrender1 libx265-199 libx264-164 \
libpng16-16 libfreetype6 python3-opencv \
&& rm -rf /var/lib/apt/lists

Expand All @@ -20,10 +22,11 @@ RUN echo "/opt/cvision/lib" > /etc/ld.so.conf.d/cvision.conf
RUN ldconfig

# Install pip packages
RUN pip3 --no-cache-dir --timeout=1000 install wheel
RUN python3 -m venv tator
COPY containers/tator_client/requirements.txt requirements.txt
RUN pip3 --no-cache-dir --timeout=1000 install -r requirements.txt
RUN . tator/bin/activate && pip --no-cache-dir --timeout=1000 install --upgrade pip && pip --no-cache-dir --timeout=1000 install -r requirements.txt
RUN rm requirements.txt
ENV PATH="/tator/bin:$PATH"

# Copy over scripts
COPY scripts/transcoder /scripts
Expand Down

0 comments on commit cb998db

Please sign in to comment.