Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comprehensive information and commands to improve the VIVO runtime #3904

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
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
56 changes: 50 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@


# VIVO: Connect, Share, Discover

[![Build](https://github.com/vivo-project/VIVO/workflows/Build/badge.svg)](https://github.com/vivo-project/VIVO/actions?query=workflow%3ABuild) [![Deploy](https://github.com/vivo-project/VIVO/workflows/Deploy/badge.svg)](https://github.com/vivo-project/VIVO/actions?query=workflow%3ADeploy) [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.2639714.svg)](https://doi.org/10.5281/zenodo.2639713)
Expand All @@ -23,10 +25,25 @@ https://wiki.lyrasis.org/display/VIVODOC/All+Documentation

When you select the wiki pages for technical documentation for the release you would like to install at https://wiki.lyrasis.org/display/VIVODOC/All+Documentation, please open the Installing VIVO section and follow the instructions.

### Docker
## Docker run

VIVO docker container is available at [vivoweb/vivo](https://hub.docker.com/repository/docker/vivoweb/vivo) with accompanying [vivoweb/vivo-solr](https://hub.docker.com/repository/docker/vivoweb/vivo-solr). These can be used independently or with docker-compose.

### VIVO Build
Before building VIVO, you will also need to clone (and switch to the same branch, if other than main) of [Vitro](https://github.com/vivo-project/Vitro). The Vitro project must be cloned to a sibling directory next to VIVO so that it can be found during the build.
```
cd $WORKSPACE
git clone https://github.com/vivo-project/VIVO.git
git clone https://github.com/vivo-project/Vitro.git
cd $WORKSPACE/VIVO
# edit home/src/main/resources/config/example.runtime.properties
# in line 93
# replace http://localhost:8983/solr/vivocore
# by http://solr:8983/solr/vivocore
vi home/src/main/resources/config/example.runtime.properties
mvn clean package -s installer/example-settings.xml
```

### Docker Compose

Docker Compose environment variables:
Expand All @@ -42,13 +59,11 @@ RESET_CORE=false
- `RESET_HOME`: Convenience to reset VIVO home when starting container. **Caution**, will delete local configuration, content, and configuration model.
- `RESET_CORE`: Convenience to reset VIVO Solr core when starting container. **Caution**, will require complete reindex.

Before building VIVO, you will also need to clone (and switch to the same branch, if other than main) of [Vitro](https://github.com/vivo-project/Vitro). The Vitro project must be cloned to a sibling directory next to VIVO so that it can be found during the build.

Build and start VIVO.
#### Start VIVO.

1. In VIVO (with Vitro cloned alongside it), run:
```
mvn clean package -s installer/example-settings.xml
docker-compose build
docker-compose up
```

Expand All @@ -57,8 +72,37 @@ docker-compose up
To build and run local Docker image.

```
# Create a docker connection network
docker network create vivo-net
# Run solr docker
docker run --net vivo-net --name solr -p 8983:8983 -d vivoweb/vivo-solr:latest
# Start build docker for VIVO
docker build -t vivoweb/vivo:development .
docker run -p 8080:8080 vivoweb/vivo:development
# Run VIVO docker
docker run --net vivo-net --name vivo -p 8080:8080 -d vivoweb/vivo:development
# Logging VIVO
docker logs --follow /vivo
```
### Useful docker commands
#### List containers
```
docker ps -a
```
#### List images
```
docker images -a
```
#### Stop/Start VIVO/SOLR
```
docker stop /vivo
docker stop /solr
docker start /vivo
docker start /solr
```
#### Removing the containers
```
docker rm /vivo
docker rm /solr
```

## Contact us
Expand Down
11 changes: 7 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ services:

solr:
image: vivoweb/vivo-solr:latest
container_name: solr
environment:
- RESET_CORE=${RESET_CORE}
- VERBOSE=${VERBOSE}
ports:
- 8983:8983
networks:
- vivo

- vivo-net
tomcat:
container_name: vivo
hostname: vivo
Expand All @@ -30,7 +31,9 @@ services:
volumes:
- ${LOCAL_VIVO_HOME}:/usr/local/vivo/home
networks:
- vivo
- vivo-net
depends_on:
- solr

networks:
vivo:
vivo-net:
21 changes: 20 additions & 1 deletion start.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

set -e
# set -e

# allow easier debugging with `docker run -e VERBOSE=yes`
if [[ "$VERBOSE" = "yes" ]]; then
Expand Down Expand Up @@ -57,4 +57,23 @@ if [ -f /usr/local/vivo/home/config/example.applicationSetup.n3 ]; then
fi
fi

echo "Waiting for solr"
# Run a few SOLR startup wait tests before starting tomcat
SOLR_STATUS_URL=$(grep '/solr/' /usr/local/vivo/home/config/runtime.properties |\
grep -v '#' | cut -f 2 -d '=' | tr -d ' ' | \
sed 's,vivocore,admin/cores?action=STATUS,g')
x=1
while [ $x -le 10 ] ; do
RESULT=$(curl -s -o /dev/null -I -w '%{http_code}' $SOLR_STATUS_URL)
if [ "$RESULT" -eq '200' ]; then
echo 'solr run'
break
else
echo 'waiting for solr'
sleep 2
x=$(( $x + 1 ))
fi
done
echo "Starting VIVO"
sleep 5
catalina.sh run