From 2c8a27330fa3d05786854fba3c8b8ef68ce94262 Mon Sep 17 00:00:00 2001 From: Christopher Usher Date: Mon, 13 Nov 2023 13:46:31 -0800 Subject: [PATCH] graphs container now builds --- build | 2 +- graphs/Dockerfile | 6 +++--- graphs/setup.py | 2 +- old_build | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 52 insertions(+), 5 deletions(-) create mode 100755 old_build diff --git a/build b/build index 277238b..e292518 100755 --- a/build +++ b/build @@ -11,7 +11,7 @@ cd "$(dirname "$(realpath "$0")")" # Pass PUSH=true to also push the resulting images, or PUSH=latest to push them as :latest tag # The different images we can build -COMPONENTS=(downloader restreamer backfiller thrimshim cutter sheetsync nginx postgres segment_coverage playlist_manager chat_archiver) +COMPONENTS=(downloader restreamer backfiller thrimshim cutter sheetsync nginx postgres segment_coverage playlist_manager chat_archiver graphs) # Define push if not already defined PUSH=${PUSH:-} diff --git a/graphs/Dockerfile b/graphs/Dockerfile index 16b424a..c43f156 100644 --- a/graphs/Dockerfile +++ b/graphs/Dockerfile @@ -2,8 +2,8 @@ FROM python:3.11 RUN pip install bokeh -COPY donation_graphs /tmp/donation_graphs -RUN pip install /tmp/donation_graphs && rm -r /tmp/donation_graphs +COPY graphs /tmp/graphs +RUN pip install /tmp/graphs && rm -r /tmp/graphs LABEL org.opencontainers.image.source https://github.com/dbvideostriketeam/wubloader -ENTRYPOINT ["python3", "-m", "donation_graphs"] +ENTRYPOINT ["python3", "-m", "graphs"] diff --git a/graphs/setup.py b/graphs/setup.py index 6281a58..15333f4 100644 --- a/graphs/setup.py +++ b/graphs/setup.py @@ -8,6 +8,6 @@ setup( 'argh', 'bokeh', 'gevent', - 'request' + 'requests' ], ) diff --git a/old_build b/old_build new file mode 100755 index 0000000..8ba9be2 --- /dev/null +++ b/old_build @@ -0,0 +1,47 @@ +#!/bin/bash + +set -eu + +# cd to location of script +cd "$(dirname "$(realpath "$0")")" + +# Builds the docker images. +# Usage: ./build {COMPONENTS}, or just ./build to build all. +# The resulting images are named wubloader-COMPONENT. +# Pass PUSH=true to also push the resulting images, or PUSH=latest to push them as :latest tag + +# The different images we can build +COMPONENTS=(downloader restreamer backfiller thrimshim cutter sheetsync nginx postgres segment_coverage graphs) + +# Define push if not already defined +PUSH=${PUSH:-} + +# Base is the repository namespace information, not including the wubloader-component part. +BASE="quay.io/ekimekim" + +# The docker image tag, derived from the git commit + whether working tree is clean +TAG=$(./get-build-tag) + +if [ "$#" -gt 0 ]; then + COMPONENTS=("$@") +fi + +for component in "${COMPONENTS[@]}"; do + echo "Building image for $component" + latest="$BASE/wubloader-$component:latest" + specific="$BASE/wubloader-$component:$TAG" + docker build \ + -f "$component/Dockerfile" \ + -t "$latest" \ + -t "$specific" \ + . + echo "Built image wubloader-$component:$TAG" + if [ -n "$PUSH" ]; then + echo "Pushing tag $specific" + docker push "$specific" + fi + if [ "$PUSH" == "latest" ]; then + echo "Pushing tag $latest" + docker push "$latest" + fi +done