Coder Social home page Coder Social logo

statonlab / tripaldock Goto Github PK

View Code? Open in Web Editor NEW
1.0 4.0 0.0 3.55 MB

Build a simple development environment for Tripal with Docker

License: GNU General Public License v3.0

Shell 0.04% PHP 0.29% PLpgSQL 99.65% Dockerfile 0.02%
tripal tripal3 docker docker-compose tripal-developer-tools

tripaldock's Introduction

DOI

Tripaldock is a command line tool that helps with creating and running Tripal sites using docker. This tool is designed for developers and is not suitable for production. It utilizes Docker Compose to build a stack of configured containers to host all required services. Supported services:

  • Web Server (Apache2)
  • PHP (7.1)
  • PostgreSQL (9.6)
  • Elasticsearch (5.6)

Installation

It is preferable to install this tool using composer.

composer global require statonlab/tripaldock:~0.1.1

Updating

You can update tripaldock using your local tripaldock!

./tripaldock self-update

Documentation

Required Software

Creating a new tripal site

Using the new command, you can create a fresh Tripal 3 site. The command will automatically download and install the dependencies as well as prepare Drupal and Tripal.

# Create a new site and call it site_name
tripaldock new site_name

# Navigate the new site
cd site_name

Please note that the parameter site_name is also going to be the name of your database.

Admin Credentials

These are the default credentials that tripaldock uses for the admin user:

  • Username: tripal
  • Password: secret

Site Structure

Once tripaldock is done creating your new site, a new directory (site_name) will be created. The directory contains multiple folders along with docker related files. The folders are:

  • modules: Maps to sites/all/modules/custom and should contain your custom modules. By default, this folder will have tripal in it.
  • themes: Maps to sites/all/themes and should contain your custom themes.
  • libraries: Maps to sites/all/libraries and should contain any Drupal libraries.
  • files: Maps to sites/default/files and should hold any custom files.

Local Tripaldock

Once the installation of the new site is completed, a copy of tripaldock will be placed within the resulting file. This is your site's specific tripaldock. It provides a set of commands to interact directly with the container responsible for this site.

Up and Down

To start up the container:

./tripaldock up

To stop the container:

./tripaldock down

SSH

To access your container and run commands directly within it, you may use the ssh command. This command will take you directly to /var/www/html which is where your Drupal resides. From there, you can run any command such as drush and interact with the database using psql -U tripal.

./tripaldock ssh

Which is equivalent to running:

docker-compose exec app bash

Obtaining Logs

You can use the logs command to obtain apache, php, postgres and elasticsearch logs:

./tripaldock logs # Get all available logs
./tripaldock logs app # Get apache and php logs
./tripaldock logs elasticsearch # Get elasticsearch logs
./tripaldock logs postgres # Get DB logs

Installing Drupal Modules

TripalDock provides a special install command to pull known modules directly from git and use composer to install their library dependencies if available. However, if the module is not one of the listed below, it will use drush to attempt to install the module.

./tripaldock install [MODULE NAME]

Known modules:

  • tripal_elasticsearch: installs the module along with elasticsearch-php library

Running Drush

You can also use tripaldock to run drush without having to access the container:

./tripaldock drush [ARGS]

Connecting to Elasticsearch

The tripal_elasticsearch module will require you to setup the correct hostname and port for your elasticsearch server. To use the elasticsearch that ships with this module, you should do the following:

  • Visit /admin/tripal/extension/tripal_elasticsearch/connection
  • Enter http://elasticsearch in the host field. You can omit the port.
  • Click the submit button.

Remove and Destroy

If you would like to completely remove the container from the system including anonymous volumes, run the rm command.

# You will be prompted to confirm the action
./tripaldock rm

Drupal Security

Drupal 7 is periodically updated with important security patches. You should ensure that you keep your core Drupal software up to date and visit the Drupal release website for more information.

Video Tutorials

Setting Up A Website From Scratch With TripalDock

TripalDock Commands And Site Structure

License

Copyright 2017 University of Tennessee Knoxville (GPL)

tripaldock's People

Contributors

almasaeed2010 avatar bradfordcondon avatar jwest60 avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

tripaldock's Issues

tripaldock new site_name failed

I ran the following commands (the output from all but last one is not included), and got a command not found error.

$ git clone https://github.com/statonlab/tripaldock.git
$ composer global require statonlab/tripaldock:~0.1.1
$ cd tripaldock/
$ ./tripaldock new tripal_dev

