Browse Source

Prep work for new container build

acm-debugging-and-enhancements
Drew Short 3 years ago
parent
commit
05c7927305
  1. 9
      .dockerignore
  2. 30
      Dockerfile
  3. 36
      acm-config-default.json
  4. 2
      pyproject.toml
  5. 2
      setup.py
  6. 11
      upload_pipeline.sh

9
.dockerignore

@ -1 +1,8 @@
acm-config.json.example
.git/
.idea/
scripts/
.gitignore
Dockerfile
pipeline.yml

30
Dockerfile

@ -2,25 +2,25 @@ FROM ubuntu:20.04
LABEL maintainer="Drew Short <warrick@sothr.com>" \ LABEL maintainer="Drew Short <warrick@sothr.com>" \
name="acm" \ name="acm" \
version="1.4.0" \
version="1.5.0" \
description="Prepackaged ACM with defaults and tooling" description="Prepackaged ACM with defaults and tooling"
ENV LC_ALL=C.UTF-8 ENV LC_ALL=C.UTF-8
ENV LANG=C.UTF-8 ENV LANG=C.UTF-8
ENV DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive
# Install tooling (ffmpeg, opusenc, optipng, python3)
# https://packages.ubuntu.com/search?suite=focal&section=all&arch=any&keywords=curl&searchon=names
RUN ln -fs /usr/share/zoneinfo/UCT /etc/localtime \ RUN ln -fs /usr/share/zoneinfo/UCT /etc/localtime \
&& apt-get update -y \ && apt-get update -y \
&& apt-get install -y --fix-missing \ && apt-get install -y --fix-missing \
curl \
ffmpeg \
opus-tools \
optipng \
python3 \
python3-pip \
tzdata \
webp
curl=7.68.0-1ubuntu2.7 \
ffmpeg=7:4.2.4-1ubuntu0.1 \
opus-tools=0.1.10-1 \
optipng=0.7.7-1 \
python3=3.8.2-0ubuntu2 \
python3-pip=20.0.2-5ubuntu1.5 \
tzdata=2021e-0ubuntu0.20.04 \
webp=0.6.1-2ubuntu0.20.04.1
WORKDIR /tmp WORKDIR /tmp
@ -42,7 +42,7 @@ RUN apt-get remove -y curl \
WORKDIR /app WORKDIR /app
# Copy application # Copy application
COPY acm-config-default.json acm.py requirements.txt /app/
COPY . /app/
# Install application requirements # Install application requirements
RUN python3 -m pip install -r requirements.txt RUN python3 -m pip install -r requirements.txt
@ -50,16 +50,16 @@ RUN python3 -m pip install -r requirements.txt
WORKDIR /bin WORKDIR /bin
# Copy application helper script # Copy application helper script
COPY docker/acm acm
RUN mv /app/docker/acm acm
# Make script executable # Make script executable
RUN chmod +x acm RUN chmod +x acm
VOLUME ["/input", "/output"] VOLUME ["/input", "/output"]
WORKDIR /app WORKDIR /app
COPY acm-config.json.example acm-config.json
COPY docker/entrypoint.sh .
RUN mv docker/* . \
&& rm -rf docker \
&& mv acm-config.json.example acm-config.json
CMD ["sh", "-c", "find /input/ -type f | /app/entrypoint.sh --stdin --remove-prefix /input/ compress -p default -d /output/"] CMD ["sh", "-c", "find /input/ -type f | /app/entrypoint.sh --stdin --remove-prefix /input/ compress -p default -d /output/"]

36
acm-config-default.json

@ -3,7 +3,7 @@
"profiles": { "profiles": {
"default": { "default": {
"jpeg": { "jpeg": {
"version": "1.4.0",
"version": "1.5.0",
"processors": [ "processors": [
"cjpeg" "cjpeg"
], ],
@ -16,7 +16,7 @@
"command": "cjpeg -optimize -quality 90 -progressive -outfile {output_file} {input_file}" "command": "cjpeg -optimize -quality 90 -progressive -outfile {output_file} {input_file}"
}, },
"png": { "png": {
"version": "1.4.0",
"version": "1.5.0",
"processors": [ "processors": [
"optipng" "optipng"
], ],
@ -28,7 +28,7 @@
"command": "optipng -o2 -strip all -out {output_file} {input_file}" "command": "optipng -o2 -strip all -out {output_file} {input_file}"
}, },
"video": { "video": {
"version": "1.4.0",
"version": "1.5.0",
"processors": [ "processors": [
"ffmpeg" "ffmpeg"
], ],
@ -40,7 +40,7 @@
"command": "ffmpeg -hide_banner -loglevel panic -i {input_file} -c:v libvpx-vp9 -b:v 0 -crf 29 -c:a libopus {output_file}" "command": "ffmpeg -hide_banner -loglevel panic -i {input_file} -c:v libvpx-vp9 -b:v 0 -crf 29 -c:a libopus {output_file}"
}, },
"audio": { "audio": {
"version": "1.4.0",
"version": "1.5.0",
"processors": [ "processors": [
"ffmpeg", "ffmpeg",
"opusenc" "opusenc"
@ -55,7 +55,7 @@
}, },
"placebo": { "placebo": {
"jpeg": { "jpeg": {
"version": "1.4.0",
"version": "1.5.0",
"processors": [ "processors": [
"cp" "cp"
], ],
@ -69,7 +69,7 @@
"command": "cp {input_file} {output_file}" "command": "cp {input_file} {output_file}"
}, },
"png": { "png": {
"version": "1.4.0",
"version": "1.5.0",
"processors": [ "processors": [
"cp" "cp"
], ],
@ -82,7 +82,7 @@
"command": "cp {input_file} {output_file}" "command": "cp {input_file} {output_file}"
}, },
"video": { "video": {
"version": "1.4.0",
"version": "1.5.0",
"processors": [ "processors": [
"cp" "cp"
], ],
@ -96,7 +96,7 @@
"command": "cp {input_file} {output_file}" "command": "cp {input_file} {output_file}"
}, },
"audio": { "audio": {
"version": "1.4.0",
"version": "1.5.0",
"processors": [ "processors": [
"cp" "cp"
], ],
@ -112,7 +112,7 @@
}, },
"webp": { "webp": {
"jpeg": { "jpeg": {
"version": "1.4.0",
"version": "1.5.0",
"processors": [ "processors": [
"cwebp" "cwebp"
], ],
@ -124,7 +124,7 @@
"command": "cwebp -jpeg_like -q 90 -o {output_file} {input_file}" "command": "cwebp -jpeg_like -q 90 -o {output_file} {input_file}"
}, },
"png": { "png": {
"version": "1.4.0",
"version": "1.5.0",
"processors": [ "processors": [
"cwebp" "cwebp"
], ],
@ -137,7 +137,7 @@
}, },
"aggressive": { "aggressive": {
"jpeg": { "jpeg": {
"version": "1.4.0",
"version": "1.5.0",
"processors": [ "processors": [
"ffmpeg", "ffmpeg",
"cjpeg" "cjpeg"
@ -151,7 +151,7 @@
"command": "export FILE={output_file} && export TEMP_FILE=${FILE}_tmp.jpg && ffmpeg -i {input_file} -vf scale=-1:720 ${TEMP_FILE} && cjpeg -optimize -quality 75 -progressive -outfile {output_file} ${TEMP_FILE} && rm ${TEMP_FILE}" "command": "export FILE={output_file} && export TEMP_FILE=${FILE}_tmp.jpg && ffmpeg -i {input_file} -vf scale=-1:720 ${TEMP_FILE} && cjpeg -optimize -quality 75 -progressive -outfile {output_file} ${TEMP_FILE} && rm ${TEMP_FILE}"
}, },
"png": { "png": {
"version": "1.4.0",
"version": "1.5.0",
"processors": [ "processors": [
"optipng" "optipng"
], ],
@ -163,7 +163,7 @@
"command": "optipng -o2 -strip all -out {output_file} {input_file}" "command": "optipng -o2 -strip all -out {output_file} {input_file}"
}, },
"video": { "video": {
"version": "1.4.0",
"version": "1.5.0",
"processors": [ "processors": [
"ffmpeg" "ffmpeg"
], ],
@ -175,7 +175,7 @@
"command": "ffmpeg -hide_banner -loglevel panic -i {input_file} -vf scale=-1:720 -c:v libvpx-vp9 -b:v 0 -crf 38 -c:a libopus {output_file}" "command": "ffmpeg -hide_banner -loglevel panic -i {input_file} -vf scale=-1:720 -c:v libvpx-vp9 -b:v 0 -crf 38 -c:a libopus {output_file}"
}, },
"audio": { "audio": {
"version": "1.4.0",
"version": "1.5.0",
"processors": [ "processors": [
"ffmpeg", "ffmpeg",
"opusenc" "opusenc"
@ -190,7 +190,7 @@
}, },
"aggressive-webp": { "aggressive-webp": {
"jpeg": { "jpeg": {
"version": "1.4.0",
"version": "1.5.0",
"processors": [ "processors": [
"cwebp" "cwebp"
], ],
@ -202,7 +202,7 @@
"command": "export FILE={output_file} && export TEMP_FILE=${FILE}_tmp.jpg && ffmpeg -i {input_file} -vf scale=-1:720 ${TEMP_FILE} && cwebp -jpeg_like -q 75 -o {output_file} ${TEMP_FILE} && rm ${TEMP_FILE}" "command": "export FILE={output_file} && export TEMP_FILE=${FILE}_tmp.jpg && ffmpeg -i {input_file} -vf scale=-1:720 ${TEMP_FILE} && cwebp -jpeg_like -q 75 -o {output_file} ${TEMP_FILE} && rm ${TEMP_FILE}"
}, },
"png": { "png": {
"version": "1.4.0",
"version": "1.5.0",
"processors": [ "processors": [
"cwebp" "cwebp"
], ],
@ -213,7 +213,7 @@
"command": "cwebp -o {output_file} ${input_file}" "command": "cwebp -o {output_file} ${input_file}"
}, },
"video": { "video": {
"version": "1.4.0",
"version": "1.5.0",
"processors": [ "processors": [
"ffmpeg" "ffmpeg"
], ],
@ -225,7 +225,7 @@
"command": "ffmpeg -hide_banner -loglevel panic -i {input_file} -vf scale=-1:720 -c:v libvpx-vp9 -b:v 0 -crf 38 -c:a libopus {output_file}" "command": "ffmpeg -hide_banner -loglevel panic -i {input_file} -vf scale=-1:720 -c:v libvpx-vp9 -b:v 0 -crf 38 -c:a libopus {output_file}"
}, },
"audio": { "audio": {
"version": "1.4.0",
"version": "1.5.0",
"processors": [ "processors": [
"ffmpeg", "ffmpeg",
"opusenc" "opusenc"

2
pyproject.toml

@ -1,6 +1,6 @@
[tool.poetry] [tool.poetry]
name = "asset-compression-manager" name = "asset-compression-manager"
version = "1.4.4"
version = "1.5.0"
description = "Helper Utility For Managing Compressed Assets" description = "Helper Utility For Managing Compressed Assets"
authors = ["Drew Short <warrick@sothr.com>"] authors = ["Drew Short <warrick@sothr.com>"]
license = "Apache2" license = "Apache2"

2
setup.py

@ -4,7 +4,7 @@ from distutils.core import setup
setup( setup(
name='Asset-Compression-Manager', name='Asset-Compression-Manager',
version='1.4.0',
version='1.5.0',
description='Helper Utility For Managing Compressed Assets', description='Helper Utility For Managing Compressed Assets',
author='Drew Short', author='Drew Short',
author_email='warrick@sothr.com' author_email='warrick@sothr.com'

11
upload_pipeline.sh

@ -1,11 +0,0 @@
#!/usr/bin/env bash
TEAM=docker
PIPELINE=acm
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
pushd "${DIR}"
fly -t ${TEAM} set-pipeline --pipeline ${PIPELINE} --config pipeline.yml
popd
Loading…
Cancel
Save