Skip to content

Commit

Permalink
[FLINK-33560][Connectors/AWS] Externalize AWS Python connectors from …
Browse files Browse the repository at this point in the history
…Flink to AWS project
  • Loading branch information
dannycranmer committed Jan 4, 2024
1 parent 27db878 commit b7f2e26
Show file tree
Hide file tree
Showing 13 changed files with 1,439 additions and 4 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,12 @@ jobs:
flink_version: ${{ matrix.flink }}
flink_url: https://s3.amazonaws.com/flink-nightly/flink-${{ matrix.flink }}-bin-scala_2.12.tgz
cache_flink_binary: false
secrets: inherit
secrets: inherit

python_test:
strategy:
matrix:
flink: [1.17-SNAPSHOT, 1.18-SNAPSHOT, 1.19-SNAPSHOT]
uses: apache/flink-connector-shared-utils/.github/workflows/python_ci.yml@ci_utils
with:
flink_version: ${{ matrix.flink }}
8 changes: 8 additions & 0 deletions .github/workflows/push_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,11 @@ jobs:
flink_url: https://archive.apache.org/dist/flink/flink-${{ matrix.flink }}/flink-${{ matrix.flink }}-bin-scala_2.12.tgz
cache_flink_binary: true
secrets: inherit

python_test:
strategy:
matrix:
flink: [ 1.17.1, 1.18.0 ]
uses: apache/flink-connector-shared-utils/.github/workflows/python_ci.yml@ci_utils
with:
flink_version: ${{ matrix.flink }}
17 changes: 16 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,19 @@ tools/flink
tools/flink-*
tools/releasing/release
tools/japicmp-output
*/.idea/
*/.idea/

flink-python/pyflink/datastream/connectors/aws_connector_version.py
flink-python/apache_flink_connector_aws.egg-info/
flink-python/.tox/
flink-python/build
flink-python/dist
flink-python/dev/download
flink-python/dev/.conda/
flink-python/dev/log/
flink-python/dev/.stage.txt
flink-python/dev/install_command.sh
flink-python/dev/lint-python.sh
flink-python/dev/build-wheels.sh
flink-python/dev/glibc_version_fix.h
flink-python/dev/dev-requirements.txt
20 changes: 20 additions & 0 deletions flink-python/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
################################################################################
# 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.
################################################################################

graft pyflink
global-exclude *.py[cod] __pycache__ .DS_Store
14 changes: 14 additions & 0 deletions flink-python/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
These are the official AWS Python connectors for Apache Flink

For the latest information about Flink connector, please visit our website at:

https://flink.apache.org

and our GitHub Account for the AWS connectors

https://github.com/apache/flink-connector-aws

If you have any questions, ask on our Mailing lists:

[email protected]
[email protected]
50 changes: 50 additions & 0 deletions flink-python/dev/integration_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/usr/bin/env bash
################################################################################
# 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.
################################################################################

function test_module() {
module="$FLINK_PYTHON_DIR/pyflink/$1"
echo "test module $module"
pytest --durations=20 ${module} $2
if [[ $? -ne 0 ]]; then
echo "test module $module failed"
exit 1
fi
}

function test_all_modules() {
# test datastream module
test_module "datastream"
}

# CURRENT_DIR is "<root-project-folder>/flink-python/dev/"
CURRENT_DIR="$(cd "$( dirname "$0" )" && pwd)"

# FLINK_PYTHON_DIR is "<root-project-folder>/flink-python/"
FLINK_PYTHON_DIR=$(dirname "$CURRENT_DIR")

# set the FLINK_TEST_LIB_DIR to "<root-project-folder>/flink-connector-aws/flink-python-connector-aws/target/dep..."
export FLINK_TEST_LIBS="${FLINK_PYTHON_DIR}/target/test-dependencies/*"

