En suivant la documentation j’ai cherché pour les images en ARM64; je n’en ai pas vu sur Docker Hub pour
- h30x/duniter-squid-hasura
- h30x/duniter-squid
Du coup j’ai récupéré le code source
J’ai switcher vers le dernier tag 0.2.8
et tenté de builder les images
image duniter-squid-hasura
docker build --no-cache -t duniter-squid-hasura:0.2.8-arm64 -f Dockerfile.Hasura .
=> Pas de soucis
image duniter-squid
Soucis avec les ./input/*
Première chose, ce n’est vraiment pas clair qu’il faut aller populer le répertoire ./input/ avec les fichiers de configuration avant de créer l’image - je résume rapidement comment j’ai populé:
J’ai repris les fichiers dans ./input/fake et les ai copiés dans ./input/
Je me suis connecté sur mon noeud duniter v2s gdev archive et j’ai exécuté la commande pour générer le gdev.json puis récupérer le fichier dans les sources dans ./input/ également
Au final, j’ai ces fichies disponibles:
input
├── README.md
├── block_hist.json
├── cert_hist.json
├── fake
│ ├── block_hist.json
│ ├── cert_hist.json
│ ├── genesis.json
│ └── tx_hist.json
├── gdev.json
├── genesis.json
└── tx_hist.json
Soucis avec le build
docker build --no-cache -t duniter-squid:0.2.8-arm64 -f Dockerfile .
=> Plante à cause de Python manquant
# logs partiels:
=> [input 2/2] COPY /input/ input/ 0.1s
=> [deps 2/3] COPY package.json pnpm-lock.yaml . 0.1s
=> [squid 2/10] COPY --from=input /squid/input input 0.0s
=> ERROR [deps 3/3] RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod 5.9s
=> [squid 3/10] COPY assets assets 0.1s
=> [squid 4/10] COPY db db 0.1s
=> [squid 5/10] COPY schema.graphql . 0.0s
------
...
5.219 .../node_modules/bufferutil install: gyp ERR! stack Error: Could not find any Python installation to use
...
Je résume également, au final, j’ai dû ajouter les packages python3 make gcc g++
dans le Dockerfile
à la racine du repo duniter-squid:
# --- node 20 base image
FROM node:20-alpine AS node
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
# Add Python and build dependencies - docker build crashes otherwise when run from ARM64 computer...
RUN apk add --no-cache python3 make gcc g++
#... reste du fichier
Avec ce changement là, le build se termine correctement.
Soucis restant lors du démarrage du stack docker compose
Après tout ceci, il me reste un problème avec le service “processor” du docker compose (lié à cette image duniter-squid
):
J’ai bien forcé la suppression des volumes pour relancer le stack docker compose proprement, mais le service “processor” crash au démarrage avec ces derniers logs (j’ai supprimé avec ...
les choses qui semblent se répéter sinon c’est trop long)
...
processor-1 | {"level":2,"time":1732448465637,"ns":"sqd:processor:mapping","msg":"There are 8 wallets from genesis and 2 additional wallets from tx history"}
processor-1 | {"level":2,"time":1732448465637,"ns":"sqd:processor:mapping","msg":" (total 10)"}
processor-1 | {"level":2,"time":1732448465641,"ns":"sqd:processor:mapping","msg":"Saving v1 transaction history and comments"}
processor-1 | {"level":2,"time":1732448465641,"ns":"sqd:processor:mapping","msg":"Flushing changes to storage, this can take a while..."}
processor-1 | {"level":2,"time":1732448465644,"ns":"sqd:processor:mapping","msg":"(about ~5 minutes for all g1 history and genesis data)"}
processor-1 | {"level":5,"time":1732448465676,"ns":"sqd:processor","err":{"stack":"QueryFailedError: null value in column \"expire_on\" of relation \"cert\" violates not-null constraint
at PostgresQueryRunner.query (/squid/node_modules/.pnpm/typeorm@0.3.20_ioredis@5.4.1_pg@8.13.1/node_modules/typeorm/driver/postgres/PostgresQueryRunner.js:219:19)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async InsertQueryBuilder.execute (/squid/node_modules/.pnpm/typeorm@0.3.20_ioredis@5.4.1_pg@8.13.1/node_modules/typeorm/query-builder/InsertQueryBuilder.js:106:33)
at async StoreWithCache.insert (/squid/node_modules/.pnpm/@subsquid+typeorm-store@1.5.1_@subsquid+big-decimal@1.0.0_typeorm@0.3.20_ioredis@5.4.1_pg@8.13.1_/node_modules/@subsquid/typeorm-store/lib/store.js:88:17)
at async /squid/node_modules/.pnpm/@belopash+typeorm-store@1.5.0_@subsquid+typeorm-config@4.1.1_typeorm@0.3.20_ioredis@5.4.1_pg@_cp67c72w5wtyb7ybut47zqag7u/node_modules/@belopash/typeorm-store/lib/store.js:219:21","query":"INSERT INTO \"cert\"(\"id\", \"is_active\", \"created_on\", \"updated_on\", \"expire_on\", \"issuer_id\", \"receiver_id\", \"created_in_id\", \"updated_in_id\") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9), ($10, $11, $12, $13, $14, $15, $16, $17, $18), ... ($262, $263, $264, $265, $266, $267, $268, $269, $270)","parameters":["genesis-cert_2-1",true,0,0,null,"genesis-identity_2","genesis-identity_1","genesis-event_0","genesis-event_0", ... "genesis-cert_5-6",true,0,0,null,"genesis-identity_5","genesis-identity_6","genesis-event_0","genesis-event_0"],"driverError":{"stack":"error: null value in column \"expire_on\" of relation \"cert\" violates not-null constraint
at /squid/node_modules/.pnpm/pg@8.13.1/node_modules/pg/lib/client.js:535:17
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async PostgresQueryRunner.query (/squid/node_modules/.pnpm/typeorm@0.3.20_ioredis@5.4.1_pg@8.13.1/node_modules/typeorm/driver/postgres/PostgresQueryRunner.js:184:25)
at async InsertQueryBuilder.execute (/squid/node_modules/.pnpm/typeorm@0.3.20_ioredis@5.4.1_pg@8.13.1/node_modules/typeorm/query-builder/InsertQueryBuilder.js:106:33)
at async StoreWithCache.insert (/squid/node_modules/.pnpm/@subsquid+typeorm-store@1.5.1_@subsquid+big-decimal@1.0.0_typeorm@0.3.20_ioredis@5.4.1_pg@8.13.1_/node_modules/@subsquid/typeorm-store/lib/store.js:88:17)
at async /squid/node_modules/.pnpm/@belopash+typeorm-store@1.5.0_@subsquid+typeorm-config@4.1.1_typeorm@0.3.20_ioredis@5.4.1_pg@_cp67c72w5wtyb7ybut47zqag7u/node_modules/@belopash/typeorm-store/lib/store.js:219:21","length":299,"name":"error","severity":"ERROR","code":"23502","detail":"Failing row contains (genesis-cert_2-1, t, 0, 0, null, genesis-identity_2, genesis-identity_1, genesis-event_0, genesis-event_0).","schema":"public","table":"cert","column":"expire_on","file":"execMain.c","line":"1977","routine":"ExecConstraints"},"length":299,"severity":"ERROR","code":"23502","detail":"Failing row contains (genesis-cert_2-1, t, 0, 0, null, genesis-identity_2, genesis-identity_1, genesis-event_0, genesis-event_0).","schema":"public","table":"cert","column":"expire_on","file":"execMain.c","line":"1977","routine":"ExecConstraints"}}
Du coup, là je ne vois plus quoi faire pour débloquer la situation…
Peut-être que mes fichiers d’input mentionnés plus haut amènent à cette erreur-ci ?