Skip to content

Commit

Permalink
use alpine
Browse files Browse the repository at this point in the history
  • Loading branch information
xgaia committed Aug 7, 2017
1 parent 0379a16 commit f998c27
Show file tree
Hide file tree
Showing 9 changed files with 56 additions and 490 deletions.
125 changes: 26 additions & 99 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,103 +1,30 @@
FROM ubuntu:latest

MAINTAINER Xavier Garnier "[email protected]"

# Set Virtuoso commit SHA to Virtuoso 7.2.4 release (25/04/2016)
ENV VIRTUOSO_COMMIT 96055f6a70a92c3098a7e786592f4d8ba8aae214

# Prerequisites
RUN apt-get update && apt-get install -y \
#virtuoso
build-essential \
debhelper \
autotools-dev \
autoconf \
automake \
unzip \
wget \
net-tools \
git \
libtool \
flex \
bison \
gperf \
gawk \
m4 \
libssl-dev \
libreadline-dev \
libreadline-dev \
openssl \
python-pip \
#AskOmics
build-essential \
python3 \
python3-pip \
python3-venv \
vim \
ruby \
npm \
nodejs-legacy


## VIRTUOSO ###################################################################

# Get Virtuoso source code from GitHub and checkout specific commit
# Make and install Virtuoso (by default in /usr/local/virtuoso-opensource)
RUN git clone https://github.com/openlink/virtuoso-opensource.git \
&& cd virtuoso-opensource \
&& git checkout ${VIRTUOSO_COMMIT} \
&& ./autogen.sh \
&& CFLAGS="-O2 -m64" && export CFLAGS && ./configure --disable-bpel-vad --enable-conductor-vad --enable-fct-vad --disable-dbpedia-vad --disable-demo-vad --disable-isparql-vad --disable-ods-vad --disable-sparqldemo-vad --disable-syncml-vad --disable-tutorial-vad --with-readline --program-transform-name="s/isql/isql-v/" \
&& make && make install \
&& ln -s /usr/local/virtuoso-opensource/var/lib/virtuoso/ /var/lib/virtuoso \
&& ln -s /var/lib/virtuoso/db /data \
&& cd .. \
&& rm -r /virtuoso-opensource

# Add Virtuoso bin to the PATH
ENV PATH /usr/local/virtuoso-opensource/bin/:$PATH

# Add Virtuoso config
ADD virtuoso/virtuoso.ini /virtuoso.ini

# Add dump_nquads_procedure
ADD virtuoso/dump_nquads_procedure.sql /dump_nquads_procedure.sql

# Add Virtuoso log cleaning script
ADD virtuoso/clean-logs.sh /clean-logs.sh

# Add startup script
ADD virtuoso/virtuoso.sh /virtuoso.sh

# Add dum template
ADD virtuoso/dump.template.nq /dump.template.nq

ENV SPARQL_UPDATE true

## ASKOMICS ###################################################################

# AskOmics github repo
ENV ASKOMICS_URL https://github.com/xgaia/askomics.git
# AskOmics commit
ENV ASKOMICS_COMMIT 2b61cdef966530e2365a9d810c05c8b2662a6999

RUN git clone ${ASKOMICS_URL} /usr/local/askomics/
FROM xgaia/virtuoso
MAINTAINER Xavier Garnier '[email protected]'


# Environment variables
ENV ASKOMICS="https://github.com/xgaia/askomics.git" \
ASKOMICS_DIR="/usr/local/askomics" \
ASKOMICS_COMMIT="9816964e5d226888f6e4fd04e968e1fd9744adfe"

# Copy files
COPY monitor_traffic.sh /monitor_traffic.sh
COPY start.sh /start.sh

# Install prerequisites, clone repository and install
RUN apk add --update bash make gcc g++ zlib-dev libzip-dev bzip2-dev xz-dev git python3 python3-dev nodejs nodejs-npm wget && \
git clone ${ASKOMICS} ${ASKOMICS_DIR} && \
cd ${ASKOMICS_DIR} && \
git checkout ${ASKOMICS_COMMIT} && \
npm install gulp -g && \
npm install --production && \
chmod +x startAskomics.sh && \
rm -rf /usr/local/askomics/venv && \
bash ./startAskomics.sh -b && \
rm -rf /var/cache/apk/* && \
chmod +x /start.sh

WORKDIR /usr/local/askomics/

RUN git checkout ${ASKOMICS_COMMIT}

RUN npm install gulp -g
RUN npm install
RUN chmod +x startAskomics.sh

# Delete the local venv if exist and build the new one
RUN rm -rf /usr/local/askomics/venv && \
./startAskomics.sh -b

ADD monitor_traffic.sh /
ADD start.sh ./
RUN chmod +x start.sh /virtuoso.sh /monitor_traffic.sh

EXPOSE 6543
CMD ["./start.sh"]
CMD ["/start.sh"]
28 changes: 26 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,26 @@
# docker-askomics-virtuoso_-ie
Docker AskOmics + Virtuoso for Galaxy Interactive Environment
# Docker AskOmics + Virtuoso (For Galaxy Interactive Environment)

![Docker Build](https://img.shields.io/docker/pulls/xgaia/docker-askomics-virtuoso-ie.svg)
[![Build Status](https://travis-ci.org/xgaia/docker-askomics-virtuoso-ie.svg?branch=master)](https://travis-ci.org/xgaia/docker-askomics-virtuoso-ie)

AskOmics and Virtuoso dockerized

## Pull from dockerHub

docker pull xgaia/askomics-ie

## Or build

# Clone the repo
git clone https://github.com/xgaia/docker-askomics-virtuoso-ie.git
cd docker-askomics-virtuoso-ie
docker build -t askomics-ie .

## Run

docker run --name myAskOmics \
-p 6543:6543 \
d xgaia/askomics-ie


This image is for the Galaxy Interactive Environment. To use AskOmics alone, please use [this image](https://github.com/askomics/docker-askomics) or [this docker compose](https://github.com/askomics/askomics-docker-compose).
2 changes: 1 addition & 1 deletion monitor_traffic.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
while true; do
sleep 1h # Set to 1h for testing, change to 1m in production mode
sleep 1m
if [ `netstat -t | grep -v CLOSE_WAIT | grep ':6543' | wc -l` -lt 3 ]
then
pkill python3
Expand Down
4 changes: 3 additions & 1 deletion start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@ mkdir -p $ASKOMICS_FILES_DIR/upload
ln -s /import $ASKOMICS_FILES_DIR/upload/$username

# Monitor traffic
chmod +x /monitor_traffic.sh
/monitor_traffic.sh &

# Start Virtuoso
chmod +x /virtuoso.sh
/virtuoso.sh &

# Wait for virtuoso to be up
Expand All @@ -39,4 +41,4 @@ while ! wget -o /dev/null http://localhost:8890/conductor; do
done

# Start AskOmics
./startAskomics.sh -r -d dev
${ASKOMICS_DIR}/startAskomics.sh -r -d dev
4 changes: 0 additions & 4 deletions virtuoso/clean-logs.sh

This file was deleted.

19 changes: 0 additions & 19 deletions virtuoso/dump.template.nq

This file was deleted.

47 changes: 0 additions & 47 deletions virtuoso/dump_nquads_procedure.sql

This file was deleted.

Loading

0 comments on commit f998c27

Please sign in to comment.