Code Monkey home page Code Monkey logo

task-ui's Introduction

Task UI

Run your Taskfile.yml from the browser.

Start the docker image with task docker:run.

Task UI is meant for Docker environments. A generic Dockerfile exists, which bundles typical dependencies like task, ttyrec, docker, docker compose.

To use, start by navigating to the docker subfolder. It contains a Taskfile, with the typical commands to build and run task-ui from a docker image. For examples with Taskfiles you could run, look into the folder examples.

The layout is somewhat responsive, supporting mobile.

Running

To set up your project to run with Task UI, it's recommended you use the example docker compose setup here:

services:
  runner:
    image: titpetric/task-ui
    restart: always
    build: .
    command:
      - --history-enable
    ports:
    - 3000:3000
    volumes:
    - $PWD/app:/app
    - /var/run/docker.sock:/var/run/docker.sock:ro

In particular, you should mount your /app folder which contains your Taskfile.yml, docker-compose.yml and other files. Task UI will run with what you provide it with.

  • If you don't want history, remove the command flags.
  • If you don't want to use docker, remove the volume for docker.sock.

The image provides an id_ecdsa key to use for ssh hops. The recommended way to deploy is to provide your own docker/root/.ssh folder with the ssh keys. You can regenerate the ssh key with task docker:gen.

Development

task: Available tasks for this project:

  • build: Build task-ui
  • fix: Fix code
  • install: Install task-ui locally
  • run: Run task-ui
  • test: Test task-ui
  • docker:build: Build task-ui docker image
  • docker:gen: Generate ssh key for docker image
  • docker:push: Push task-ui to registry
  • docker:run: Run task-ui in docker env

task: build

Build task-ui

dependencies:

  • fix

commands:

  • CGO_ENABLED=0 go build .

task: test

Test task-ui

dependencies:

  • fix

commands:

  • CGO_ENABLED=1 go test -race -count=1 -cover ./...
  • CGO_ENABLED=0 go test -count=1 -cover ./...

task: run

Run task-ui

dependencies:

  • build

commands:

  • ./task-ui --history-enable

task: install

Install task-ui locally

dependencies:

  • fix

commands:

  • go install .

task: fix

Fix code

dependencies:

  • deps:goimports

commands:

  • goimports -w .
  • go fmt ./...
  • go vet .
  • go mod tidy
  • ./README.md.sh > README.md

task-ui's People

Contributors

ccoveille avatar titpetric avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

task-ui's Issues

failed to initialize build cache at /root/Library/Caches/go-build: mkdir /root: read-only file system

If I run this using task from Terminal it works.

But when run from task-ui it fails.

Not quite sure what's going on yet...

I am NOT running inside docker BTW.
Does this automatically invoke docker ?

go version go1.22.1 darwin/arm64

Task-UI:

task: [hot] go build -o ./webui_bin cmd/webui/main.go
failed to initialize build cache at /root/Library/Caches/go-build: mkdir /root: read-only file system
task: Failed to run task "hot": exit status 1

Taskfile.yml:

# https://taskfile.dev

version: "3"

interval: 100ms

vars:
  NAME: "webui"
  BIN_NAME: "{{.NAME}}_bin"
  VERSION:
    sh: cat library/package.json| jq -r .version

  hot:
    desc: Server hot reload

    sources:
      - "**/*.go"
      - "webui/static/**/*"
      - "{{.NAME}}/static/**/*"
    
    cmds:
      #- go mod tidy
      - go build -o ./{{.BIN_NAME}} cmd/{{.NAME}}/main.go
      - ./{{.BIN_NAME}}


  default:
    deps:
      - hot
    silent: false

Capture stderr/stdout output separately

I may want to use taskfiles as an ETL pipeline API; it should be local filesystem aware, so it knows where to write out outputs if it's a "local" processing job (e.g. data extraction with parsing, jq, yq), however in some cases it makes sense to collect only the output directly (e.g. pipe workflow). Using CombinedOutput doesn't give us access to the stdout separately;

May want to reuse task-ui for this but adjust to capture the outputs separately, so i can distribute a job runner similar to a github matrix job, but sort of in a structured ETL framework.

Filing this in the idea pile, likely going to skip the distributed nature of some tasks 🗡️ ; but i'll need to fan out pretty soon as a single threaded job runner won't work for the use case.

can't run command: exec: "ttyrec": executable file not found in $PATH Session terminated

On Mac, arm64 with docker running.

Am running task.ui against task-ui src code with:

cd task-ui and task-ui --history-enable

every single task results in the following output in the html gui:

can't run command: exec: "ttyrec": executable file not found in $PATH
Session terminated

the terminal server shows:

