Skip to content

Commit

Permalink
Add eclipseLinkDeps options for Dockerfile and run.sh (apache#313)
Browse files Browse the repository at this point in the history
  • Loading branch information
MonkeyCanCode authored Sep 24, 2024
1 parent 81ec424 commit 3396e22
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# Base Image
# Use a non-docker-io registry, because pulling images from docker.io is
# subject to aggressive request rate limiting and bandwidth shaping.
FROM registry.access.redhat.com/ubi9/openjdk-21:1.20-2.1726695192 as build
FROM registry.access.redhat.com/ubi9/openjdk-21:1.20-2.1726695192 AS build
ARG ECLIPSELINK=false
ARG ECLIPSELINK_DEPS

Expand Down
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,21 @@ select * from db1.table1;

Apache Polaris supports the following optional build options:
- `-PeclipseLink=true` – Enables the EclipseLink extension.
- `-PeclipseLinkDeps=[groupId]:[artifactId]:[version],...` – Specifies one or more additional dependencies for EclipseLink (e.g., JDBC drivers), separated by commas.
- `-PeclipseLinkDeps=[groupId]:[artifactId]:[version],...` – Specifies one or more additional dependencies for EclipseLink (e.g., JDBC drivers) separated by commas.

### More build and run options
Running in Docker
- `docker build -t localhost:5001/polaris:latest .` - To build the image.
- Optional build options:
- `docker build -t localhost:5001/polaris:latest --build-arg ECLIPSELINK=true .` - Enables the EclipseLink extension.
- `docker build -t localhost:5001/polaris:latest --build-arg ECLIPSELINK=true --build-arg ECLIPSELINK_DEPS=[groupId]:[artifactId]:[version],... .` – Enables the EclipseLink extension with one or more additional dependencies for EclipseLink (e.g. JDBC drivers) separated by commas.
- `docker run -p 8181:8181 localhost:5001/polaris:latest` - To run the image in standalone mode.

Running in Kubernetes
- `./run.sh` - To run Polaris as a mini-deployment locally. This will create one pod that bind itself to ports `8181` and `8182`.
- Optional run options:
- `./run.sh -b "ECLIPSELINK=true"` - Enables the EclipseLink extension.
- `./run.sh -b "ECLIPSELINK=true;ECLIPSELINK_DEPS=[groupId]:[artifactId]:[version],..."` – Enables the EclipseLink extension with one or more additional dependencies for EclipseLink (e.g. JDBC drivers) separated by commas.
- `kubectl port-forward svc/polaris-service -n polaris 8181:8181 8182:8182` - To create secure connections between a local machine and a pod within the cluster for both service and metrics endpoints.
- Currently supported metrics endpoints:
- localhost:8182/metrics
Expand Down
8 changes: 4 additions & 4 deletions run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ BUILD_ARGS="" # Initialize an empty string to store Docker build arguments

# Function to display usage information
usage() {
echo "Usage: $0 [-b build-arg1=value1,build-arg2=value2,...] [-h]"
echo " -b Pass a set of arbitrary build arguments to docker build, separated by commas"
echo "Usage: $0 [-b build-arg1=value1;build-arg2=value2;...] [-h]"
echo " -b Pass a set of arbitrary build arguments to docker build, separated by semicolons"
echo " -h Display this help message"
exit 1
}
Expand All @@ -36,7 +36,7 @@ usage() {
while getopts "b:h" opt; do
case ${opt} in
b)
IFS=',' read -ra ARGS <<< "${OPTARG}" # Split the comma-separated list into an array
IFS=';' read -ra ARGS <<< "${OPTARG}" # Split the semicolon-separated list into an array
for arg in "${ARGS[@]}"; do
BUILD_ARGS+=" --build-arg ${arg}" # Append each build argument to the list
done
Expand All @@ -59,7 +59,7 @@ sh ./kind-registry.sh

# Check if BUILD_ARGS is not empty and print the build arguments
if [[ -n "$BUILD_ARGS" ]]; then
echo "Building polaris image with build arguments: $BUILD_ARGS"
echo "Building polaris image with build arguments:$BUILD_ARGS"
else
echo "Building polaris image without any additional build arguments."
fi
Expand Down

0 comments on commit 3396e22

Please sign in to comment.