Skip to content

Commit

Permalink
changed execution order in startup and added test for data persistence
Browse files Browse the repository at this point in the history
  • Loading branch information
jyotipm29 committed Nov 11, 2024
1 parent 4739bb8 commit 82d23c7
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 12 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/single.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ cd "$WORKING_DIR"
docker build -t quay.io/bgruening/galaxy galaxy/
#container_size_check quay.io/bgruening/galaxy 1500

echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin "$DOCKER_REGISTRY"
docker tag quay.io/bgruening/galaxy jyotipm29/galaxy-stable:latest
docker push jyotipm29/galaxy-stable:latest
docker logout "$DOCKER_REGISTRY"

mkdir local_folder
docker run -d -p 8080:80 -p 8021:21 -p 8022:22 \
--name galaxy \
Expand Down Expand Up @@ -133,6 +138,28 @@ docker_exec install-tools "$SAMPLE_TOOLS"
# Test the Conda installation
docker_exec_run bash -c 'export PATH=$GALAXY_CONFIG_TOOL_DEPENDENCY_DIR/_conda/bin/:$PATH && conda --version && conda install samtools -c bioconda --yes'
# Test if data persistence works
docker stop galaxy
docker rm -f galaxy
cd "$WORKING_DIR"
docker run -d -p 8080:80 \
--name galaxy \
--privileged=true \
-v "$(pwd)/local_folder:/export/" \
-e GALAXY_CONFIG_ALLOW_USER_DATASET_PURGE=True \
-e GALAXY_CONFIG_ALLOW_PATH_PASTE=True \
-e GALAXY_CONFIG_ALLOW_USER_DELETION=True \
-e GALAXY_CONFIG_ENABLE_BETA_WORKFLOW_MODULES=True \
-v /tmp/:/tmp/ \
quay.io/bgruening/galaxy
echo 'Waiting for Galaxy to come up.'
galaxy-wait -g $BIOBLEND_GALAXY_URL --timeout 600
# Test if the tool installed previously is available
curl -v --fail 'http://localhost:8080/api/tools/toolshed.g2.bx.psu.edu/repos/devteam/cut_columns/Cut1/1.0.2'
# analyze image using dive tool
CI=true dive quay.io/bgruening/galaxy
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/single_container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,7 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Build and Test
run: bash .github/workflows/single.sh
env:
DOCKER_REGISTRY: ${{ secrets.docker_registry }}
DOCKER_USERNAME: ${{ secrets.docker_registry_username }}
DOCKER_PASSWORD: ${{ secrets.docker_registry_password }}
24 changes: 12 additions & 12 deletions galaxy/startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -319,15 +319,6 @@ function start_supervisor {
fi
fi

wait_for_postgres

# Make sure the database is automatically updated
if [[ ! -z $GALAXY_AUTO_UPDATE_DB ]]
then
echo "Updating Galaxy database"
sh manage_db.sh -c $GALAXY_CONFIG_FILE upgrade
fi

if [[ ! -z $SUPERVISOR_MANAGE_CRON ]]; then
if [[ $NONUSE != *"cron"* ]]
then
Expand Down Expand Up @@ -496,16 +487,16 @@ if $PRIVILEGED; then
if [[ -z $DOCKER_PARENT ]]; then
#build the docker in docker environment
bash /root/cgroupfs_mount.sh
start_gravity
start_supervisor
start_gravity
supervisorctl start docker
wait_for_docker
else
#inheriting /var/run/docker.sock from parent, assume that you need to
#run docker with sudo to validate
echo "$GALAXY_USER ALL = NOPASSWD : ALL" >> /etc/sudoers
start_gravity
start_supervisor
start_gravity
fi
if [[ ! -z $PULL_IT_IMAGES ]]; then
echo "About to pull IT images. Depending on the size, this may take a while!"
Expand All @@ -523,8 +514,17 @@ if $PRIVILEGED; then
else
echo "Disable Galaxy Interactive Tools. Start with --privileged to enable ITs."
export GALAXY_CONFIG_INTERACTIVETOOLS_ENABLE=False
start_gravity
start_supervisor
start_gravity
fi

wait_for_postgres

# Make sure the database is automatically updated
if [[ ! -z $GALAXY_AUTO_UPDATE_DB ]]
then
echo "Updating Galaxy database"
sh manage_db.sh -c $GALAXY_CONFIG_FILE upgrade
fi

# In case the user wants the default admin to be created, do so.
Expand Down

0 comments on commit 82d23c7

Please sign in to comment.