Skip to content

Ssh.do: How to run pure computations on remote? #4

@mandel59

Description

@mandel59

Pure computations always run on the local worker with the current Ssh.do implementation. How to compute whole data flow on remote?

For instance, let's think about the following code:

basedir = "/etc"
dirs <- Ssh.do { user: "user", host: "example.com" } (
    files <- File.listStatus basedir,
    dirs = (file <- files, [file.name | file.isDirectory]),
    Task.of dirs
)

At first glance, it seems that files are listed up and directries of them are selected on the remote server, and then the directories are returned to local, like the following shell script line:

echo /etc | ssh user@example.com 'xargs -L1 ls -lA | grep ^d | sed -E "s/([^ ]+ +){8}//"'

Actually it doesn't work so. Only actions are sent to and run on remote. Pure computations and the pipeline run on local like:

echo /etc | ssh user@example.com 'xargs -L1 ls -lA' | grep ^d | sed -E "s/([^ ]+ +){8}//"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions