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

Run aqua code from CLI #324

Merged
merged 22 commits into from
Oct 13, 2021
Merged

Run aqua code from CLI #324

merged 22 commits into from
Oct 13, 2021

Conversation

DieMyst
Copy link
Member

@DieMyst DieMyst commented Oct 6, 2021

Aqua functions could be run from the console:

aqua run -i aqua/caller.aqua -f "callFunc(\"arg1\",\"arg2\")"

This feature won't be published until fixing performance issues

@DieMyst DieMyst requested a review from alari October 6, 2021 07:32
@@ -0,0 +1,9 @@
service Console("console"):
Copy link
Member

Choose a reason for hiding this comment

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

Why does this file exist in the npm/aqua folder?

val multiaddrOpt: Opts[String] =
Opts
.option[String]("addr", "Relay multiaddress", "a")
.withDefault("/dns4/stage.fluence.dev/tcp/19002/wss/p2p/12D3KooWMigkP4jkVyufq5JnDJL6nXvyjeaDNpRfEZqQhsG3sYCU")
Copy link
Member

Choose a reason for hiding this comment

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

I suppose a Krasnodar network's node should be there.

@@ -134,7 +138,9 @@ object AquaCli extends IOApp with Logging {
helpFlag = false,
None
)(
main[IO](runtime),
{
Copy link
Member

Choose a reason for hiding this comment

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

Any reason to keep these braces?

@@ -33,6 +36,8 @@ object AppOps {
Validated.fromEither(toLogLevel(str))
}

def runCom[F[_]: Monad: Files: AquaIO: Async](implicit ec: ExecutionContext): Opts[F[ExitCode]] = Opts.subcommand(RunOpts.runCommand[F])
Copy link
Member

Choose a reason for hiding this comment

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

What does runCom mean?

import scala.concurrent.{ExecutionContext, Future}

object RunCommand {
def run[F[_]: Monad: Files: AquaIO: Async](multiaddr: String, func: String, input: Path, imps: List[Path])(implicit ec: ExecutionContext): F[Unit] = ???
Copy link
Member

Choose a reason for hiding this comment

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

Docs

)
_ <- peer.stop().toFuture
} yield {
Validated.Valid({})
Copy link
Member

Choose a reason for hiding this comment

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

Please replace {} with ()


val generatedFuncName = "callerUniqueFunction"

def run[F[_]: Monad: Files: AquaIO: Async](
Copy link
Member

Choose a reason for hiding this comment

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

  • Docs?
  • Async is already a Monad

AirBackend,
config
)
parsingTime = System.currentTimeMillis()
Copy link
Member

Choose a reason for hiding this comment

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

Use Timer typeclass instead.

With System.currentTimeMillis you actually don't know what time you are measuring: when a FlatMap case class is built, or when it's executed, or what.


object RunCommand extends Logging {

def funcCall(multiaddr: String, funcName: String, air: Generated, config: TransformConfig)(
Copy link
Member

Choose a reason for hiding this comment

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

Docs

cli/.js/src/main/scala/aqua/JsTypes.scala Show resolved Hide resolved
@alari
Copy link
Member

alari commented Oct 13, 2021

Please update the minor version and add the performance improvements which are already implemented, and let's have it in the wild as an unstable experimental feature.

@DieMyst DieMyst merged commit 3844d8f into main Oct 13, 2021
@DieMyst DieMyst deleted the sdk-integration branch October 13, 2021 08:10
DieMyst added a commit that referenced this pull request Oct 13, 2021
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.

None yet

2 participants