Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add docker-compose testnet #103

Open
wants to merge 16 commits into
base: master
Choose a base branch
from

Conversation

mixmasala
Copy link
Contributor

@mixmasala mixmasala commented Mar 8, 2024

This adds Makefile targets to start and stop a local talek deployment using docker-compose and podman or docker. It provides a docker-compose.yml and writes a client configuration file for use with talekclient.

This adds Makefile targets for running a local deployment of talek with podman and docker-compose.

testnet-start: starts a talek deployment
testnet-stop: stops the deployment
testnet-build-config: builds configuration with talekutil
testnet-clean: cleans images and stampfiles
testnet-cli: starts a shell with talek cli programs
@mixmasala mixmasala marked this pull request as draft March 8, 2024 08:27
@mixmasala
Copy link
Contributor Author

After manually editing talek.json to point at the frontend instance listening on :8080 I wasn't able to read/write data using talekclient. For example:

root@e6d0b67b79b7:/talek_net# talekclient --config talek.json --verbose --read
Connection to RPC established.
[Client] INFO: 2024/03/08 08:10:44 client.go:258: Reading bucket 163
[Client] INFO: 2024/03/08 08:10:45 client.go:258: Reading bucket 164
[Client] INFO: 2024/03/08 08:10:46 client.go:258: Reading bucket 163
[Client] INFO: 2024/03/08 08:10:47 client.go:258: Reading bucket 164
[Client] INFO: 2024/03/08 08:10:48 client.go:258: Reading bucket 163
Timed out waiting for new message.
root@e6d0b67b79b7:/talek_net# talekclient --config talek.json --verbose --write "hello"
Connection to RPC established.
[Client] INFO: 2024/03/08 08:10:54 client.go:258: Reading bucket -1
[Client] INFO: 2024/03/08 08:10:54 client.go:128: Wrote [91 153 108 182](1024) to 163,164.
root@e6d0b67b79b7:/talek_net# talekclient --config talek.json --verbose --read
Connection to RPC established.
[Client] INFO: 2024/03/08 08:10:56 client.go:258: Reading bucket 944
[Client] INFO: 2024/03/08 08:10:57 client.go:258: Reading bucket 63
[Client] INFO: 2024/03/08 08:10:58 client.go:258: Reading bucket 944
[Client] INFO: 2024/03/08 08:10:59 client.go:258: Reading bucket 63
[Client] INFO: 2024/03/08 08:11:00 client.go:258: Reading bucket 944
Timed out waiting for new message.
root@e6d0b67b79b7:/talek_net# 

@mixmasala
Copy link
Contributor Author

You should be able to replicate this by using the Makefile target testnet-start and testnet-cli, where the client configuration is written to /talek_net/talek.json inside the container

restart: "no"
image: talek
volumes:
- ./:/talek_net
Copy link
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
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

@mixmasala mixmasala changed the title Add 102 talek testnet Add doker-compose testnet Mar 13, 2024
@mixmasala mixmasala changed the title Add doker-compose testnet Add docker-compose testnet Mar 13, 2024
@mixmasala mixmasala marked this pull request as ready for review March 13, 2024 15:59
leif added 8 commits May 4, 2024 13:50
instead of requiring a python docker image
- use default config file names
- use docker workdir
- escape quotes so sed line actually works
- fix port number
This works for me right now, but I don't know why I need to fork the log handle
into a reader and a writer the way I am here before using it.

If I read and write using the same handle (without making a copy of it first),
the read operations always read from the locations --write would write to
*next*, rather than the previous locations which have actually been written to.
So, there is either an off-by-one error somewhere or I am confused about how
this is supposed to work.
- allow stopping and restarting without regenerating configs
- make testnet-test-write-and-read target depend on the network being up
After merging masala's fix for parsing read-only handles from
privacylab#110 this works now.
@willscott
Copy link
Member

Is this a a point that's ready for a review?

@leif
Copy link

leif commented May 15, 2024

Is this a a point that's ready for a review?

Yes please. Note that this has the fix from the other open PR (#110) merged to make the write-and-read integration test work.

Let me know if you're actually running travis somewhere and I could add it to .travis.yml too (or if you want to setup github CI to run it i could do that also/instead).

@willscott
Copy link
Member

  • I am not aware of a travis instance running somewhere
  • happy to get github CI set up as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants