diff --git a/coprocessor/Makefile b/coprocessor/Makefile index 0dcec43..7c6a80d 100644 --- a/coprocessor/Makefile +++ b/coprocessor/Makefile @@ -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 diff --git a/coprocessor/docker-compose/docker-compose-db-migration.yml b/coprocessor/docker-compose/docker-compose-db-migration.yml new file mode 100644 index 0000000..d2f2951 --- /dev/null +++ b/coprocessor/docker-compose/docker-compose-db-migration.yml @@ -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 \ No newline at end of file