iroha: [bug] Fix iroha2 deployment

Feature request

New iroha2:dev image is not able to be deployed on remote instances. When we trying to use the follow docker-compose.yml file through Ansible deployment that was fine on old CI:

version: "2.4"

services:
  iroha2:
    container_name: iroha2
    image: hyperledger/iroha2:dev
    restart: always
    mem_limit: 14g
    environment:
      IROHA_PUBLIC_KEY: 'ed01201c61faf8fe94e253b93114240394f79a607b7fa55f9e5a41ebec74b88055768b'
      IROHA_PRIVATE_KEY: '{"digest_function": "ed25519", "payload": "282ed9f3cf92811c3818dbc4ae594ed59dc1a2f78e4241e31924e101d6b1fb831c61faf8fe94e253b93114240394f79a607b7fa55f9e5a41ebec74b88055768b"}'
      TERMINAL_COLORS: 'false'
      DISABLE_PANIC_TERMINAL_COLORS: 'true'
    command: iroha --submit genesis
    volumes:
      - /opt/docker_data/chain:/chain
      - /opt/iroha2-deploy/configs/peer:/config

    ports:
      - "1337:1337"
      - "8080:8080"
      - "8180:8180"

    labels:
      - 'filebeat.fields.app=iroha2'
      - 'filebeat.fields.env=test'
      - 'filebeat.fields.project=iroha2'

    networks:
      - iroha2-net
    
    logging:
      driver: "json-file"
      options:
        max-size: "100m"
        max-file: "3"

networks:
  iroha2-net:
    external:
      name: iroha2-net

Every time we get the error:

Error: Failed to retrieve required environment variable: IROHA_TORII

Caused by:
    environment variable not found

Location:
    cli/src/main.rs:50:37

Attempt to move a variables from config.json to docker env vars was unsuccessful and we got the same error:

version: "3.8"
services:
  iroha2:
    container_name: iroha2
    image: hyperledger/iroha2:dev
    restart: always

    environment:
      KURA_BLOCK_STORE_PATH: /storage
      TORII_P2P_ADDR: 0.0.0.0:1337
      TORII_API_URL: 0.0.0.0:8080
      TORII_TELEMETRY_URL: 0.0.0.0:8180
      IROHA_PUBLIC_KEY: 'ed01201c61faf8fe94e253b93114240394f79a607b7fa55f9e5a41ebec74b88055768b'
      IROHA_PRIVATE_KEY: '{"digest_function": "ed25519", "payload": "282ed9f3cf92811c3818dbc4ae594ed59dc1a2f78e4241e31924e101d6b1fb831c61faf8fe94e253b93114240394f79a607b7fa55f9e5a41ebec74b88055768b"}'
      SUMERAGI_TRUSTED_PEERS: '[{"address":"s1.stg1.iroha2.iroha.tech:1337", "public_key": "ed01201c61faf8fe94e253b93114240394f79a607b7fa55f9e5a41ebec74b88055768b"}, {"address":"s2.stg1.iroha2.iroha.tech:1337", "public_key": "ed0120cc25624d62896d3a0bfd8940f928dc2abf27cc57cefeb442aa96d9081aae58a1"}, {"address": "s3.stg1.iroha2.iroha.tech:1337", "public_key": "ed0120faca9e8aa83225cb4d16d67f27dd4f93fc30ffa11adc1f5c88fd5495ecc91020"}, {"address": "s4.stg1.iroha2.iroha.tech:1337", "public_key": "ed01208e351a70b6a603ed285d666b8d689b680865913ba03ce29fb7d13a166c4e7f1f"}]'

...

Motivation

We should find the reason in deployment of new iroha2-dev image. By the way, iroha2:dev is able to be successfully deployed locally using this docker-compose file

Who can help?

@appetrosyan @s8sato

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 19 (19 by maintainers)

Most upvoted comments

The last suggestion is correct and the reason of this issue. We can close the ticket.

Have you checked that the remote instance and your local machine have the same hashes of hyperledger/iroha2:dev ?

BTW this can be a issue specific to the current iroha2:dev image, which is not up-to-date due to the failure to publish iroha2-base:dev image, which is exactly what I’m fixing. So could you put this on hold for a while @BAStos525 ?

Yes, I checked that these iroha2:dev images are the same both for local and remote deployment. By the way, iroha2-bas:dev image has been published.