Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: ATS-812 - PoC FFmpeg skeleton - please keep (for experiments) - do not merge #364

Draft
wants to merge 30 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
186e187
ATS-812: PoC for FFmpeg T-Engine (WIP) - initial folder skeleton
montgolfiere Jul 27, 2020
7d8c8e6
ATS-812: PoC for FFmpeg T-Engine (WIP) - initial folder skeleton
montgolfiere Jul 28, 2020
c88cb02
ATS-812: PoC for FFmpeg T-Engine (WIP) - initial folder skeleton
montgolfiere Jul 28, 2020
8107134
ATS-850_Disable_WhiteSource_Veracode_scans (#325)
TheOutsSeeker Jan 26, 2021
f4126b4
Merge branch 'master' into ATS-812_PoC_FFmpeg_skeleton
montgolfiere Mar 29, 2021
81cbf0e
ATS-812: PoC FFmpeg skeleton - experimental
montgolfiere Mar 29, 2021
8c3ac3f
ATS-812: PoC FFmpeg skeleton - experimental
montgolfiere Mar 29, 2021
05169a8
ATS-812: PoC FFmpeg skeleton - experimental
montgolfiere Mar 29, 2021
9665a6d
ATS-812: PoC FFmpeg skeleton - experimental
montgolfiere Mar 29, 2021
926ac11
ATS-812: PoC FFmpeg skeleton - experimental
montgolfiere Mar 29, 2021
9c4a239
ATS-812: PoC FFmpeg skeleton - unit test fixes
montgolfiere Mar 29, 2021
8dacb86
ATS-812: PoC FFmpeg skeleton - experiments
montgolfiere Mar 29, 2021
d0d1fd8
ATS-812: PoC FFmpeg skeleton - experiments
montgolfiere Mar 29, 2021
b8c1463
ATS-812: PoC FFmpeg skeleton - experiments
montgolfiere Mar 30, 2021
aa16bb1
ATS-812: PoC FFmpeg - minor: add extra (internal) check for src/tgt m…
montgolfiere Dec 22, 2021
2c68e29
Merge commit '0c939761299358bec8084ab7675d0a4798d09b16' into ATS-812_…
montgolfiere Jan 5, 2022
6630498
ATS-812: PoC FFmpeg
montgolfiere Jan 5, 2022
dbafd81
ATS-812: PoC FFmpeg (experimental) - bump pom.xml to 2.5.5-A1-SNAPSHOT
montgolfiere Jan 5, 2022
48c11c4
ATS-812: PoC FFmpeg (experimental) - bump pom.xml to 2.5.5-A1-SNAPSHOT
montgolfiere Jan 5, 2022
c6d88fe
Merge commit '2fd8361a783f117592b55bbca4fc7273adf1db49' into ATS-812_…
montgolfiere Jan 6, 2022
d1f38d3
ATS-812: PoC FFmpeg (experimental) - comment out T-Engine jobs except…
montgolfiere Jan 6, 2022
dba3400
ATS-812: PoC FFmpeg (experimental)
montgolfiere Jan 6, 2022
9f18bd5
ATS-812: PoC FFmpeg (experimental) - "fix" testPojoTransform
montgolfiere Jan 6, 2022
ec5a813
ATS-812: PoC FFmpeg (experimental) - add duration (in addition to tim…
montgolfiere Jan 6, 2022
a0ec144
ATS-812: PoC FFmpeg (experimental) - add frame width & height
montgolfiere Jan 7, 2022
34bd371
ATS-812: PoC for FFmpeg T-Engine (WIP) - add conversion to animated gif
montgolfiere Feb 8, 2022
14e7761
ATS-812: PoC for FFmpeg T-Engine (WIP) - fix build
montgolfiere Feb 8, 2022
462468a
Merge branch 'master' into ATS-812_PoC_FFmpeg_skeleton
montgolfiere Feb 25, 2022
8005581
ATS-812: FFmpeg PoC (skeleton)
montgolfiere Feb 25, 2022
7330485
ATS-812: FFmpeg PoC (skeleton)
montgolfiere Feb 25, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,19 @@ jobs:
install: skip
script: travis_wait 30 bash _ci/source_clear.sh

- stage: Build and Test
name: "Core & Base Snapshot deployment" # This is to separate the snapshot deployment from the following jobs, to prevent duplication on nexus
- name: "Core & Base Snapshot deployment" # This is to separate the snapshot deployment from the following jobs, to prevent duplication on nexus
stage: build and test
if: branch = master AND type != pull_request
before_script: travis_wait bash _ci/cache_artifacts.sh
install: travis_wait 20 mvn -B -U -q clean install -DadditionalOption=-Xdoclint:none -DskipTests -Dmaven.javadoc.skip=true -Dmaven.wagon.http.pool=false -Pbase
script: mvn -B -U clean deploy -DadditionalOption=-Xdoclint:none -Dmaven.javadoc.skip=true -Dmaven.wagon.http.pool=false -Pbase

# TODO PoC for Video/Audio transforms (using FFmpeg)
- name: "Transform Video/Audio (FFmpeg)"
before_script: travis_wait bash _ci/cache_artifacts.sh
install: _ci/build.sh ffmpeg
script: bash _ci/test.sh ffmpeg

- name: "ImageMagick"
before_script: travis_wait bash _ci/cache_artifacts.sh
install: _ci/build.sh imagemagick
Expand All @@ -69,7 +76,9 @@ jobs:
before_script: travis_wait bash _ci/cache_artifacts.sh
install: _ci/build.sh full-build
script: travis_wait 30 bash _ci/test.sh aio-test

# - name: "Static Analysis (SAST)"
# stage: build and test
# TODO ATS-721: comment out until it is possible to run concurrent SAST scans
# if: type != pull_request
# if: branch = master AND type != pull_request
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Image provides a container in which to run FFmpeg transformations

# TODO PoC for FFmpeg
# The FFmpeg transformer uses FFmpeg. See license: https://github.com/FFmpeg/FFmpeg/blob/master/LICENSE.md

# TODO PoC for FFmpeg - note: CentOS 7 may mean using FFmpeg 3.x instead of 4.x
FROM alfresco/alfresco-base-java:11.0.13-openjdk-centos-7@sha256:c1e399d1bbb5d08e0905f1a9ef915ee7c5ea0c0ede11cc9bd7ca98532a9b27fa

# TODO PoC for FFmpeg - update & download from Nexus
#ARG FFMPEG_VERSION=3.4.9
#ENV FFMPEG_RPM_URL=https://download1.rpmfusion.org/free/el/updates/8/x86_64/f/ffmpeg-${FFMPEG_VERSION}.el7.x86_64.rpm
#ENV FFMPEG_LICENSE_FILE=https://github.com/Alfresco/acs-community-packaging/blob/master/distribution/src/main/resources/licenses/3rd-party/TODO-license.txt

ENV JAVA_OPTS=""

# Set default user information
ARG GROUPNAME=Alfresco
ARG GROUPID=1000

# TODO PoC for FFmpeg - update w3 page with a specific allocated id in sequence (may not be 33099)
ARG FFMPEGUSERNAME=ffmpeg
ARG USERID=33099

COPY target/${env.project_artifactId}-${env.project_version}.jar /usr/bin

RUN ln /usr/bin/${env.project_artifactId}-${env.project_version}.jar /usr/bin/${env.project_artifactId}.jar && \
# TODO PoC for FFmpeg - see above
# curl -s -S $FFMPEG_RPM_URL -o ffmpeg-distribution-linux.rpm && \
# curl -s -S $FFMPEG_LICENSE_FILE -o FFmpeg-license.txt && \
yum install -y epel-release && \
# yum localinstall -y ffmpeg-distribution-*linux.rpm && \
yum localinstall -y --nogpgcheck https://download1.rpmfusion.org/free/el/rpmfusion-free-release-7.noarch.rpm && \
yum install -y ffmpeg && \
# rm -f ffmpeg-distribution-*.rpm && \
yum clean all

ADD target/generated-resources/licenses /licenses
ADD target/generated-resources/licenses.xml /licenses/
ADD target/generated-sources/license/THIRD-PARTY.txt /licenses/

RUN groupadd -g ${GROUPID} ${GROUPNAME} && \
useradd -u ${USERID} -G ${GROUPNAME} ${FFMPEGUSERNAME} && \
chgrp -R ${GROUPNAME} /usr/bin/${env.project_artifactId}.jar

EXPOSE 8090

USER ${PDFUSERNAME}

ENTRYPOINT java $JAVA_OPTS -jar /usr/bin/${env.project_artifactId}.jar

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
### Licenses

* TODO - The FFmpeg transformer uses FFmpeg. See license: https://github.com/FFmpeg/FFmpeg/blob/master/LICENSE.md
304 changes: 304 additions & 0 deletions alfresco-transform-ffmpeg/alfresco-transform-ffmpeg-boot/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,304 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">


<modelVersion>4.0.0</modelVersion>
<artifactId>alfresco-transform-ffmpeg-boot</artifactId>
<name>Alfresco FFmpeg Spring Boot</name>
<packaging>jar</packaging>

<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-transform-core</artifactId>
<version>2.5.7-A5-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

<properties>
<!-- TODO PoC for FFmpeg -->
<image.name>alfresco/alfresco-transform-ffmpeg-poc</image.name>

<image.registry>quay.io</image.registry>
<env.project_artifactId>${project.artifactId}</env.project_artifactId>
</properties>

<dependencies>
<dependency>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-transformer-base</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-transformer-base</artifactId>
<version>${project.version}</version>
<classifier>tests</classifier>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-transform-ffmpeg</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>com.vaadin.external.google</groupId>
<artifactId>android-json</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>org.dom4j</groupId>
<artifactId>dom4j</artifactId>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>license-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>


<profiles>
<profile>
<id>docker-it-setup</id>
<!-- raises an ActiveMq container for the Integration Tests -->
<build>
<plugins>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<configuration>
<images>
<image>
<alias>activemq</alias>
<name>alfresco/alfresco-activemq:5.15.8</name>
<run>
<hostname>activemq</hostname>
<ports>
<port>8161:8161</port>
<port>5672:5672</port>
<port>61616:61616</port>
</ports>
<wait>
<log>Apache ActiveMQ 5.15.8 .* started</log>
<time>20000</time>
<kill>500</kill>
<shutdown>100</shutdown>
<exec>
<preStop>kill 1</preStop>
<preStop>kill -9 1</preStop>
</exec>
</wait>
</run>
</image>

<image>
<alias>alfresco-ffmpeg</alias>
<name>${image.name}:${image.tag}</name>
<run>
<ports>
<port>8090:8090</port>
</ports>
<wait>
<http>
<url>http://localhost:8090/transform/config</url>
<method>GET</method>
<status>200...299</status>
</http>
<time>300000</time>
<kill>500</kill>
<shutdown>100</shutdown>
<exec>
<preStop>kill 1</preStop>
<preStop>kill -9 1</preStop>
</exec>
</wait>
</run>
</image>
</images>
</configuration>
</plugin>
</plugins>
</build>
</profile>

<profile>
<id>local</id>
<build>
<plugins>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>fabric8-maven-plugin</artifactId>
<configuration>
<images>
<image>
<name>${image.name}:${image.tag}</name>
<build>
<dockerFileDir>${project.basedir}/</dockerFileDir>
<buildOptions>
<squash>true</squash>
</buildOptions>
</build>
</image>
</images>
</configuration>
<executions>
<execution>
<id>build-image</id>
<phase>package</phase>
<goals>
<goal>build</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>

<profile>
<id>internal</id>
<build>
<plugins>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>fabric8-maven-plugin</artifactId>
<configuration>
<images>
<!-- QuayIO image -->
<image>
<name>${image.name}:${image.tag}</name>
<registry>${image.registry}</registry>
<build>
<dockerFileDir>${project.basedir}/</dockerFileDir>
<buildOptions>
<squash>true</squash>
</buildOptions>
</build>
</image>
<!-- DockerHub image -->
<image>
<name>${image.name}:${image.tag}</name>
<build>
<dockerFileDir>${project.basedir}/</dockerFileDir>
<buildOptions>
<squash>true</squash>
</buildOptions>
</build>
</image>
</images>
</configuration>
<executions>
<execution>
<id>build-image</id>
<phase>package</phase>
<goals>
<goal>build</goal>
</goals>
</execution>
<execution>
<id>push-image</id>
<phase>install</phase>
<goals>
<goal>push</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>

<profile>
<id>release</id>
<build>
<plugins>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>fabric8-maven-plugin</artifactId>
<configuration combine.self="override">
<images>
<!-- QuayIO image -->
<image>
<name>${image.name}:${project.version}</name>
<registry>${image.registry}</registry>
<build>
<dockerFileDir>${project.basedir}/</dockerFileDir>
<buildOptions>
<squash>true</squash>
</buildOptions>
</build>
</image>
<!-- DockerHub image -->
<image>
<name>${image.name}:${project.version}</name>
<build>
<dockerFileDir>${project.basedir}/</dockerFileDir>
<buildOptions>
<squash>true</squash>
</buildOptions>
</build>
</image>
</images>
</configuration>
<executions>
<execution>
<id>build-push-image</id>
<phase>deploy</phase>
<goals>
<goal>build</goal>
<goal>push</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
Loading