diff --git a/Makefile b/Makefile index 4a2068eac..139dc6c27 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/api/main/util.py b/api/main/util.py index 26fb2d529..3acf9c4bf 100644 --- a/api/main/util.py +++ b/api/main/util.py @@ -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 """ @@ -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): diff --git a/containers/svt_transcoder b/containers/svt_transcoder index a7bb31b29..a71f899f3 160000 --- a/containers/svt_transcoder +++ b/containers/svt_transcoder @@ -1 +1 @@ -Subproject commit a7bb31b29e54140dcf5c3e976e3fee8577bb361a +Subproject commit a71f899f32c6d450bdacd6a7f87e009dc8e9182c diff --git a/containers/tator/Dockerfile b/containers/tator/Dockerfile index 989be955d..0fe84b17f 100644 --- a/containers/tator/Dockerfile +++ b/containers/tator/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:22.04 +FROM ubuntu:24.04 MAINTAINER CVision AI ARG APT_REPO_HOST=http://archive.ubuntu.com/ubuntu/ @@ -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 diff --git a/containers/tator/requirements.txt b/containers/tator/requirements.txt index 38aca8947..1e829a994 100644 --- a/containers/tator/requirements.txt +++ b/containers/tator/requirements.txt @@ -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 diff --git a/containers/tator_client/Dockerfile b/containers/tator_client/Dockerfile index c692241f5..2ab4b8949 100644 --- a/containers/tator_client/Dockerfile +++ b/containers/tator_client/Dockerfile @@ -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 @@ -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