Fatal error: Uncaught Error: Class 'Symfony\Component\Console\Command\Command' not found in tripaldock/src/NewCommand.php:12
Stack trace:
#0 tripaldock/src/bootstrap.php(9): require()
#1 tripaldock/tripaldock(19): require('/Users/herndonn...')
#2 {main}
  thrown in tripaldock/src/NewCommand.php on line 12

Drupal site login info

I'm using Tripaldock to test Tripal Galaxy issues that @MingChen0919 was having and I was able to find a username and password but it's not documented how to log into the Tripal site in the README.

running jobs via tripaldock doesnt work?

./tripaldock drush trp-run-jobs --username=tripal --root=/var/www/html

TRIPALDOCK: Running drush trp-run-jobs --username=tripal --root=/var/www/html
2018-02-10 20:19:07
ERROR: Please provide a username (--username argument) for running this job.
Drush command terminated abnormally due to an unrecoverable error.

Basic Install: DB Fails

ERROR:  function create_point(integer, bigint) does not exist
LINE 1: SELECT box (create_point(0, $1), create_point($2,500000000))
                    ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
QUERY:  SELECT box (create_point(0, $1), create_point($2,500000000))
CONTEXT:  SQL function "boxrange" during inlining

We probably need to add SET public_path TO public, chado.

Note we need to add this right after the CREATE statement for CHADO.

Errors running on Ubuntu

Docker compose gives the following errors a bunch of times:

ERROR: Version in "./../docker-compose.yaml" is unsupported. You might be seeing this error because you're using the wrong Compose file version. Either specify a version of "2" (or "2.0") and place your service definitions under the `services` key, or omit the `version` key and place your service definitions at the root of the file to use version 1.
For more on the Compose file format versions, see https://docs.docker.com/compose/compose-file/

change license to GPL3?

is there any reason not to change the license to GPL3? This is the only module in the test suite paper under MIT: it would clean up a reviewer criticism if we change this license.

install error: can only install one symfony/console

undoubtedly a problem with my setup, this is on my desktop instead of laptop

  - statonlab/tripaldock 0.1.1 requires symfony/console ^3.3 -> satisfiable by symfony/console[v3.3.0, v3.3.1, v3.3.10, v3.3.11, v3.3.12, v3.3.13, v3.3.14, v3.3.15, v3.3.16, v3.3.17, v3.3.18, v3.3.2, v3.3.3, v3.3.4, v3.3.5, v3.3.6, v3.3.7, v3.3.8, v3.3.9, v3.4.0, v3.4.1, v3.4.10, v3.4.11, v3.4.12, v3.4.13, v3.4.14, v3.4.15, v3.4.2, v3.4.3, v3.4.4, v3.4.5, v3.4.6, v3.4.7, v3.4.8, v3.4.9].
    - Can only install one of: symfony/console[v3.3.0, v3.2.4].
    - Can only install one of: symfony/console[v3.3.1, v3.2.4].
    - Can only install one of: symfony/console[v3.3.10, v3.2.4].
    - Can only install one of: symfony/console[v3.3.11, v3.2.4].
    - Can only install one of: symfony/console[v3.3.12, v3.2.4].
    - Can only install one of: symfony/console[v3.3.13, v3.2.4].
    - Can only install one of: symfony/console[v3.3.14, v3.2.4].
    - Can only install one of: symfony/console[v3.3.15, v3.2.4].
    - Can only install one of: symfony/console[v3.3.16, v3.2.4].
    - Can only install one of: symfony/console[v3.3.17, v3.2.4].
    - Can only install one of: symfony/console[v3.3.18, v3.2.4].
    - Can only install one of: symfony/console[v3.3.2, v3.2.4].
    - Can only install one of: symfony/console[v3.3.3, v3.2.4].
    - Can only install one of: symfony/console[v3.3.4, v3.2.4].
    - Can only install one of: symfony/console[v3.3.5, v3.2.4].
    - Can only install one of: symfony/console[v3.3.6, v3.2.4].
    - Can only install one of: symfony/console[v3.3.7, v3.2.4].
    - Can only install one of: symfony/console[v3.3.8, v3.2.4].
    - Can only install one of: symfony/console[v3.3.9, v3.2.4].
    - Can only install one of: symfony/console[v3.4.0, v3.2.4].
    - Can only install one of: symfony/console[v3.4.1, v3.2.4].
    - Can only install one of: symfony/console[v3.4.10, v3.2.4].
    - Can only install one of: symfony/console[v3.4.11, v3.2.4].
    - Can only install one of: symfony/console[v3.4.12, v3.2.4].
    - Can only install one of: symfony/console[v3.4.13, v3.2.4].
    - Can only install one of: symfony/console[v3.4.14, v3.2.4].
    - Can only install one of: symfony/console[v3.4.15, v3.2.4].
    - Can only install one of: symfony/console[v3.4.2, v3.2.4].
    - Can only install one of: symfony/console[v3.4.3, v3.2.4].
    - Can only install one of: symfony/console[v3.4.4, v3.2.4].
    - Can only install one of: symfony/console[v3.4.5, v3.2.4].
    - Can only install one of: symfony/console[v3.4.6, v3.2.4].
    - Can only install one of: symfony/console[v3.4.7, v3.2.4].
    - Can only install one of: symfony/console[v3.4.8, v3.2.4].
    - Can only install one of: symfony/console[v3.4.9, v3.2.4].
    - Installation request for symfony/console (locked at v3.2.4) -> satisfiable by symfony/console[v3.2.4].

