From e1e8905f45aca0a5e00d5d8ef4efc7c154633509 Mon Sep 17 00:00:00 2001 From: Washington Kigani Kamadi Date: Mon, 16 Sep 2024 20:58:59 +0300 Subject: [PATCH] NOISSUE - Run Manager using Systemd Docs (#42) * docs for starting manager as a service Signed-off-by: WashingtonKK * use makefile to start manager Signed-off-by: WashingtonKK * add instructions for sev-snp Signed-off-by: WashingtonKK --------- Signed-off-by: WashingtonKK --- docs/manager.md | 58 +++++++++++++++++++++++++++++++++---------------- 1 file changed, 39 insertions(+), 19 deletions(-) diff --git a/docs/manager.md b/docs/manager.md index bd27d25..111aa3e 100644 --- a/docs/manager.md +++ b/docs/manager.md @@ -86,37 +86,47 @@ NB: we set environment variables that we will use in the shell process where we ## Deployment -To start the service, execute the following shell script (note a server needs to be running see [here](https://github.com/ultravioletrs/cocos/tree/main/test/computations)): +To start the service, execute the following shell script (note a server needs to be running see [here](https://github.com/ultravioletrs/cocos/tree/main/test/computations)). Additionally, the required environment variables should be set in [cocos-manager.env](https://github.com/ultravioletrs/cocos/blob/main/cocos-manager.env) beforehand. ```bash # download the latest version of the service go get github.com/ultravioletrs/cocos cd $GOPATH/src/github.com/ultravioletrs/cocos +``` -# compile the manager -make manager +Variables should be set at this point in [cocos-manager.env](https://github.com/ultravioletrs/cocos/blob/main/cocos-manager.env). -# copy binary to bin +```bash +# builds binaries, copies them to bin and installs the env variables required for manager make install -# set the environment variables and run the service -MANAGER_GRPC_URL=localhost:7001 -MANAGER_LOG_LEVEL=debug \ -MANAGER_QEMU_USE_SUDO=false \ -MANAGER_QEMU_ENABLE_SEV=false \ -./build/cocos-manager +# run the service +make run ``` -To enable [AMD SEV](https://www.amd.com/en/developer/sev.html) support, start manager like this +To enable [AMD SEV](https://www.amd.com/en/developer/sev.html) support, start manager after setting these environment variables in [cocos-manager.env](https://github.com/ultravioletrs/cocos/blob/main/cocos-manager.env). -```sh -MANAGER_GRPC_URL=localhost:7001 -MANAGER_LOG_LEVEL=debug \ -MANAGER_QEMU_USE_SUDO=true \ -MANAGER_QEMU_ENABLE_SEV=true \ -MANAGER_QEMU_SEV_CBITPOS=51 \ -./build/cocos-manager +```bash +MANAGER_QEMU_USE_SUDO=true +MANAGER_QEMU_ENABLE_SEV=true +MANAGER_QEMU_SEV_CBITPOS=51 +``` + +You can also enable SEV_SNP through the environment variable: + +```bash +MANAGER_QEMU_ENABLE_SEV_SNP=false +``` + +Then install the service: + +```bash +# install the service with the environment variables +sudo make install + +# start the service +sudo make run ``` ### Verifying VM Launch @@ -130,7 +140,7 @@ go run ./test/computations/main.go