Skip to content
Merged
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
5 changes: 5 additions & 0 deletions src/Docker/alaska/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
# UBUNTU VERSION: 16.04 (xenial)
FROM ubuntu:xenial

# Timezone
ARG TIMEZONE=America/Los_Angeles
RUN ln -snf /usr/share/zoneinfo/$TIMEZONE /etc/localtime && \
echo $TIMEZONE > /etc/timezone

# default to 4.5.1
ARG MINICONDA_VER=4.5.1
ARG MINICONDA3_URL=https://repo.continuum.io/miniconda/Miniconda3-$MINICONDA_VER-Linux-x86_64.sh
Expand Down
2 changes: 2 additions & 0 deletions src/Docker/alaska/build_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ source scripts/set_env_variables.sh

# build alaska image
docker build -t $DOCKER_ALASKA_TAG \
--build-arg TIMEZONE=$TIMEZONE \
--build-arg MINICONDA_VER="$MINICONDA_VER" \
--build-arg MINICONDA3_URL="$MINICONDA3_URL" \
--force-rm \
--no-cache \
Docker/alaska/

Expand Down
5 changes: 5 additions & 0 deletions src/Docker/cgi/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
# UBUNTU VERSION: 16.04 (xenial)
FROM ubuntu:xenial

# Timezone
ARG TIMEZONE=America/Los_Angeles
RUN ln -snf /usr/share/zoneinfo/$TIMEZONE /etc/localtime && \
echo $TIMEZONE > /etc/timezone

##### DEPENDECIES #####
RUN apt-get update && apt-get install -y \
lsb-release \
Expand Down
2 changes: 2 additions & 0 deletions src/Docker/cgi/build_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ source scripts/set_env_variables.sh

# build cgi image
docker build -t $DOCKER_CGI_TAG \
--build-arg TIMEZONE=$TIMEZONE \
--force-rm \
--no-cache \
Docker/cgi/

Expand Down
9 changes: 0 additions & 9 deletions src/Docker/ftp/Dockerfile

This file was deleted.

7 changes: 3 additions & 4 deletions src/Docker/ftp/build_container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@ source scripts/set_env_variables.sh

# create ftp container
docker create -it --name="$DOCKER_FTP_TAG" \
-v $DOCKER_TIME_MOUNT \
-v $DOCKER_DATA_MOUNT \
-v $DOCKER_FTP_MOUNT \
-p $DOCKER_FTP_PORT \
-p $DOCKER_FTP_PORTS \
-e "$DOCKER_FTP_ENV1" \
-e "$DOCKER_FTP_ENV2" \
-e "$DOCKER_FTP_ENV3" \
-e "$DOCKER_FTP_HOST" \
-e "$DOCKER_FTP_FLAGS" \
-e "TZ=$TIMEZONE" \
--restart unless-stopped \
$DOCKER_FTP_BASE

Expand Down
11 changes: 0 additions & 11 deletions src/Docker/ftp/build_image.sh

This file was deleted.

5 changes: 5 additions & 0 deletions src/Docker/kallisto/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
# UBUNTU VERSION: 16.04 (xenial)
FROM ubuntu:xenial

# Timezone
ARG TIMEZONE=America/Los_Angeles
RUN ln -snf /usr/share/zoneinfo/$TIMEZONE /etc/localtime && \
echo $TIMEZONE > /etc/timezone

# versions
ARG MINICONDA_VER=4.5.1
ARG MINICONDA3_URL=https://repo.continuum.io/miniconda/Miniconda3-$MINICONDA_VER-Linux-x86_64.sh
Expand Down
2 changes: 2 additions & 0 deletions src/Docker/kallisto/build_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ source scripts/set_env_variables.sh

