-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2818 from IBM/issue-2798
Add Automation for ibm-fhir-term-graph-loader and ibm-fhir-bucket-tool
- Loading branch information
Showing
16 changed files
with
403 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
target/ |
50 changes: 50 additions & 0 deletions
50
fhir-install/src/main/docker/ibm-fhir-bucket-tool/DEVELOPMENT.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
--- | ||
layout: default | ||
title: IBM FHIR Server - Bucket Tool - Development | ||
date: 2021-10-14 | ||
permalink: /ibm-fhir-bucket-tool-development/ | ||
--- | ||
|
||
# Development | ||
|
||
The document helps developers setup the development environment for the IBM FHIR Server - Bucket Tool. | ||
|
||
1. Build the `fhir-examples` and `fhir-parent` | ||
|
||
``` shell | ||
export WORKSPACE=`pwd` | ||
cd fhir-install/src/main/docker/ibm-fhir-bucket-tool | ||
mvn clean install -DskipTests -f ${WORKSPACE}/fhir-examples/ | ||
mvn clean install -DskipTests -f ${WORKSPACE}/fhir-parent/ | ||
``` | ||
|
||
2. Change to the `fhir-install/src/main/docker/ibm-fhir-bucket-tool` directory | ||
|
||
3. Prep the contents | ||
|
||
``` shell | ||
mkdir -p target | ||
cp ${WORKSPACE}/fhir-bucket/target/fhir-bucket-*-cli.jar target/ | ||
cp ${WORKSPACE}/LICENSE target/LICENSE | ||
``` | ||
|
||
4. Build the bucket tool. | ||
|
||
``` shell | ||
docker build --build-arg FHIR_VERSION=4.10.0 -t ibm-fhir-bucket-tool:4.10.0 . | ||
``` | ||
|
||
5. Run | ||
|
||
``` shell | ||
time docker run ibmcom/ibm-fhir-bucket-tool:latest $ARGS | tee out.log | ||
``` | ||
|
||
# Run a Shell Check | ||
|
||
Sanity check of the Shell Script | ||
|
||
``` | ||
brew install shellcheck | ||
shellcheck run.sh | ||
``` |
63 changes: 63 additions & 0 deletions
63
fhir-install/src/main/docker/ibm-fhir-bucket-tool/Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# ---------------------------------------------------------------------------- | ||
# (C) Copyright IBM Corp. 2021 | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# ---------------------------------------------------------------------------- | ||
# Stage: Base | ||
|
||
# IBM Semeru Runtimes provides Non-official docker images. These are maintained by IBM. | ||
# The link to Semeru is at https://hub.docker.com/r/ibmsemeruruntime/open-11-jdk | ||
FROM ibmsemeruruntime/open-11-jdk:ubi_min-jre-latest as base | ||
|
||
# Create the base working directory | ||
RUN mkdir -p /opt/ibm/fhir/bucket/workarea | ||
|
||
# Copy in the relevant artifacts in a single command | ||
COPY ./run.sh ./target/fhir-bucket-*-cli.jar ./target/LICENSE /opt/ibm/fhir/bucket/ | ||
|
||
# ---------------------------------------------------------------------------- | ||
# Stage: Runnable | ||
|
||
FROM registry.access.redhat.com/ubi8/ubi-minimal | ||
|
||
ARG FHIR_VERSION=4.10.0 | ||
|
||
# The following labels are required: | ||
LABEL name='IBM FHIR Server - Bucket Tool' | ||
LABEL vendor='IBM' | ||
LABEL version="$FHIR_VERSION" | ||
LABEL summary="Image for IBM FHIR Server - Bucket Tool with OpenJ9 and UBI 8" | ||
LABEL description="The IBM FHIR Server - Bucket Tool manages the IBM FHIR Server operations and generates synthetic load." | ||
|
||
# Environment variables | ||
ENV SKIP false | ||
ENV TOOL_INPUT false | ||
|
||
ENV LANG='en_US.UTF-8' | ||
ENV LANGUAGE='en_US:en' | ||
ENV LC_ALL='en_US.UTF-8' | ||
ENV TZ 'UTC' | ||
|
||
WORKDIR /opt/ibm/fhir/bucket/workarea | ||
|
||
COPY --chown=1001:0 --from=base /opt/ /opt/ | ||
|
||
RUN chmod -R 755 /opt/ibm/fhir/bucket/run.sh && \ | ||
mkdir -p /licenses && \ | ||
mv /opt/ibm/fhir/bucket/LICENSE /licenses && \ | ||
microdnf update -y && \ | ||
microdnf install -y nc tzdata openssl curl ca-certificates fontconfig glibc-langpack-en gzip tar findutils shadow-utils && \ | ||
groupadd -r fhirbucketadmin -g 1001 && \ | ||
useradd -u 1001 -r -g 1001 -m -d /opt/ibm/fhir/bucket/home -s /sbin/nologin fhirbucketadmin && \ | ||
chmod -R 755 /opt/ibm/fhir/bucket/ && \ | ||
rm -rf /var/cache/yum && \ | ||
rm -f /@System.solv && \ | ||
microdnf clean all && \ | ||
rm -rf /var/tmp/* && \ | ||
rm -rf /tmp/* && \ | ||
mkdir -p /opt/ibm/fhir/bucket/workarea && \ | ||
chmod -R 775 /opt/ibm/fhir/bucket/workarea | ||
|
||
USER 1001 | ||
|
||
ENTRYPOINT ["/opt/ibm/fhir/bucket/run.sh"] |
11 changes: 11 additions & 0 deletions
11
fhir-install/src/main/docker/ibm-fhir-bucket-tool/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# IBM FHIR Server - Bucket Tool | ||
|
||
The image wraps the IBM FHIR Server Bucket Tool which wraps the module - `fhir-bucket`. | ||
|
||
************ | ||
# **License** | ||
|
||
The IBM FHIR Server - Bucket Tool is licensed under the Apache 2.0 license. Full license text is available at [LICENSE](https://github.com/IBM/FHIR/blob/master/LICENSE). | ||
|
||
FHIR® is the registered trademark of HL7 and is used with the permission of HL7. Use of the FHIR trademark does not constitute endorsement of this product by HL7. | ||
IBM and the IBM logo are trademarks of International Business Machines Corporation, registered in many jurisdictions worldwide. Other product and service names might be trademarks of IBM or other companies. A current list of IBM trademarks is available on [https://ibm.com/trademark](https://ibm.com/trademark). |
45 changes: 45 additions & 0 deletions
45
fhir-install/src/main/docker/ibm-fhir-bucket-tool/build.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/usr/bin/env bash | ||
|
||
# ---------------------------------------------------------------------------- | ||
# (C) Copyright IBM Corp. 2021 | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# ---------------------------------------------------------------------------- | ||
|
||
############################################################################## | ||
|
||
if [ -z "${WORKSPACE}" ] | ||
then | ||
echo "The WORKSPACE is not set" | ||
exit 10; | ||
fi | ||
|
||
if [ -z "${BUILD_ID}" ] | ||
then | ||
echo "The Build ID is not set" | ||
exit 11; | ||
fi | ||
|
||
# docker login is already complete at this point. | ||
|
||
pushd $(pwd) | ||
|
||
cd ${WORKSPACE}/fhir-install/src/main/docker/ibm-fhir-bucket-tool/ | ||
|
||
# Copy the files over | ||
mkdir -p target/ | ||
cp ${WORKSPACE}/fhir-bucket/target/fhir-bucket-*cli.jar target/ | ||
cp ${WORKSPACE}/LICENSE target/ | ||
|
||
docker build --build-arg FHIR_VERSION=${BUILD_ID} -t ibm-fhir-bucket-tool:latest . | ||
DOCKER_IMAGE=$(docker images --filter=reference='ibm-fhir-bucket-tool:latest' --format "{{.ID}}") | ||
echo "Docker Image is: ${DOCKER_IMAGE}" | ||
|
||
docker tag ${DOCKER_IMAGE} ibmcom/ibm-fhir-bucket-tool:${BUILD_ID} | ||
docker tag ${DOCKER_IMAGE} ibmcom/ibm-fhir-bucket-tool:latest | ||
docker push ibmcom/ibm-fhir-bucket-tool:${BUILD_ID} | ||
docker push ibmcom/ibm-fhir-bucket-tool:latest | ||
|
||
popd > /dev/null | ||
|
||
# EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/env bash | ||
|
||
# ---------------------------------------------------------------------------- | ||
# (C) Copyright IBM Corp. 2021 | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# ---------------------------------------------------------------------------- | ||
|
||
/opt/java/openjdk/bin/java -jar /opt/ibm/fhir/bucket/fhir-bucket-*-cli.jar "$@" | ||
# EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
fhir-install/src/main/docker/ibm-fhir-term-graph-loader/.gitignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
target/ |
62 changes: 62 additions & 0 deletions
62
fhir-install/src/main/docker/ibm-fhir-term-graph-loader/DEVELOPMENT.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
--- | ||
layout: default | ||
title: IBM FHIR Term Graph Loader Tool - Development | ||
date: 2021-10-04 | ||
permalink: /ibm-fhir-term-graph-loader-tool-development/ | ||
--- | ||
|
||
# Development | ||
|
||
The document helps developers setup the development environment for the IBM FHIR Server - Term Graph Loader Tool. | ||
|
||
1. Build the `fhir-examples` and `fhir-parent` | ||
|
||
``` shell | ||
export WORKSPACE=`pwd` | ||
cd fhir-install/src/main/docker/ibm-fhir-term-graph-loader | ||
mvn clean install -DskipTests -f ${WORKSPACE}/fhir-examples/ | ||
mvn clean install -DskipTests -f ${WORKSPACE}/fhir-parent/ | ||
``` | ||
|
||
2. Change to the `fhir-install/src/main/docker/ibm-fhir-term-graph-loader` directory | ||
|
||
3. Prep the contents | ||
|
||
``` shell | ||
mkdir -p target | ||
cp ${WORKSPACE}/term/fhir-term-graph-loader/target/fhir-term-graph-loader-*-cli.jar target/ | ||
cp ${WORKSPACE}/LICENSE target/LICENSE | ||
``` | ||
|
||
4. Build the tool. | ||
|
||
``` shell | ||
docker build --tag ibm-fhir-term-loader:latest . | ||
``` | ||
|
||
or | ||
|
||
``` shell | ||
docker build --build-arg FHIR_VERSION=4.10.0 -t ibm-fhir-term-loader:4.10.0 . | ||
``` | ||
|
||
5. Run the shell. (You may have to edit the corresponding examples) | ||
|
||
``` shell | ||
time docker run --rm -e LOAD_UMLS=true ibmcom/ibm-fhir-term-loader:latest| tee out.log | ||
``` | ||
|
||
``` shell | ||
time docker run --rm -e LOAD_MAP=true ibmcom/ibm-fhir-term-loader:latest| tee out.log | ||
``` | ||
|
||
You'll also have to mount a config properties and pass in a configuration environment variable. | ||
|
||
# Run a Shell Check | ||
|
||
Sanity check of the Shell Script | ||
|
||
``` | ||
brew install shellcheck | ||
shellcheck run.sh | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
fhir-install/src/main/docker/ibm-fhir-term-graph-loader/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# IBM FHIR Term Graph Loader Tool | ||
|
||
The image wraps the IBM FHIR Server Term Graph Loader tool. | ||
|
||
************ | ||
# **License** | ||
|
||
The IBM FHIR Server - Term Graph Loader Tool is licensed under the Apache 2.0 license. Full license text is available at [LICENSE](https://github.com/IBM/FHIR/blob/master/LICENSE). | ||
|
||
FHIR® is the registered trademark of HL7 and is used with the permission of HL7. Use of the FHIR trademark does not constitute endorsement of this product by HL7. | ||
IBM and the IBM logo are trademarks of International Business Machines Corporation, registered in many jurisdictions worldwide. Other product and service names might be trademarks of IBM or other companies. A current list of IBM trademarks is available on [https://ibm.com/trademark](https://ibm.com/trademark). |
Oops, something went wrong.