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-5847 marlowe-contract service #578

Merged
merged 23 commits into from May 24, 2023
Merged

PLT-5847 marlowe-contract service #578

merged 23 commits into from May 24, 2023

Conversation

jhbertra
Copy link
Contributor

@jhbertra jhbertra commented May 10, 2023

  • Adds new marlowe-contract service to runtime topology
  • Adds MarloweLoad protocol to MarloweRuntime protocol
  • Adds load command to marlowe-runtime-cli
  • Updates docker-compose, operable and OCI images
  • TODO Updates nomad tasks
  • TODO adds documentation for JSON format accepted by load command.

Pre-submit checklist:

  • Branch
    • Tests are provided (if possible)
    • Commit sequence broadly makes sense
    • Key commits have useful 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
    • Reviewer requested

@jhbertra jhbertra changed the title Plt 5847 marlowe loader PLT-5847 marlowe-contract service May 11, 2023
@jhbertra jhbertra force-pushed the plt-5847-marlowe-loader branch 2 times, most recently from b41ffa3 to 1402a68 Compare May 15, 2023 19:21
@jhbertra jhbertra changed the base branch from main to jhbertra/refactor-marlowe-proxy May 15, 2023 19:44
@jhbertra jhbertra force-pushed the jhbertra/refactor-marlowe-proxy branch 2 times, most recently from d9fbdc0 to 15c446e Compare May 16, 2023 21:23
@jhbertra jhbertra force-pushed the jhbertra/refactor-marlowe-proxy branch from 15c446e to 0b1da8a Compare May 17, 2023 14:28
Base automatically changed from jhbertra/refactor-marlowe-proxy to main May 17, 2023 14:44
@jhbertra jhbertra requested a review from bwbush May 17, 2023 17:22
@jhbertra jhbertra self-assigned this May 17, 2023
@jhbertra jhbertra force-pushed the plt-5847-marlowe-loader branch 2 times, most recently from d623136 to 1cb6ab3 Compare May 17, 2023 18:40
@jhbertra jhbertra marked this pull request as ready for review May 17, 2023 18:50
deploy/operables.nix Outdated Show resolved Hide resolved
countNodes :: Int -> FilePath -> CountM Int
countNodes count path = withContract path $ countNodes' count

countNodes' :: Int -> LoadContract -> CountM Int
Copy link
Collaborator

Choose a reason for hiding this comment

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

I wonder if the multiplate in Language.Marlowe.Core.V1.Plate could be used to do this counting?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Possibly, the concept of a Node is somewhat abstract though, and isn't directly captured by anything in there.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Actually, I see that LoadContract is not Contract, which is what the plate acts on. ☹️

import System.IO.LockFile (withLockFile)
import UnliftIO
import UnliftIO.Directory
( XdgDirectory(XdgData)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is the XDG stuff portable?

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 it is

bufferSizeParser = option readOption $ mconcat
[ long "buffer-size"
, short 'b'
, value 4098
Copy link
Collaborator

Choose a reason for hiding this comment

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

Seems too high. Are exceptions caught in a way the forces a flush before exit?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

1024 could be a better default. The staging area is wrapped in a bracket that discards the entire temp staging directory on exception. So there should be no resource leak (though nothing will protect from a SIGKILL or a loss of power of course).

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.

Looks great. I'll do an on-chain test when marlowe-runtime-cli create supports this.

@jhbertra jhbertra force-pushed the plt-5847-marlowe-loader branch 2 times, most recently from 0c1480d to 2b7f9a1 Compare May 24, 2023 15:27
@jhbertra jhbertra enabled auto-merge May 24, 2023 15:29
@jhbertra jhbertra merged commit c60bf21 into main May 24, 2023
36 checks passed
@jhbertra jhbertra deleted the plt-5847-marlowe-loader branch May 24, 2023 17:50
@Sammyreal1 Sammyreal1 linked an issue Jun 8, 2023 that may be closed by this pull request
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.

Approved
2 participants