Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
67 changes: 66 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,72 @@ jobs:
cd flink-autoscaler-plugin-jdbc
mvn -B verify -Dit.skip=false
cd ..
e2e_smoke_test:
name: HTTP Client smoke test
runs-on: ubuntu-latest
strategy:
matrix:
http-client: [ "okhttp", "jdk", "jetty", "vertx" ]
version: ["v1_20"]
mode: ["native"]
namespace: ["default"]
java-version: ["21"]
Comment on lines +78 to +79
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should actually move the namespace , and java-version matrix also to the smoke_test and fix-it (remove-it) in the regular e2es.

The http-client, java-version, namespace matrix doesn't need all the different tests, it either works or it doesn't (famous last words).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually the namespace flink/default doesn't really need more than 1 test (regardless of other params...)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should actually move the namespace , and java-version matrix also to the smoke_test and fix-it (remove-it) in the regular e2es.

I agree it's a bit strange. What I was intending to do was make the smallest change here and revisit it in a follow up hence the matrix of single values.

actually the namespace flink/default doesn't really need more than 1 test (regardless of other params...)

Thanks that’s the kind of insight I need for restructuring🧩.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SamBarker , how would you like to proceed with this? As long as we are adding the matrix changes I suggested in a followup , this is good from my side.

Should we squash it and merge it or would you want to add the restructuring here as a "second" commit

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to get this merged and follow up with the restructuring.

Squashing seems wise 😆

