Skip to content

Commit

Permalink
upgrade to askomics 19.01.3
Browse files Browse the repository at this point in the history
  • Loading branch information
xgaia committed Aug 27, 2019
1 parent ee90b65 commit fec42aa
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 67 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ services:
- docker
install:
- docker build -t askomics-ie .
- docker run -d -p 6543:6543 askomics-ie
- docker run -d -p 6543:6543 -p 8890:8890 -e ASKO_files_dir='/tmp/askomics-ie' -e ASKO_database_path='/tmp/askomics-ie/database.db' -e ASKO_load_url='http://localhost:6543' -e SPARQL_UPDATE='true' -e GALAXY_USER_NAME='jdoe' -e GALAXY_USER_EMAIL='[email protected]' -e ASKOMICS_API_KEY='jdoe' askomics_ie:19.01.3
before_script:
- sleep 1m
script:
Expand Down
17 changes: 8 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
FROM askomics/virtuoso
FROM askomics/virtuoso:7.2.5.1
MAINTAINER Xavier Garnier '[email protected]'


# Environment variables
ENV ASKOMICS="https://github.com/askomics/askomics.git" \
ENV ASKOMICS_GIT_URL="https://github.com/askomics/askomics.git" \
ASKOMICS_DIR="/usr/local/askomics" \
ASKOMICS_VERSION="17.12" \
ASKOMICS_GIT_VERSION="19.01.3" \
SPARQL_UPDATE=true

# Copy files
COPY monitor_traffic.sh /monitor_traffic.sh
COPY start.sh /start.sh
COPY dump.template.nq /dump.template.nq

# 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} && \
RUN apk update && \
apk del openssl openssl-dev && \
apk add bash make gcc g++ zlib-dev libzip-dev bzip2-dev xz-dev git python3 python3-dev nodejs nodejs-npm wget openldap-dev linux-headers && \
git clone ${ASKOMICS_GIT_URL} ${ASKOMICS_DIR} && \
cd ${ASKOMICS_DIR} && \
git checkout ${ASKOMICS_VERSION} && \
npm install gulp -g && \
git checkout ${ASKOMICS_GIT_VERSION} && \
npm install --production && \
chmod +x startAskomics.sh && \
rm -rf /usr/local/askomics/venv && \
Expand Down
19 changes: 0 additions & 19 deletions dump.template.nq

This file was deleted.

8 changes: 0 additions & 8 deletions monitor_traffic.sh

This file was deleted.

42 changes: 12 additions & 30 deletions start.sh
Original file line number Diff line number Diff line change
@@ -1,42 +1,23 @@
#! /bin/bash

# get user info
username="Galaxy" #FIXME: get the galaxy username
pw_hash="" # no password
salt="" # no salt
# Create the database with the Galaxy user
mkdir -p ${ASKO_files_dir}
sqlite3 ${ASKO_database_path} "CREATE TABLE IF NOT EXISTS users (user_id INTEGER PRIMARY KEY AUTOINCREMENT, username text, email text, password text, salt text, apikey text, admin boolean, blocked boolean);"
sqlite3 ${ASKO_database_path} "INSERT INTO users VALUES (NULL, '${GALAXY_USER_NAME}', '${GALAXY_USER_EMAIL}', '', '', '${ASKOMICS_API_KEY}', 'true', 'false')"

# sed the dump template
cp /dump.template.nq /dump.nq
sed -i "s@__USERNAME__@$username@g" /dump.nq
sed -i "s/__EMAIL__/$USER_EMAIL/g" /dump.nq
sed -i "s@__PASSWORD_HASH__@$pw_hash@g" /dump.nq
sed -i "s@__SALT__@$salt@g" /dump.nq
sqlite3 ${ASKO_database_path} "CREATE TABLE IF NOT EXISTS galaxy_accounts (galaxy_id INTEGER PRIMARY KEY AUTOINCREMENT, user_id INTEGER, url text, apikey text, FOREIGN KEY(user_id) REFERENCES users(user_id));"
sqlite3 ${ASKO_database_path} "INSERT INTO galaxy_accounts VALUES(NULL, 1, '${GALAXY_URL}', '${GALAXY_API_KEY}');"

sed -i "s@__ASKOMICS_KEY_ID__@galaxy_5Dvp@g" /dump.nq
sed -i "s@__ASKOMICS_KEY_NAME__@galaxy@g" /dump.nq
sed -i "s@__ASKOMICS_API_KEY__@$ASKOMICS_API_KEY@g" /dump.nq

sed -i "s@__GALAXY_ID__@$galaxy_id@g" /dump.nq
sed -i "s@__GALAXY_URL__@$GALAXY_URL@g" /dump.nq
sed -i "s@__GALAXY_KEY__@$API_KEY@g" /dump.nq

mkdir /data/toLoad
mv /dump.nq /data/toLoad

# Link galaxy uplaoded datasets into askomics upload dir
mkdir -p $ASKO_files_dir/upload
ln -s /import $ASKO_files_dir/upload/$username

# Monitor traffic
chmod +x /monitor_traffic.sh
/monitor_traffic.sh &
# Link galaxy uploaded datasets into askomics upload dir
mkdir -p ${ASKO_files_dir}/${GALAXY_USER_NAME}
ln -s /import ${ASKO_files_dir}/${GALAXY_USER_NAME}/upload

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

# Wait for virtuoso to be up
while ! wget -o /dev/null http://localhost:8890/conductor; do
while ! wget -O /dev/null http://localhost:8890/conductor; do
sleep 1s
done

Expand All @@ -49,4 +30,5 @@ if [[ $PROXY_PREFIX != "" ]]; then
fi

# Start AskOmics
${ASKOMICS_DIR}/startAskomics.sh -r
cd ${ASKOMICS_DIR}
./startAskomics.sh -r

0 comments on commit fec42aa

Please sign in to comment.