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

rofl-docs: Document podman-compose caveats #2164

Open
matevz opened this issue Feb 21, 2025 · 1 comment
Open

rofl-docs: Document podman-compose caveats #2164

matevz opened this issue Feb 21, 2025 · 1 comment
Assignees
Labels
c:docs Category: documentation c:rofl Category: ROFL

Comments

@matevz
Copy link
Member

matevz commented Feb 21, 2025

I tripped up on these two issues:

services:
  oracle:
    environment:
      CONTRACT_ADDRESS: 0x5FbDB2315678afecb367f032d93F642f64180aa3
    entrypoint: /bin/sh -c 'python main.py --network http://sapphire-localnet:8545 --ollama-address http://ollama:11434 --secret 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 $${CONTRACT_ADDRESS}'

The CONTRACT_ADDRESS will be empty in podman-compose. Injecting the variable directly inside entrypoint seems to be the only way currently

services:
  oracle:
    entrypoint: /bin/sh -c 'python main.py --network http://sapphire-localnet:8545 --ollama-address http://ollama:11434 --secret 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 0x5FbDB2315678afecb367f032d93F642f64180aa3'
  oracle:
    environment:
      CONTRACT_ADDRESS: 0x5FbDB2315678afecb367f032d93F642f64180aa3
    build:
      dockerfile: Dockerfile.oracle
        entrypoint: /bin/sh -c 'python main.py --network http://sapphire-localnet:8545 --ollama-address http://ollama:11434 --secret 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 $${CONTRACT_ADDRESS}'
    restart: on-failure
    depends_on:
      contracts:
        condition: service_completed_successfully

will be started prematurely before the contracts are deployed. Adding some sleep can solve the issue:

  oracle:
    build:
      dockerfile: Dockerfile.oracle
    entrypoint: /bin/sh -c 'sleep 100; python main.py --network http://sapphire-localnet:8545 --ollama-address http://ollama:11434 --secret 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 0x5FbDB2315678afecb367f032d93F642f64180aa3'
    restart: on-failure

Document both caveats somewhere at the end of https://docs.oasis.io/build/rofl/app probably?

@matevz matevz added c:docs Category: documentation c:rofl Category: ROFL labels Feb 21, 2025
@matevz matevz self-assigned this Feb 21, 2025
@kostko
Copy link
Member

kostko commented Feb 21, 2025

The above syntax seems incorrect to me, where did you see that $${CONTRACT_ADDRESS} would work? Did you try the regular $CONTRACT_ADDRESS instead?

$ export FOO=3
$ bash -c 'echo $FOO'
3
$ bash -c 'echo $$FOO'
2606301FOO
$ bash -c 'echo $${FOO}'
2606302{FOO}

Because $$ expands to PID.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c:docs Category: documentation c:rofl Category: ROFL
Projects
None yet
Development

No branches or pull requests

2 participants