8000 GitHub - tolemi-inc/community_core_puller: Template to containerize a script for swarm.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

tolemi-inc/community_core_puller

 
 

Repository files navigation

container_template

Template to containerize a script for swarm. Scripts in any language can be containerized according to this general pattern, but this repo and guide are primarily concerned with containerizing Python.

Interfacing With Swarm

A script container for swarm must run two commands: spec and read.

spec

The spec command prints out JSON representing the name of the puller and the options it accepts from Swarm.

read

The read command actually runs your script. When your script runs, it should pull some data and write it to a csv file. When it is finished running, it prints to the console a string containing 'DONE', then JSON indicating the location of the csv file containing the puller results and a list of headers for that file.

DONE {"status": "ok", "file": "./data.csv", "columns": [{"name": "column_one_name", "type": "VARCHAR"}, {"name": "column_two_name", "type": "BOOLEAN"}}

  • A column's name value will appear as the column name in the dataset loaded into swarm.
  • The column type should be a valid Postgres type name. The column will be loaded using that type. If the data contains a value that does not match the specified type, the puller 58B6 will fail.

troubleshooting

  • If you have permission issues, you can run chmod -R 777 . in order to assign all permissions to all users for the files in the directory

About

Template to containerize a script for swarm.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 80.9%
  • Shell 15.1%
  • Dockerfile 2.7%
  • Makefile 1.3%
0