From 4c1a5f17ee343f9fd3f42780d8a85e399efae51b Mon Sep 17 00:00:00 2001 From: Ivan Subotic <400790+subotic@users.noreply.github.com> Date: Wed, 1 Dec 2021 12:27:29 +0100 Subject: [PATCH] build: fix issues with fuseki (DEV-277) (#1953) --- Makefile | 28 +++++++--------------------- README.md | 15 --------------- docker-compose.yml | 4 ++-- 3 files changed, 9 insertions(+), 38 deletions(-) diff --git a/Makefile b/Makefile index 1ba5d7e7e0..a48e2a4e02 100644 --- a/Makefile +++ b/Makefile @@ -93,19 +93,7 @@ print-env-file: ## prints the env file used by knora-stack .PHONY: env-file env-file: ## write the env file used by knora-stack. -ifeq ($(KNORA_DB_HOME), unknown) - @echo KNORA_DB_HOME_DIR=db-home > .env -else - $(info Using $(KNORA_DB_HOME) for the DB home directory.) - @echo KNORA_DB_HOME_DIR=$(KNORA_DB_HOME) > .env -endif -ifeq ($(KNORA_DB_IMPORT), unknown) - @echo KNORA_DB_IMPORT_DIR=db-import >> .env -else - $(info Using $(KNORA_DB_IMPORT) for the DB import directory.) - @echo KNORA_DB_IMPORT_DIR=$(KNORA_DB_IMPORT) >> .env -endif - @echo DOCKERHOST=$(DOCKERHOST) >> .env + @echo DOCKERHOST=$(DOCKERHOST) > .env @echo KNORA_DB_REPOSITORY_NAME=$(KNORA_DB_REPOSITORY_NAME) >> .env @echo LOCAL_HOME=$(CURRENT_DIR) >> .env @@ -204,7 +192,7 @@ stack-without-api-and-sipi: stack-up ## starts the knora-stack without knora-api @docker-compose -f docker-compose.yml stop sipi .PHONY: stack-db-only -stack-db-only: docker-build-knora-jena-fuseki-image env-file ## starts only fuseki. +stack-db-only: env-file docker-build-knora-jena-fuseki-image ## starts only fuseki. docker-compose -f docker-compose.yml up -d db $(CURRENT_DIR)/webapi/scripts/wait-for-db.sh @@ -268,27 +256,27 @@ test: docker-build ## runs all test targets. ################################# .PHONY: init-db-test -init-db-test: stack-down-delete-volumes stack-db-only ## initializes the knora-test repository +init-db-test: env-file stack-down-delete-volumes stack-db-only ## initializes the knora-test repository @echo $@ @$(MAKE) -C webapi/scripts fuseki-init-knora-test .PHONY: init-db-test-minimal -init-db-test-minimal: stack-down-delete-volumes stack-db-only ## initializes the knora-test repository with minimal data +init-db-test-minimal: env-file stack-down-delete-volumes stack-db-only ## initializes the knora-test repository with minimal data @echo $@ @$(MAKE) -C webapi/scripts fuseki-init-knora-test-minimal .PHONY: init-db-test-empty -init-db-test-empty: stack-down-delete-volumes stack-db-only ## initializes the knora-test repository with minimal data +init-db-test-empty: env-file stack-down-delete-volumes stack-db-only ## initializes the knora-test repository with minimal data @echo $@ @$(MAKE) -C webapi/scripts fuseki-init-knora-test-empty .PHONY: init-db-test-unit -init-db-test-unit: stack-down-delete-volumes stack-db-only ## initializes the knora-test-unit repository +init-db-test-unit: env-file stack-down-delete-volumes stack-db-only ## initializes the knora-test-unit repository @echo $@ @$(MAKE) -C webapi/scripts fuseki-init-knora-test-unit .PHONY: init-db-test-unit-minimal -init-db-test-unit-minimal: stack-down-delete-volumes stack-db-only ## initializes the knora-test-unit repository with minimal data +init-db-test-unit-minimal: env-file stack-down-delete-volumes stack-db-only ## initializes the knora-test-unit repository with minimal data @echo $@ @$(MAKE) -C webapi/scripts fuseki-init-knora-test-unit-minimal @@ -370,8 +358,6 @@ clean: docs-clean clean-local-tmp clean-docker ## clean build artifacts info: ## print out all variables @echo "BUILD_TAG: \t\t $(BUILD_TAG)" @echo "GIT_EMAIL: \t\t $(GIT_EMAIL)" - @echo "KNORA_DB_IMPORT: \t $(KNORA_DB_IMPORT)" - @echo "KNORA_DB_HOME: \t\t $(KNORA_DB_HOME)" .PHONY: help help: ## this help diff --git a/README.md b/README.md index 6a082b24b9..659dfcca75 100644 --- a/README.md +++ b/README.md @@ -121,21 +121,6 @@ Run : make test ``` -### Running with Custom Folders - -The `$ make stack-up` target can be additionally configured thorough the -following environment variables: - -* `KNORA_DB_HOME`: sets the path to the folder where the triplestore will store -the database files -* `KNORA_DB_IMPORT`: sets the path to the import directory accessible from -inside the docker image - -If the import and/or data directory are not set, then Docker volumes will be -used instead. Be aware on macOS, that setting the `KNORA_DB_HOME` has a -significant negative impact on performance, because of how synchronization with -the VM, in which docker is running, is implemented. - ## How to Contribute You can help by testing Knora with your data, making bug reports, improving the diff --git a/docker-compose.yml b/docker-compose.yml index ab98ff17d7..b1e86ebc21 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,8 +7,8 @@ services: ports: - "3030:3030" volumes: - - ${KNORA_DB_HOME_DIR}:/fuseki:delegated - - ${KNORA_DB_IMPORT_DIR}:/staging:delegated + - db-home:/fuseki:delegated + - db-import:/staging:delegated networks: - knora-net environment: