Skip to content

Commit

Permalink
Merge pull request #45 from bento-platform/qa/v2.6
Browse files Browse the repository at this point in the history
v2.6.5-rc1
  • Loading branch information
brouillette committed May 24, 2022
2 parents 12aa110 + 0b75ccf commit 37490c3
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 31 deletions.
40 changes: 25 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ OS_NAME := $(shell uname -s | tr A-Z a-z)
export OS_NAME

#>>>
# provide host-level user id as an
# provide host-level user id as an
# environment variable for containers to use
#<<<
CURRENT_UID := $(shell id -u)
Expand All @@ -47,7 +47,7 @@ export EXECUTED_NOW
init-chord-services:
@echo "-- Initializing CHORD service configuration files --"

@# copy services json to the microservices that need it
@# copy services json to the microservices that need it
@echo "- Providing a complete chord_services.json to lib/[logging, service-registry, wes]"
@envsubst < ${PWD}/etc/templates/chord_services.example.json > $(PWD)/lib/logging/chord_services.json;
@envsubst < ${PWD}/etc/templates/chord_services.example.json > $(PWD)/lib/service-registry/chord_services.json;
Expand All @@ -60,7 +60,7 @@ init-chord-services:
# create non-repo directories
#<<<
.PHONY: init-dirs
init-dirs: data-dirs
init-dirs: data-dirs
@echo "-- Initializing temporary and data directories --"
@echo "- Creating temporary secrets dir"
mkdir -p $(PWD)/tmp/secrets
Expand Down Expand Up @@ -203,7 +203,7 @@ auth-setup:
#<<<
run-all:
$(foreach SERVICE, $(SERVICES), \
$(MAKE) run-$(SERVICE) &)
$(MAKE) run-$(SERVICE) &)

watch -n 2 'docker ps'

Expand All @@ -217,7 +217,7 @@ run-all:
#<<<
run-web-dev: clean-web
docker-compose -f docker-compose.dev.yaml up -d --force-recreate web
run-public-dev:
run-public-dev:
docker-compose -f docker-compose.dev.yaml up -d --force-recreate public

#>>>
Expand Down Expand Up @@ -247,22 +247,22 @@ run-katsu-dev: #clean-katsu
# ...
# see docker-compose.dev.yaml
#<<<
run-federation-dev:
run-federation-dev:
docker-compose -f docker-compose.dev.yaml up -d --force-recreate federation

#>>>
# ...
# see docker-compose.dev.yaml
#<<<
run-wes-dev:
run-wes-dev:
#clean-wes
docker-compose -f docker-compose.dev.yaml up -d --force-recreate wes

#>>>
# ...
# see docker-compose.dev.yaml
#<<<
run-drs-dev:
run-drs-dev:
docker-compose -f docker-compose.dev.yaml up -d --force-recreate drs


Expand All @@ -271,7 +271,7 @@ run-drs-dev:
#<<<
run-%:
@# FreeBSD sed -i expects a suffix parameter for a backup file. Empty string
@# may be provided after a space which is incompatible with GNU sed (no
@# may be provided after a space which is incompatible with GNU sed (no
@# space after -i). The solution here is to create a backup file and remove
@# it along with the working copy using a wildcard.
@if [[ $* == gateway ]]; then \
Expand Down Expand Up @@ -340,8 +340,8 @@ build-common-base:
#<<<
build-all:
$(foreach SERVICE, $(SERVICES), \
$(MAKE) build-$(SERVICE) &)
$(MAKE) build-$(SERVICE) &)

watch -n 2 'docker ps'


Expand All @@ -355,7 +355,7 @@ build-%:
exit 1; \
fi

@mkdir -p tmp/logs/${EXECUTED_NOW}/$*
@mkdir -p tmp/logs/${EXECUTED_NOW}/$*
@echo "-- Building $* --" && \
docker-compose build --no-cache $* &> tmp/logs/${EXECUTED_NOW}/$*/build.log

Expand Down Expand Up @@ -418,10 +418,10 @@ clean-all:
#<<<
clean-%:
@mkdir -p tmp/logs/${EXECUTED_NOW}/$*

@echo "-- Removing bentov2-$* container --" && \
docker rm bentov2-$* --force >> tmp/logs/${EXECUTED_NOW}/$*/clean.log 2>&1

@# Clean public using native makefile
@if [[ $* == public ]]; then \
cd lib/bento_public && $(MAKE) clean-public ; \
Expand Down Expand Up @@ -495,7 +495,7 @@ run-unit-tests:
run-integration-tests:
@echo "-- Running integration tests! --"
@$(PWD)/etc/tests/integration/run_tests.sh 10 firefox False



# -- Utils --
Expand All @@ -520,3 +520,13 @@ clean-dangling-images:
docker rmi $(docker images -f "dangling=true" -q)
clean-exited-containers:
docker rm $(docker ps -a -f status=exited -q)

