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

Support KissCache client configuration #176

Open
wants to merge 2 commits 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
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,9 @@ There are two way to add custom devices types.
If you are modifying an already present (upstream) device-type, it is the best way.

## How to made LAVA slave use a proxy ?
Add env to a slave like:

For a standard HTTP/HTTPS proxy add env to a slave like:

slave:
env:
- "http_proxy: http://dns:port"
Expand All @@ -490,6 +492,11 @@ Or on master via
- "http_proxy: http://squid_IP_address:3128"
- "https_proxy: http://squid_IP_address:3128"

Or alternatively for a URL format string style proxy such as KissCache:

slave:
http_url_format_string: http://kisscache_host:port


## How to use a board which uses PXE ?
All boards which uses PXE, could be used with LAVA via grub.
Expand Down
2 changes: 2 additions & 0 deletions lava-slave/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ COPY configs/lava-slave /etc/lava-dispatcher/lava-slave

COPY configs/tftpd-hpa /etc/default/tftpd-hpa

COPY worker-config /root/worker-config

COPY scripts/ /usr/local/bin/
RUN chmod a+x /usr/local/bin/*

Expand Down
11 changes: 0 additions & 11 deletions lava-slave/scripts/setdispatcherip.py

This file was deleted.

6 changes: 3 additions & 3 deletions lava-slave/scripts/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ do
else
echo "DEBUG: Worker does not need a TOKEN"
fi
if [ ! -z "$LAVA_DISPATCHER_IP" ];then
echo "Add dispatcher_ip $LAVA_DISPATCHER_IP to $worker"
/usr/local/bin/setdispatcherip.py $LAVA_MASTER_URI $worker $LAVA_DISPATCHER_IP || exit $?
if [ -s "/root/worker-config" ];then
echo "Applying LAVA worker configuration to $worker"
lavacli $LAVACLIOPTS workers config set $worker /root/worker-config || exit $?
fi
for device in $(ls /root/devices/$worker/)
do
Expand Down
Empty file added lava-slave/worker-config
Empty file.
10 changes: 8 additions & 2 deletions lavalab-gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ def main():
"custom_volumes",
"devices", "dispatcher_ip", "default_slave",
"extra_actions", "export_ser2net", "expose_ser2net", "expose_ports", "env",
"host", "host_healthcheck",
"host", "host_healthcheck", "http_url_format_string",
"loglevel", "lava-coordinator", "lava_worker_token",
"name",
"remote_user", "remote_master", "remote_address", "remote_rpc_port", "remote_proto", "remote_user_token",
Expand Down Expand Up @@ -563,7 +563,9 @@ def main():
fcoordinator.write(template_lava_coordinator_conf.substitute(masterurl=remote_address))
fcoordinator.close()
if "dispatcher_ip" in worker:
dockcomp["services"][worker_name]["environment"]["LAVA_DISPATCHER_IP"] = worker["dispatcher_ip"]
fconfig = open("%s/worker-config" % workerdir, 'a')
fconfig.write("dispatcher_ip: %s\n" % worker["dispatcher_ip"])
fconfig.close()
if "expose_ports" in worker:
for eports in worker["expose_ports"]:
dockcomp["services"][name]["ports"].append("%s" % eports)
Expand All @@ -581,6 +583,10 @@ def main():
if remote_master in worker and "build_args" in worker[remote_master]:
dockcomp["services"]["healthcheck"]["build"]["args"] = worker[remote_master]['build_args']
shutil.copytree("healthcheck", "output/%s/healthcheck" % host)
if "http_url_format_string" in worker:
fconfig = open("%s/worker-config" % workerdir, 'a')
fconfig.write("http_url_format_string: \"%s\"\n" % worker["http_url_format_string"])
fconfig.close()
if "extra_actions" in worker:
fp = open("%s/scripts/extra_actions" % workerdir, "w")
for eaction in worker["extra_actions"]:
Expand Down
Loading