# build kallisto image
docker build -t $DOCKER_KALLISTO_TAG \
--build-arg TIMEZONE="$TIMEZONE" \
--build-arg MINICONDA_VER="$MINICONDA_VER" \
--build-arg MINICONDA3_URL="$MINICONDA3_URL" \
--build-arg KALLISTO_VER="$KALLISTO_VER" \
--build-arg KALLISTO_URL="$KALLISTO_URL" \
--force-rm \
--no-cache \
Docker/kallisto/

Expand Down
5 changes: 5 additions & 0 deletions src/Docker/qc/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
# UBUNTU VERSION: 16.04 (xenial)
FROM ubuntu:xenial

# Timezone
ARG TIMEZONE=America/Los_Angeles
RUN ln -snf /usr/share/zoneinfo/$TIMEZONE /etc/localtime && \
echo $TIMEZONE > /etc/timezone

# versions
# Note: rseqc requires python2
ARG MINICONDA_VER=4.5.1
Expand Down
2 changes: 2 additions & 0 deletions src/Docker/qc/build_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ source scripts/set_env_variables.sh

# build qc image
docker build -t $DOCKER_QC_TAG \
--build-arg TIMEZONE="$TIMEZONE" \
--build-arg MINICONDA_VER="$MINICONDA_VER" \
--build-arg MINICONDA2_URL="$MINICONDA2_URL" \
--build-arg BOWTIE2_VER="$BOWTIE2_VER" \
Expand All @@ -14,6 +15,7 @@ docker build -t $DOCKER_QC_TAG \
--build-arg SAMBAMBA_VER="$SAMBAMBA_VER" \
--build-arg KALLISTO_VER="$KALLISTO_VER" \
--build-arg KALLISTO_URL="$KALLISTO_URL" \
--force-rm \
--no-cache \
Docker/qc/

Expand Down
5 changes: 5 additions & 0 deletions src/Docker/request/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
# UBUNTU VERSION: 16.04 (xenial)
FROM ubuntu:xenial

# Timezone
ARG TIMEZONE=America/Los_Angeles
RUN ln -snf /usr/share/zoneinfo/$TIMEZONE /etc/localtime && \
echo $TIMEZONE > /etc/timezone

# default to 4.5.1
ARG MINICONDA_VER=4.5.1
ARG MINICONDA3_URL=https://repo.continuum.io/miniconda/Miniconda3-$MINICONDA_VER-Linux-x86_64.sh
Expand Down
2 changes: 2 additions & 0 deletions src/Docker/request/build_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ source scripts/set_env_variables.sh

# build request image
docker build -t $DOCKER_REQUEST_TAG \
--build-arg TIMEZONE="$TIMEZONE" \
--build-arg MINICONDA_VER="$MINICONDA_VER" \
--build-arg MINICONDA3_URL="$MINICONDA3_URL" \
--no-cache \
--force-rm \
Docker/request/

# exit with return value of the above command
Expand Down
5 changes: 5 additions & 0 deletions src/Docker/sleuth/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
# UBUNTU VERSION: 16.04 (xenial)
FROM ubuntu:xenial

# Timezone
ARG TIMEZONE=America/Los_Angeles
RUN ln -snf /usr/share/zoneinfo/$TIMEZONE /etc/localtime && \
echo $TIMEZONE > /etc/timezone

# default to 4.5.1
ARG MINICONDA_VER=4.5.1
ARG MINICONDA3_URL=https://repo.continuum.io/miniconda/Miniconda3-$MINICONDA_VER-Linux-x86_64.sh
Expand Down
2 changes: 2 additions & 0 deletions src/Docker/sleuth/build_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ source scripts/set_env_variables.sh

# build request image
docker build -t $DOCKER_SLEUTH_TAG \
--build-arg TIMEZONE="$TIMEZONE" \
--build-arg MINICONDA_VER="$MINICONDA_VER" \
--build-arg MINICONDA3_URL="$MINICONDA3_URL" \
--build-arg SLEUTH_VER="$SLEUTH_VER" \
--no-cache \
--force-rm \
Docker/sleuth/

# exit with return value of the above command
Expand Down
23 changes: 23 additions & 0 deletions src/Setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,29 @@ then
esac
fi

