All Projects → fujiwara → tuggle

fujiwara / tuggle

Licence: MIT license
Distributed file mirroring proxy in Consul cluster

Programming Languages

go
31211 projects - #10 most used programming language
Makefile
30231 projects
HTML
75241 projects

Projects that are alternatives of or similar to tuggle

Stretcher
Deployment tool with consul/serf event notification.
Stars: ✭ 232 (+1350%)
Mutual labels:  deployment, consul
docker vault
Docker + Consul + Vault
Stars: ✭ 34 (+112.5%)
Mutual labels:  consul
tiller-circleci-orb
Deploy Trellis, Bedrock and Sage(optional) via CircleCI
Stars: ✭ 13 (-18.75%)
Mutual labels:  deployment
fm.consulinterop
a lib for build micro-service
Stars: ✭ 33 (+106.25%)
Mutual labels:  consul
github-env-vars-action
🚀 GitHub Action for Environment Variables
Stars: ✭ 129 (+706.25%)
Mutual labels:  deployment
portainer-stack-utils
CLI client for Portainer
Stars: ✭ 66 (+312.5%)
Mutual labels:  deployment
sclblpy
Python package for Scailable uploads
Stars: ✭ 18 (+12.5%)
Mutual labels:  deployment
strapi-plugin-vercel
▲ Strapi plugin for Vercel Platform
Stars: ✭ 28 (+75%)
Mutual labels:  deployment
capistrano-docker-compose
Docker Compose specific tasks for Capistrano
Stars: ✭ 17 (+6.25%)
Mutual labels:  deployment
deployment-status
GitHub action for updating deployments with status events.
Stars: ✭ 24 (+50%)
Mutual labels:  deployment
Consul.ServiceDiscovery.Demo
This demo shows how to implement simple containerized (Docker) microservice architecture with gateway, load balancer (Ocelot) and automatic service discovery (Consul).
Stars: ✭ 24 (+50%)
Mutual labels:  consul
drupal-pi
Drupal on Docker on a Raspberry Pi. Pi Dramble's little brother.
Stars: ✭ 92 (+475%)
Mutual labels:  deployment
travis
⛔ ARCHIVED ⛔ Set Up 'Travis' for Testing and Deployment
Stars: ✭ 61 (+281.25%)
Mutual labels:  deployment
envoyer-npm-deployment
Compile assets that depend on node packages using Laravel Envoyer deployment hooks
Stars: ✭ 43 (+168.75%)
Mutual labels:  deployment
dockerized-drupal-starter
End-to-end (CI + CD) dockerized Drupal 8 starting point.
Stars: ✭ 27 (+68.75%)
Mutual labels:  deployment
feater
Tool for rapid deployment of selected features of your web application to isolated testing or demo environments.
Stars: ✭ 27 (+68.75%)
Mutual labels:  deployment
ansible-rails-deployment
deploy projects using ansible
Stars: ✭ 77 (+381.25%)
Mutual labels:  deployment
ml api covid
This is the API Code for my tutorial article. It paints a picture for developing a machine learning Python API from start to finish and provides help in more difficult areas like the setup with AWS Lambda.
Stars: ✭ 21 (+31.25%)
Mutual labels:  deployment
FogTorchPI
A probabilistic prototype for deployment of Fog applications.
Stars: ✭ 19 (+18.75%)
Mutual labels:  deployment
meshery-consul
Meshery adapter for Consul
Stars: ✭ 50 (+212.5%)
Mutual labels:  consul

tuggle

Distributed file mirroring proxy in Consul cluster

Install

go get -u github.com/fujiwara/tuggle
Usage of tuggle:
  -data-dir string
    	data directory (default "./data")
  -fetch-rate string
    	Max fetch rate limit(/sec) (default "unlimited")
  -fetch-timeout string
    	fetch timeout (default "10m0s")
  -namespace string
    	namespace (default "tuggle")
  -port int
    	listen port (default 8900)
  -slave
    	slave mode (fetch only)

Getting Started

Run

Run tuggle process in a Consul cluster. (e.g. node1, node2, node3)

[node{1,2,3}]$ mkdir /tmp/tuggle
[node{1,2,3}]$ tuggle -data-dir /tmp/tuggle
  • comunicate with consul agent via 127.0.0.1:8500.
  • store files in -data-dir.
  • listen port tcp/8900

Put file

tuggle accepts files by HTTP POST method.

[node1]$ curl -XPUT -H"Content-Type: application/gzip" --data-binary @test.gz localhost:8900/test.gz

List stored files.

[node1]$ curl -s localhost:8900 | jq .
[
  {
    "id": "6524a9d7b3bde0f3543f1ead0ae8604f",
    "name": "test.gz",
    "content_type": "application/gzip",
    "size": 8764510,
    "created_at": "2017-02-13T07:46:18.809409122Z"
  }
]

ID is md5 hex of filename.

tuggle will register to Consul service(name=tuggle, tag=ID).

$ curl -s localhost:8500/v1/catalog/service/tuggle?tag=6524a9d7b3bde0f3543f1ead0ae8604f | jq .
[
  {
    "ID": "ec22d2d8-0728-406b-6212-02e55c5c14a0",
    "Node": "ip-172-31-17-183",
    "Address": "172.31.17.183",
    "TaggedAddresses": {
      "lan": "172.31.17.183",
      "wan": "172.31.17.183"
    },
    "NodeMeta": {},
    "ServiceID": "tuggle",
    "ServiceName": "tuggle",
    "ServiceTags": [
      "6524a9d7b3bde0f3543f1ead0ae8604f"
    ],
    "ServiceAddress": "",
    "ServicePort": 8900,
    "ServiceEnableTagOverride": false,
    "CreateIndex": 10055,
    "ModifyIndex": 46156
  }
]

Get files from other nodes

[node2]$ curl --head localhost:8900/test.gz
HTTP/1.1 200 OK
Content-Length: 8764510
Content-Type: application/gzip
Last-Modified: Mon, 13 Feb 2017 07:46:18 UTC
X-Tuggle-Object-Id: 6524a9d7b3bde0f3543f1ead0ae8604f
Date: Mon, 13 Feb 2017 07:53:46 GMT
[node2]$ curl localhost:8900/test.gz > test.gz
[node2]$ ls -l test.gz
-rw-rw-r-- 1 foo bar 8764510 Feb 13 07:55 test.gz

tuggle on node{2,3} works as below.

  • Find test.gz in data-dir
  • If it is not found
    • Fetch test.gz from [MD5 of filename].tuggle.service.consul
    • Store into data-dir.
    • Register myself to Consul service.
    • Serve file to http client.

Delete files

[node1]$ curl -X DELETE localhost:8900/test.gz

DELETE is enable on any nodes.

LICENSE

MIT License

Copyright (c) 2017 FUJIWARA Shunichiro / KAYAC Inc.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].