2024/03/26 20:43:36  info History is enabled, writing to "./history"
Listening on http://localhost:3000
2024/03/26 20:43:43 "GET http://localhost:3000/ HTTP/1.1" from [::1]:61180 - 200 5854B in 2.241ms
2024/03/26 20:43:43 "GET http://localhost:3000/static/index.js HTTP/1.1" from [::1]:61180 - 200 2495B in 3.704834ms
2024/03/26 20:43:43 "GET http://localhost:3000/static/index.css HTTP/1.1" from [::1]:61181 - 200 1505B in 2.9615ms
2024/03/26 20:43:44 "GET http://localhost:3000/default HTTP/1.1" from [::1]:61180 - 200 8873B in 2.569334ms
2024/03/26 20:43:44 "GET http://localhost:3000/static/index.css HTTP/1.1" from [::1]:61180 - 200 1505B in 135.459µs
2024/03/26 20:43:44 "GET http://localhost:3000/static/index.js HTTP/1.1" from [::1]:61180 - 200 2495B in 56.542µs
2024/03/26 20:43:45  info can't run command         error=exec: "ttyrec": executable file not found in $PATH
2024/03/26 20:43:45 "GET http://localhost:3000/ws/default HTTP/1.1" from [::1]:61182 - 000 0B in 1.470917ms
2024/03/26 20:43:47 "GET http://localhost:3000/fix HTTP/1.1" from [::1]:61180 - 200 8893B in 1.164417ms
2024/03/26 20:43:47 "GET http://localhost:3000/static/index.css HTTP/1.1" from [::1]:61180 - 200 1505B in 90.584µs
2024/03/26 20:43:47 "GET http://localhost:3000/static/index.js HTTP/1.1" from [::1]:61181 - 200 2495B in 712.708µs
2024/03/26 20:43:48  info can't run command         error=exec: "ttyrec": executable file not found in $PATH
2024/03/26 20:43:48 "GET http://localhost:3000/ws/fix HTTP/1.1" from [::1]:61183 - 000 0B in 1.838209ms
2024/03/26 20:43:49 "GET http://localhost:3000/build HTTP/1.1" from [::1]:61180 - 200 8861B in 675.541µs
2024/03/26 20:43:49 "GET http://localhost:3000/static/index.js HTTP/1.1" from [::1]:61181 - 200 2495B in 43.792µs
2024/03/26 20:43:49 "GET http://localhost:3000/static/index.css HTTP/1.1" from [::1]:61180 - 200 1505B in 68.833µs
2024/03/26 20:43:50  info can't run command         error=exec: "ttyrec": executable file not found in $PATH
2024/03/26 20:43:50 "GET http://localhost:3000/ws/build HTTP/1.1" from [::1]:61184 - 000 0B in 1.708375ms
2024/03/26 20:43:51 "GET http://localhost:3000/test HTTP/1.1" from [::1]:61180 - 200 8874B in 2.18375ms
2024/03/26 20:43:51 "GET http://localhost:3000/static/index.css HTTP/1.1" from [::1]:61180 - 200 1505B in 91.042µs
2024/03/26 20:43:51 "GET http://localhost:3000/static/index.js HTTP/1.1" from [::1]:61181 - 200 2495B in 54.542µs
2024/03/26 20:43:53  info can't run command         error=exec: "ttyrec": executable file not found in $PATH
2024/03/26 20:43:53 "GET http://localhost:3000/ws/test HTTP/1.1" from [::1]:61185 - 000 0B in 1.810916ms
2024/03/26 20:43:53 "GET http://localhost:3000/benchmark HTTP/1.1" from [::1]:61180 - 200 8899B in 1.368417ms
2024/03/26 20:43:53 "GET http://localhost:3000/static/index.css HTTP/1.1" from [::1]:61180 - 200 1505B in 103.792µs
2024/03/26 20:43:53 "GET http://localhost:3000/static/index.js HTTP/1.1" from [::1]:61180 - 200 2495B in 59.5µs
2024/03/26 20:43:54  info can't run command         error=exec: "ttyrec": executable file not found in $PATH
2024/03/26 20:43:54 "GET http://localhost:3000/ws/benchmark HTTP/1.1" from [::1]:61186 - 000 0B in 2.022959ms
2024/03/26 20:44:08 "GET http://localhost:3000/test HTTP/1.1" from [::1]:61180 - 200 8874B in 1.556167ms
2024/03/26 20:44:08 "GET http://localhost:3000/static/index.css HTTP/1.1" from [::1]:61180 - 200 1505B in 87.333µs
2024/03/26 20:44:08 "GET http://localhost:3000/static/index.js HTTP/1.1" from [::1]:61181 - 200 2495B in 42µs
2024/03/26 20:44:09  info can't run command         error=exec: "ttyrec": executable file not found in $PATH
2024/03/26 20:44:09 "GET http://localhost:3000/ws/test HTTP/1.1" from [::1]:61188 - 000 0B in 1.612667ms
^Cmake: *** [Makefile:31: run-go] Interrupt: 2

thanks

This is quite useful for remote ops.

just wanted to say thanks,

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.