test:
- test_application_operations.sh
steps:
- uses: actions/checkout@v4
- name: Set up JDK ${{ matrix.java-version }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java-version }}
distribution: 'temurin'
cache: 'maven'
- name: Start minikube
run: |
source e2e-tests/utils.sh
start_minikube
- name: Install cert-manager
run: |
kubectl get pods -A
kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/v1.8.2/cert-manager.yaml
kubectl -n cert-manager wait --all=true --for=condition=Available --timeout=300s deploy
- name: Build image
run: |
export SHELL=/bin/bash
export DOCKER_BUILDKIT=1
eval $(minikube -p minikube docker-env)
JAVA_VERSION=${{matrix.java-version}}
HTTP_CLIENT=${{ matrix.http-client }}
docker build --progress=plain --no-cache -f ./Dockerfile -t flink-kubernetes-operator:ci-latest --progress plain --build-arg JAVA_VERSION="${JAVA_VERSION:-11}" --build-arg HTTP_CLIENT="${HTTP_CLIENT:-okhttp}" .
docker images
- name: Start the operator
run: |
if [[ "${{ matrix.test }}" == "test_flink_operator_ha.sh" ]]; then
sed -i "s/# kubernetes.operator.leader-election.enabled: false/kubernetes.operator.leader-election.enabled: true/" helm/flink-kubernetes-operator/conf/flink-conf.yaml
sed -i "s/# kubernetes.operator.leader-election.lease-name: flink-operator-lease/kubernetes.operator.leader-election.lease-name: flink-operator-lease/" helm/flink-kubernetes-operator/conf/flink-conf.yaml
sed -i "s/replicas: 1/replicas: 2/" helm/flink-kubernetes-operator/values.yaml
fi
helm --debug install flink-kubernetes-operator -n ${{ matrix.namespace }} helm/flink-kubernetes-operator --set image.repository=flink-kubernetes-operator --set image.tag=ci-latest ${{ matrix.extraArgs }}
kubectl wait --for=condition=Available --timeout=120s -n ${{ matrix.namespace }} deploy/flink-kubernetes-operator
kubectl get pods -n ${{ matrix.namespace }}
- name: Run Flink e2e tests
run: |
sed -i "s/image: flink:.*/image: ${{ matrix.image }}/" e2e-tests/data/*.yaml
sed -i "s/flinkVersion: .*/flinkVersion: ${{ matrix.version }}/" e2e-tests/data/*.yaml
sed -i "s/mode: .*/mode: ${{ matrix.mode }}/" e2e-tests/data/*.yaml
git diff HEAD
echo "Running e2e-tests/$test"
bash e2e-tests/${{ matrix.test }} || exit 1
git reset --hard
- name: Stop the operator
run: |
helm uninstall -n ${{ matrix.namespace }} flink-kubernetes-operator
- name: Stop minikube
run: |
source e2e-tests/utils.sh
stop_minikube
e2e_ci:
needs: e2e_smoke_test
runs-on: ubuntu-latest
strategy:
matrix:
Expand Down Expand Up @@ -166,7 +231,7 @@ jobs:
export SHELL=/bin/bash
export DOCKER_BUILDKIT=1
eval $(minikube -p minikube docker-env)
export JAVA_VERSION=${{ matrix.java-version }}
JAVA_VERSION=${{ matrix.java-version }}
docker build --progress=plain --no-cache -f ./Dockerfile -t flink-kubernetes-operator:ci-latest --progress plain --build-arg JAVA_VERSION="${JAVA_VERSION:-11}" .
docker images
- name: Start the operator
Expand Down
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@
ARG JAVA_VERSION=11
FROM maven:3.8.8-eclipse-temurin-${JAVA_VERSION} AS build
ARG SKIP_TESTS=true
ARG HTTP_CLIENT=okhttp

WORKDIR /app

COPY . .

RUN --mount=type=cache,target=/root/.m2 mvn -ntp clean install -pl flink-kubernetes-standalone,flink-kubernetes-operator-api,flink-kubernetes-operator,flink-autoscaler,flink-kubernetes-webhook -DskipTests=$SKIP_TESTS
RUN --mount=type=cache,target=/root/.m2 mvn -ntp clean install -pl flink-kubernetes-standalone,flink-kubernetes-operator-api,flink-kubernetes-operator,flink-autoscaler,flink-kubernetes-webhook -DskipTests=$SKIP_TESTS -Dfabric8.httpclinent.impl="$HTTP_CLIENT"

RUN cd /app/tools/license; mkdir jars; cd jars; \
cp /app/flink-kubernetes-operator/target/flink-kubernetes-operator-*-shaded.jar . && \
Expand Down
45 changes: 33 additions & 12 deletions flink-kubernetes-operator/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,21 @@ under the License.
<!-- required by FlinkConfigManagerTest -->
--add-opens=java.base/java.util=ALL-UNNAMED
</surefire.module.config>
<!-- valid options can be checked at https://central.sonatype.com/search?q=kubernetes-httpclient- currently: okhttp, jdk, jetty, vertx -->
<fabric8.httpclinent.impl>okhttp</fabric8.httpclinent.impl>
</properties>

<dependencies>
<dependency>
<groupId>io.javaoperatorsdk</groupId>
<artifactId>operator-framework</artifactId>
<version>${operator.sdk.version}</version>
<exclusions>
<exclusion>
<groupId>io.fabric8</groupId>
<artifactId>kubernetes-httpclient-okhttp</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
Expand All @@ -60,26 +68,17 @@ under the License.
</dependency>

<dependency>
<!-- https://github.com/fabric8io/kubernetes-client/blob/main/doc/FAQ.md#what-artifacts-should-my-project-depend-on-->
<groupId>io.fabric8</groupId>
<artifactId>kubernetes-httpclient-okhttp</artifactId>
<artifactId>kubernetes-httpclient-${fabric8.httpclinent.impl}</artifactId>
<version>${fabric8.version}</version>
<exclusions>
<exclusion>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>*</artifactId>
<artifactId>okhttp</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>${okhttp.version}</version>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>logging-interceptor</artifactId>
<version>${okhttp.version}</version>
</dependency>

<!-- Flink -->
<dependency>
Expand Down Expand Up @@ -174,6 +173,12 @@ under the License.
<artifactId>kubernetes-server-mock</artifactId>
<version>${fabric8.version}</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>mockwebserver</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
Expand Down Expand Up @@ -413,6 +418,22 @@ under the License.
</plugins>
</build>
</profile>
<profile>
<id>depend-on-okhttp4</id>
<activation>
<property>
<name>fabric8.httpclinent.impl</name>
<value>okhttp</value>
</property>
</activation>
<dependencies>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>${okhttp.version}</version>
</dependency>
Comment on lines +430 to +434
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By default kubernetes-httpclient-okhttp pulls in OkHttp 3.X which is reported to have problems with Kubernetes IPV6 stacks e.g. https://issues.apache.org/jira/browse/FLINK-31928

</dependencies>
</profile>
</profiles>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
import io.javaoperatorsdk.operator.processing.event.ResourceID;
import lombok.SneakyThrows;
import org.apache.commons.io.IOUtils;
import org.jetbrains.annotations.NotNull;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -202,7 +201,7 @@ public Map<String, String> getParallelismOverrides(KubernetesJobAutoScalerContex
.orElse(new HashMap<>());
}

@NotNull
@Nonnull
@Override
public ConfigChanges getConfigChanges(KubernetesJobAutoScalerContext jobContext) {
return configMapStore
Expand Down
4 changes: 2 additions & 2 deletions flink-kubernetes-operator/src/main/resources/META-INF/NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ This project bundles the following dependencies under the Apache Software Licens
- io.fabric8:kubernetes-model-scheduling:jar:6.13.2
- io.fabric8:kubernetes-model-storageclass:jar:6.13.2
- io.fabric8:zjsonpatch:jar:0.3.0
- io.javaoperatorsdk:operator-framework-core:jar:4.8.3
- io.javaoperatorsdk:operator-framework:jar:4.8.3
- io.javaoperatorsdk:operator-framework-core:jar:4.9.4
- io.javaoperatorsdk:operator-framework:jar:4.9.4
- org.apache.commons:commons-compress:1.21
- org.apache.commons:commons-lang3:3.14.0
- org.apache.commons:commons-math3:3.6.1
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ under the License.
<maven-javadoc-plugin.version>3.3.2</maven-javadoc-plugin.version>
<git-commit-id-maven-plugin.version>5.0.0</git-commit-id-maven-plugin.version>

<operator.sdk.version>4.8.3</operator.sdk.version>
<operator.sdk.version>4.9.4</operator.sdk.version>
<operator.sdk.webhook-framework.version>1.1.1</operator.sdk.webhook-framework.version>

<fabric8.version>6.13.2</fabric8.version>
Expand Down
Loading