-
Notifications
You must be signed in to change notification settings - Fork 249
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
[QE] Improve CRC E2E tests pipelines by adding java application deploy workflow using Eclipse JKube #4397
Comments
Just as preliminary work I would try to just spin crc on Target windows or mac as I am more in doubt about the usage for |
Unfortunately, I don't have access to Here is the Dockerfile I used (Not sure what adjustments would need to be done in order to make it work on mac and windows) : FROM registry.access.redhat.com/ubi9/openjdk-17:1.20-2.1726695177
LABEL org.opencontainers.image.authors="CRCQE <[email protected]>"
USER root
# Install oc
RUN curl -o oc.tar https://downloads-openshift-console.apps.sandbox-m4.g2pi.p1.openshiftapps.com/amd64/linux/oc.tar
RUN tar -xf oc.tar
RUN mv oc /usr/local/bin/oc
# Install Git
RUN microdnf install -y git
USER default
RUN git clone https://github.com/eclipse-jkube/jkube-integration-tests.git
COPY <<-EOT /script.sh
oc login -u developer -p developer https://localhost:6443 --insecure-skip-tls-verify
oc new-project jkube-spring-boot-app-deploy
cd jkube-integration-tests
mvn -B -DskipTests clean install
# Run existing JKube Quarkus OpenShift Integration test to test deploy flow
mvn -B verify -Dit.test=QuarkusOcITCase -POpenShift,quarkus -Djkube.version=1.17.0
EOT
ENTRYPOINT ["sh", "/script.sh"] |
Hi @rohanKanojia, so this is running an image providing java, installing oc cli and connecting to current host (api.crc.tessting right?) to run the java application.
|
@albfan :
Sorry, I don't understand. Could you please elaborate your question?
I'm only running a single test case |
about localhost: Should we use localhost instead of api.crc.testing on your script? about java project: if it just reuses something you know well that's enough by now |
@albfan : I tested by changing podman build . --tag redhat-ubi-openjdk17-with-oc:latest
podman run --network host redhat-ubi-openjdk17-with-oc:latest
[INFO]
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running org.eclipse.jkube.integrationtests.quarkus.rest.QuarkusOcITCase
[ForkJoinPool-1-worker-1] INFO org.eclipse.jetty.websocket.client.WebSocketClient - Shutdown WebSocketClient@ae5d5bd7[coreClient=WebSocketCoreClient@1c9a3e14{STARTED},openSessions.size=0]
[INFO] Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 141.2 s -- in org.eclipse.jkube.integrationtests.quarkus.rest.QuarkusOcITCase
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 5, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO]
[INFO] --- maven-failsafe-plugin:3.1.2:verify (default) @ integration-tests ---
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for JKube :: Integration Tests :: Parent 0.0.0-SNAPSHOT:
[INFO]
[INFO] JKube :: Integration Tests :: Parent ............... SUCCESS [ 0.001 s]
[INFO] JKube :: Integration Tests :: Quarkus :: Rest ...... SUCCESS [02:58 min]
[INFO] JKube :: Integration Tests :: Quarkus :: Rest :: Trace Logging Enabled SUCCESS [ 5.440 s]
[INFO] JKube :: Integration Tests :: Tests ................ SUCCESS [02:28 min]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 11:15 min
[INFO] Finished at: 2024-10-10T10:39:20Z
[INFO] ------------------------------------------------------------------------
|
@albfan can you try this exact same thing on a Windows or Mac machine? as @rohanKanojia does not have access to any of them |
I added some preliminary acceptance criteria, but would like to see some constraints and result based outcome there. |
test on windows and mac where successful
but due to some limitations on windows/mac test do not end: https://github.com/crc-org/crc/wiki/Podman-support#limitations
Results from running:
@rohanKanojia Is it possible to fix that port and share? |
We can decide to move some of the criteria to a new issue. This means this can move forward/merge this, and adding additional tests as a follow-up. WDYT? |
@adrianriobo: Hello. After getting help from @albfan, I managed to test the Dockerfile on Windows and MacOS. As you and Alberto pointed out, In order to make it work on Windows/MacOS, I used I modified Dockerfile like this (omitted some lines related to downloading FROM registry.access.redhat.com/ubi9/openjdk-17:1.20-2.1726695177
USER root
# Install oc
RUN curl -o oc.tar https://downloads-openshift-console.apps.sandbox-m4.g2pi.p1.openshiftapps.com/amd64/linux/oc.tar
RUN tar -xf oc.tar
RUN mv oc /usr/local/bin/oc
USER default
COPY <<-EOT /script.sh
oc login -u developer -p developer https://host.containers.internal:6443 --insecure-skip-tls-verify
# Application Deployment using JKube to crc cluster
# ...
EOT
ENTRYPOINT ["sh", "/script.sh"] The container is built and started like this: # Expose CRC podman daemon
eval $(crc podman-env)
# Build Image
podman build . --tag localhost/redhat-ubi-openjdk17-with-oc:latest
# Start container
podman run --rm \
--add-host=oauth-openshift.apps-crc.testing:host-gateway \
localhost/redhat-ubi-openjdk17-with-oc:latest How do you think we should proceed with test implementation? I have these options in my mind:
|
where is this |
I am creating
Sorry, I don't understand your comment. Are you talking about crc cluster URL |
Alright so this is specific for test it on crc side.
not build argument but as run argument, you can have default arg as part of build but if it is very specific to crc then I am OK with hardcode. |
…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. + Test would be performing java maven based build inside a container within podman inside CRC VM. At the moment, we're building and running container at the same time. Signed-off-by: Rohan Kumar <[email protected]>
…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. + Test would be performing java maven based build inside a container within podman inside CRC VM. At the moment, we're building and running container at the same time. Signed-off-by: Rohan Kumar <[email protected]>
…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. + Test would be performing java maven based build inside a container within podman inside CRC VM. At the moment, we're building and running container at the same time. Signed-off-by: Rohan Kumar <[email protected]>
…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. + Test would be performing java maven based build inside a container within podman inside CRC VM. At the moment, we're building and running container at the same time. Signed-off-by: Rohan Kumar <[email protected]>
…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. + Test would be performing java maven based build inside a container within podman inside CRC VM. At the moment, we're building and running container at the same time. Signed-off-by: Rohan Kumar <[email protected]>
…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. + Test would be performing java maven based build inside a container within podman inside CRC VM. At the moment, we're building and running container at the same time. Signed-off-by: Rohan Kumar <[email protected]>
…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. + Test would be performing java maven based build inside a container within podman inside CRC VM. At the moment, we're building and running container at the same time. Signed-off-by: Rohan Kumar <[email protected]>
…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 <[email protected]>
…JKube (#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 <[email protected]>
Description
As we discussed internally during F2F meeting, CRC can use the JKube project to test the deployment workflow of a simple Java application.
Once CRC has been set up in E2E tests, we can add one more step to build and deploy a Java application into the installed cluster and verify whether it's accessible from the CRC cluster. JKube performs an S2I binary build to build a container image and then deploys it to the OpenShift cluster.
I had discussed this with @adrianriobo , we can try adding this step in a container.
originally posted by @adrianriobo in internal chat:
Expected Behavior
CRC pipelines are improved to verify application deployment workflow for a simple Java application. We can use some simple Quarkus application and deploy it to the created CRC cluster using Eclipse JKube to achieve this.
Acceptance Criteria
The text was updated successfully, but these errors were encountered: