Resolves #21 #145
No reviewers
Labels
No Label
applications
BLOCKED
bug
design
duplicate
enhancement
fixed?
funding-needed
help wanted
infrastructure
invalid
payments
qubes
question
ready-for-implementation
refactor
spam
tapir-server
testing
tor
wontfix
No Milestone
4 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: cwtch.im/cwtch#145
Loading…
Reference in New Issue
No description provided.
Delete Branch ":21ContainerizeServer"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Adds a Dockerfile and dependencies (server/torrc, server/docker-entrypoint) allowing one to create a docker image containing tor and cwtch.
Both Tor and Cwtch are downloaded and compiled at build time, only the build artifacts are present in the final image.
A .gitlab-ci.yml file is present for compatibility with Gitlab CI pipelines allowing one to automatically push new Cwtch container images to Gitlab registry and Docker Hub.
If using Gitlab the CI Environment variables
DOCKER_HUB_ID
andDOCKER_HUB_PASSWORD
must be present to push to docker hub.Drone Build Status: failure
https://build.openprivacy.ca/cwtch.im/cwtch/218
Drone Build Status: success
https://build.openprivacy.ca/cwtch.im/cwtch/220
This looks awesome! Assigning @dan to look at it.
General: Omg wow, thanks, this is amazing work!
Comments:
.gitlab-ci.yml:
mkdir /go/src/cwtch.im
ln -s /builds/BrassHornComms/cwtch /go/src/cwtch.im/cwtch
cd /go/src/cwtch.im/cwtch/server/app/
go get
This seems a bit specific to one setup, anyway we can generalize this a little more?
Also will this work on a clean system? it seems like you are cding into server/app before go getting the cwtch codebase, might want to cd into cwtch.im/cwtch then go get server/app ? Not sure, just eyeballing this
You will find in
testing
we have two scriptstests.sh
andquality.sh
. Tests runs unit tests on the whole code base, and quality does vet and lint. Additionally runninggo test testing
will run our integration test which spins up 3 peers and a servers and confirms they can interact. May want to use those for your tests, not sure?Dockerfile:
Omg you have it build the latest Tor? That's great!!!
I may borrow that for our build server test images, currently we have it wget-ting a static tor build... -_-; nice work
This may be something we need to work together on: when it launches, does it give any feed back on the .onion address its working on? I believe right now we do have it print it out on boot, but I think we could do a little more to expose it and make it clear. Is it good enough for your uses now?
k8s/cwtch.yml:
I am getting a 404 on this and it may be a specific name. I'm unfamiliar with Kubernetics and registry.gitlab.com. What is this? Is this a place to store built images?
So yeah, this looks amazing, just a few this as outlined above I'd like to investigate if we can generalize.
Thanks!
Whoops, yes those are both in need of a cleanup.
TAGNAME will 404 as it gets replaced by sed with the commit hash, but again this is probably a bit too specific to my setup so will remove it.
Docker captures STDOUT and STDERR so you would need to issue
docker logs CONTAINERNAME
to get your address if demonized (-d
) or if running in the foreground withdocker run cwtch:latest
you'd see; https://twitter.com/NetworkString/status/1051808658605006848This is a docker registry built into gitlab.com (github clone) which as you suggest is a place to store built docker images. FWIW we can actually remove .gitlab-ci.yml since you have drone (which I wasn't aware of at the time).
I'm not familiar with drone but one of you could register at hub.docker.com (the defacto docker registry) and take these lines from the .gitlab-ci.yml to build a docker image and push it straight to docker hub;
gitlab spins up a fresh container, checks out the source and then executes the commands, $GOWORKDIR handles everything being pulled into the right place;
I had issues doing
go get
orgo test
in any dir other thanserver/app
orclient/app
but I'm not sure if this is down to my build env or not?OK.
So you should be good to checkout this branch and in the root issue;
docker build -t cwtch:latest
If all is successful then;
docker run cwtch:latest
I've pushed this commit to my gitab repo and it has triggered gitlab pipeline https://gitlab.com/BrassHornComms/cwtch/pipelines/33046937 which should result in a new docker image in gitlab and docker hub
At this point you could either configure drone to mimic what's in the .gitlab-ci.yml or signup for gitlab, configure a repository mirror for Gogs and create a Docker Hub organisation for pushing to Docker Hub.
The bonus of pushing your images to docker hub is that people only need to issue
docker run openpriv/cwtch
(or possibly justdocker run cwtch
) and it'll work without them needing to do any other config!Drone Build Status: success
https://build.openprivacy.ca/cwtch.im/cwtch/221
Drone Build Status: success
https://build.openprivacy.ca/cwtch.im/cwtch/222
Drone is out build system (http://docs.drone.io/) and uses docker compose to make images to compile and run tests on
I don't know kubernetics so I dont know how compatible they are, there may be value in having that still around?
We really don't have enough documentation about running Cwtch and now you're adding a bunch of lovely new ways, can you maybe add a new section at the bottom of README.md on how to use these new containers and then we should be good to merge it all!
thanks so much
Kubernetes is just dockerd on steroids. Underneath it's still docker but with lots of other bits on top (which run as containers) that allows you to 'declare' a configuration (this many containers, running this image, with these values, and a load balancer please) and it goes and does it for you.
In order for a kubernetes manifest to be useful we need to know where to pull the image(s) from.
I'd suggest that once I've added the README changes someone at OpenPrivacy signup to Docker Hub and configure Drone to push the image there ( http://docs.drone.io/publish-docker-images/ seems to be lacking :/ ), once there's a "public" image available I can submit another PR with a k8s manifest?
Drone Build Status: success
https://build.openprivacy.ca/cwtch.im/cwtch/223
awesome!
thanks!
and will do