Sign inSign up

hltcoe/file-access

By hltcoe

•Updated over 9 years ago

Implementation of Fetch and Store services using a file system backend

Image
0

5.8K

hltcoe/file-access repository overview

⁠Running the access services

Usage is very simple. To run a FetchCommunicationService on top of an existing tar file, start a container:

docker run -d --name fetch hltcoe/file-access python /tmp/file_fetch_server.py --path /data --port 9090

and upload the file:

cat my_data_file.tgz | docker exec -i fetch python /tmp/populate.py --path /data

To start a StoreCommunicationService, run:

docker run -d --name store hltcoe/file-access python /tmp/file_store_server.py --path /data --port 9091

After sending a bunch of Communications to a running Store service, you could extract all the stored Communications:

protocol, transport = set_up_my_thrift_stuff()
client = FetchCommunicationService.Client(protocol)
transport.open()
count = client.getCommunicationCount()
ids = client.getCommunicationIDs(0, count)
comms = client.fetch(FetchRequest(communicationIds=ids)).communications
write_my_communications(comms, file)

An important point is that, if you want another container (say, your analytic) to be able to speak with one of these services, you'll need to start it on the same virtual network like so:

docker run --network='container:store' my_great_container

or any of the many ways of exposing/connecting ports from Docker containers.

Tag summary

Content type

Image

Digest

Size

418.6 MB

Last updated

over 9 years ago

docker pull hltcoe/file-access