GithubHelp home page GithubHelp logo

qisun2 / galaxy-docker-biohpc Goto Github PK

View Code? Open in Web Editor NEW

This project forked from galaxyproject/galaxy-docker-k8s

0.0 0.0 0.0 189 KB

An Ansible playbook for building a Galaxy container for Kubernetes.

License: MIT License

HTML 100.00%

galaxy-docker-biohpc's Introduction

Under Development ...

An Ansible playbook used when creating the minimal docker image for Galaxy.

This playbook uses the ansible-galaxy role, and defines settings suitable for running a minimal build of Galaxy, by default using a local sqlite database. This minimalist image is also used in the Kubernetes distribution of Galaxy. See Galaxy Helm chart for how to set up on Kubernetes. See Docker Galaxy Stable for a fully-fledged, single container installation of Galaxy.

Building a Galaxy docker image

git clone https://github.com/galaxyproject/galaxy.git
docker build -f .k8s_ci.Dockerfile . --tag galaxy/galaxy:latest
docker run -it --rm -p 8080:8080 galaxy/galaxy:latest

Extending the image

Method 1

Build the image with a customized playbook. Your customized playbook can override all settings as required.

git clone https://github.com/galaxyproject/galaxy.git
docker build -f .k8s_ci.Dockerfile --build-arg GALAXY_PLAYBOOK_REPO=https://github.com/myrepo/galaxy-custom . -t galaxy/galaxy:custom

Method 2

Extend the minimal image and add your customizations on top.

FROM galaxy/galaxy:latest

# switch to root
USER root

RUN apt-get -qq update && apt-get install -y --no-install-recommends gridengine-drmaa1.0

# switch back to galaxy
USER galaxy

RUN /galaxy/server/.venv/bin/pip install drmaa

Build and run a container image (full with Postgres database)

The default build above uses an sqlite database, although the image has the necessary postgres drivers installed. In order to start Galaxy with a Postgres database, we need to run a Postgres container in parallel.

  1. It is necessary to link the Galaxy container and the Postgres one. For this, we need to create a dedicated bridge network so the docker build command can link to a running Postgres container. This needs to be done only once on a machine where you're building the image.

    docker network create gnet
    
  2. Now we create a database that Galaxy will use. We need to provide a path on the host machine where the database files will be persisted (e.g., ~/tmp_local/docker/volumes/pg_gxylatest). If you are using a Mac to build the image, do not use the /tmp directory for this, as it is periodically cleaned by the OS, so your data will not be persisted properly. Note that we can reuse the same path/database multiple times. The first time we build the container, the database will be initialized by applying the latest Galaxy migration. Going forward, necessary migrations will be applied automatically. Note that this will change the structure of the database on the host. Finally, the version of the Postgres container should match the version of Postgres used by the Postgres chart specified in the requirements.

    docker run --rm -e POSTGRES_DB=galaxy -e POSTGRES_USER=galaxydbuser \
    -e POSTGRES_PASSWORD=42 --publish-all --network gnet --name gpsql \
    -v </local/path/to/database/dir>:/var/lib/postgresql/data postgres:11.6
    
  3. Now we can build the Galaxy image against the psql image or skip this step if you have already built the image. First update playbook.yml to set galaxy_manage_database to true. If the database username and password were changed in the above step, correspondingly update the database_connection line. In a separate terminal tab, run the following command, changing the tag as desired.

    docker build --no-cache --network gnet --tag galaxy/galaxy-k8s:latest .
    
  4. To test the build, first ensure that the Postgres container is running (refer to step 2 in the previous section). Then run the following:

    docker run -it --rm --network gnet -p 8080:8080 \
    -e GALAXY_CONFIG_OVERRIDE_DATABASE_CONNECTION="postgresql://galaxydbuser:42@gpsql/galaxy" \
    galaxy/galaxy-k8s:latest
    

    Galaxy will now be accessible on port 8080.


galaxy-docker-biohpc's People

Contributors

jdavcs avatar nuwang avatar afgane avatar qisun2 avatar dannon avatar rhpvorderman avatar jmchilton avatar vjalili avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.