From 55ff8d8d91855a7e81614e3a53fbee4f420360e1 Mon Sep 17 00:00:00 2001 From: Josh Borrow Date: Tue, 6 Feb 2024 16:13:13 -0500 Subject: [PATCH] Cleanup old stuff --- .dockerignore | 13 ------ container/Dockerfile | 37 ---------------- container/app_start.sh | 14 ------ container/server-config-docker.json | 40 ----------------- container/ssh_config | 5 --- container/store_start.sh | 12 ----- docker-compose.yml | 68 ----------------------------- 7 files changed, 189 deletions(-) delete mode 100644 .dockerignore delete mode 100644 container/Dockerfile delete mode 100755 container/app_start.sh delete mode 100644 container/server-config-docker.json delete mode 100644 container/ssh_config delete mode 100755 container/store_start.sh delete mode 100644 docker-compose.yml diff --git a/.dockerignore b/.dockerignore deleted file mode 100644 index 5744335..0000000 --- a/.dockerignore +++ /dev/null @@ -1,13 +0,0 @@ -# ignore docs -docs/* -README.md -LICENSE -CHANGELOG.md -hl_client.cfg.sample - -# ignore ci files, except what we need to build the app -ci -!ci/librarian_server_conda_env.yml - -# don't include secrets folder -container/secrets diff --git a/container/Dockerfile b/container/Dockerfile deleted file mode 100644 index d1b6d64..0000000 --- a/container/Dockerfile +++ /dev/null @@ -1,37 +0,0 @@ -## -*- docker-image-name: "librarian-app" -*- - -# define base image that has librarian installed -FROM continuumio/miniconda3:latest AS librarian-base - -# copy setup file -RUN mkdir -p /usr/src/app -WORKDIR /usr/src/app -COPY ci/librarian_server_conda_env.yml ci/librarian_server_conda_env.yml - -# update base environment -RUN conda update conda && conda update --all -RUN conda env update --file ci/librarian_server_conda_env.yml - -# copy app code -COPY . . - -# install -RUN pip install . - - -# define image for running librarian app -FROM librarian-base AS librarian-app - -# launch server -ENTRYPOINT ["./container/app_start.sh"] - - -# define image for running store -FROM librarian-base AS librarian-store - -# install openssh-server -RUN apt-get update && apt-get install -y openssh-server rsync -RUN mkdir -p /run/sshd -RUN groupadd sobs -g 72653 && useradd --no-log-init -m -g 72653 -u 72653 sobs -USER sobs -ENTRYPOINT ["./container/store_start.sh"] diff --git a/container/app_start.sh b/container/app_start.sh deleted file mode 100755 index 17391dc..0000000 --- a/container/app_start.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -# put ssh config files in place -mkdir -p ~/.ssh -cp container/ssh_config ~/.ssh/config -cp /secrets/id_rsa_pub ~/.ssh/id_rsa.pub -cp /secrets/id_rsa ~/.ssh/id_rsa - -# put server config in place -cp /secrets/server-config.json /usr/src/app/server-config.json - -# wait for postgres to be available -./container/wait-for-it.sh db:5432 -- alembic upgrade head -exec runserver.py diff --git a/container/server-config-docker.json b/container/server-config-docker.json deleted file mode 100644 index 077f3c0..0000000 --- a/container/server-config-docker.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "server": "tornado", - - "SECRET_KEY": "d41d8cd98f00b204e9800998ecf8427e", - - "SQLALCHEMY_DATABASE_URI": "postgresql://postgres:password@db/librarian", - - "SQLALCHEMY_TRACK_MODIFICATIONS": false, - - "log_level": "info", - - "displayed_site_name": "Test", - - "port": 21108, - - "n_server_processes": 1, - - "n_worker_threads": 8, - - "standing_order_mode": "normal", - - "obsid_inference_mode": "hera", - - "sources": { - "HumanUser": { - "authenticator": "I am a human" - }, - "TestUser": { - "authenticator": "I am a bot" - } - }, - - "add-stores": { - "samplestore": { - "path_prefix": "/data", - "ssh_host": "libstore", - "available": true - } - } -} diff --git a/container/ssh_config b/container/ssh_config deleted file mode 100644 index b8a6aed..0000000 --- a/container/ssh_config +++ /dev/null @@ -1,5 +0,0 @@ -Host = lib-store - User = sobs - Port = 2222 - IdentityFile = ~/.ssh/id_rsa - StrictHostKeyChecking = no diff --git a/container/store_start.sh b/container/store_start.sh deleted file mode 100755 index 72f16c4..0000000 --- a/container/store_start.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -# put ssh config files in place -HOME="${VARIABLE:=/home/sobs}" -mkdir -p $HOME/.ssh -chmod 700 $HOME/.ssh -cat /secrets/id_rsa_pub > $HOME/.ssh/authorized_keys -chmod 600 $HOME/.ssh/authorized_keys - -# start sshd process -echo "starting sshd process" -/usr/sbin/sshd -D -f /secret_keys/sshd_config diff --git a/docker-compose.yml b/docker-compose.yml deleted file mode 100644 index 6678afc..0000000 --- a/docker-compose.yml +++ /dev/null @@ -1,68 +0,0 @@ -version: '3.8' -services: - db: - image: postgres:13.1 - restart: always - container_name: db - volumes: - - pgdata:/var/lib/postgresql/data - environment: - POSTGRES_DB: librarian - POSTGRES_USER: postgres - POSTGRES_PASSWORD: password - networks: - - lib-network - - librarian-app: - build: - context: . - dockerfile: container/Dockerfile - target: librarian-app - container_name: librarian - environment: - LIBRARIAN_CONFIG_PATH: /usr/src/app/container/server-config-docker.json - stdin_open: true - tty: true - depends_on: - - db - - librarian-store - ports: - - 21108:21108 - volumes: - - .:/usr/src/app - networks: - - lib-network - secrets: - - id_rsa - - id_rsa_pub - - librarian-store: - build: - context: . - dockerfile: container/Dockerfile - target: librarian-store - container_name: libstore - hostname: libstore - volumes: - - libstore:/data - ports: - - "2222:22" - restart: unless-stopped - networks: - - lib-network - secrets: - - id_rsa_pub - -volumes: - pgdata: - driver: local - libstore: - -networks: - lib-network: - -secrets: - id_rsa: - file: ./container/secrets/id_rsa.txt - id_rsa_pub: - file: ./container/secrets/id_rsa_pub.txt