From ca3c48e0e9da64d57c2c31b932fbeb7322a96726 Mon Sep 17 00:00:00 2001 From: 0xawaz Date: Fri, 22 Nov 2024 15:33:31 +0100 Subject: [PATCH 1/7] build: add fhevm-db-migration image --- fhevm-engine/fhevm-db/Dockerfile | 19 ++++++ fhevm-engine/fhevm-db/initialize_db.sh | 11 ++++ .../migrations/20240722111257_coprocessor.sql | 62 +++++++++++++++++++ ...20241120173212_insert_test_tenant.down.sql | 1 + .../20241120173212_insert_test_tenant.up.sql | 19 ++++++ 5 files changed, 112 insertions(+) create mode 100644 fhevm-engine/fhevm-db/Dockerfile create mode 100644 fhevm-engine/fhevm-db/initialize_db.sh create mode 100644 fhevm-engine/fhevm-db/migrations/20240722111257_coprocessor.sql create mode 100644 fhevm-engine/fhevm-db/migrations/20241120173212_insert_test_tenant.down.sql create mode 100644 fhevm-engine/fhevm-db/migrations/20241120173212_insert_test_tenant.up.sql diff --git a/fhevm-engine/fhevm-db/Dockerfile b/fhevm-engine/fhevm-db/Dockerfile new file mode 100644 index 00000000..a2bc3d97 --- /dev/null +++ b/fhevm-engine/fhevm-db/Dockerfile @@ -0,0 +1,19 @@ +# Use the Rust image as the base +FROM rust:1.74 + +# Install dependencies and tools +RUN apt-get update && \ + apt-get install -y libpq-dev && \ + cargo install sqlx-cli --no-default-features --features postgres --locked && \ + apt-get clean && rm -rf /var/lib/apt/lists/* + +# Copy migrations and initialization script +COPY fhevm-engine/fhevm-db/initialize_db.sh /initialize_db.sh +COPY fhevm-engine/fhevm-db/migrations /migrations +COPY fhevm-engine/fhevm-keys /fhevm-keys + +# Make the script executable +RUN chmod +x /initialize_db.sh + +# Run the initialization script as the entrypoint +ENTRYPOINT ["/bin/bash", "/initialize_db.sh"] \ No newline at end of file diff --git a/fhevm-engine/fhevm-db/initialize_db.sh b/fhevm-engine/fhevm-db/initialize_db.sh new file mode 100644 index 00000000..301f43c1 --- /dev/null +++ b/fhevm-engine/fhevm-db/initialize_db.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +# 1: Create Database +echo "Creating database..." +sqlx database create + +# 2: Run sqlx migrations +echo "Running migrations..." +sqlx migrate run --source /migrations || { echo "Failed to run migrations."; exit 1; } + +echo "Database initialization complete." \ No newline at end of file diff --git a/fhevm-engine/fhevm-db/migrations/20240722111257_coprocessor.sql b/fhevm-engine/fhevm-db/migrations/20240722111257_coprocessor.sql new file mode 100644 index 00000000..25b2b94b --- /dev/null +++ b/fhevm-engine/fhevm-db/migrations/20240722111257_coprocessor.sql @@ -0,0 +1,62 @@ + +CREATE TABLE IF NOT EXISTS computations ( + tenant_id INT NOT NULL, + output_handle BYTEA NOT NULL, + output_type SMALLINT NOT NULL, + -- can be handle or scalar, depends on is_scalar field + -- only second dependency can ever be scalar + dependencies BYTEA[] NOT NULL, + fhe_operation SMALLINT NOT NULL, + created_at TIMESTAMP NOT NULL DEFAULT NOW(), + completed_at TIMESTAMP, + is_scalar BOOLEAN NOT NULL, + is_completed BOOLEAN NOT NULL DEFAULT 'f', + is_error BOOLEAN NOT NULL DEFAULT 'f', + error_message TEXT, + PRIMARY KEY (tenant_id, output_handle) +); + +CREATE TABLE IF NOT EXISTS ciphertexts ( + tenant_id INT NOT NULL, + handle BYTEA NOT NULL, + ciphertext BYTEA NOT NULL, + ciphertext_version SMALLINT NOT NULL, + ciphertext_type SMALLINT NOT NULL, + -- if ciphertext came from blob we have its reference + input_blob_hash BYTEA, + input_blob_index INT NOT NULL DEFAULT 0, + created_at TIMESTAMP DEFAULT NOW(), + PRIMARY KEY (tenant_id, handle, ciphertext_version) +); + +-- store for audits and historical reference +CREATE TABLE IF NOT EXISTS input_blobs ( + tenant_id INT NOT NULL, + blob_hash BYTEA NOT NULL, + blob_data BYTEA NOT NULL, + blob_ciphertext_count INT NOT NULL, + created_at TIMESTAMP DEFAULT NOW(), + PRIMARY KEY (tenant_id, blob_hash) +); + +CREATE TABLE IF NOT EXISTS tenants ( + tenant_id SERIAL PRIMARY KEY, + tenant_api_key UUID NOT NULL DEFAULT gen_random_uuid(), + -- for EIP712 signatures + chain_id INT NOT NULL, + -- for EIP712 signatures + verifying_contract_address TEXT NOT NULL, + acl_contract_address TEXT NOT NULL, + pks_key BYTEA NOT NULL, + sks_key BYTEA NOT NULL, + public_params BYTEA NOT NULL, + -- for debugging, can be null + cks_key BYTEA, + -- admin api key is allowed to create more tenants with their keys + is_admin BOOLEAN DEFAULT 'f' +); + +CREATE INDEX IF NOT EXISTS computations_dependencies_index ON computations USING GIN (dependencies); +CREATE INDEX IF NOT EXISTS computations_completed_index ON computations (is_completed); +CREATE INDEX IF NOT EXISTS computations_errors_index ON computations (is_error); +CREATE UNIQUE INDEX IF NOT EXISTS tenants_by_api_key ON tenants (tenant_api_key); \ No newline at end of file diff --git a/fhevm-engine/fhevm-db/migrations/20241120173212_insert_test_tenant.down.sql b/fhevm-engine/fhevm-db/migrations/20241120173212_insert_test_tenant.down.sql new file mode 100644 index 00000000..0ae3b2a5 --- /dev/null +++ b/fhevm-engine/fhevm-db/migrations/20241120173212_insert_test_tenant.down.sql @@ -0,0 +1 @@ +DELETE FROM tenants WHERE tenant_api_key = 'a1503fb6-d79b-4e9e-826d-44cf262f3e05'; \ No newline at end of file diff --git a/fhevm-engine/fhevm-db/migrations/20241120173212_insert_test_tenant.up.sql b/fhevm-engine/fhevm-db/migrations/20241120173212_insert_test_tenant.up.sql new file mode 100644 index 00000000..9fdef746 --- /dev/null +++ b/fhevm-engine/fhevm-db/migrations/20241120173212_insert_test_tenant.up.sql @@ -0,0 +1,19 @@ +INSERT INTO tenants ( + tenant_api_key, + chain_id, + acl_contract_address, + verifying_contract_address, + pks_key, + sks_key, + public_params, + cks_key +) VALUES ( + 'a1503fb6-d79b-4e9e-826d-44cf262f3e05', + 12345, + '0x339EcE85B9E11a3A3AA557582784a15d7F82AAf2', + '0x69dE3158643e738a0724418b21a35FAA20CBb1c5', + '/fhevm-keys/pks', + '/fhevm-keys/sks', + '/fhevm-keys/pp', + '/fhevm-keys/cks' +) ON CONFLICT DO NOTHING; \ No newline at end of file From 14ae5dfd2c4c32bec7aedd55cdcaed9892180fce Mon Sep 17 00:00:00 2001 From: 0xawaz Date: Fri, 22 Nov 2024 15:39:30 +0100 Subject: [PATCH 2/7] build: add db migration to docker-compose --- fhevm-engine/coprocessor/Makefile | 4 ++ fhevm-engine/coprocessor/docker-compose.yml | 57 ++++++++++++++++----- 2 files changed, 47 insertions(+), 14 deletions(-) diff --git a/fhevm-engine/coprocessor/Makefile b/fhevm-engine/coprocessor/Makefile index 7b1d62fb..004515bc 100644 --- a/fhevm-engine/coprocessor/Makefile +++ b/fhevm-engine/coprocessor/Makefile @@ -17,6 +17,10 @@ init_db: $(DB_URL) sqlx migrate run $(DB_URL) cargo test setup_test_user -- --nocapture --ignored +.PHONY: run +run: + docker compose up -d + .PHONY: recreate_db recreate_db: $(MAKE) cleanup diff --git a/fhevm-engine/coprocessor/docker-compose.yml b/fhevm-engine/coprocessor/docker-compose.yml index ffaed7ac..2067eaea 100644 --- a/fhevm-engine/coprocessor/docker-compose.yml +++ b/fhevm-engine/coprocessor/docker-compose.yml @@ -1,37 +1,66 @@ -version: '3.8' +name: fhevm + services: db: + container_name: db image: postgres:15.7 restart: always environment: - - POSTGRES_USER=postgres - - POSTGRES_PASSWORD=postgres + POSTGRES_USER: postgres + POSTGRES_PASSWORD: postgres ports: - '5432:5432' - volumes: + healthcheck: + test: ["CMD-SHELL", "pg_isready -U postgres"] + interval: 10s + timeout: 5s + retries: 3 + volumes: - db:/var/lib/postgresql/data - coproc: - image: ghcr.io/zama-ai/fhevm-coprocessor:v7 + + migration: + container_name: migration + image: ghcr.io/zama-ai/fhevm-db-migration:v1 + environment: + DATABASE_URL: postgresql://postgres:postgres@db:5432/coprocessor + depends_on: + db: + condition: service_healthy + + coprocessor: + container_name: coprocessor + image: ghcr.io/zama-ai/fhevm-coprocessor:v0.1.0-3 environment: - - DATABASE_URL=postgresql://postgres:postgres@db:5432/coprocessor + DATABASE_URL: postgresql://postgres:postgres@db:5432/coprocessor ports: - '50051:50051' volumes: - - ${PWD}/coprocessor.key:/usr/share/coprocessor.key + - ./coprocessor.key:/usr/share/coprocessor.key command: - --run-bg-worker - --run-server - --server-addr=0.0.0.0:50051 - --coprocessor-private-key=/usr/share/coprocessor.key + depends_on: + migration: + condition: service_completed_successfully + geth: - image: ghcr.io/zama-ai/geth-coprocessor-devnode:v6 + container_name: geth + image: ghcr.io/zama-ai/geth-coprocessor-devnode:v8 environment: - - FHEVM_COPROCESSOR_API_KEY=a1503fb6-d79b-4e9e-826d-44cf262f3e05 - - FHEVM_COPROCESSOR_URL=coproc:50051 - - COPROCESSOR_CONTRACT_ADDRESS=0x6819e3aDc437fAf9D533490eD3a7552493fCE3B1 - - ACL_CONTRACT_ADDRESS=0x339EcE85B9E11a3A3AA557582784a15d7F82AAf2 + FHEVM_COPROCESSOR_API_KEY: a1503fb6-d79b-4e9e-826d-44cf262f3e05 + FHEVM_COPROCESSOR_URL: coprocessor:50051 + COPROCESSOR_CONTRACT_ADDRESS: 0x6819e3aDc437fAf9D533490eD3a7552493fCE3B1 + ACL_CONTRACT_ADDRESS: 0x339EcE85B9E11a3A3AA557582784a15d7F82AAf2 + volumes: + - ./geth:/geth ports: - '8745:8545' + depends_on: + coprocessor: + condition: service_started + volumes: db: - driver: local + driver: local \ No newline at end of file From 3aadd4d4190fd28904ce72a59e1003272d8812cb Mon Sep 17 00:00:00 2001 From: 0xawaz Date: Mon, 25 Nov 2024 12:17:20 +0100 Subject: [PATCH 3/7] fix: insert test tenant binary keys instead of paths --- fhevm-engine/fhevm-db/Dockerfile | 4 +-- fhevm-engine/fhevm-db/initialize_db.sh | 29 +++++++++++++++++++ ...20241120173212_insert_test_tenant.down.sql | 1 - .../20241120173212_insert_test_tenant.up.sql | 19 ------------ 4 files changed, 31 insertions(+), 22 deletions(-) delete mode 100644 fhevm-engine/fhevm-db/migrations/20241120173212_insert_test_tenant.down.sql delete mode 100644 fhevm-engine/fhevm-db/migrations/20241120173212_insert_test_tenant.up.sql diff --git a/fhevm-engine/fhevm-db/Dockerfile b/fhevm-engine/fhevm-db/Dockerfile index a2bc3d97..6d60f280 100644 --- a/fhevm-engine/fhevm-db/Dockerfile +++ b/fhevm-engine/fhevm-db/Dockerfile @@ -3,7 +3,7 @@ FROM rust:1.74 # Install dependencies and tools RUN apt-get update && \ - apt-get install -y libpq-dev && \ + apt-get install -y libpq-dev postgresql-client vim-common && \ cargo install sqlx-cli --no-default-features --features postgres --locked && \ apt-get clean && rm -rf /var/lib/apt/lists/* @@ -16,4 +16,4 @@ COPY fhevm-engine/fhevm-keys /fhevm-keys RUN chmod +x /initialize_db.sh # Run the initialization script as the entrypoint -ENTRYPOINT ["/bin/bash", "/initialize_db.sh"] \ No newline at end of file +ENTRYPOINT ["/bin/bash", "/initialize_db.sh"] diff --git a/fhevm-engine/fhevm-db/initialize_db.sh b/fhevm-engine/fhevm-db/initialize_db.sh index 301f43c1..90285436 100644 --- a/fhevm-engine/fhevm-db/initialize_db.sh +++ b/fhevm-engine/fhevm-db/initialize_db.sh @@ -8,4 +8,33 @@ sqlx database create echo "Running migrations..." sqlx migrate run --source /migrations || { echo "Failed to run migrations."; exit 1; } +# 3. Insert test tenant with keys +echo "Running Insert test tenant..." +TENANT_API_KEY=a1503fb6-d79b-4e9e-826d-44cf262f3e05 +ACL_CONTRACT_ADDRESS=0x339EcE85B9E11a3A3AA557582784a15d7F82AAf2 +INPUT_VERIFIER_ADDRESS=0x69dE3158643e738a0724418b21a35FAA20CBb1c5 + +PKS="$(cat /fhevm-keys/pks | xxd -p | tr -d '\n')" +SKS="$(cat /fhevm-keys/sks | xxd -p | tr -d '\n')" +PUBLIC_PARAMS="$(cat /fhevm-keys/pp | xxd -p | tr -d '\n')" +CKS="$(cat /fhevm-keys/cks | xxd -p | tr -d '\n')" + +QUERY=" +INSERT INTO tenants(tenant_api_key, chain_id, acl_contract_address, verifying_contract_address, pks_key, sks_key, public_params, cks_key) + VALUES ( + '${TENANT_API_KEY}', + 12345, + '${ACL_CONTRACT_ADDRESS}', + '${INPUT_VERIFIER_ADDRESS}', + decode('${PKS}', 'hex'), + decode('${SKS}', 'hex'), + decode('${PUBLIC_PARAMS}', 'hex'), + decode('${CKS}', 'hex') + ) +" + +echo $QUERY | psql $DATABASE_URL + +echo 'Test tenant insertion done' + echo "Database initialization complete." \ No newline at end of file diff --git a/fhevm-engine/fhevm-db/migrations/20241120173212_insert_test_tenant.down.sql b/fhevm-engine/fhevm-db/migrations/20241120173212_insert_test_tenant.down.sql deleted file mode 100644 index 0ae3b2a5..00000000 --- a/fhevm-engine/fhevm-db/migrations/20241120173212_insert_test_tenant.down.sql +++ /dev/null @@ -1 +0,0 @@ -DELETE FROM tenants WHERE tenant_api_key = 'a1503fb6-d79b-4e9e-826d-44cf262f3e05'; \ No newline at end of file diff --git a/fhevm-engine/fhevm-db/migrations/20241120173212_insert_test_tenant.up.sql b/fhevm-engine/fhevm-db/migrations/20241120173212_insert_test_tenant.up.sql deleted file mode 100644 index 9fdef746..00000000 --- a/fhevm-engine/fhevm-db/migrations/20241120173212_insert_test_tenant.up.sql +++ /dev/null @@ -1,19 +0,0 @@ -INSERT INTO tenants ( - tenant_api_key, - chain_id, - acl_contract_address, - verifying_contract_address, - pks_key, - sks_key, - public_params, - cks_key -) VALUES ( - 'a1503fb6-d79b-4e9e-826d-44cf262f3e05', - 12345, - '0x339EcE85B9E11a3A3AA557582784a15d7F82AAf2', - '0x69dE3158643e738a0724418b21a35FAA20CBb1c5', - '/fhevm-keys/pks', - '/fhevm-keys/sks', - '/fhevm-keys/pp', - '/fhevm-keys/cks' -) ON CONFLICT DO NOTHING; \ No newline at end of file From 44bd8ebefc3db197128fa85483c497975d932720 Mon Sep 17 00:00:00 2001 From: 0xawaz Date: Mon, 25 Nov 2024 14:03:35 +0100 Subject: [PATCH 4/7] fix: use COPY for large binary files --- fhevm-engine/coprocessor/docker-compose.yml | 2 +- fhevm-engine/fhevm-db/initialize_db.sh | 37 ++++++++------------- 2 files changed, 15 insertions(+), 24 deletions(-) diff --git a/fhevm-engine/coprocessor/docker-compose.yml b/fhevm-engine/coprocessor/docker-compose.yml index 2067eaea..aed104ef 100644 --- a/fhevm-engine/coprocessor/docker-compose.yml +++ b/fhevm-engine/coprocessor/docker-compose.yml @@ -20,7 +20,7 @@ services: migration: container_name: migration - image: ghcr.io/zama-ai/fhevm-db-migration:v1 + image: ghcr.io/zama-ai/fhevm-db-migration:v1.1 environment: DATABASE_URL: postgresql://postgres:postgres@db:5432/coprocessor depends_on: diff --git a/fhevm-engine/fhevm-db/initialize_db.sh b/fhevm-engine/fhevm-db/initialize_db.sh index 90285436..20400c40 100644 --- a/fhevm-engine/fhevm-db/initialize_db.sh +++ b/fhevm-engine/fhevm-db/initialize_db.sh @@ -9,32 +9,23 @@ echo "Running migrations..." sqlx migrate run --source /migrations || { echo "Failed to run migrations."; exit 1; } # 3. Insert test tenant with keys -echo "Running Insert test tenant..." +echo "Start preparing tenant query..." TENANT_API_KEY=a1503fb6-d79b-4e9e-826d-44cf262f3e05 +CHAIN_ID=12345 ACL_CONTRACT_ADDRESS=0x339EcE85B9E11a3A3AA557582784a15d7F82AAf2 INPUT_VERIFIER_ADDRESS=0x69dE3158643e738a0724418b21a35FAA20CBb1c5 +PKS_FILE="/fhevm-keys/pks" +SKS_FILE="/fhevm-keys/sks" +PUBLIC_PARAMS_FILE="/fhevm-keys/pp" -PKS="$(cat /fhevm-keys/pks | xxd -p | tr -d '\n')" -SKS="$(cat /fhevm-keys/sks | xxd -p | tr -d '\n')" -PUBLIC_PARAMS="$(cat /fhevm-keys/pp | xxd -p | tr -d '\n')" -CKS="$(cat /fhevm-keys/cks | xxd -p | tr -d '\n')" - -QUERY=" -INSERT INTO tenants(tenant_api_key, chain_id, acl_contract_address, verifying_contract_address, pks_key, sks_key, public_params, cks_key) - VALUES ( - '${TENANT_API_KEY}', - 12345, - '${ACL_CONTRACT_ADDRESS}', - '${INPUT_VERIFIER_ADDRESS}', - decode('${PKS}', 'hex'), - decode('${SKS}', 'hex'), - decode('${PUBLIC_PARAMS}', 'hex'), - decode('${CKS}', 'hex') - ) -" - -echo $QUERY | psql $DATABASE_URL - -echo 'Test tenant insertion done' +TMP_CSV="/tmp/tenant_data.csv" +echo "tenant_api_key,chain_id,acl_contract_address,verifying_contract_address,pks_key,sks_key,public_params" > $TMP_CSV + +echo "$TENANT_API_KEY,$CHAIN_ID,$ACL_CONTRACT_ADDRESS,$INPUT_VERIFIER_ADDRESS,\"\\x$(cat $PKS_FILE | xxd -p | tr -d '\n')\",\"\\x$(cat $SKS_FILE | xxd -p | tr -d '\n')\",\"\\x$(cat $PUBLIC_PARAMS_FILE | xxd -p | tr -d '\n')\"" >> $TMP_CSV + +echo "Inserting tenant data using \COPY..." +psql $DATABASE_URL -c "\COPY tenants (tenant_api_key, chain_id, acl_contract_address, verifying_contract_address, pks_key, sks_key, public_params) FROM '$TMP_CSV' CSV HEADER;" + +rm -f $TMP_CSV echo "Database initialization complete." \ No newline at end of file From 44b4d29eca1909a799c90393687c4b7cc1889c79 Mon Sep 17 00:00:00 2001 From: 0xawaz Date: Mon, 25 Nov 2024 14:04:08 +0100 Subject: [PATCH 5/7] build: add db-migration docker image --- .github/workflows/fhevm-db-migration.yml | 46 ++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/fhevm-db-migration.yml diff --git a/.github/workflows/fhevm-db-migration.yml b/.github/workflows/fhevm-db-migration.yml new file mode 100644 index 00000000..9c5798de --- /dev/null +++ b/.github/workflows/fhevm-db-migration.yml @@ -0,0 +1,46 @@ +name: "fhEVM DB migtaion Docker Image" + +on: + push: + branches: + - main + - ci/db-migration + paths: + - .github/workflows/fhevm-coprocessor.yml + - .github/workflows/common-docker.yml + - fhevm-engine/fhevm-db/** + release: + types: + - published + +concurrency: + group: fhevm-coprocessor-${{ github.ref_name }} + cancel-in-progress: false + +jobs: + docker-coprocessor: + uses: ./.github/workflows/common-docker.yml + permissions: + contents: "read" + id-token: "write" + packages: "write" + with: + working-directory: "." + push_image: ${{ github.event_name == 'release' || github.ref_name == 'main' }} + image-name: "fhevm-db-migration" + generate-dev-image: false + docker-file: "fhevm-engine/fhevm-db/Dockerfile" + arm-build: true + + secrets: + BLOCKCHAIN_ACTIONS_TOKEN: ${{ secrets.BLOCKCHAIN_ACTIONS_TOKEN }} + GRAVITON_BUILDER_SSH_PRIVATE_KEY: ${{ secrets.GRAVITON_BUILDER_SSH_PRIVATE_KEY }} + + done: + runs-on: ubuntu-latest + name: Pipeline Done + steps: + - name: Success + run: echo Pipeline Done + needs: + - docker-coprocessor From ba56b692edb5e353bd503e93e1a5c8c3283a4619 Mon Sep 17 00:00:00 2001 From: 0xawaz Date: Mon, 25 Nov 2024 14:06:48 +0100 Subject: [PATCH 6/7] build: fix hadolint warn --- .hadolint.yaml | 3 +++ fhevm-engine/fhevm-db/Dockerfile | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 .hadolint.yaml diff --git a/.hadolint.yaml b/.hadolint.yaml new file mode 100644 index 00000000..6454064c --- /dev/null +++ b/.hadolint.yaml @@ -0,0 +1,3 @@ +ignored: + - DL3018 + - DL3008 \ No newline at end of file diff --git a/fhevm-engine/fhevm-db/Dockerfile b/fhevm-engine/fhevm-db/Dockerfile index 6d60f280..e2752c66 100644 --- a/fhevm-engine/fhevm-db/Dockerfile +++ b/fhevm-engine/fhevm-db/Dockerfile @@ -3,7 +3,7 @@ FROM rust:1.74 # Install dependencies and tools RUN apt-get update && \ - apt-get install -y libpq-dev postgresql-client vim-common && \ + apt-get install -y --no-install-recommends libpq-dev postgresql-client vim-common && \ cargo install sqlx-cli --no-default-features --features postgres --locked && \ apt-get clean && rm -rf /var/lib/apt/lists/* From 788ae7d35973e0c10dc0cc4ffeb9633951bf8f31 Mon Sep 17 00:00:00 2001 From: 0xawaz Date: Mon, 25 Nov 2024 14:49:09 +0100 Subject: [PATCH 7/7] build: enable push --- .github/workflows/fhevm-db-migration.yml | 4 ++-- fhevm-engine/fhevm-db/Dockerfile | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/fhevm-db-migration.yml b/.github/workflows/fhevm-db-migration.yml index 9c5798de..a4bef461 100644 --- a/.github/workflows/fhevm-db-migration.yml +++ b/.github/workflows/fhevm-db-migration.yml @@ -1,4 +1,4 @@ -name: "fhEVM DB migtaion Docker Image" +name: "fhEVM DB migration Docker Image" on: push: @@ -26,7 +26,7 @@ jobs: packages: "write" with: working-directory: "." - push_image: ${{ github.event_name == 'release' || github.ref_name == 'main' }} + push_image: true image-name: "fhevm-db-migration" generate-dev-image: false docker-file: "fhevm-engine/fhevm-db/Dockerfile" diff --git a/fhevm-engine/fhevm-db/Dockerfile b/fhevm-engine/fhevm-db/Dockerfile index e2752c66..9b4343db 100644 --- a/fhevm-engine/fhevm-db/Dockerfile +++ b/fhevm-engine/fhevm-db/Dockerfile @@ -3,7 +3,7 @@ FROM rust:1.74 # Install dependencies and tools RUN apt-get update && \ - apt-get install -y --no-install-recommends libpq-dev postgresql-client vim-common && \ + apt-get install -y --no-install-recommends libpq-dev postgresql-client xxd && \ cargo install sqlx-cli --no-default-features --features postgres --locked && \ apt-get clean && rm -rf /var/lib/apt/lists/*