# Then, check if the ftp container is already running.
if [[ $(docker inspect -f '{{.State.Running}}' $DOCKER_FTP_TAG) == "true" ]]
then
printf "%s\n" "$DOCKER_FTP_TAG is currently running."
printf "%s\n" "The container must be stopped before rebuilding any images."
printf "%s\n" "Would you like to proceed? (Y/N)"
read -p ">" choice
case "$choice" in
Y|y ) docker stop $DOCKER_FTP_TAG;;
* ) exit 0;;
esac
fi

# remove old containers
docker container rm --force $DOCKER_ALASKA_TAG
docker container rm --force $DOCKER_CGI_TAG
docker container rm --force $DOCKER_FTP_TAG

# make data volumes
docker volume create --name $DOCKER_SCRIPT_VOLUME
docker volume create --name $DOCKER_DATA_VOLUME
docker volume create --name $DOCKER_CGI_VOLUME
docker volume create --name $DOCKER_FTP_VOLUME

# build alaska image
Docker/alaska/build_image.sh
Expand Down Expand Up @@ -109,3 +124,11 @@ if [ $exit_code -ne 0 ]; then
printf "%s\n" "Failed to build $DOCKER_CGI_TAG container."
exit $exit_code
fi

# ftp container
Docker/ftp/build_container.sh
exit_code=$?
if [ $exit_code -ne 0 ]; then
printf "%s\n" "Failed to build $DOCKER_FTP_TAG container."
exit $exit_code
fi
13 changes: 7 additions & 6 deletions src/scripts/set_env_variables.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
# These include: Update.sh, Setup.sh, and Start.sh
# This script is to be called with the 'source' prefix.

# Timezone for all containers.
TIMEZONE="America/Los_Angeles"

####### DEFINE VARIABLES #######
# Docker tags.
DOCKER_SCRIPT_VOLUME="alaska_script_volume"
Expand All @@ -24,21 +27,19 @@ DOCKER_SOCKET_MOUNT="/var/run/docker.sock:/var/run/docker.sock"
DOCKER_SCRIPT_MOUNT="$DOCKER_SCRIPT_VOLUME:/alaska/scripts"
DOCKER_DATA_MOUNT="$DOCKER_DATA_VOLUME:/alaska/root"
DOCKER_CGI_MOUNT="$DOCKER_CGI_VOLUME:/usr/lib/cgi-bin/alaska"
# DOCKER_FTP_MOUNT="$DOCKER_FTP_VOLUME:/etc/pure-ftpd"
DOCKER_FTP_MOUNT="ftppswd:/etc/pure-ftpd"
DOCKER_FTP_MOUNT="$DOCKER_FTP_VOLUME:/etc/pure-ftpd"
# DOCKER_FTP_MOUNT="ftppswd:/etc/pure-ftpd"

# Port mappings & networking.
DOCKER_CGI_PORT="80:80"
DOCKER_FTP_PORT="21:21"
DOCKER_FTP_PORTS="30000-30009:30000-30009"
DOCKER_FTP_ENV1="PUBLICHOST=bagua.caltech.edu"
DOCKER_FTP_ENV2="ADDED_FLAGS=-d -d"
DOCKER_FTP_ENV3="ADDED_FLAGS=-O w3c:/var/log/pure-ftpd/transfer.log"
DOCKER_FTP_HOST="PUBLICHOST=alaska.caltech.edu"
DOCKER_FTP_FLAGS="ADDED_FLAGS=-d -d -O w3c:/var/log/pure-ftpd/transfer.log -c 25 -C 10"

# Declare array varables for required images, containers, volumes, and networks
declare -a images=(
"$DOCKER_ALASKA_TAG"
"$DOCKER_FTP_TAG"
"$DOCKER_REQUEST_TAG"
"$DOCKER_QC_TAG"
"$DOCKER_KALLISTO_TAG"
Expand Down