Sign inSign up

myminifactory/task-actioner

By myminifactory

Updated over 6 years ago

Task Actioner is a RabbitMQ comsumer that receives task messages and runs them

Image
0

2.2K

myminifactory/task-actioner repository overview

Task Actioner

Build Status Docker Cloud Build Status

Task Actioner is a RabbitMQ comsumer that receives task messages and runs them as native or docker actions

Consumer role

  • Always on - never crash or restart on crash
  • Consumes rabbitMQ
  • Read the message (i.e. payload-example.json)
  • Download the required files
  • Read the type of task to call the right action if it's a docker container:
  • mount the right volumes
  • convert the params as args

Two types of actions:

  • Built in code (faster/reliable)
  • call of Docker image (GitHub actions-like)

Use Task Actioner Docker image

Pull image
docker pull myminifactory/task-actioner
Environment variable

Here are all the environment variables you need to run the container:

Variable nameDescriptionDefault value
MMF_API_BASE_URLThe base url of your MyMiniFactory instancenull
MMF_API_SECRET_KEYYour access token to use your MyMiniFactory instancenull
FILE_STORAGE_HOSTThe url of your storage servicenull
FILE_STORAGE_PORTThe port of you storage servicenull
FILE_STORAGE_USE_SSLput it to true if you want to use SSL to communicate with your storage servicenull
FILE_STORAGE_ACCESS_KEYThe login of your storage servicenull
FILE_STORAGE_SECRET_KEYThe password of your storage servicenull
RABBITMQ_HOSTThe url of your RabbitMQ servicenull
RABBITMQ_PORTThe port of your storage servicenull
RABBITMQ_USE_SSLset true if you want to use AMQPS to communicate with RabbitMQ AMQP otherwise
RABBITMQ_USERThe login of your storage servicenull
RABBITMQ_PASSWORDThe password of your storage servicenull
UIDThe user id of the user to manipulate your file in the container launched with docker actions1000
GIDThe group id of the user to manipulate your file in the container launched with docker actions1000
UNAMEThe name of the user to manipulate your file in the container launched with docker actionsworker
TASK_ACTIONER_PATHThe location of your task actioner applicationnull
SIMULTANEOUS_TASKSNumber of concurrent tasks1

Run the tests suite

Start the test environment

Go into the tests directory and run docker-compose specifying the environment variable TASK_ACTIONER_PATH, RABBITMQ_PORT, FILE_STORAGE_ACCESS_KEY and FILE_STORAGE_SECRET_KEY

TASK_ACTIONER_PATH=<task_actioner_path> RABBITMQ_PORT=<rabbitmq_port> FILE_STORAGE_ACCESS_KEY=<access_key> FILE_STORAGE_SECRET_KEY=<secret_key> docker-compose up -d

Go back tot the root the repository

Install the the test actions with docker and npm:

docker build -t zip -f tests/actions/zip/Dockerfile tests/actions/zip/

npm i tests/actions/unzip

Now you can run:

npm test

TODO

  • Plug the consumer to rabbitMQ
  • Build docker image if it doesn't exist
  • Rebuild in Rust
  • Handle errors nicely and log!
  • Handle progress feedback of tasks

Tag summary

Content type

Image

Digest

Size

153.2 MB

Last updated

over 6 years ago

docker pull myminifactory/task-actioner