From baf384d6e035a64d78e0dc0bad2c17df60f6c1b4 Mon Sep 17 00:00:00 2001 From: Lex Berezhny Date: Fri, 14 Aug 2020 03:42:04 +0000 Subject: [PATCH] cleanup --- docker/Dockerfile.wallet_server | 52 ------------------------- docker/docker-compose-wallet-server.yml | 34 ---------------- docker/install_choco.ps1 | 11 ------ docker/wallet_server_entrypoint.sh | 23 ----------- 4 files changed, 120 deletions(-) delete mode 100644 docker/Dockerfile.wallet_server delete mode 100644 docker/docker-compose-wallet-server.yml delete mode 100644 docker/install_choco.ps1 delete mode 100755 docker/wallet_server_entrypoint.sh diff --git a/docker/Dockerfile.wallet_server b/docker/Dockerfile.wallet_server deleted file mode 100644 index 329a48063..000000000 --- a/docker/Dockerfile.wallet_server +++ /dev/null @@ -1,52 +0,0 @@ -FROM ubuntu:19.10 - -ARG user=lbry -ARG db_dir=/database -ARG projects_dir=/home/$user - -ARG DOCKER_TAG -ARG DOCKER_COMMIT=docker -ENV DOCKER_TAG=$DOCKER_TAG DOCKER_COMMIT=$DOCKER_COMMIT - -RUN apt-get update && \ - apt-get -y --no-install-recommends install \ - wget \ - tar unzip \ - build-essential \ - python3 \ - python3-dev \ - python3-pip \ - python3-wheel \ - python3-setuptools && \ - update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 1 && \ - rm -rf /var/lib/apt/lists/* - -RUN groupadd -g 999 $user && useradd -m -u 999 -g $user $user -RUN mkdir -p $db_dir -RUN chown -R $user:$user $db_dir - -COPY . $projects_dir -RUN chown -R $user:$user $projects_dir - -USER $user -WORKDIR $projects_dir - -RUN pip install uvloop -RUN make install -RUN python3 docker/set_build.py -RUN rm ~/.cache -rf - -# entry point -ARG host=0.0.0.0 -ARG tcp_port=50001 -ARG daemon_url=http://lbry:lbry@localhost:9245/ -VOLUME $db_dir -ENV TCP_PORT=$tcp_port -ENV HOST=$host -ENV DAEMON_URL=$daemon_url -ENV DB_DIRECTORY=$db_dir -ENV MAX_SESSIONS=1000000000 -ENV MAX_SEND=1000000000000000000 -ENV EVENT_LOOP_POLICY=uvloop -COPY ./docker/wallet_server_entrypoint.sh /entrypoint.sh -ENTRYPOINT ["/entrypoint.sh"] diff --git a/docker/docker-compose-wallet-server.yml b/docker/docker-compose-wallet-server.yml deleted file mode 100644 index 339b5cc9d..000000000 --- a/docker/docker-compose-wallet-server.yml +++ /dev/null @@ -1,34 +0,0 @@ -version: "3" - -volumes: - lbrycrd: - wallet_server: - -services: - lbrycrd: - image: lbry/lbrycrd:${LBRYCRD_TAG:-latest-release} - restart: always - ports: # accessible from host - - "9246:9246" # rpc port - expose: # internal to docker network. also this doesn't do anything. its for documentation only. - - "9245" # node-to-node comms port - volumes: - - "lbrycrd:/data/.lbrycrd" - environment: - - RUN_MODE=default - - SNAPSHOT_URL=${LBRYCRD_SNAPSHOT_URL-https://lbry.com/snapshot/blockchain} - - RPC_ALLOW_IP=0.0.0.0/0 - wallet_server: - image: lbry/wallet-server:${WALLET_SERVER_TAG:-latest-release} - depends_on: - - lbrycrd - restart: always - ports: - - "50001:50001" # rpc port - - "50005:50005" # websocket port - #- "2112:2112" # uncomment to enable prometheus - volumes: - - "wallet_server:/database" - environment: - - SNAPSHOT_URL=${WALLET_SERVER_SNAPSHOT_URL-https://lbry.com/snapshot/wallet} - - DAEMON_URL=http://lbry:lbry@lbrycrd:9245 diff --git a/docker/install_choco.ps1 b/docker/install_choco.ps1 deleted file mode 100644 index 6fc8ed226..000000000 --- a/docker/install_choco.ps1 +++ /dev/null @@ -1,11 +0,0 @@ -# requires powershell and .NET 4+. see https://chocolatey.org/install for more info. - -$chocoVersion = powershell choco -v -if(-not($chocoVersion)){ - Write-Output "Chocolatey is not installed, installing now" - Write-Output "IF YOU KEEP GETTING THIS MESSAGE ON EVERY BUILD, TRY RESTARTING THE GITLAB RUNNER SO IT GETS CHOCO INTO IT'S ENV" - Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) -} -else{ - Write-Output "Chocolatey version $chocoVersion is already installed" -} \ No newline at end of file diff --git a/docker/wallet_server_entrypoint.sh b/docker/wallet_server_entrypoint.sh deleted file mode 100755 index 8bcbd8a96..000000000 --- a/docker/wallet_server_entrypoint.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash - -# entrypoint for wallet server Docker image - -set -euo pipefail - -SNAPSHOT_URL="${SNAPSHOT_URL:-}" #off by default. latest snapshot at https://lbry.com/snapshot/wallet - -if [[ -n "$SNAPSHOT_URL" ]] && [[ ! -f /database/claims.db ]]; then - files="$(ls)" - echo "Downloading wallet snapshot from $SNAPSHOT_URL" - wget --no-verbose --trust-server-names --content-disposition "$SNAPSHOT_URL" - echo "Extracting snapshot..." - filename="$(grep -vf <(echo "$files") <(ls))" # finds the file that was not there before - case "$filename" in - *.tgz|*.tar.gz|*.tar.bz2 ) tar xvf "$filename" --directory /database ;; - *.zip ) unzip "$filename" -d /database ;; - * ) echo "Don't know how to extract ${filename}. SNAPSHOT COULD NOT BE LOADED" && exit 1 ;; - esac - rm "$filename" -fi - -/home/lbry/.local/bin/torba-server "$@"