Skip to content
Snippets Groups Projects
README.md 2.67 KiB
Newer Older
  • Learn to ignore specific revisions
  • [![pipeline status](https://gitlab.eclipse.org/eclipse/xfsc/tsa/task/badges/main/pipeline.svg)](https://gitlab.eclipse.org/eclipse/xfsc/tsa/task/-/commits/main)
    [![coverage report](https://gitlab.eclipse.org/eclipse/xfsc/tsa/task/badges/main/coverage.svg)](https://gitlab.eclipse.org/eclipse/xfsc/tsa/task/-/commits/main)
    
    Cristina Pauna's avatar
    Cristina Pauna committed
    This project has been migrated to Eclipse Foundation, and it can be found under https://gitlab.eclipse.org/eclipse/xfsc/
    
    Lyuben Penkovski's avatar
    Lyuben Penkovski committed
    
    
    Yordan Kinkov's avatar
    Yordan Kinkov committed
    The task service provides an HTTP interface for executing asynchronous (HTTP) tasks and task lists.
    
    
    It is developed using the [Goa v3](https://goa.design/) framework.
    
    While the service is up and running, you can see a live Swagger API
    description at `servicehost:serviceport/swagger-ui`. In the local docker-compose
    environment, the Swagger URL is available at http://localhost:8082/swagger-ui/
    
    
    ### High-level Overview
    
    ```mermaid  
    flowchart LR  
    	A([client]) -- HTTP --> B[Task API] 
    
    	subgraph task
            B --- C[(Storage)]
            C --- E[Executor]
            B --> D[(Queue)]
            D --> E[Executor]
    
    	E --> F[Policy]
    	E --> G[Cache]
    
    Tasks are created by clients making HTTP requests.
    In order to create a Task, a TaskTemplate must be present in the Storage. The newly created tasks are
    added to a Queue. Current implementation of the [Queue interface](internal/service/queue.go)
    is a persistent database. An executor component is retrieving tasks from the Queue for execution.
    Clients receive an immediate response with the `taskID` for the created task and can later query
    
    the state of task and retrieve its result either by directly querying the Cache
    service, or by querying the task HTTP interface for task results.
    
    
    Yordan Kinkov's avatar
    Yordan Kinkov committed
    ### More information
    * [Tasks](docs/task.md)
    * [Task lists](docs/task-list.md)
    * [Queue](docs/queue.md)
    
    * [Storage](docs/storage.md)
    
    ### Cache events
    
    Task service is able to subscribe for events produced by the Cache service
    and create a Task for every received event. Current implementation uses
    [NATS](https://nats.io/) for messaging system.
    
    ##### More information
    * [Cache Event Task](docs/cache-event-task.md)
    
    
    ### Tests and Linters
    
    To execute the units tests for the service go to the root project directory and run:
    ```go
    go test -race ./...
    ```
    
    To run the linters go to the root project directory and run:
    ```go
    golangci-lint run
    ```
    
    
    Kalin Canov's avatar
    Kalin Canov committed
    ## Dependencies
    
    
    The project uses Go modules for managing dependencies, and we commit the `vendor` directory.
    When you add/change dependencies, be sure to clean and update the `vendor` directory before
    submitting your Merge Request for review.
    ```shell
    go mod tidy
    go mod vendor
    ```
    
    Kalin Canov's avatar
    Kalin Canov committed
    
    
    Kalin Canov's avatar
    Kalin Canov committed
    [Dependencies](go.mod)
    
    
    Kalin Canov's avatar
    Kalin Canov committed
    ## License
    <hr/>
    
    
    Kalin Canov's avatar
    Kalin Canov committed
    [Apache 2.0 license](LICENSE)