sites/default/files directory is missing

Perhaps I did something wrong but the sites/default/files directory seems to be missing. When I tried to upload files I couldn't. After I created the directory and set proper permissions all was good.

tripaldock new exiting


Creating docked_elasticsearch_1 ... done
Creating docked_postgres_1      ... done
Creating docked_app_1           ... done
 5/9 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░░]  55%

 TRIPALDOCK: Installing Drupal
You are about to create a /var/www/html/sites/default/settings.php file and DROP all tables in your 'docked' database. Do you want to continue? (y/n): y
Starting Drupal installation. This takes a while. Consider using the [ok]
--notify global option.
Exception: Resolve all issues below to continue the installation. For[error]
help configuring your database server, see the <a
href="http://drupal.org/getting-started/install">installation
handbook</a>, or contact your hosting provider.<p
class="error">Failed to connect to your database server. The server
reports the following message: <em>SQLSTATE[08006] [7] could not
connect to server: Connection refused
	Is the server running on host &quot;postgres&quot; (192.168.32.3)
and accepting
	TCP/IP connections on port 5432?</em>.<ul><li>Is the database server
running?</li><li>Does the database exist, and have you entered the
correct database name?</li><li>Have you entered the correct username
and password?</li><li>Have you entered the correct database
hostname?</li></ul></p> in
/var/www/html/includes/install.core.inc:415
Stack trace:
#0 /var/www/html/includes/install.core.inc(339):
install_run_task(Array, Array)
#1 /var/www/html/includes/install.core.inc(77):
install_run_tasks(Array)
#2 /root/.composer/vendor/drush/drush/includes/drush.inc(723):
install_drupal(Array)
#3 /root/.composer/vendor/drush/drush/includes/drush.inc(709):
drush_call_user_func_array('install_drupal', Array)
#4
/root/.composer/vendor/drush/drush/commands/core/drupal/site_install_7.inc(82):
drush_op('install_drupal', Array)
#5
/root/.composer/vendor/drush/drush/commands/core/site_install.drush.inc(291):
drush_core_site_install_version('standard', Array)
#6 /root/.composer/vendor/drush/drush/includes/command.inc(361):
drush_core_site_install('standard', 'install_configu...')
#7 /root/.composer/vendor/drush/drush/includes/command.inc(212):
_drush_invoke_hooks(Array, Array)
#8 /root/.composer/vendor/drush/drush/includes/command.inc(180):
drush_command('standard', 'install_configu...')
#9
/root/.composer/vendor/drush/drush/lib/Drush/Boot/BaseBoot.php(64):
drush_dispatch(Array)
#10 /root/.composer/vendor/drush/drush/drush.php(70):
Drush\Boot\BaseBoot->bootstrap_and_dispatch()
#11 /root/.composer/vendor/drush/drush/drush.php(11): drush_main()
#12 {main}

In NewCommand.php line 561:

  Exited with code 1


new <name>

Find out if there is a better way to map files

Currently on OSX and Windows, the filesystem is slow due to a docker problem. What if we managed to add the needed folders of the Drupal install in the container but map a custom directory in the modules folder so users can map only a set of modules rather than the entire FS.

Prompt for ports, usernames and passwords

It might be better for the user if we allow the apache port to be customizable and offer an "auto" option that does what the tool is currently doing. And the same goes for db username password and drupal site username password.

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.