Skip to content
This repository has been archived by the owner on May 1, 2019. It is now read-only.

[fix] update ports (8888,8889) -> (6006,6007) #38

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ TL;DR:
To start the server, run the following:

```bash
$ docker run -d -p 8888:8888 -p 8889:8889 --name crayon alband/crayon
$ docker run -d -p 6006:6006 -p 6007:6007 --name crayon alband/crayon
```

Tensorboard is now accessible on a browser at `server_machine_address:8888`. The
client should send the data at `server_machine_address:8889`.
Tensorboard is now accessible on a browser at `server_machine_address:6006`. The
client should send the data at `server_machine_address:6007`.

### Client

Expand Down
6 changes: 3 additions & 3 deletions client/lua/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Run:

```bash
# Start new test server
$ docker run -d -p 7998:8888 -p 7999:8889 --name crayon_lua_test alband/crayon
$ docker run -d -p 6006:6006 -p 6007:6007 --name crayon_lua_test alband/crayon

# Run test script
$ lua(jit) test.lua
Expand All @@ -82,7 +82,7 @@ local crayon = require("crayon")

-- Connect to the server
-- substitute localhost and port with the ones you are using
local cc = crayon.CrayonClient("localhost", 8889)
local cc = crayon.CrayonClient("localhost", 6007)

-- Create a new experiment
local foo = cc:create_experiment("foo")
Expand Down Expand Up @@ -161,7 +161,7 @@ bar:get_scalar_values("accuracy")

### `CrayonClient`

* Creation: `CrayonClient(hostname="localhost", port=8889)`
* Creation: `CrayonClient(hostname="localhost", port=6007)`
* Create a client object and connect it to the server at address `hostname` and port `port`.

* `get_experiment_names()`
Expand Down
2 changes: 1 addition & 1 deletion client/lua/crayon.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ do
setmetatable(self, CrayonClient)

self.hostname = hostname or "localhost"
self.port = port or 8889
self.port = port or 6007
self.url = self.hostname .. ":" .. tostring(self.port)

-- Add http header if missing
Expand Down
4 changes: 2 additions & 2 deletions client/lua/test.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ local crayon = require("crayon")


-- A clean server should be running on the test_port with:
-- docker run -it -p 7998:8888 -p 7999:8889 --name crayon_lua_test alband/crayon
local test_port = 7999
-- docker run -it -p 6006:6006 -p 6007:6007 --name crayon_lua_test alband/crayon
local test_port = 6007

local cc = crayon.CrayonClient("localhost", test_port)

Expand Down
2 changes: 1 addition & 1 deletion client/python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ bar.get_scalar_values("accuracy")

### `CrayonClient`

* Creation: `CrayonClient(hostname="localhost", port=8889)`
* Creation: `CrayonClient(hostname="localhost", port=6007)`
* Create a client object and connect it to the server at address `hostname` and port `port`.

* `get_experiment_names()`
Expand Down
2 changes: 1 addition & 1 deletion client/python/pycrayon/crayon.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@


class CrayonClient(object):
def __init__(self, hostname="localhost", port=8889):
def __init__(self, hostname="localhost", port=6007):
self.hostname = hostname
self.port = port
self.url = self.hostname + ":" + str(self.port)
Expand Down
6 changes: 3 additions & 3 deletions client/python/test/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

class Helper(object):

def __init__(self, start=True, tb_ip=8888, server_ip=8889, name="crayon"):
def __init__(self, start=True, tb_ip=6006, server_ip=6007, name="crayon"):
self.client = docker.from_env()
self.tb_ip = tb_ip
self.server_ip = server_ip
Expand All @@ -19,8 +19,8 @@ def __init__(self, start=True, tb_ip=8888, server_ip=8889, name="crayon"):
def start(self):
self.container = self.client.containers.run(
"alband/crayon:latest",
ports={8888: self.tb_ip,
8889: self.server_ip},
ports={6006: self.tb_ip,
6007: self.server_ip},
detach=True,
name=self.name)
# check server is working
Expand Down
4 changes: 2 additions & 2 deletions server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ RUN pip install flask
ADD startup.sh /
ADD server.py /
ADD patch_tensorboard.py /
EXPOSE 8889
EXPOSE 6007
# TODO: move from cmd to entrypoint
ENTRYPOINT ["/bin/bash", "/startup.sh"]
ENTRYPOINT ["/bin/bash", "/startup.sh"]
6 changes: 3 additions & 3 deletions server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ docker build -t alband/crayon:latest .

Then the server can be started with:
```bash
docker run -d -p 8888:8888 -p 8889:8889 --name crayon alband/crayon [frontend_refresh] [backend_refresh]
docker run -d -p 6006:6006 -p 6007:6007 --name crayon alband/crayon [frontend_refresh] [backend_refresh]
```
Where `frontend_refresh` is an optional argument that allows to change the refresh rate of tensorboard to the given value (in seconds). Default is 10 seconds.
Where `backend_refresh` in an optional argument that allows to change how often the tensorflow backend reload the files from disk (in seconds). Default is 0.5 seconds. Reducing this value too much may make tensorboard unstable.


Tensorboard can then be accessed from a browser at `localhost:8888`.
The client should be setup to send the datas at `localhost:8889`.
Tensorboard can then be accessed from a browser at `localhost:6006`.
The client should be setup to send the datas at `localhost:6007`.
4 changes: 2 additions & 2 deletions server/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
# Command line arguments
import argparse
parser = argparse.ArgumentParser(description="Backend server for crayon")
parser.add_argument("port", type=int, default=8889,
parser.add_argument("port", type=int, default=6007,
help="Port where to listen for incoming datas")
parser.add_argument("backend_reload", type=float, default=1,
help="How fast is tensorboard reloading its backend")
Expand Down Expand Up @@ -145,7 +145,7 @@ def tb_add_histogram(experiment, name, wall_time, step, histo):

# Perform requests to tensorboard http api
def tb_request(query_type, run=None, tag=None, safe=True):
request_url = "http://localhost:8888/data/{}"
request_url = "http://localhost:6006/data/{}"
if run and tag:
request_url += "?run={}&tag={}"

Expand Down
4 changes: 2 additions & 2 deletions server/startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ if [[ ${RETURN_CODE} != "3" ]] && [[ ${RETURN_CODE} != "2" ]]; then
fi
echo "Using $CRAYON_BACKEND_RELOAD for backend reload time."

tensorboard --reload_interval $CRAYON_BACKEND_RELOAD --logdir /tmp/tensorboard --port 8888 &
tensorboard --reload_interval $CRAYON_BACKEND_RELOAD --logdir /tmp/tensorboard --port 6006 &

python /server.py 8889 $CRAYON_BACKEND_RELOAD 2>&1 1>/tmp/crayon.log
python /server.py 6007 $CRAYON_BACKEND_RELOAD 2>&1 1>/tmp/crayon.log