Skip to content

Commit

Permalink
ADH-4828
Browse files Browse the repository at this point in the history
- fixed pr comments
- added java existence and version checks
  • Loading branch information
VitekArkhipov committed Aug 16, 2024
1 parent a3f5132 commit 1e0ae04
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 6 deletions.
23 changes: 22 additions & 1 deletion build-images.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
set -e

SSM_APP_VERSION=$(mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec)
SSM_APP_VERSION=$(echo "${SSM_APP_VERSION}" | head -1)
Expand All @@ -7,6 +8,26 @@ HADOOP_VERSION=3.2.4
HADOOP_PROFILE=3.2
CLUSTER_TYPE=$1

if type -p java; then
echo found java executable in PATH
_java=java
elif [[ -n "$JAVA_HOME" ]] && [[ -x "$JAVA_HOME/bin/java" ]]; then
echo found java executable in JAVA_HOME
_java="$JAVA_HOME/bin/java"
else
echo "ERROR: no java"
exit 1
fi

if [[ "$_java" ]]; then
version=$("$_java" -version 2>&1 | awk -F '"' '/version/ {print $2}')
echo version "$version"
if [[ "$version" != "1.8"* ]]; then
echo "ERROR: java must be 1.8+ version"
exit 1
fi
fi

if [ -z "$CLUSTER_TYPE" ]
then
CLUSTER_TYPE=multihost
Expand All @@ -15,7 +36,7 @@ fi
echo "=============================="
echo " Rebuild the project "
echo "=============================="
mvn clean package -Pdist,web,hadoop-${HADOOP_PROFILE} -DskipTests
mvn clean package -Pdist,web-ui,hadoop-${HADOOP_PROFILE} -DskipTests

echo "========================================================"
echo " Build Hadoop ${HADOOP_VERSION} with SSM image "
Expand Down
10 changes: 5 additions & 5 deletions supports/tools/docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ There are two cluster types:
Command to build docker images in singlehost cluster mode (from project root dir)

```shell
build-image.sh singlehost
/bin/bash build-images.sh singlehost
```

Command to start docker containers

```shell
docker-compose -f ${project-dir}/supports/tools/docker/singlehost/docker-compose.yaml up -d
docker compose -f ${project-dir}/supports/tools/docker/singlehost/docker-compose.yaml up -d
```

## Multihost configuration
Expand All @@ -31,17 +31,17 @@ docker-compose -f ${project-dir}/supports/tools/docker/singlehost/docker-compose
Command to build docker images in multihost cluster mode (from project root dir)

```shell
build-image.sh multihost
/bin/bash build-images.sh multihost
```
or without arg
```shell
build-image.sh
/bin/bash build-images.sh
```

Command to start docker containers

```shell
docker-compose -f ${project-dir}/supports/tools/docker/multihost/docker-compose.yaml up -d
docker compose -f ${project-dir}/supports/tools/docker/multihost/docker-compose.yaml up -d
```

# Run/Test SSM with Docker
Expand Down

0 comments on commit 1e0ae04

Please sign in to comment.