# Temporarily update the installed 'pyflink_gateway_server.py' files with the new one
# Needed only until Flink 1.19 release
echo "Checking ${FLINK_PYTHON_DIR} for 'pyflink_gateway_server.py'"
find "${FLINK_PYTHON_DIR}/.tox" -name pyflink_gateway_server.py -exec cp "${FLINK_PYTHON_DIR}/pyflink/pyflink_gateway_server.py" {} \;

# python test
test_all_modules
173 changes: 173 additions & 0 deletions flink-python/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">

<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.apache.flink</groupId>
<artifactId>flink-connector-aws</artifactId>
<version>4.3-SNAPSHOT</version>
</parent>

<artifactId>flink-python-connector-aws</artifactId>
<name>Flink : Connectors : AWS : Python</name>

<packaging>pom</packaging>

<properties>
<python.infra.download.skip>false</python.infra.download.skip>
</properties>

<dependencies>
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-sql-connector-kinesis</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-sql-connector-aws-kinesis-firehose</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>clean</id>
<phase>clean</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<delete dir="${project.basedir}/.tox"/>
<delete dir="${project.basedir}/apache_flink_connector_aws.egg-info"/>
<delete dir="${project.basedir}/dev/.conda"/>
<delete dir="${project.basedir}/dev/download"/>
<delete dir="${project.basedir}/dev/log"/>
<delete dir="${project.basedir}/build"/>
<delete dir="${project.basedir}/dist"/>
<delete dir="${project.basedir}/pyflink/lib"/>
<delete dir="${project.basedir}/target"/>
<delete file="${project.basedir}/dev/.stage.txt"/>
<delete file="${project.basedir}/dev/install_command.sh"/>
<delete file="${project.basedir}/dev/lint-python.sh"/>
<delete file="${project.basedir}/dev/build-wheels.sh"/>
<delete file="${project.basedir}/dev/glibc_version_fix.h"/>
<delete file="${project.basedir}/dev/dev-requirements.txt"/>
<delete file="${project.basedir}/pyflink/datastream/connectors/aws_connector_version.py"/>
</target>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.apache.flink</groupId>
<artifactId>flink-sql-connector-kinesis</artifactId>
</artifactItem>
<artifactItem>
<groupId>org.apache.flink</groupId>
<artifactId>flink-sql-connector-aws-kinesis-firehose</artifactId>
</artifactItem>
</artifactItems>
<outputDirectory>${project.build.directory}/test-dependencies</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>wagon-maven-plugin</artifactId>
<version>2.0.2</version>
<executions>
<execution>
<id>download-install</id>
<phase>validate</phase>
<goals>
<goal>download-single</goal>
</goals>
<configuration>
<url>https://raw.githubusercontent.com/apache/flink-connector-shared-utils/ci_utils/python/install_command.sh</url>
<toDir>${project.basedir}/dev</toDir>
<skip>${python.infra.download.skip}</skip>
</configuration>
</execution>
<execution>
<id>download-lint</id>
<phase>validate</phase>
<goals>
<goal>download-single</goal>
</goals>
<configuration>
<url>https://raw.githubusercontent.com/apache/flink-connector-shared-utils/ci_utils/python/lint-python.sh</url>
<toDir>${project.basedir}/dev</toDir>
<skip>${python.infra.download.skip}</skip>
</configuration>
</execution>
<execution>
<id>download-build-wheels</id>
<phase>validate</phase>
<goals>
<goal>download-single</goal>
</goals>
<configuration>
<url>https://raw.githubusercontent.com/apache/flink-connector-shared-utils/ci_utils/python/build-wheels.sh</url>
<toDir>${project.basedir}/dev</toDir>
<skip>${python.infra.download.skip}</skip>
</configuration>
</execution>
<execution>
<id>download-build-version-header</id>
<phase>validate</phase>
<goals>
<goal>download-single</goal>
</goals>
<configuration>
<url>https://raw.githubusercontent.com/apache/flink-connector-shared-utils/ci_utils/python/glibc_version_fix.h</url>
<toDir>${project.basedir}/dev</toDir>
<skip>${python.infra.download.skip}</skip>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Loading

0 comments on commit b7f2e26

Please sign in to comment.