NIFI-7873 removing defunct modules and relaxing github ci test speeds to help restore reliability

This commit is contained in:
Joe Witt 2021-02-01 15:11:59 -07:00
parent 5fea9179c4
commit 0a82946946
No known key found for this signature in database
GPG Key ID: 9093BF854F811A1A
4 changed files with 0 additions and 261 deletions

View File

@ -1,56 +0,0 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
# Apache NiFi Docker Compose
# Usage
## Overview
The colocated docker-compose.yml is a [Docker Compose](https://docs.docker.com/compose/overview/) definition providing an easy way to start up an Apache NiFi Cluster.
## NiFi version configuration
There are two primary ways in which the cluster can be configured:
1. By default, the Compose file (docker-compose.yml) is configured to make use of the latest image that would be created by a NiFi Maven build with the Docker profile activated through an invocation similar to `mvn clean install -Pdocker`.
2. Optionally, a user can update the docker-compose.yml file to use a released convenience image provided in the [Apache NiFi Docker Hub repository](https://hub.docker.com/r/apache/nifi/tags/). This is accomplished by changing the `image` property of the `nifi` service definition to be an available Docker Hub tag such as `apache/nifi:1.7.0`. **NOTE** Changes to the image can affect the expected conventions of the docker-compose.yml configuration. All released images 1.7.0 or later should work with the file as provided. If there are any issues, please file a [JIRA](https://issues.apache.org/jira/browse/NIFI).
## Starting the cluster
A user can start a minimal NiFi cluster with a simple `docker-compose up -d` in the `docker-compose` directory after configuring a desired NiFi version [above](#nifi-version-configuration). This will start a NiFi cluster of one node in Compose's detached mode, with containers running in the background.
Typically, however, when clustering a user will likely want multiple instances of NiFi. In this, more pragmatic perspective, a user would opt to instead run `docker-compose up --scale nifi=<number of instances> -d`, specifying a number of instances, such as `docker-compose up --scale nifi=3 -d`. The `docker-compose up --scale` command can be performed at any point in the lifecycle of a running cluster instance and Compose will scale up or down to meet the number specified. Consider the following user commands after a user starts a NiFi cluster specifying n-instances through `docker-compose up --scale nifi=n -d`:
* `docker-compose up --scale nifi=n-m -d`: Compose will notice that the requested number of instances (`n-m`) is less than those currently running and remove `m` instances of the `nifi` service from the running configuration,
* `docker-compose up --scale nifi=n -d`: Compose will notice that the requested number of instances is the number currently running and not perform any changes
* `docker-compose up --scale nifi=n+m -d`: Compose will notice that the requested number of instances (`n+m`) is more than those currently running and add `m` instances of the `nifi` service from the running configuration
**NOTE**: NiFi currently does not provide any management of removed nodes from the cluster and, by virtue of how Compose works, data on those instances will be lost when instances are scaled down or removed.
## Monitoring the cluster
### Viewing logs
Logs for all running services (ZooKeeper and NiFi Nodes) can be viewed by performing `docker-compose logs` to receive a view of the collected logs thus far. Alternatively, a user can follow the logs by adding the `-f` option such as `docker-compose logs -f`.
### Accessing the UI
To facilitate accommodating multiple instances of NiFi on one host, a fixed and exposed port is not specified in the docker-compose.yml configuration. A user can find the host allocated port by performing `docker-compose port nifi 8080`. This will return output similar to `0.0.0.0:32787`, indicating that the UI port, 8080, is available on all network interfaces of the host at port 32787. If you are running the Compose environment on your local system, this would create an address of http://localhost:32787/nifi/. If you would like to access the UI of other instances for additional evaluation, the `docker-compose port` command additionally accepts an `--index` option as follows `docker-compose port --index=<instance number> port nifi 8080`.
## Stopping the cluster
When a user has completed their usage of the cluster, all containers can be stopped by performing `docker-compose down` from the docker-compose folder. This will both stop and remove all containers associated with services in the docker-compose.yml configuration.
**NOTE**: NiFi currently does not provide any management of removed nodes from the cluster and, by virtue of how Compose works, data on those instances will be lost when instances are scaled down or removed.

View File

@ -1,33 +0,0 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
version: "3"
services:
zookeeper:
hostname: zookeeper
container_name: zookeeper
image: 'bitnami/zookeeper:latest'
environment:
- ALLOW_ANONYMOUS_LOGIN=yes
nifi:
image: apache/nifi:1.13.0-SNAPSHOT-dockermaven
ports:
- 8080 # Unsecured HTTP Web Port
environment:
- NIFI_WEB_HTTP_PORT=8080
- NIFI_CLUSTER_IS_NODE=true
- NIFI_CLUSTER_NODE_PROTOCOL_PORT=8082
- NIFI_ZK_CONNECT_STRING=zookeeper:2181
- NIFI_ELECTION_MAX_WAIT=1 min

View File

@ -1,63 +0,0 @@
#@IgnoreInspection BashAddShebang
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
FROM openjdk:8-jre-alpine
LABEL maintainer="Apache NiFi <dev@nifi.apache.org>"
ARG UID=1000
ARG GID=1000
ARG NIFI_VERSION
ARG LIB_DIR
ARG WORKING_DIR
ENV NIFI_BASE_DIR /opt/nifi
ENV NIFI_HOME ${NIFI_BASE_DIR}/nifi-current
# Setup NiFi user
RUN addgroup -g ${GID} nifi && adduser -s /bin/sh -u ${UID} -G nifi -D nifi
RUN mkdir -p $NIFI_HOME && chown nifi:nifi $NIFI_HOME
RUN mkdir -p ${NIFI_HOME}/work/stateless-nars && chown nifi:nifi ${NIFI_HOME}/work/stateless-nars && chmod 777 ${NIFI_HOME}/work/stateless-nars
COPY --chown=nifi:nifi $WORKING_DIR ${NIFI_HOME}/work
COPY --chown=nifi:nifi $LIB_DIR ${NIFI_HOME}/lib/
#NiFi's HDFS processors require core-site.xml or hdfs-site.xml to exist on disk before they can be started...
RUN echo '<configuration> \n\
<property> \n\
<name>fs.defaultFS</name> \n\
<value>hdfs://localhost:8020</value> \n\
</property> \n\
<property> \n\
<name>fs.hdfs.impl</name> \n\
<value>org.apache.hadoop.hdfs.DistributedFileSystem</value> \n\
</property> \n\
</configuration>' > /tmp/core-site.xml && chown nifi /tmp/core-site.xml && chmod 777 /tmp/core-site.xml
RUN mkdir -p /hadoop/yarn/local && chown nifi /hadoop/yarn/local && chmod 777 /hadoop/yarn/local
USER nifi
EXPOSE 8080
WORKDIR ${NIFI_HOME}
ENTRYPOINT ["/usr/bin/java", "-cp", "lib/bootstrap/*", "org.apache.nifi.bootstrap.RunStatelessNiFi"]
CMD ["RunOpenwhiskActionServer", "8080"]

View File

@ -1,109 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
license agreements. See the NOTICE file distributed with this work for additional
information regarding copyright ownership. The ASF licenses this file to
You under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of
the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
by applicable law or agreed to in writing, software distributed under the
License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
OF ANY KIND, either express or implied. See the License for the specific
language governing permissions and limitations under the License. -->
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-docker</artifactId>
<version>1.13.0-SNAPSHOT</version>
</parent>
<artifactId>dockermaven-stateless</artifactId>
<profiles>
<profile>
<id>docker</id>
<build>
<plugins>
<!-- Using Ant until Docker squash is stable -->
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<id>extract archives</id>
<phase>process-sources</phase>
<configuration>
<tasks>
<unzip src="${project.basedir}/../../nifi-assembly/target/nifi-${nifi.version}-bin.zip" dest="${project.basedir}/target/" />
<move todir="${project.basedir}/target/lib">
<fileset dir="${project.basedir}/target/nifi-${nifi.version}/lib" />
</move>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
<execution>
<id>extract NARs</id>
<phase>process-sources</phase>
<configuration>
<target>
<exec dir="${project.basedir}/target" executable="java">
<arg value="-cp" />
<arg value="lib/bootstrap/*" />
<arg value="org.apache.nifi.bootstrap.RunStatelessNiFi" />
<arg value="ExtractNars" />
</exec>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
<execution>
<id>remove framework nar</id>
<phase>process-sources</phase>
<configuration>
<tasks>
<!--Not needed in docker image-->
<delete dir="${project.basedir}/target/lib" includes="*.nar" />
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>dockerfile-maven-plugin</artifactId>
<version>1.4.10</version>
<executions>
<execution>
<id>default</id>
<goals>
<goal>build</goal>
</goals>
<configuration>
<buildArgs>
<UID>1000</UID>
<GID>1000</GID>
<NIFI_VERSION>${project.version}</NIFI_VERSION>
<LIB_DIR>target/lib</LIB_DIR>
<WORKING_DIR>target/work</WORKING_DIR>
</buildArgs>
<repository>apache/nifi-stateless</repository>
<tag>${project.version}-dockermaven</tag>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>