Skip to content
Permalink
Browse files
build: fix issues with fuseki (DEV-277) (#1953)
  • Loading branch information
subotic committed Dec 1, 2021
1 parent 394c6f4 commit 4c1a5f17ee343f9fd3f42780d8a85e399efae51b
Showing with 9 additions and 38 deletions.
  1. +7 −21 Makefile
  2. +0 −15 README.md
  3. +2 −2 docker-compose.yml
@@ -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
@@ -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
@@ -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:

0 comments on commit 4c1a5f1

Please sign in to comment.