From 307071e1b0d536abbec277764b427d145d4f42b7 Mon Sep 17 00:00:00 2001 From: Linus Nordberg Date: Tue, 24 Feb 2015 19:26:21 +0100 Subject: Add packaging and examples. --- examples/docker-minimal-separate/README | 18 ++++++++++ .../docker-minimal-separate/frontend/Dockerfile | 13 +++++++ .../frontend/catlfish.config | 38 ++++++++++++++++++++ examples/docker-minimal-separate/frontend/frontend | 42 ++++++++++++++++++++++ .../docker-minimal-separate/storage/Dockerfile | 10 ++++++ .../storage/catlfish.config | 35 ++++++++++++++++++ 6 files changed, 156 insertions(+) create mode 100644 examples/docker-minimal-separate/README create mode 100644 examples/docker-minimal-separate/frontend/Dockerfile create mode 100644 examples/docker-minimal-separate/frontend/catlfish.config create mode 100644 examples/docker-minimal-separate/frontend/frontend create mode 100644 examples/docker-minimal-separate/storage/Dockerfile create mode 100644 examples/docker-minimal-separate/storage/catlfish.config (limited to 'examples/docker-minimal-separate') diff --git a/examples/docker-minimal-separate/README b/examples/docker-minimal-separate/README new file mode 100644 index 0000000..afb5f64 --- /dev/null +++ b/examples/docker-minimal-separate/README @@ -0,0 +1,18 @@ +Given a docker image 'catlfish' as defined in +catlfish/packaging/docker, here is an example of a minimal catlfish +instance using three docker containers to run a single frontend node, +a single storage node and a third system for merge. + +First, edit frontend/catlfish.config and replace MY-PUBLIC-ADDRESS +with an IP address or DNS name for the interface on the host system +that is most likely to play well with docker. (This part of the +instructions can most certainly be improved by someone with some +docker skills!) + +Then, run + + $ docker build -t my-single-node-catlfish docker + +How to run the single node catlfish image: + + $ docker run my-single-node-catlfish diff --git a/examples/docker-minimal-separate/frontend/Dockerfile b/examples/docker-minimal-separate/frontend/Dockerfile new file mode 100644 index 0000000..d5391b9 --- /dev/null +++ b/examples/docker-minimal-separate/frontend/Dockerfile @@ -0,0 +1,13 @@ +FROM catlfish + +ADD logkey/eckey.pem logkey/eckey-public.pem /opt/plop/test/ +ADD catlfish.config /opt/catlfish/rel/ +ADD known_roots /opt/catlfish/rel/known_roots +ADD https /opt/catlfish/rel/https +RUN mkdir /opt/catlfish/rel/log + +WORKDIR /opt/catlfish/rel +EXPOSE 8080 +EXPOSE 8082 + +CMD ["/usr/bin/supervisord"] diff --git a/examples/docker-minimal-separate/frontend/catlfish.config b/examples/docker-minimal-separate/frontend/catlfish.config new file mode 100644 index 0000000..9f5e35d --- /dev/null +++ b/examples/docker-minimal-separate/frontend/catlfish.config @@ -0,0 +1,38 @@ +%% catlfish configuration file (-*- erlang -*-) +%% Start like this: +%% $ erl -boot start_sasl -config catlfish -run inets +[{sasl, + [{sasl_error_logger, false}, + {errlog_type, error}, + {error_logger_mf_dir, "log"}, + {error_logger_mf_maxbytes, 10485760}, % 10 MB + {error_logger_mf_maxfiles, 10}]}, + {catlfish, + [{known_roots_path, "known_roots"}, + {rejected_certs_path, "rejected"}, + {https_servers, + [{external_https_api, "0.0.0.0", 8080, v1}, + {frontend_https_api, "0.0.0.0", 8082, frontend} + ]}, + {https_certfile, "https/certs/ct.cert.pem"}, + {https_keyfile, "https/keys/ct.key.pem"}, + {https_cacertfile, "https/certs/cas.pem"} + ]}, + {lager, + [{handlers, + [{lager_console_backend, info}, + {lager_file_backend, [{file, "log/error.log"}, {level, error}]}, + {lager_file_backend, [{file, "log/debug.log"}, {level, debug}]}, + {lager_file_backend, [{file, "log/console.log"}, {level, info}]} + ]} + ]}, + {plop, + [{entry_root_path, "db/certentries/"}, + {index_path, "db/index"}, + {entryhash_root_path, "db/entryhash/"}, + {treesize_path, "db/treesize"}, + {indexforhash_root_path, "db/certindex/"}, + {storage_nodes, + ["https://MY-PUBLIC-ADDRESS:10081/ct/storage/"]}, + {storage_nodes_quorum, 1} + ]}]. diff --git a/examples/docker-minimal-separate/frontend/frontend b/examples/docker-minimal-separate/frontend/frontend new file mode 100644 index 0000000..96f9a9b --- /dev/null +++ b/examples/docker-minimal-separate/frontend/frontend @@ -0,0 +1,42 @@ +%% catlfish configuration file (-*- erlang -*-) +%% Start like this: +%% $ erl -boot start_sasl -config catlfish -run inets +[{sasl, + [{sasl_error_logger, false}, + {errlog_type, error}, + {error_logger_mf_dir, "log"}, + {error_logger_mf_maxbytes, 10485760}, % 10 MB + {error_logger_mf_maxfiles, 10}]}, + {catlfish, + [{known_roots_path, "known_roots"}, + {rejected_certs_path, "rejected"}, + {https_servers, + [{external_https_api, "0.0.0.0", 8080, v1}, + {frontend_https_api, "0.0.0.0", 8082, frontend} + ]}, + {https_certfile, "https/certs/ct.cert.pem"}, + {https_keyfile, "https/keys/ct.key.pem"}, + {https_cacertfile, "https/certs/cas.pem"} + ]}, + {lager, + [{handlers, + [{lager_console_backend, info}, + {lager_file_backend, [{file, "log/error.log"}, {level, error}]}, + {lager_file_backend, [{file, "log/debug.log"}, {level, debug}]}, + {lager_file_backend, [{file, "log/console.log"}, {level, info}]} + ]} + ]}, + {plop, + [{entry_root_path, "db/certentries/"}, + {index_path, "db/index"}, + {entryhash_root_path, "db/entryhash/"}, + {treesize_path, "db/treesize"}, + {indexforhash_root_path, "db/certindex/"}, + {storage_nodes, + ["https://f0.ct.nordu.net:10081/ct/storage/", + "https://f0.ct.nordu.net:11081/ct/storage/", + "https://f0.ct.nordu.net:12081/ct/storage/", + "https://f0.ct.nordu.net:13081/ct/storage/", + "https://f0.ct.nordu.net:14081/ct/storage/"]}, + {storage_nodes_quorum, 3} + ]}]. diff --git a/examples/docker-minimal-separate/storage/Dockerfile b/examples/docker-minimal-separate/storage/Dockerfile new file mode 100644 index 0000000..623b195 --- /dev/null +++ b/examples/docker-minimal-separate/storage/Dockerfile @@ -0,0 +1,10 @@ +FROM catlfish + +ADD catlfish.config /opt/catlfish/rel/ +ADD https /opt/catlfish/rel/https +RUN mkdir /opt/catlfish/rel/log + +WORKDIR /opt/catlfish/rel +EXPOSE 8081 + +CMD ["/usr/bin/supervisord"] diff --git a/examples/docker-minimal-separate/storage/catlfish.config b/examples/docker-minimal-separate/storage/catlfish.config new file mode 100644 index 0000000..4ff8626 --- /dev/null +++ b/examples/docker-minimal-separate/storage/catlfish.config @@ -0,0 +1,35 @@ +%% catlfish configuration file (-*- erlang -*-) +%% Start like this: +%% $ erl -boot start_sasl -config catlfish -run inets +[{sasl, + [{sasl_error_logger, false}, + {errlog_type, error}, + {error_logger_mf_dir, "log"}, + {error_logger_mf_maxbytes, 10485760}, % 10 MB + {error_logger_mf_maxfiles, 10}]}, + {catlfish, + [{known_roots_path, "known_roots"}, + {rejected_certs_path, "rejected"}, + {https_servers, + [{storage_https_api, "0.0.0.0", 8081, storage} + ]}, + {https_certfile, "https/certs/ct.cert.pem"}, + {https_keyfile, "https/keys/ct.key.pem"}, + {https_cacertfile, "https/certs/cas.pem"} + ]}, + {lager, + [{handlers, + [{lager_console_backend, info}, + {lager_file_backend, [{file, "log/error.log"}, {level, error}]}, + {lager_file_backend, [{file, "log/debug.log"}, {level, debug}]}, + {lager_file_backend, [{file, "log/console.log"}, {level, info}]} + ]} + ]}, + {plop, + [{entry_root_path, "db/certentries/"}, + {index_path, "db/index"}, + {newentries_path, "db/newentries"}, + {entryhash_root_path, "db/entryhash/"}, + {treesize_path, "db/treesize"}, + {indexforhash_root_path, "db/certindex/"} + ]}]. -- cgit v1.1