Skip to content

uri-j/cs202-project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

201 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CS202 Computer Systems - project - 2025

This project is a simple, distributed hash table, Linux-only software composed of multiple servers referenced in one or multiple client. Those clients can write or read any value stored with a key in the hash table. Note that the servers do not store all the key value pairs.
We've done the whole project as asked.

1. Install dependencies and clone the project

Using a container is recommended to prevent dependecies issues with your other applications.
Run those commands as root to install all dependencies.

$ apt-get update 
$ apt-get install -y git build-essential gcc clang check openssh-client curl libssl-dev libssl-doc libvips-dev libcurl4-openssl-dev libjson-c-dev python3 python-is-python3
$ apt-get install -y clang-tools gdb cmake

To download the project, go into your preferred folder and run the command below.
⚠️ You may need an ssh key linked to your Github account to authenticate yourself.

$ git clone git@github.com:projprogsys-epfl/project-comparch-la-revanche.git

2. Compile the project

⚠️ Watch out, you may need to remove the previous binary which could prevent recompiling. Do it using the following command.

$ make clean

Inside the done folder in the project, compile the project using make

$ cd project-comparch-la-revanche/done/
$ make

3. Configure and run the servers and clients

Run the servers

You can run the server as below and add default key value pairs to the server hash table if needed.

$ ./dkvs-server <SERVER_IP> <SERVER_PORT> [<key> <value>]...

Run the client

First configure the client, write the servers ip and port inside of the done/servers.txt file as below, one line per server.
⚠️ You must use UNIX line termination \n.
⚠️ Note that if you change this file between usage, you may not get expected values from the servers.

<SERVER_IP> <SERVER_PORT> <NODE_COUNT>
...

Node count is used for how much you'll use the this precise server. Higher it is, more likely you'll use it to store a key, value pair. \

$ ./dkvs-client <command> [-r R] [-w W] [-n N] -- ...

Where possible commands are:

  • help: displays the help message.
  • get: get a value from a key, to be provided as extra argument (after --).
  • put: put a key-value pair, to be provided as extra arguments, key first, then value.
  • cat: concatenate several values into a new key; the values are indicated by their key.
    for example: cat -- a b c, will concatenate the values of keys a and b into the value for key c.
  • substr: extract a substring from a value and store the result under a new key.
    it requires 4 arguments: key to read from, index of substr, length of substr, and key where to put the result to.
  • find: to search from a value into another; it requires two keys: which value to search into and what value to search. it returns the index of the searched value inside the reference value (starting from 0) or -1 if the value is not found.

The flags are used to prevent desynchronization issues:

  • -n: the number of server the client will connect to.
  • -r: the threshold of same response, the client will consider the value as correct.
  • -w: the threshold of successful response, the client will consider the write as success.

You can also dump every value stored on all server with:

$ ./dkvs-dump

To change the maximum element (key or value) size, servers.txt filepath, default hash table size, or packet timeout, you can edit the done/config.h and recompile the project.

Run tests and debug

To print additional information about the current state of the servers, add this argument before compiling.

$ make DEBUG=1

To add more of these, use the debug_printf() macro from error.h.
Run the tests provided and made by our group by using this command, you can add your own inside of the done/tests folder.

$ make check

Time taken by our group

The time we took is detailed within the done/time.csv file.

Week number Hours taken
5 17.25
6 20.50
7 0
8 14.25
9 26.00
10 22.75
11 22.75
12 27.25
13 23.00

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors