Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Dockerfile for talek
FROM golang:1.12
FROM golang:1.20
MAINTAINER Raymond Cheng <me@raymondcheng.net>
USER root

Expand Down
44 changes: 40 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
docker_compose?= $(shell if which podman|grep -q .; then echo DOCKER_HOST="unix://$$XDG_RUNTIME_DIR/podman/podman.sock" docker-compose; else echo docker-compose; fi)
docker_user?=$(shell if echo ${docker}|grep -q podman; then echo 0:0; else echo ${uid}:${gid}; fi)
docker=$(shell if which podman|grep -q .; then echo podman; else echo docker; fi)
net_name=talek_net

.PHONY: get-tools test lint unit

get-tools:
Expand Down Expand Up @@ -25,9 +30,40 @@ ci: lint
goveralls -coverprofile=overalls.coverprofile -service=travis-ci; \
fi

docker-build:
docker build -t talek-base:latest ./
docker build -t talek-replica:latest ./cli/talekreplica/
docker-build.stamp:
$(docker) build -t talek-base:latest ./
#$(docker) build -t talek-replica:latest ./cli/talekreplica/
touch $@

docker-bash:
docker run -it talek-base:latest bash
$(docker) run -it talek-base:latest bash

testnet-build-config: docker-build-cli.stamp
$(docker) run --rm -v ./$(net_name):/$(net_name) talek-cli bash -c "cd /$(net_name) && talekutil --common --outfile common.json && \
talekutil --replica --incommon common.json --private --index 1 --name replica1 --address :8081 --outfile replica1.json && \
talekutil --replica --incommon common.json --private --index 2 --name replica2 --address :8082 --outfile replica2.json && \
talekutil --replica --incommon common.json --private --index 3 --name replica3 --address :8083 --outfile replica3.json && \
talekutil --trustdomain --infile replica1.json --outfile replica1.pub.json && \
talekutil --trustdomain --infile replica2.json --outfile replica2.pub.json && \
talekutil --trustdomain --infile replica3.json --outfile replica3.pub.json && \
talekutil --client --infile common.json --trustdomains replica1.pub.json,replica2.pub.json,replica3.pub.json --outfile talek.json"

docker-build-cli.stamp: docker-build.stamp
$(docker) build -t talek-cli:latest ./cli/
touch $@

testnet-start: testnet-build-config
cd $(net_name); DOCKER_USER=${docker_user} $(docker_compose) up --remove-orphans -d; $(docker_compose) top
touch $(net_name)/running.stamp

testnet-stop:
cd $(net_name) && DOCKER_USER=${docker_user} $(docker_compose) down --remove-orphans; rm -fv running.stamp

testnet-clean:
$(docker) rmi talek-cli
$(docker) rmi talek-base
rm docker-build-cli.stamp
rm docker-build.stamp

testnet-cli:
$(docker) run --rm --network host -it -v ./$(net_name):/$(net_name) talek-cli:latest bash
13 changes: 13 additions & 0 deletions cli/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Dockerfile for talek
FROM talek-base:latest
MAINTAINER Masala <masala@riseup.net>
USER root

# build and install talek cli tools
RUN go mod download
RUN cd cli/talekutil && go install
RUN cd cli/clinfo && go install
RUN cd cli/talekclient && go install
RUN cd cli/talekfrontend && go install
RUN cd cli/talekreplica && go install
RUN cd cli/talekutil && go install
2 changes: 0 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@ go 1.12