#>>>
# patch records in DRS database after the change in path from /drs/chord_drs/ to /drs/bento_drs/
# This needs to be done only once, for installations prior v2.6.5
#<<<
patch-drs-db:
sqlite3 ${BENTOV2_DRS_PROD_VOL_DIR}/db/db.sqlite3 \
"UPDATE drs_object SET location = REPLACE(location, 'chord_drs', 'bento_drs')" && \
sqlite3 ${BENTOV2_DRS_DEV_VOL_DIR}/db/db.sqlite3 \
"UPDATE drs_object SET location = REPLACE(location, 'chord_drs', 'bento_drs')"
33 changes: 19 additions & 14 deletions docker-compose.dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ services:
BENTO_WEB_USER: ${CURRENT_UID}
volumes:
- ./lib/web/bento_web:/web/bento_web
# Execute npm build/install and watch, and
# Execute npm build/install and watch, and
# nginx "listener" upon container startup
entrypoint: sh /web/dev_startup.sh
extends:
file: docker-compose.yaml
service: web

public:
extends:
file: ./lib/bento_public/docker-compose.yaml
Expand All @@ -33,7 +33,7 @@ services:

gateway:
# Override network aliases, adding BENTOV2_AUTH_DOMAIN
networks:
networks:
bridge-net:
aliases:
- ${BENTOV2_DOMAIN}
Expand All @@ -47,14 +47,14 @@ services:
build:
context: $PWD/lib/katsu
dockerfile: Dockerfile.dev
networks:
networks:
- bridge-net
depends_on:
- katsu-db
extends:
file: $PWD/lib/katsu/docker-compose.katsu.yaml
service: katsu
volumes:
volumes:
- ./lib/katsu/katsu:/app/katsu
- ${BENTOV2_KATSU_DEV_WES_VOL_TMP_DIR}:/wes/tmp
environment:
Expand All @@ -63,7 +63,7 @@ services:
- "${BENTOV2_KATSU_EXTERNAL_PORT}:${BENTOV2_KATSU_INTERNAL_PORT}"

katsu-db:
networks:
networks:
- bridge-net
extends:
file: $PWD/lib/katsu/docker-compose.katsu.yaml
Expand All @@ -76,14 +76,14 @@ services:
build:
context: $PWD/lib/federation
dockerfile: Dockerfile.dev
environment:
environment:
- CHORD_DEBUG=${BENTOV2_FEDERATION_DEV_DEBUG}
networks:
networks:
- bridge-net
extends:
file: $PWD/lib/federation/docker-compose.federation.yaml
service: federation
volumes:
volumes:
- ./lib/federation/bento_federation_service:/federation/bento_federation_service
ports:
- "5000:5000"
Expand All @@ -94,7 +94,7 @@ services:
build:
context: $PWD/lib/wes
dockerfile: Dockerfile.dev
networks:
networks:
- bridge-net
environment:
- CHORD_DEBUG=true
Expand All @@ -108,22 +108,27 @@ services:
- ${BENTOV2_WES_DEV_DROP_BOX_VOL_DIR}:/data
ports:
- "5000:5000"

drs:
build:
context: $PWD/lib/drs
dockerfile: Dockerfile
networks:
dockerfile: Dockerfile.dev
networks:
- bridge-net
extends:
file: $PWD/lib/drs/docker-compose.drs.yaml
service: drs
ports:
- "${BENTOV2_DRS_EXTERNAL_PORT}:5000"
volumes:
- ./lib/drs/bento_drs:/drs/bento_drs
- ./lib/drs/startup.sh:/drs/bento_drs/chord_drs/startup.sh:ro
# Override main drs data directory
- ${BENTOV2_DRS_DEV_VOL_DIR}:/drs/bento_drs/data
- ${BENTOV2_DRS_DEV_WES_VOL_DIR}:/wes/tmp
networks:
command: >
sh -c /drs/bento_drs/chord_drs/startup.sh
networks:
bridge-net:
external: true
2 changes: 1 addition & 1 deletion lib/drs/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ RUN git fetch && \
RUN ["pip", "install", "-r", "requirements.txt"]

# Run
WORKDIR /drs/bento_drs/bento_drs
WORKDIR /drs/bento_drs/chord_drs

COPY startup.sh ./startup.sh

Expand Down
24 changes: 24 additions & 0 deletions lib/drs/Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
ARG BASE_IMAGE
ARG BASE_IMAGE_VERSION

FROM "${BASE_IMAGE}:${BASE_IMAGE_VERSION}"

# TODO: change USER
USER root

RUN mkdir /drs && \
mkdir /wes;

RUN echo "Building DRS in Development Mode";

RUN mkdir -p /drs/bento_drs/data/obj && \
mkdir -p /drs/bento_drs/data/db;

WORKDIR /drs/bento_drs

# Remove comment if custom requirements are needed
COPY ./bento_drs/requirements.txt ./requirements.txt

RUN ["pip", "install", "-r", "requirements.txt"]

WORKDIR /drs/bento_drs/chord_drs
2 changes: 1 addition & 1 deletion lib/drs/startup.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ cd ../data;
mkdir db;
mkdir obj;

cd ../bento_drs;
cd ../chord_drs;
flask db upgrade;

# call variant endpoint to trigger init
Expand Down

0 comments on commit 37490c3

Please sign in to comment.