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

build: add db migration service #48

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
11 changes: 7 additions & 4 deletions coprocessor/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,13 @@ else ifeq ($(CENTRALIZED_KMS),true)
else
@echo "CENTRALIZED_KMS is set to an unrecognized value: $(CENTRALIZED_KMS)"
endif
cp -v network-fhe-keys/* $(COPROCESSOR_PATH)/fhevm-engine/fhevm-keys
cd $(COPROCESSOR_PATH)/fhevm-engine/coprocessor && make init


@COMPOSE_PROJECT_NAME=zama-kms-gateway docker compose -vvv -f docker-compose/docker-compose-db-migration.yml up -d --wait || true
@if [ "$$(docker inspect -f '{{.State.ExitCode}}' migration)" -eq 0 ]; then \
echo "Container exited with code 0, proceeding..."; \
else \
echo "Container did not exit successfully, failing..."; \
exit 1; \
fi

run-coprocessor: $(WORKDIR)/ check-coprocessor check-all-test-repo
cd $(COPROCESSOR_PATH)/fhevm-engine/coprocessor && make cleanup
Expand Down
14 changes: 14 additions & 0 deletions coprocessor/docker-compose/docker-compose-db-migration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
services:
migration:
container_name: migration
image: ghcr.io/zama-ai/fhevm-db-migration:v1
environment:
DATABASE_URL: postgresql://postgres:postgres@zama-kms-gateway-db-1:5432/coprocessor
volumes:
- ../network-fhe-keys/:/fhevm-keys/
networks:
- zama-kms-gateway_default

networks:
zama-kms-gateway_default:
external: true