require (
github.com/agl/ed25519 v0.0.0-20170116200512-5312a6153412
github.com/barnex/cuda5 v0.0.0-20170131213030-57cec7ab46da
github.com/coreos/etcd v0.0.0-20170414193847-e2d0db95ebbc
github.com/coreos/go-systemd v0.0.0-20170324095819-1f9909e51b2d // indirect
github.com/coreos/pkg v0.0.0-20170405072653-099530d80109 // indirect
github.com/dchest/siphash v1.2.1
github.com/foobaz/go-zopfli v0.0.0-20140122214029-7432051485e2
github.com/go-gl/cl v0.0.0-20160402050751-283e73a0ca2a
github.com/google/zopfli v0.0.0-20190118173051-ef109ddf1649
github.com/gorilla/rpc v1.1.0
github.com/spf13/pflag v0.0.0-20170412152249-e453343e6260
github.com/willscott/bloom v0.0.0-20190611115233-60e4b211444f
Expand Down
8 changes: 3 additions & 5 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,29 +1,27 @@
github.com/agl/ed25519 v0.0.0-20170116200512-5312a6153412 h1:w1UutsfOrms1J05zt7ISrnJIXKzwaspym5BTKGx93EI=
github.com/agl/ed25519 v0.0.0-20170116200512-5312a6153412/go.mod h1:WPjqKcmVOxf0XSf3YxCJs6N6AOSrOx3obionmG7T0y0=
github.com/barnex/cuda5 v0.0.0-20170131213030-57cec7ab46da/go.mod h1:GnBnFz4V/+kxwKFnquvOOi+IjZoVJsIUbcAVOXLCxCo=
github.com/coreos/etcd v0.0.0-20170414193847-e2d0db95ebbc h1:VR+2Zdu4LwGrVDMUdVphibZfMHoFEnb5t8xQDWi1IAk=
github.com/coreos/etcd v0.0.0-20170414193847-e2d0db95ebbc/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
github.com/coreos/go-systemd v0.0.0-20170324095819-1f9909e51b2d h1:JmJsvY9kF4oqiNrI+3FEoTtpRu8HvlxPgCSIrxxoZTQ=
github.com/coreos/go-systemd v0.0.0-20170324095819-1f9909e51b2d/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
github.com/coreos/pkg v0.0.0-20170405072653-099530d80109 h1:8RxHvQFXd1AgM3q7iG92w06tQKiuqpHCNf5lVKs9bbs=
github.com/coreos/pkg v0.0.0-20170405072653-099530d80109/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dchest/siphash v1.1.0 h1:1Rs9eTUlZLPBEvV+2sTaM8O0NWn0ppbgqS7p11aWawI=
github.com/dchest/siphash v1.1.0/go.mod h1:q+IRvb2gOSrUnYoPqHiyHXS0FOBBOdl6tONBlVnOnt4=
github.com/dchest/siphash v1.2.1 h1:4cLinnzVJDKxTCl9B01807Yiy+W7ZzVHj/KIroQRvT4=
github.com/dchest/siphash v1.2.1/go.mod h1:q+IRvb2gOSrUnYoPqHiyHXS0FOBBOdl6tONBlVnOnt4=
github.com/foobaz/go-zopfli v0.0.0-20140122214029-7432051485e2 h1:VA6jElpcJ+wkwEBufbnVkSBCA2TEnxdRppjRT5Kvh0A=
github.com/foobaz/go-zopfli v0.0.0-20140122214029-7432051485e2/go.mod h1:Yi95+RbwKz7uGndSuUhoq7LJKh8qH8DT9fnL4ewU30k=
github.com/go-gl/cl v0.0.0-20160402050751-283e73a0ca2a h1:XIGMyilyw1fCjQW2XBAQYNSqBjz6ZEDSQcU24zjC/TI=
github.com/go-gl/cl v0.0.0-20160402050751-283e73a0ca2a/go.mod h1:x9JFrvJwNd4nJdwEzeF+68Bul1G/WftfhxdnJF85OUc=
github.com/google/zopfli v0.0.0-20190118173051-ef109ddf1649 h1:zDqfvNfJRhocVF/Ul+M/hhhewIw9R8xJwDOGrHDKzzI=
github.com/google/zopfli v0.0.0-20190118173051-ef109ddf1649/go.mod h1:s2ULOAKrLKt7BL/w7MwT3F8bAXHc792qVNGEd5Wp7OQ=
github.com/gorilla/rpc v1.1.0 h1:marKfvVP0Gpd/jHlVBKCQ8RAoUPdX7K1Nuh6l1BNh7A=
github.com/gorilla/rpc v1.1.0/go.mod h1:V4h9r+4sF5HnzqbwIez0fKSpANP0zlYd3qR7p36jkTQ=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/spf13/pflag v0.0.0-20170412152249-e453343e6260 h1:Rel8ggqtJ8xEfIJKPRDcF/f8a5Ukr6Wsyen4uGcYh+k=
github.com/spf13/pflag v0.0.0-20170412152249-e453343e6260/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/willscott/bloom v0.0.0-20190611115233-60e4b211444f h1:HDruOClXOci/Duq+8QQZZTt2S2BvgT70pyX3nsVZbPQ=
github.com/willscott/bloom v0.0.0-20190611115233-60e4b211444f/go.mod h1:ioaxSY0uYBnMt/u6zoCy87QnCVbch+cfpqo9rtSfK2s=
Expand Down
39 changes: 39 additions & 0 deletions talek_net/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
version: "2"

services:

frontend:
restart: "no"
image: talek
volumes:
- ./:/talek_net

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe make the volume talek_shared_mnt or something that disambiguates from the docker network net?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed the volume path to talek_shared

command: talekfrontend --client /talek_net/talek.json --common /talek_net/common.json -l ":8080" --verbose
network_mode: host
depends_on:
- replica1
- replica2
- replica3

replica1:
restart: "no"
image: talek
volumes:
- ./:/talek_net
command: talekreplica -f /talek_net/common.json -l ":8081" -c /talek_net/replica1.json
network_mode: host

replica2:
restart: "no"
image: talek
volumes:
- ./:/talek_net
command: talekreplica -f /talek_net/common.json -l ":8082" -c /talek_net/replica2.json
network_mode: host

replica3:
restart: "no"
image: talek
volumes:
- ./:/talek_net
command: talekreplica -f /talek_net/common.json -l ":8083" -c /talek_net/replica3.json
network_mode: host