Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into feature/VDYP-443
Browse files Browse the repository at this point in the history
  • Loading branch information
smithkm committed Dec 9, 2024
2 parents 138043d + c5280a8 commit ba5bc5f
Show file tree
Hide file tree
Showing 322 changed files with 18,245 additions and 3,410 deletions.
1 change: 1 addition & 0 deletions .github/workflows/.deployer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ jobs:
--set frontend.env.VITE_SSO_CLIENT_ID=${{ secrets.VITE_SSO_CLIENT_ID }} \
--set frontend.env.VITE_SSO_REALM=${{ secrets.VITE_SSO_REALM }} \
--set frontend.env.VITE_SSO_REDIRECT_URI=${{ secrets.VITE_SSO_REDIRECT_URI }} \
--set frontend.env.VITE_API_URL=${{ secrets.VITE_API_URL }} \
${{ inputs.params }} \
--install --wait --atomic ${{ steps.vars.outputs.release }} \
--timeout ${{ inputs.timeout-minutes }}m \
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/openshift-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ jobs:
- uses: bcgov-nr/[email protected]
with:
keep_versions: 50
build_context: .
build_file: ${{matrix.package}}/Dockerfile
package: ${{ matrix.package }}
tag: ${{ github.event.number }}
tag_fallback: latest
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -240,3 +240,4 @@ $RECYCLE.BIN/

# nohup logs
nohup.out
.quarkus
8 changes: 0 additions & 8 deletions backend/.dockerignore

This file was deleted.

16 changes: 11 additions & 5 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,25 @@

# "Provides the native-image executable. Used by the Maven and Gradle plugin from Quarkus to build linux64 executables"
FROM quay.io/quarkus/ubi-quarkus-graalvmce-builder-image:jdk-21 AS build
ARG CONTEXT="backend"

# Image defaults to /project; copy controlled by .dockerignore
COPY --chown=quarkus:quarkus . ./
RUN chmod +x ./mvnw && ./mvnw package -Pnative -DskipTests
COPY --chown=quarkus:quarkus ./${CONTEXT} ./${CONTEXT}
COPY --chown=quarkus:quarkus ./buildtools ./buildtools
COPY ./pom.xml ./pom.xml
RUN chmod +x buildtools/mvnw && chmod +x ${CONTEXT}/mvnw && ./buildtools/mvnw clean install -N --batch-mode
RUN cd buildtools && ./mvnw clean install --batch-mode -DskipTests && cd ..
RUN cd ${CONTEXT} && ./mvnw clean package --batch-mode -DskipTests -Pnative

# "A base image to run Quarkus native application using UBI Micro"
FROM quay.io/quarkus/quarkus-micro-image:2.0

# Port and health check
EXPOSE 3000
HEALTHCHECK --interval=300s --timeout=3s CMD curl -f http://localhost:3000/ || exit 1
EXPOSE 8080
HEALTHCHECK --interval=300s --timeout=3s CMD curl -f http://localhost:8080/ || exit 1

