Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[releng] Docker support #365

Closed
wants to merge 14 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,9 @@ then
-XX:+AlwaysPreTouch \
-Xss1m \
-Xloggc:$KERNEL_HOME/serviceability/`date +%F_%H%M-%S`-gc.log \
-XX:+UseConcMarkSweepGC \
-XX:CMSInitiatingOccupancyFraction=75 \
-XX:+UseCMSInitiatingOccupancyOnly \
-XX:+PrintGCDetails \
-XX:+PrintGCDateStamps \
-XX:+PrintGCApplicationStoppedTime \
Expand Down
41 changes: 41 additions & 0 deletions releng/docker/examples/snow-owl-cluster-example/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
version: '3.7'
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:6.5.0
container_name: elasticsearch
environment:
ES_JAVA_OPTS: "-Xms6g -Xmx6g"
volumes:
- esdata:/usr/share/elasticsearch/data
networks:
elastic:
aliases:
- es
healthcheck:
test: ["CMD", "curl", "-f", "http:https://es:9200"]
interval: 1s
timeout: 1s
retries: 60
ports:
- 9200:9200
- 9300:9300


snowowl:
image: b2ihealthcare/snow-owl:7.0.0
container_name: snowowl
environment:
SO_JAVA_OPTS: "-Xms2g -Xmx2g"
ES_CLUSTER_URL: "http:https://es:9200"
depends_on:
- elasticsearch
networks:
- elastic
ports:
- 8080:8080

networks:
elastic:

volumes:
esdata:
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: '3.7'
services:
snowowl:
image: b2ihealthcare/snow-owl:7.0.0
environment:
SO_JAVA_OPTS: "-Xms2g -Xmx2g"
container_name: snowowl
networks:
- snowowl
ports:
- 8080:8080

networks:
snowowl:
45 changes: 45 additions & 0 deletions releng/docker/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<project xmlns="http:https://maven.apache.org/POM/4.0.0"
xmlns:xsi="http:https://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http:https://maven.apache.org/POM/4.0.0 http:https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<artifactId>docker</artifactId>
<packaging>pom</packaging>

<parent>
<groupId>com.b2international.snowowl</groupId>
<artifactId>releng-parent</artifactId>
<version>7.1.0-SNAPSHOT</version>
</parent>

<properties>
<dockerfile.maven.version>1.4.10</dockerfile.maven.version>
</properties>

<build>
<plugins>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>dockerfile-maven-plugin</artifactId>
<version>${dockerfile.maven.version}</version>
<executions>
<execution>
<id>default</id>
<goals>
<goal>build</goal>
<!-- <goal>push</goal> -->
</goals>
</execution>
</executions>
<configuration>
<repository>b2ihealthcare/snow-owl</repository>
<tag>${project.version}</tag>
<buildArgs>
<SNOWOWL_VERSION>7.0.0</SNOWOWL_VERSION>
</buildArgs>
</configuration>
</plugin>
</plugins>
</build>

</project>
41 changes: 41 additions & 0 deletions releng/docker/src/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
FROM centos:7
LABEL maintainer="B2i Healthcare <http:https://b2i.sg/>"

ARG SNOWOWL_VERSION

# Install java 1.8 as a pre requirement
RUN yum -y update -q -e 0 && yum clean all
RUN yum install -y \
java-1.8.0-openjdk \
java-1.8.0-openjdk-devel -q -e 0

# Set JAVA_HOME environment variable
ENV JAVA_HOME /etc/alternatives/jre

# Install wget
RUN yum -y install wget -q -e 0
# Download 7.0.0 Snow Owl rpm package
RUN wget https://github.com/b2ihealthcare/snow-owl/releases/download/v${SNOWOWL_VERSION}/snow-owl-oss-${SNOWOWL_VERSION}.rpm -q

# Install Snow Owl rpm package
RUN rpm --install snow-owl-oss-${SNOWOWL_VERSION}.rpm

RUN rm -f snow-owl-oss-${SNOWOWL_VERSION}.rpm

# Openshift overrides USER and uses ones with randomly uid>1024 and gid=0
RUN chgrp 0 /usr/share/snowowl/bin/startup.sh && \
chmod g=u /etc/passwd && \
chmod 0775 /usr/share/snowowl/bin/startup.sh

# Overwrite config file after installation
COPY /config/snowowl.yml /etc/snowowl/snowowl.yml

# Set environment variable for Snow Owl data folder
ENV SO_PATH_DATA /var/lib/snowowl:$SO_PATH_DATA

# Expose necessary ports used by Snow OWl
EXPOSE 2036 8080

USER snowowl

ENTRYPOINT ["/usr/share/snowowl/bin/startup.sh"]
41 changes: 41 additions & 0 deletions releng/docker/src/config/snowowl.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#
# Copyright 2011-2019 B2i Healthcare Pte Ltd, http:https://b2i.sg
#

# necessary to connect one user to the system otherwise Snow Owl startup fails
systemUser: true

identity:
providers:
- file:
name: users
# - ldap:
# uri: <ldap_uri>
# baseDn: dc=snowowl,dc=b2international,dc=com
# rootDn: cn=admin,dc=snowowl,dc=b2international,dc=com
# rootDnPassword: <adminpwd>
# userIdProperty: uid
# usePool: false

# snomed:
# concreteDomainSupport: false
# maxReasonerCount: 1
# ids:
# strategy : EMBEDDED

repository:
host: 0.0.0.0
port: 2036

index:
socketTimeout: 60000
clusterUrl: ${ES_CLUSTER_URL}

# monitoring:
# enabled: true

#reviewManager:
# Minutes to keep reviews in CURRENT state persisted in the index (default 15 minutes)
# keepCurrentMins: 15
# Minutes to keep reviews in others states persisted (default 5 minutes)
# keepOtherMins: 5