From 58937c32c98cbc99086f9348c2f9712335e27e10 Mon Sep 17 00:00:00 2001 From: Guilhem Saurel <guilhem.saurel@laas.fr> Date: Mon, 13 Jun 2022 21:46:47 +0200 Subject: [PATCH] =?UTF-8?q?clarify=20{=20=E2=86=92=20MANAGER=5F}HOST?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- example-1/Dockerfile | 4 ++-- example-1/README.md | 2 +- example-1/manager.py | 2 +- example-2/Dockerfile | 4 ++-- example-2/README.md | 4 ++-- example-2/manager.py | 2 +- example-3/Dockerfile | 4 ++-- example-3/manager.py | 2 +- example-4/Dockerfile | 4 ++-- example-4/manager.py | 2 +- pfc-1/README.md | 2 +- pfc-1/manager.py | 2 +- pfc-1/schedule.sh | 2 +- pfc-2/manager.py | 2 +- pfc-2/schedule.sh | 2 +- pfc-2g/manager.py | 2 +- pfc-2g/schedule.sh | 2 +- pfc-3/manager.py | 2 +- pfc-3/pfc-3.def | 2 +- pfc-3g/manager.py | 2 +- pfc-3g/pfc-3g.def | 2 +- 21 files changed, 26 insertions(+), 26 deletions(-) diff --git a/example-1/Dockerfile b/example-1/Dockerfile index 328a823..08d6087 100644 --- a/example-1/Dockerfile +++ b/example-1/Dockerfile @@ -9,7 +9,7 @@ WORKDIR /app ADD manager.py minion.py work.py ./ -ARG HOST -ENV HOST=$HOST +ARG MANAGER_HOST +ENV MANAGER_HOST=$MANAGER_HOST CMD /app/minion.py diff --git a/example-1/README.md b/example-1/README.md index 806ab7a..d554d11 100644 --- a/example-1/README.md +++ b/example-1/README.md @@ -70,7 +70,7 @@ docker login gitlab.laas.fr:4567 The built and push of the container is then to be run from this directory (on any computer your want, for example your personal computer). ```bash -docker build --build-arg HOST=nyusan -t gitlab.laas.fr:4567/$USER/multiprocessing-examples:EXAMPLE-NAME . +docker build --build-arg MANAGER_HOST=nyusan -t gitlab.laas.fr:4567/$USER/multiprocessing-examples:EXAMPLE-NAME . docker push gitlab.laas.fr:4567/$USER/multiprocessing-examples:EXAMPLE-NAME ``` diff --git a/example-1/manager.py b/example-1/manager.py index c4c9d6c..e0444d2 100755 --- a/example-1/manager.py +++ b/example-1/manager.py @@ -20,7 +20,7 @@ class QueueClient: def __init__(self): QueueManager.register("get_queue") manager = QueueManager( - address=(os.environ.get("HOST", "localhost"), PORT), authkey=KEY + address=(os.environ.get("MANAGER_HOST", "localhost"), PORT), authkey=KEY ) manager.connect() self.queue = manager.get_queue() diff --git a/example-2/Dockerfile b/example-2/Dockerfile index d6d7257..1fa057c 100644 --- a/example-2/Dockerfile +++ b/example-2/Dockerfile @@ -9,7 +9,7 @@ WORKDIR /app ADD boss.py manager.py minion.py task.py ./ -ARG HOST -ENV HOST=$HOST +ARG MANAGER_HOST +ENV MANAGER_HOST=$MANAGER_HOST CMD /app/minion.py diff --git a/example-2/README.md b/example-2/README.md index 072cd11..d2e6e80 100644 --- a/example-2/README.md +++ b/example-2/README.md @@ -12,13 +12,13 @@ And in many others: `./minion.py` ## Test on multiple computers -We suppose that the host of the manager will be HOST (e.g. nyusan, *CHECK AVAILABILITY* before using it), user is $USER and docker registry gitlab.laas.fr:4567/$USER/multiprocessing-examples +We suppose that the host of the manager will be MANAGER_HOST (e.g. nyusan, *CHECK AVAILABILITY* before using it), user is $USER and docker registry gitlab.laas.fr:4567/$USER/multiprocessing-examples First build and push the docker. ```bash IMAGE="gitlab.laas.fr:4567/$USER/multiprocessing-examples:example-2" -docker build --build-arg HOST=nyusan -t "$IMAGE" . +docker build --build-arg MANAGER_HOST=nyusan -t "$IMAGE" . docker login gitlab.laas.fr:4567 # only required once docker push gitlab.laas.fr:4567/$USER/multiprocessing-examples:example-2 ``` diff --git a/example-2/manager.py b/example-2/manager.py index 57fbfaf..8900777 100755 --- a/example-2/manager.py +++ b/example-2/manager.py @@ -21,7 +21,7 @@ class QueueClient: QueueManager.register("get_tasks") QueueManager.register("get_results") manager = QueueManager( - address=(os.environ.get("HOST", "localhost"), PORT), authkey=KEY + address=(os.environ.get("MANAGER_HOST", "localhost"), PORT), authkey=KEY ) manager.connect() self.tasks = manager.get_tasks() diff --git a/example-3/Dockerfile b/example-3/Dockerfile index 846726d..4985133 100644 --- a/example-3/Dockerfile +++ b/example-3/Dockerfile @@ -7,8 +7,8 @@ RUN /setup.sh ENV PATH=/opt/openrobots/bin:$PATH \ LD_LIBRARY_PATH=/opt/openrobots/lib -ARG HOST -ENV HOST=$HOST +ARG MANAGER_HOST +ENV MANAGER_HOST=$MANAGER_HOST WORKDIR /app diff --git a/example-3/manager.py b/example-3/manager.py index ead1b2c..df88e35 100755 --- a/example-3/manager.py +++ b/example-3/manager.py @@ -21,7 +21,7 @@ class QueueClient: QueueManager.register("get_tasks") QueueManager.register("get_results") manager = QueueManager( - address=(os.environ.get("HOST", "localhost"), PORT), authkey=KEY + address=(os.environ.get("MANAGER_HOST", "localhost"), PORT), authkey=KEY ) manager.connect() self.tasks = manager.get_tasks() diff --git a/example-4/Dockerfile b/example-4/Dockerfile index 846726d..4985133 100644 --- a/example-4/Dockerfile +++ b/example-4/Dockerfile @@ -7,8 +7,8 @@ RUN /setup.sh ENV PATH=/opt/openrobots/bin:$PATH \ LD_LIBRARY_PATH=/opt/openrobots/lib -ARG HOST -ENV HOST=$HOST +ARG MANAGER_HOST +ENV MANAGER_HOST=$MANAGER_HOST WORKDIR /app diff --git a/example-4/manager.py b/example-4/manager.py index ead1b2c..df88e35 100755 --- a/example-4/manager.py +++ b/example-4/manager.py @@ -21,7 +21,7 @@ class QueueClient: QueueManager.register("get_tasks") QueueManager.register("get_results") manager = QueueManager( - address=(os.environ.get("HOST", "localhost"), PORT), authkey=KEY + address=(os.environ.get("MANAGER_HOST", "localhost"), PORT), authkey=KEY ) manager.connect() self.tasks = manager.get_tasks() diff --git a/pfc-1/README.md b/pfc-1/README.md index 6a15d63..f6d94b8 100644 --- a/pfc-1/README.md +++ b/pfc-1/README.md @@ -10,7 +10,7 @@ You'll need: - start the manager `./manager.py`. This might be on the `pfcalcul.laas.fr` frontend, but the real requirements are: - must be reachable by network from the pfcalcul nodes - must stay available for the whole job time -- populate the Queue with tasks from a master (eg. on your personnal computer): `HOST=pfcalcul.laas.fr ./boss.py` +- populate the Queue with tasks from a master (eg. on your personnal computer): `MANAGER_HOST=pfcalcul.laas.fr ./boss.py` - ask the pfcalcul to schedule enough minions: `sbatch ./schedule.sh` After that, you should get a job number. And you'll get mails for everything. diff --git a/pfc-1/manager.py b/pfc-1/manager.py index c4c9d6c..e0444d2 100755 --- a/pfc-1/manager.py +++ b/pfc-1/manager.py @@ -20,7 +20,7 @@ class QueueClient: def __init__(self): QueueManager.register("get_queue") manager = QueueManager( - address=(os.environ.get("HOST", "localhost"), PORT), authkey=KEY + address=(os.environ.get("MANAGER_HOST", "localhost"), PORT), authkey=KEY ) manager.connect() self.queue = manager.get_queue() diff --git a/pfc-1/schedule.sh b/pfc-1/schedule.sh index 94229a6..4d82e9b 100755 --- a/pfc-1/schedule.sh +++ b/pfc-1/schedule.sh @@ -6,4 +6,4 @@ #SBATCH --output=output-%A-%a-%N.log #SBATCH --error=output-%A-%a-%N.err -HOST=pfcalcul.laas.fr ./minion.py 10 +MANAGER_HOST=pfcalcul.laas.fr ./minion.py 10 diff --git a/pfc-2/manager.py b/pfc-2/manager.py index c4c9d6c..e0444d2 100755 --- a/pfc-2/manager.py +++ b/pfc-2/manager.py @@ -20,7 +20,7 @@ class QueueClient: def __init__(self): QueueManager.register("get_queue") manager = QueueManager( - address=(os.environ.get("HOST", "localhost"), PORT), authkey=KEY + address=(os.environ.get("MANAGER_HOST", "localhost"), PORT), authkey=KEY ) manager.connect() self.queue = manager.get_queue() diff --git a/pfc-2/schedule.sh b/pfc-2/schedule.sh index d677916..eedb3a2 100755 --- a/pfc-2/schedule.sh +++ b/pfc-2/schedule.sh @@ -8,4 +8,4 @@ source venv/bin/activate -HOST=pfcalcul.laas.fr ./minion.py 10 +MANAGER_HOST=pfcalcul.laas.fr ./minion.py 10 diff --git a/pfc-2g/manager.py b/pfc-2g/manager.py index c4c9d6c..e0444d2 100755 --- a/pfc-2g/manager.py +++ b/pfc-2g/manager.py @@ -20,7 +20,7 @@ class QueueClient: def __init__(self): QueueManager.register("get_queue") manager = QueueManager( - address=(os.environ.get("HOST", "localhost"), PORT), authkey=KEY + address=(os.environ.get("MANAGER_HOST", "localhost"), PORT), authkey=KEY ) manager.connect() self.queue = manager.get_queue() diff --git a/pfc-2g/schedule.sh b/pfc-2g/schedule.sh index 910344c..d0cf9a0 100755 --- a/pfc-2g/schedule.sh +++ b/pfc-2g/schedule.sh @@ -11,4 +11,4 @@ source venv/bin/activate -HOST=pfcalcul.laas.fr ./minion.py 10 +MANAGER_HOST=pfcalcul.laas.fr ./minion.py 10 diff --git a/pfc-3/manager.py b/pfc-3/manager.py index c4c9d6c..e0444d2 100755 --- a/pfc-3/manager.py +++ b/pfc-3/manager.py @@ -20,7 +20,7 @@ class QueueClient: def __init__(self): QueueManager.register("get_queue") manager = QueueManager( - address=(os.environ.get("HOST", "localhost"), PORT), authkey=KEY + address=(os.environ.get("MANAGER_HOST", "localhost"), PORT), authkey=KEY ) manager.connect() self.queue = manager.get_queue() diff --git a/pfc-3/pfc-3.def b/pfc-3/pfc-3.def index 3c6bdca..f5f4061 100644 --- a/pfc-3/pfc-3.def +++ b/pfc-3/pfc-3.def @@ -8,7 +8,7 @@ From: python:3.8-slim pip install --no-cache-dir -r requirements.txt %environment - export HOST=pfcalcul.laas.fr + export MANAGER_HOST=pfcalcul.laas.fr %appfiles minion manager.py diff --git a/pfc-3g/manager.py b/pfc-3g/manager.py index c4c9d6c..e0444d2 100755 --- a/pfc-3g/manager.py +++ b/pfc-3g/manager.py @@ -20,7 +20,7 @@ class QueueClient: def __init__(self): QueueManager.register("get_queue") manager = QueueManager( - address=(os.environ.get("HOST", "localhost"), PORT), authkey=KEY + address=(os.environ.get("MANAGER_HOST", "localhost"), PORT), authkey=KEY ) manager.connect() self.queue = manager.get_queue() diff --git a/pfc-3g/pfc-3g.def b/pfc-3g/pfc-3g.def index 3c6bdca..f5f4061 100644 --- a/pfc-3g/pfc-3g.def +++ b/pfc-3g/pfc-3g.def @@ -8,7 +8,7 @@ From: python:3.8-slim pip install --no-cache-dir -r requirements.txt %environment - export HOST=pfcalcul.laas.fr + export MANAGER_HOST=pfcalcul.laas.fr %appfiles minion manager.py -- GitLab