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

PLT-7566 Add docker images for marlowe-apps #715

Merged
merged 7 commits into from
Sep 22, 2023

Conversation

jhbertra
Copy link
Contributor

Pre-submit checklist:

  • Branch
    • Tests are provided (if possible)
    • Test report is updated (if relevant)
    • Commit sequence broadly makes sense
    • Key commits have useful messages
    • Relevant tickets are mentioned in commit messages
    • Formatting, PNG optimization, etc. are updated
  • PR
    • Self-reviewed the diff
    • Useful pull request description
      • Review required
      • Substantial changes to code, test, or documentation
      • Change made to Marlowe validator (@bwbush and @palas must be included as reviewers)
      • Review not required
      • Minor changes to non-critical code, documentation, nix derivations, configuration files, or scripts
      • Formatting, spelling, grammar, or reorganization
    • Reviewer requested

@jhbertra jhbertra requested a review from bwbush September 20, 2023 20:17
@jhbertra jhbertra self-assigned this Sep 20, 2023
@jhbertra jhbertra force-pushed the plt-7566-marlowe-apps-images branch from b5e8317 to e1cfeda Compare September 21, 2023 12:25
@jhbertra
Copy link
Contributor Author

# REQUIRED VARS #
#################
# ADDRESS: The Bech32 address of the oracle.
# KEYFILE: The extended payment signing key file for the oracle.
Copy link
Collaborator

@bwbush bwbush Sep 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In order to use an external keyfile, don't we need a volume that we can bind to? We'll need to document this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that is the idea. Where best to document this I wonder.

Copy link
Collaborator

@bwbush bwbush left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code and images look good, except for an unset environment variables that I noted.

I verified that the oracle works outside of the container.

However, when I run the image, the oracle crashes early with an apparent inability to connect to the marlowe-tx-proxy service, even though the ping to the port succeeds. Note that the Runtime service is at this very same commit.

Connection to 192.168.0.9 13780 port [tcp/*] succeeded!
{"DiscoveryProcess":{"duration":60.055698835,"end":"2023-09-22T02:31:40.301659265Z","event-id":"7a8e1c7e-97a9-4301-a325-7045a4133cff","start":"2023-09-22T02:30:40.24596043Z","unstructured-exception":"DeserializeError {message = \"not enough bytes\", offset = 0, unconsumedInput = \"\"}"}}
marlowe-oracle: DeserializeError {message = "not enough bytes", offset = 0, unconsumedInput = ""}
{"OracleProcess":{"duration":60.058800326,"end":"2023-09-22T02:31:40.304757094Z","event-id":"48aecbb1-7cce-45a6-a80a-ac94f1b840c2","start":"2023-09-22T02:30:40.245956768Z","unstructured-exception":"thread blocked indefinitely in an STM transaction"}}
marlowe-oracle: thread blocked indefinitely in an STM transaction
{"DetectionProcess":{"duration":60.058783247,"end":"2023-09-22T02:31:40.304808034Z","event-id":"2ebc936c-df46-4140-a278-5763d8295375","start":"2023-09-22T02:30:40.246024787Z","unstructured-exception":"thread blocked indefinitely in an STM transaction"}}

This may be a problem with my test environment, but the kube file is pretty simple:

kind: Pod

metadata:
  name: mrt-preprod-oracle
  labels:
    app: mrt-preprod-oracle

spec:

  hostname: mrt-preprod-oracle

  containers:

  - name: marlowe-oracle
    image: docker.io/bwbush/marlowe-oracle:ee6889829b67adb5af128d8786f6212eebcacc43
    env:
    - name: MARLOWE_RT_HOST
      value: 192.168.0.9
    - name: RUNTIME_HOST  # A workaround for a bug in operable.
      value: 192.168.0.9
    - name: MARLOWE_RT_PORT
      value: 13780
    - name: RUNTIME_PORT  # A workaround for a bug in operable.
      value: 13780
    - name: ADDRESS
      value: addr_test1vq9prvx8ufwutkwxx9cmmuuajaqmjqwujqlp9d8pvg6gupczgtm9j
    - name: KEYFILE
      value: /data/treasury/payment.skey
    volumeMounts:
    - mountPath: /data/treasury
      name: treasury

  volumes:
  - name: treasury
    hostPath:
      type: Directory
      path: /extra/iohk/networks/treasury

  restartPolicy: Always
  enableServiceLinks: false
  automountServiceAccountToken: false

status: {}

# CONFIRM_SECONDS: Wait specified seconds after transaction confirmation.
# RETRY_SECONDS: Wait specified seconds after a failed transaction before trying again.
# RETRY_LIMIT: Maximum number of attempts for trying a failed transaction again.

Copy link
Collaborator

@bwbush bwbush Sep 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to add the following because an export is required for the app to see the variable? Or does docker automatically mark the variable as exported?

export MARLOWE_RT_HOST="''${MARLOWE_RT_HOST}"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That should not be necessary

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, the connection is successful, but something is going wrong over the wire

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You would see a different error if the connection failed, not a DeserializeError

Copy link
Collaborator

@bwbush bwbush left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I resolved the oracle crash, which was due to a misconfigured container.

@jhbertra jhbertra merged commit 0ee84d5 into main Sep 22, 2023
5 checks passed
@jhbertra jhbertra deleted the plt-7566-marlowe-apps-images branch September 22, 2023 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants