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

cmd/run: task field cleanup #549

Merged
merged 3 commits into from
May 17, 2018

Conversation

buchanae
Copy link
Contributor

I've been using this command a lot lately, and noticed a few areas that need cleaning up:

  • tags, environ, and resources can be printed as empty dictionaries
  • everything is namespaced under /opt/funnel/ which seems unnecessary
  • stdout and stderr are always included, which is a legacy hack for stdout/err log streaming, I think
  • task name has escaped double quotes. single quotes look nicer in the terminal/JSON
  • task name is prefixed with "Funnel run: " which adds no value.

Before

./build/bin/funnel-darwin-amd64 run --print 'echo $I > $O' -i I=swift://buchanan/foo.txt -o O=swift://buchanan/out.txt
{
  "name": "Funnel run: sh -c \"echo $I \u003e $O\"",
  "inputs": [
    {
      "name": "I",
      "url": "swift://buchanan/foo.txt",
      "path": "/opt/funnel/inputs/buchanan/foo.txt"
    }
  ],
  "outputs": [
    {
      "name": "O",
      "url": "swift://buchanan/out.txt",
      "path": "/opt/funnel/outputs/buchanan/out.txt"
    }
  ],
  "resources": {

  },
  "executors": [
    {
      "image": "alpine",
      "command": [
        "sh",
        "-c",
        "echo $I \u003e $O"
      ],
      "workdir": "/opt/funnel",
      "stdout": "/opt/funnel/outputs/stdout-0",
      "stderr": "/opt/funnel/outputs/stderr-0",
      "env": {
        "I": "/opt/funnel/inputs/buchanan/foo.txt",
        "O": "/opt/funnel/outputs/buchanan/out.txt"
      }
    }
  ],
  "tags": {
  }
}

After

RJHB552 funnel (funnel-run-cleanup-2)
funnel run --print 'echo $I > $O' -i I=swift://buchanan/foo.txt -o O=swift://buchanan/out.txt
{
  "name": "sh -c 'echo $I \u003e $O'",
  "inputs": [
    {
      "name": "I",
      "url": "swift://buchanan/foo.txt",
      "path": "/inputs/buchanan/foo.txt"
    }
  ],
  "outputs": [
    {
      "name": "O",
      "url": "swift://buchanan/out.txt",
      "path": "/outputs/buchanan/out.txt"
    }
  ],
  "executors": [
    {
      "image": "alpine",
      "command": [
        "sh",
        "-c",
        "echo $I \u003e $O"
      ],
      "env": {
        "I": "/inputs/buchanan/foo.txt",
        "O": "/outputs/buchanan/out.txt"
      }
    }
  ]
}

@buchanae buchanae force-pushed the funnel-run-cleanup-2 branch from 2cbf27a to 6e14a21 Compare May 16, 2018 15:36
@buchanae buchanae force-pushed the funnel-run-cleanup-2 branch from 6e14a21 to 0e325a1 Compare May 16, 2018 20:34
@buchanae
Copy link
Contributor Author

Strangely, many of the tests had commands like --sh "sh -c 'exit 1'". Not sure what I removed from funnel run that was allowing that to work :( I removed those commands from the tests.

@buchanae buchanae force-pushed the funnel-run-cleanup-2 branch from 873966e to a7f58fc Compare May 17, 2018 16:53
@buchanae
Copy link
Contributor Author

Build is passing

@adamstruck adamstruck merged commit e2f4c00 into ohsu-comp-bio:master May 17, 2018
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