Skip to content

Commit

Permalink
Merge pull request #105 from tripal/docs
Browse files Browse the repository at this point in the history
Adds installation instructions to the new docs.
  • Loading branch information
laceysanderson authored Mar 31, 2024
2 parents ad7fe5a + c76403b commit 5702be3
Show file tree
Hide file tree
Showing 6 changed files with 76 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
supervisord*
.phpunit.*
mkdocs/site
*.DS_STORE
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ ARG phpversion='8.3'
ARG pgsqlversion="16"
FROM tripalproject/tripaldocker:drupal${drupalversion}-php${phpversion}-pgsql${pgsqlversion}-noChado

LABEL org.opencontainers.image.source=https://github.com/tripal/tripal_blast
LABEL org.opencontainers.image.description="Provides a demonstration of the Tripal BLAST module installed in the most recent version of Tripal 4"
LABEL org.opencontainers.image.licenses=GPL-3.0-or-later

COPY . /var/www/drupal/web/modules/contrib/tripal_blast

## Install NCBI Blast+.
Expand Down
Binary file added mkdocs/docs/images/TripalLogo_only.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions mkdocs/docs/install/composer-install.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,21 @@
!!! warning "Under Development"

This documentation is still being developed as this module is being upgraded.

This module should be download via composer; however, we don't yet have that setup.

In the meantime, you can install this module in an existing Drupal/Tripal site as follows:

1. Download the current module code to the appropriate place in your site. This can be done by replacing DRUPALROOT with the full path to your drupal site. For example, `/var/www/drupal/web`.
```
cd DRUPALROOT/modules/contrib
git clone https://github.com/tripal/tripal_blast
```
2. Enable the module in your site. This can be done on the command line via Drush or through the UI by going to Administration Toolbar > Extend and selecting the checkbox beside Tripal BLAST before clicking "Install".
```
drush en tripal_blast
```

!!! note "Process once Composer is available"

Once composer install is available, it will be as easy as following the composer instructions on your site to add Tripal BLAST to your composer.json without having composer download it since it is already there.
53 changes: 51 additions & 2 deletions mkdocs/docs/install/docker-demo.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,55 @@

# Trying out Tripal BLAST with Docker

!!! warning "Under Construction"
Tripal BLAST comes with a docker file/image to provide a quick and easy way to checkout the module, as well as, to provide an easy way to contribute fixes/functionality.

This documentation is still being developed as this module is being upgraded.
!!! note "Requirements"

If you don't yet have docker installed on your system there are instructions for installation here in the [Official Docker Documentation](https://docs.docker.com/engine/install/). If you are using MacOS or Windows, I highly recommend Docker Desktop (as a daily Mac user). The links to Docker desktop are in the official install documentation linked previously.

## Tripal BLAST Demo

We have already built the docker image for the Tripal BLAST demo and provided it on GitHub. You can run it locally as follows:

1. Pull the demo image from Github
```
docker pull ghcr.io/tripal/tripal_blast:demo
```
2. Use the run command to create a local container which will house the entire Tripal site and Tripal BLAST demonstration.
```
docker run -tid --name=TripalBLASTDemo --publish=80:80 ghcr.io/tripal/tripal_blast:demo
docker exec TripalBLASTDemo service postgresql restart
```
3. Go to http://localhost in your browser of choice and login in using the [Administrative username and password for the Tripal Docker](https://tripaldoc.readthedocs.io/en/latest/install/docker.html#development-site-information).

You now have a fully functional Tripal site with Tripal BLAST and NCBI Blast+ command-line utilities installed.

## Using Docker to Contribute

We would Love to collaborate with you! To use docker to spin up a development environment for Tripal BLAST we recommend building the demonstration image locally and then running a container that mounts your current git clone of our repository inside the container. This allows you to make code changes to the local git clone and see them immediately reflected within the image for testing purposes!

1. Using Github, make a fork of our repository by going to the following URL while logged into github: https://github.com/tripal/tripal_blast/fork or by clicking on "Fork" on our repository.
2. Clone your fork locally. We will use the main repository URL below but **you should substitute the URL of your fork here**.
```
mkdir ~/Dockers
cd ~/Dockers
git clone https://github.com/tripal/tripal_blast
cd tripal_blast
```
3. Create a branch for your contributions. When you eventually make a PR, you can commit to this branch to update the PR based on suggestions. This is why we recommend you not use the main branch of your repository. You can name the branch whatever you want (we used `my-feature-or-fix` in the below example).
```
git checkout -b my-feature-or-fix
```
4. Build the docker demonstration image.
```
docker build --tag=tripalBlast:local ./
```
5. Create a container from the previous image in your current directory. The `--volume` part of this command will mount your current directory to the appropriate place inside the container.
```
docker run --publish=80:80 -tid --name=tripalBlast --volume=`pwd`:/var/www/drupal/web/modules/contrib/tripal_blast tripalBlast:local
docker exec tripalBlast service postgresql restart
```

Now you can interact with the Tripal site in your browser in all the same ways you would a regular Tripal site by going to https://localhost and logging in using the [Administrative username and password for the Tripal Docker](https://tripaldoc.readthedocs.io/en/latest/install/docker.html#development-site-information).

You can also edit the files in your local git clone directly with the editor of your choice (e.g. VSCode or vim) and see the changes reflected immediately in the site.
2 changes: 2 additions & 0 deletions mkdocs/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ markdown_extensions:

theme:
name: material
logo: images/TripalLogo_only.png
favicon: images/TripalLogo_only.png
palette:
- media: "(prefers-color-scheme: light)"
scheme: default
Expand Down

0 comments on commit 5702be3

Please sign in to comment.