Skip to content

Commit

Permalink
Build Docker images for Polaris using Quarkus
Browse files Browse the repository at this point in the history
  • Loading branch information
adutra committed Jan 10, 2025
1 parent 5fa469d commit 6d67aaa
Show file tree
Hide file tree
Showing 8 changed files with 63 additions and 95 deletions.
28 changes: 21 additions & 7 deletions .github/workflows/helm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ jobs:
with:
fetch-depth: 0

- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'

- name: Set up Helm
uses: azure/[email protected]
with:
Expand Down Expand Up @@ -83,14 +89,22 @@ jobs:
if: steps.list-changed.outputs.changed == 'true'
uses: medyagh/[email protected]

- name: Docker build
- name: Print Docker info
if: steps.list-changed.outputs.changed == 'true'
run: |
docker -v
minikube docker-env
- name: Image build
if: steps.list-changed.outputs.changed == 'true'
run: |
eval $(minikube docker-env)
docker build -f ./Dockerfile \
--build-arg ECLIPSELINK=true \
--build-arg ECLIPSELINK_DEPS=com.h2database:h2:2.3.232 \
-t polaris:latest .
export BUILD_TAG=helm-ci-$(date +%s)
echo BUILD_TAG=${BUILD_TAG} >> ${GITHUB_ENV}
eval $(minikube -p minikube docker-env)
./gradlew :polaris-quarkus-server:build -x check \
-Dquarkus.container-image.build=true \
-Dquarkus.container-image.name=polaris-testing \
-Dquarkus.container-image.tag=${BUILD_TAG}
- name: Install fixtures
if: steps.list-changed.outputs.changed == 'true'
Expand All @@ -103,5 +117,5 @@ jobs:
run: |
ct install --target-branch ${{ github.event.repository.default_branch }} \
--namespace polaris-ns \
--helm-extra-set-args "--set=image.repository=polaris --set=image.tag=latest" \
--helm-extra-set-args "--set=image.repository=apache/polaris-testing --set=image.tag=${BUILD_TAG}" \
--debug --charts ./helm/polaris
29 changes: 27 additions & 2 deletions .github/workflows/regtest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,35 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: fix permissions

- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'

- name: Fix permissions
run: mkdir -p regtests/output && chmod 777 regtests/output && chmod 777 regtests/t_*/ref/*

- name: Image build
run: |
export BUILD_TAG=regtests-ci-$(date +%s)
echo BUILD_TAG=${BUILD_TAG} >> ${GITHUB_ENV}
./gradlew :polaris-quarkus-server:build -x check \
-Dquarkus.container-image.build=true \
-Dquarkus.container-image.name=polaris-testing \
-Dquarkus.container-image.tag=${BUILD_TAG}
- name: Regression Test
env:
AWS_ACCESS_KEY_ID: ${{secrets.AWS_ACCESS_KEY_ID}}
AWS_SECRET_ACCESS_KEY: ${{secrets.AWS_SECRET_ACCESS_KEY}}
run: docker compose up --build --exit-code-from regtest
run: |
cd regtests
# create compose override file and set image tag
cat <<EOF > docker-compose.override.yml
services:
polaris:
image: apache/polaris-testing:${BUILD_TAG}
EOF
docker compose up --build --exit-code-from regtest
67 changes: 0 additions & 67 deletions Dockerfile

This file was deleted.

2 changes: 0 additions & 2 deletions helm/polaris/ci/persistence-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ image:
tag: latest
pullPolicy: Never

bootstrapMetastoreManager: true

persistenceConfigSecret: polaris-persistence

polarisServerConfig:
Expand Down
6 changes: 2 additions & 4 deletions helm/polaris/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,6 @@ spec:
{{- end }}
image: "{{ tpl .Values.image.repository . }}:{{ tpl .Values.image.tag . | default .Chart.Version }}"
imagePullPolicy: {{ tpl .Values.image.pullPolicy . }}
command: ["/app/bin/polaris-service"]
args: ["server", "/app/config/polaris-server.yml"]
{{- if .Values.extraEnv }}
env:
{{- tpl (toYaml .Values.extraEnv) . | nindent 12 }}
Expand All @@ -107,7 +105,7 @@ spec:
{{- end }}
livenessProbe:
httpGet:
path: /healthcheck
path: /q/health/live
port: "polaris-metrics"
scheme: HTTP
initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }}
Expand All @@ -118,7 +116,7 @@ spec:
terminationGracePeriodSeconds: {{ .Values.livenessProbe.terminationGracePeriodSeconds }}
readinessProbe:
httpGet:
path: /healthcheck
path: /q/health/ready
port: "polaris-metrics"
scheme: HTTP
initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }}
Expand Down
2 changes: 1 addition & 1 deletion helm/polaris/templates/tests/test-connection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ spec:
- name: wget
image: busybox
command: ['wget']
args: ['{{ include "polaris.fullname" . }}:{{ index .Values.service.ports "polaris-metrics" }}/healthcheck']
args: ['{{ include "polaris.fullname" . }}:{{ index .Values.service.ports "polaris-metrics" }}/q/health']
restartPolicy: Never
2 changes: 1 addition & 1 deletion helm/polaris/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ replicaCount: 1

image:
# -- The image repository to pull from.
repository: localhost:5001/polaris
repository: apache/polaris
# -- The image pull policy.
pullPolicy: IfNotPresent
# -- The image tag.
Expand Down
22 changes: 11 additions & 11 deletions docker-compose.yml → regtests/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
#

services:

polaris:
build:
context: .
image: apache/polaris:latest
ports:
- "8181:8181"
- "8181"
- "8182"
environment:
AWS_REGION: us-west-2
Expand All @@ -32,20 +32,20 @@ services:
AZURE_TENANT_ID: $AZURE_TENANT_ID
AZURE_CLIENT_ID: $AZURE_CLIENT_ID
AZURE_CLIENT_SECRET: $AZURE_CLIENT_SECRET
POLARIS_AUTHENTICATION_AUTHENTICATOR_TYPE: test
POLARIS_AUTHENTICATION_TOKEN_SERVICE_TYPE: test
QUARKUS_OTEL_SDK_DISABLED: "true"
polaris.authentication.authenticator.type: test
polaris.authentication.token-service.type: test
quarkus.otel.sdk.disabled: "true"
volumes:
- ./regtests/credentials:/tmp/credentials/

- ./credentials:/tmp/credentials/
healthcheck:
test: ["CMD", "curl", "http://localhost:8182/q/health"]
interval: 10s
timeout: 10s
retries: 5

regtest:
build:
context: regtests
context: .
args:
POLARIS_HOST: polaris
depends_on:
Expand All @@ -69,5 +69,5 @@ services:
AWS_CROSS_REGION_BUCKET: $AWS_CROSS_REGION_BUCKET
AWS_ROLE_FOR_CROSS_REGION_BUCKET: $AWS_ROLE_FOR_CROSS_REGION_BUCKET
volumes:
- ./regtests/output:/tmp/polaris-regtests/
- ./regtests/credentials:/tmp/credentials/
- ./output:/tmp/polaris-regtests/
- ./credentials:/tmp/credentials/

0 comments on commit 6d67aaa

Please sign in to comment.