Skip to content

Commit

Permalink
Merge pull request #221 from yrodiere/openapi
Browse files Browse the repository at this point in the history
Expose openapi spec in prod and staging, expose swagger UI on staging
  • Loading branch information
yrodiere authored Apr 8, 2024
2 parents b02622b + 79a2fea commit fb7536a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
runs-on: ubuntu-latest

env:
HELM_PROFILE: ${{ github.ref == 'refs/heads/production' && 'prod' || 'staging' }}
QUARKUS_PROFILE: ${{ github.ref == 'refs/heads/production' && 'prod' || 'staging' }}

steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -98,4 +98,4 @@ jobs:
- name: Deploy Helm charts
run: |
helm upgrade --install search-quarkus-io ./target/helm/openshift/search-quarkus-io \
-f ./src/main/helm/values.$HELM_PROFILE.yaml
-f ./src/main/helm/values.$QUARKUS_PROFILE.yaml
3 changes: 3 additions & 0 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 +205,13 @@ There are two namespaces containing two separate deployments at the moment:
* Production (`production` branch):
** Console: https://console-openshift-console.apps.ospo-osci.z3b1.p1.openshiftapps.com/k8s/cluster/projects/prod-search-quarkus-io
** Endpoint: https://search.quarkus.io/api/guides/search
** Endpoint spec (OpenAPI): https://search.quarkus.io/api/openapi
** Indexing status reports: https://github.com/quarkusio/search.quarkus.io/issues/130
* Staging (`main` branch):
** Console: https://console-openshift-console.apps.ospo-osci.z3b1.p1.openshiftapps.com/k8s/cluster/projects/dev-search-quarkus-io
** Endpoint: https://search-quarkus-io-dev-search-quarkus-io.apps.ospo-osci.z3b1.p1.openshiftapps.com/api/guides/search
** Endpoint spec (OpenAPI): https://search-quarkus-io-dev-search-quarkus-io.apps.ospo-osci.z3b1.p1.openshiftapps.com/api/openapi
** SwaggerUI: https://search-quarkus-io-dev-search-quarkus-io.apps.ospo-osci.z3b1.p1.openshiftapps.com/q/swaggerui
** Indexing status reports: https://github.com/quarkusio/search.quarkus.io/issues/131

Deployment will happen automatically when pushing to the relevant branch.
Expand Down
5 changes: 3 additions & 2 deletions src/main/helm/values.staging.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
app:
envs:
QUARKUS_PROFILE: 'staging'
# Avoid overloading the rather resource-constrained OpenSearch instance
INDEXING_BULK_SIZE: " 10"
INDEXING_QUEUE_COUNT: " 12"
INDEXING_BULK_SIZE: 10
INDEXING_QUEUE_COUNT: 12
resources:
limits:
cpu: 2000m
Expand Down
7 changes: 6 additions & 1 deletion src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,14 @@ mp.openapi.extensions.smallrye.info.description=Search Quarkus resources
mp.openapi.extensions.smallrye.info.contact.email=[email protected]
mp.openapi.extensions.smallrye.info.contact.name=Quarkus team
mp.openapi.extensions.smallrye.info.contact.url=https://github.com/quarkusio/search.quarkus.io
# In prod, we want the openapi spec to be exposed on the main interface
%prod.quarkus.smallrye-openapi.management.enabled=false
%prod.quarkus.smallrye-openapi.path=/api/openapi

########################
# Swagger UI
########################
quarkus.swagger-ui.always-include=true
%staging.quarkus.swagger-ui.always-include=true
quarkus.swagger-ui.title=Quarkus Search API

########################
Expand Down Expand Up @@ -205,6 +208,8 @@ quarkus.helm.values."resources.limits.cpu".paths=(kind == Deployment).spec.templ
quarkus.helm.values."resources.requests.cpu".paths=(kind == Deployment).spec.template.spec.containers.resources.requests.cpu
quarkus.helm.values."resources.limits.memory".paths=(kind == Deployment).spec.template.spec.containers.resources.limits.memory
quarkus.helm.values."resources.requests.memory".paths=(kind == Deployment).spec.template.spec.containers.resources.requests.memory
# Quarkus profile (overridden for staging, see src/main/helm)
quarkus.openshift.env.vars.QUARKUS_PROFILE=prod
# Indexing settings (overridden for staging, see src/main/helm)
quarkus.openshift.env.vars.INDEXING_QUEUE_COUNT=${INDEXING_QUEUE_COUNT}
quarkus.openshift.env.vars.INDEXING_BULK_SIZE=${INDEXING_BULK_SIZE}
Expand Down

0 comments on commit fb7536a

Please sign in to comment.