# Startup
COPY --chown=1001:root --from=build /project/target/*-runner /app
ARG CONTEXT="./backend"
COPY --chown=1001:root --from=build /project/${CONTEXT}/target/*-runner /app
USER 1001
CMD ["/app", "-Dquarkus.http.host=0.0.0.0"]
71 changes: 13 additions & 58 deletions backend/README.md
Original file line number Diff line number Diff line change
@@ -1,69 +1,24 @@
# quickstart-openshift-backends
# JAX-RS/Jersey server with OpenAPI

This project uses Quarkus, the Supersonic Subatomic Java Framework.
## Overview
This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using an
[OpenAPI-Spec](https://openapis.org), you can easily generate a server stub.

If you want to learn more about Quarkus, please visit its website: https://quarkus.io/ .
This is an example of building a OpenAPI-enabled JAX-RS server.
This example uses the [JAX-RS](https://jax-rs-spec.java.net/) framework.
Jersey is used as JAX-RS implementation, `io.swagger:swagger-jersey2-jaxrs` is used to derive the OpenAPI Specification from the annotated code.

### Prerequisites
- [x] Java 17 JDK
- [x] Docker
To run the server, please execute the following:

## Running the application in dev mode

You can run your application in dev mode that enables live coding using:
```shell script
./mvnw compile quarkus:dev
```

> **_NOTE:_** Quarkus now ships with a Dev UI, which is available in dev mode only at http://localhost:8080/q/dev/.
## Packaging and running the application

The application can be packaged using:
```shell script
./mvnw package
```
It produces the `quarkus-run.jar` file in the `target/quarkus-app/` directory.
Be aware that it’s not an _über-jar_ as the dependencies are copied into the `target/quarkus-app/lib/` directory.

The application is now runnable using `java -jar target/quarkus-app/quarkus-run.jar`.

If you want to build an _über-jar_, execute the following command:
```shell script
./mvnw package -Dquarkus.package.type=uber-jar
mvn clean package jetty:run
```

The application, packaged as an _über-jar_, is now runnable using `java -jar target/*-runner.jar`.

## Creating a native executable
You can then view the OpenAPI v2 specification here:

You can create a native executable using:
```shell script
./mvnw package -Pnative
```

Or, if you don't have GraalVM installed, you can run the native executable build in a container using:
```shell script
./mvnw package -Pnative -Dquarkus.native.container-build=true
http://localhost:8080/MJUNKIN_1/VDYP-File/1.0.0/swagger.json
```

You can then execute your native executable with: `./target/quickstart-openshift-backends-1.0.0-SNAPSHOT-runner`

If you want to learn more about building native executables, please consult https://quarkus.io/guides/maven-tooling.

## Related Guides

- Flyway ([guide](https://quarkus.io/guides/flyway)): Handle your database schema migrations
- SmallRye OpenAPI ([guide](https://quarkus.io/guides/openapi-swaggerui)): Document your REST APIs with OpenAPI - comes with Swagger UI
- RESTEasy Reactive ([guide](https://quarkus.io/guides/resteasy-reactive)): A Jakarta REST implementation utilizing build time processing and Vert.x. This extension is not compatible with the quarkus-resteasy extension, or any of the extensions that depend on it.
- SmallRye Fault Tolerance ([guide](https://quarkus.io/guides/smallrye-fault-tolerance)): Build fault-tolerant network services
- Reactive PostgreSQL client ([guide](https://quarkus.io/guides/reactive-sql-clients)): Connect to the PostgreSQL database using the reactive pattern
- SmallRye Metrics ([guide](https://quarkus.io/guides/smallrye-metrics)): Expose metrics for your services

## Provided Code

### RESTEasy Reactive

Easily start your Reactive RESTful Web Services

[Related guide section...](https://quarkus.io/guides/getting-started-reactive#reactive-jax-rs-resources)
Note that if you have configured the `host` to be something other than localhost, the calls through
swagger-ui will be directed to that host and not localhost!
Empty file modified backend/mvnw
100644 → 100755
Empty file.
12 changes: 6 additions & 6 deletions backend/openshift.deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ objects:
key: database-user

ports:
- containerPort: 3000
- containerPort: 8080
protocol: TCP
resources:
requests:
Expand All @@ -119,7 +119,7 @@ objects:
readinessProbe:
httpGet:
path: /
port: 3000
port: 8080
scheme: HTTP
initialDelaySeconds: 5
periodSeconds: 2
Expand All @@ -131,7 +131,7 @@ objects:
failureThreshold: 3
httpGet:
path: /
port: 3000
port: 8080
scheme: HTTP
initialDelaySeconds: 60
periodSeconds: 30
Expand All @@ -145,10 +145,10 @@ objects:
name: "${NAME}-${ZONE}-${COMPONENT}"
spec:
ports:
- name: 3000-tcp
- name: 8080-tcp
protocol: TCP
port: 80
targetPort: 3000
targetPort: 8080
selector:
deploymentconfig: "${NAME}-${ZONE}-${COMPONENT}"
- apiVersion: route.openshift.io/v1
Expand All @@ -160,7 +160,7 @@ objects:
spec:
host: "${NAME}-${ZONE}-${COMPONENT}.${DOMAIN}"
port:
targetPort: 3000-tcp
targetPort: 8080-tcp
to:
kind: Service
name: "${NAME}-${ZONE}-${COMPONENT}"
Expand Down
Loading

0 comments on commit ba5bc5f

Please sign in to comment.