-
Notifications
You must be signed in to change notification settings - Fork 242
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
test (e2e) : Add E2E test for java app deploy workflow using Eclipse JKube (#4397) #4414
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Hi @rohanKanojia. Thanks for your PR. I'm waiting for a crc-org member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
/ok-to-test |
|
||
@linux @windows @darwin | ||
Scenario: Deploy a java application using Eclipse JKube in podman container and then verify it's health | ||
When executing "podman build --tag localhost/redhat-ubi-openjdk17-with-oc:latest -f ../../../testdata/JKubeAppDeployment_Containerfile ." succeeds |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you still need ../../../testdata/JKube...
as full path because it should directly work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I only specify file name, I get this error:
--- Failed steps:
Scenario: Deploy a java application using Eclipse JKube in podman container and then verify it's health # features/application_deployment.feature:13
When executing "podman build --tag localhost/redhat-ubi-openjdk17-with-oc:latest -f JKubeAppDeployment_Containerfile ." succeeds # features/application_deployment.feature:14
Error: command 'podman build --tag localhost/redhat-ubi-openjdk17-with-oc:latest -f JKubeAppDeployment_Containerfile .', expected to succeed, exited with exit code: 125
Command stdout:
Command stderr: Error: the specified Containerfile or Dockerfile does not exist, JKubeAppDeployment_Containerfile: no such file or directory
If I don't specify any source file override for podman build, I see that podman is trying to look into this directory:
--- Failed steps:
Scenario: Deploy a java application using Eclipse JKube in podman container and then verify it's health # features/application_deployment.feature:13
When executing "podman build --tag localhost/redhat-ubi-openjdk17-with-oc:latest ." succeeds # features/application_deployment.feature:14
Error: command 'podman build --tag localhost/redhat-ubi-openjdk17-with-oc:latest .', expected to succeed, exited with exit code: 125
Command stdout:
Command stderr: Error: no Containerfile or Dockerfile specified or found in context directory, /home/rokumar/go/src/github.com/crc-org/crc/test/e2e/out/test-run: no such file or directory
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@adrianriobo do you know where we put the file to use it without absolute path?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@praveenkumar : I was missing @testdata
annotation in test scenario. It should be fixed now.
@linux @windows @darwin | ||
Scenario: Deploy a java application using Eclipse JKube in podman container and then verify it's health | ||
When executing "podman build --tag localhost/redhat-ubi-openjdk17-with-oc:latest -f ../../../testdata/JKubeAppDeployment_Containerfile ." succeeds | ||
And executing "podman run --rm --dns=8.8.8.8 --name application-deployment-build-e2e --add-host=oauth-openshift.apps-crc.testing:host-gateway localhost/redhat-ubi-openjdk17-with-oc:latest" succeeds |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why we need extra dns=8.8.8.8
because by default it is not working?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not 100% sure whether this is due to some misconfiguration on my system or an actual issue. But When I was not using --dns=8.8.8.8
maven dependency download was failing with this intermittent error :
[INFO] Scanning for projects...
Downloading from central: https://repo1.maven.org/maven2/io/quarkus/quarkus-bom/3.9.1/quarkus-bom-3.9.1.pom
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[ERROR] Non-resolvable import POM: Could not transfer artifact io.quarkus:quarkus-bom:pom:3.9.1 from/to central (https://repo1.maven.org/maven2): transfer failed for https://repo1.maven.org/maven2/io/quarkus/quarkus-bom/3.9.1/quarkus-bom-3.9.1.pom @ line 41, column 19
@
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project org.eclipse.jkube.quickstarts.maven:quarkus:1.17.0 (/home/default/jkube/quickstarts/maven/quarkus/pom.xml) has 1 error
[ERROR] Non-resolvable import POM: Could not transfer artifact io.quarkus:quarkus-bom:pom:3.9.1 from/to central (https://repo1.maven.org/maven2): transfer failed for https://repo1.maven.org/maven2/io/quarkus/quarkus-bom/3.9.1/quarkus-bom-3.9.1.pom @ line 41, column 19: Connect to repo1.maven.org:443 [repo1.maven.org/151.101.36.209] failed: Connection timed out -> [Help 2]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException
However, when I run the same command directly against CRC's podman daemon I don't see this issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is mostly your network which might blocking maven dep target.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay, I will remove --dns
override from podman command
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should no longer be required due to changed approach.
oc get pods | ||
cd jkube/quickstarts/maven/quarkus | ||
# When | ||
mvn -U package oc:build oc:resource oc:apply |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So whole point of we are creating this containerfile is to clone the repo and have mvn plugin installed ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eclipse JKube requires these things to be installed to work:
- Java 1.8+ Runtime (provided by
registry.access.redhat.com/ubi9/openjdk-17:1.20-2.1726695177
) - Apache Maven/Gradle (provided by
registry.access.redhat.com/ubi9/openjdk-17:1.20-2.1726695177
)
We can move the clone part to the script. Or maybe don't clone any repository, I can add a simple Quarkus project here in test folder.
As per discussion in #4397 (comment) we though it's better to not add extra dependencies and do java based build inside a container.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As per discussion in #4397 (comment) we though it's better to not add extra dependencies and do java based build inside a container.
Yes, that is what we want. Have we tried using this container file directly using oc command instead building it with podman and then running with podman? I think if we do it as part of oc then build happen in the cluster and we don't need the login part.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean to execute it in a Pod instead? It would use the mounted ServiceAccount's token for authentication (we might need to give it appropriate permissions for that)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we can create a service account first with required permission and then add that service account to the pod which would do required stuff?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, Let me update this PR to use this approach instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we keep it simple for now? The containerfile seems to be a situation that is easy to test with. The suggestion about building in a pod, and therefore involve S2I sounds like an improvement.
- The first step was to make sure the cluster is operational to run an application.
- The next step would be to make sure the expected functionality of the cluster is available/operational.
- The third step would be to load test, memory test, etc with an application we understand and 'own', to ensure the cluster keeps operating under conditions like stress, long use, etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With current flow this looks like as part of containerfile we are embedding logic to login to cluster and then deploy it to cluster which seems overkill and have hardcoded cluster login info instead what we should've this containerfile generic enough to target any cluster.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have modified this PR to perform jkube build in a pod instead.
1694b71
to
822ab7b
Compare
d1d5f41
to
e0902c5
Compare
/ok-to-test |
9e7d7b1
to
705f351
Compare
@rohanKanojia check the e2e failure, looks like it is failing with basic test because status of crc is running which is not expected. |
705f351
to
4bc5be3
Compare
@praveenkumar : I tried reproducing it locally but couldn't reproduce it. Could it be a flaky failure? |
4bc5be3
to
7f67ea7
Compare
@praveenkumar : I have added Now the only failing e2e test I see is of cert rotation:
I think it was failing before too. |
2d1e43b
to
c17f5bb
Compare
@rohanKanojia squash the commits because second commit is making changes what you did in first one. other than that looks good to me. |
…JKube (crc-org#4397) + Added new test `application_deployment.feature` that would deploy a simple Quarkus application onto existing CRC cluster and verify that application is accessible via endpoint. + Perform JKube application deploy step in a Pod instead of podman container in order to skip oc login Signed-off-by: Rohan Kumar <rohaan@redhat.com>
c17f5bb
to
8e6e2f6
Compare
@rohanKanojia: The following tests failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
Description
Fix #4397
application_deployment.feature
that would deploy a simple Quarkus application onto existing CRC cluster and verify that application is accessible via endpoint.Signed-off-by: Rohan Kumar rohaan@redhat.com
Type of change
test, version modification, documentation, etc.)
Checklist
Fixes: Issue #4397
Relates to: Issue #4397, Issue https://github.com/eclipse-jkube/team/issues/32
Solution/Idea
I added an E2E test that would clone the Eclipse JKube repository and deploy one of the quickstart jkube@quickstarts/maven/quarkus onto the deployed CRC cluster. I've used a simple Quarkus REST application, but it can be changed to something else as well.
Proposed changes
Add a new E2E test that would verify deployment workflow of a simple Java application using Eclipse JKube
Testing
This PR only adds an E2E test, in order to run it. Use the following command: