Skip to content

Commit 3bb7d86

Browse files
committed
Rewrite the setup_playbook.yaml
1 parent 2609aae commit 3bb7d86

File tree

5 files changed

+273
-206
lines changed

5 files changed

+273
-206
lines changed

README.md

+18-15
Original file line numberDiff line numberDiff line change
@@ -117,29 +117,32 @@ To test the inventory, you can try the [example
117117
playbook](https://docs.ansible.com/ansible/latest/getting_started/get_started_playbook.html)
118118
on the official Ansible documentation.
119119
120-
Once you have the inventory file, run ansible-playbook:
120+
**Important:** on the control node you need to have the DFaaS Git repository and
121+
to build the DFaaS Agent. This can be done with the following:
121122
122123
```console
123-
$ ansible-playbook -i inventory.yaml setup_playbook.yaml
124+
$ git clone https://github.com/unimib-datAI/dfaas.git
125+
$ sudo apt install golang-go
126+
$ go build -C dfaas/dfaasagent
124127
```
125128

126-
**WIP**
127-
128-
Run the `ansible-playbook` command on the control node to execute the tasks specified in the playbook with the following options:
129-
130-
`-i` : path to an inventory file
131-
`--extra-vars` : to specify the Sysbox version and shiftfs branch to be installed
132-
`--tags` : to specify steps of the playbook to be executed
129+
Then you can run the playbook with ansible-playbook (make sure to be on the
130+
DFaaS directory!):
133131

134-
```shell
135-
ansible-playbook -i inventory.yaml setup_playbook.yaml --tags "installation, deploy"
132+
```console
133+
$ ansible-playbook -i inventory.yaml setup_playbook.yaml
136134
```
137135

138-
**WIP**
136+
This deploys a basic, fully functional DFaaS node using the Node Margin
137+
Strategy. You can modify the `dfaasagent.env` file to configure the agent and
138+
replay the playbook to deploy it.
139139

140-
This Ansible playbook installs the required software and executes the [docker-compose.yml](docker-compose.yml), deploying three DFaaS nodes containers, and a fourth container called [operator](operator), which deploys functions on DFaaS nodes and starts specified load tests.
140+
You can make automatic calls to the node with the **operator**. More information
141+
about it in the [dedicated directory](operator).
141142

142-
If you have four different VMs it's recommended to deploy the entire system exploiting the playbook and configuration files in [test_environment](test_environment).
143+
If you have four different VMs it's recommended to deploy the entire system
144+
exploiting the playbook and configuration files in
145+
[test_environment](test_environment). This is still a work in progress.
143146

144147
### Manual deployment
145148

@@ -163,7 +166,7 @@ root user.
163166
# apt install golang-go haproxy python3-pip python3-venv
164167
```
165168

166-
3. Clone this repository in the `/opt/dfaas-src` directory:
169+
3. Clone (or copy) this repository in the `/opt/dfaas-src` directory:
167170

168171
```console
169172
# mkdir --parents /opt/

dfaasagent.env

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ AGENT_PUBSUB_TOPIC="/dfaasagent/1.0.0"
1717

1818
AGENT_RECALC_PERIOD=1m
1919

20-
AGENT_HAPROXY_TEMPLATE_FILE_NMS="/agent/haproxycfgnms.tmpl"
21-
AGENT_HAPROXY_TEMPLATE_FILE_RECALC="/agent/haproxycfgrecalc.tmpl"
20+
AGENT_HAPROXY_TEMPLATE_FILE_NMS="/opt/dfaasagent/haproxycfgnms.tmpl"
21+
AGENT_HAPROXY_TEMPLATE_FILE_RECALC="/opt/dfaasagent/haproxycfgrecalc.tmpl"
2222
AGENT_HAPROXY_CONFIG_FILE="/etc/haproxy/haproxy.cfg"
2323
AGENT_HAPROXY_CONFIG_UPDATE_COMMAND="/usr/bin/systemctl reload haproxy.service"
2424
AGENT_HAPROXY_HOST=127.0.0.1
@@ -41,7 +41,7 @@ AGENT_FORECASTER_PORT=8000
4141

4242
AGENT_STRATEGY="nodemarginstrategy"
4343

44-
AGENT_GROUP_LIST_FILE_NAME="/agent/group_list.json"
44+
AGENT_GROUP_LIST_FILE_NAME="/opt/dfaasagent/group_list.json"
4545

4646
AGENT_NODE_TYPE=1 # heavy=0 mid=1 light=2
4747

dfaasagent/agent/agent.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,8 @@ func Main() {
236236
rand.Seed(int64(time.Now().Nanosecond()))
237237

238238
// Load configuration
239-
_config, err := config.LoadConfig("/agent")
239+
// FIXME: Do not write an hardcoded directory
240+
_config, err := config.LoadConfig("/opt/dfaasagent")
240241

241242
// Setup logging engine
242243
logger, err := logging.Initialize(_config.DateTime, _config.DebugMode, _config.LogColors)

docker/forecaster/model/config_constants.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
# This file is licensed under the AGPL v3.0 or later license. See LICENSE and
44
# AUTHORS file for more information.
55

6-
MODELS_BASE_PATH = "forecaster/models/"
7-
SCALERS_BASE_PATH = "forecaster/scalers/"
6+
# FIXME: Make the paths configurable.
7+
MODELS_BASE_PATH = "/opt/forecaster/models/"
8+
SCALERS_BASE_PATH = "/opt/forecaster/scalers/"
89
GROUPS_COLUMNS_NAMES = ["rate_group_HIGH_USAGE", "rate_group_LOW_USAGE", "rate_group_HIGH_USAGE"]
910
CPU_USAGE_METRIC = "cpu_usage_node"
1011
RAM_USAGE_METRIC = "ram_usage_node"

0 commit comments

Comments
 (0)