From 0f72d1665485b8d4b81b7a994bd1f1dc572eb6ac Mon Sep 17 00:00:00 2001 From: Anthony Nixon Date: Mon, 25 Mar 2024 12:09:45 +0000 Subject: [PATCH 1/3] Adds a log configuration to docker containers such that max size of the container is 30m. --- go/common/docker/docker.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/go/common/docker/docker.go b/go/common/docker/docker.go index 3262f75d97..eb115c7d9c 100644 --- a/go/common/docker/docker.go +++ b/go/common/docker/docker.go @@ -89,6 +89,12 @@ func StartNewContainer(containerName, image string, cmds []string, ports []int, exposedPorts[nat.Port(fmt.Sprintf("%d/tcp", port))] = struct{}{} } + // set log rotations + logOptions := map[string]string{ + "max-size": "10m", + "max-file": "3", + } + // create the container resp, err := cli.ContainerCreate(ctx, &container.Config{ Image: image, @@ -101,6 +107,7 @@ func StartNewContainer(containerName, image string, cmds []string, ports []int, PortBindings: portBindings, Mounts: mountVolumes, Resources: container.Resources{Devices: deviceMapping}, + LogConfig: container.LogConfig{Type: "json-file", Config: logOptions}, }, &network.NetworkingConfig{ EndpointsConfig: map[string]*network.EndpointSettings{ From 07d3b4a1a3ffd5279a1c6a6c674cf5945b4e10a4 Mon Sep 17 00:00:00 2001 From: Anthony Nixon Date: Mon, 25 Mar 2024 15:47:10 +0000 Subject: [PATCH 2/3] update create instructions for matching new dependencies on commit 46e0c --- .github/workflows/runner-scripts/create-vm.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/runner-scripts/create-vm.txt b/.github/workflows/runner-scripts/create-vm.txt index c46f41e69a..e1a7bfe128 100644 --- a/.github/workflows/runner-scripts/create-vm.txt +++ b/.github/workflows/runner-scripts/create-vm.txt @@ -11,7 +11,7 @@ ssh obscurouser@IPADDRESS sudo apt-get update \ && sudo apt-get install -y gcc \ - && sudo snap refresh && sudo snap install --channel=1.20 go --classic \ + && sudo snap refresh && sudo snap install go --channel=1.21/stable --classic \ && curl -fsSL https://get.docker.com -o get-docker.sh && sh ./get-docker.sh exit From a4c8513f90ed995cd9a9dac3dce48e34538c7c68 Mon Sep 17 00:00:00 2001 From: Anthony Nixon Date: Mon, 25 Mar 2024 20:05:58 +0000 Subject: [PATCH 3/3] update create instructions to force standard security type for overriding the base image and matching current deployments. delete current image step added. --- .github/workflows/runner-scripts/create-vm.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/runner-scripts/create-vm.txt b/.github/workflows/runner-scripts/create-vm.txt index e1a7bfe128..914fd1778b 100644 --- a/.github/workflows/runner-scripts/create-vm.txt +++ b/.github/workflows/runner-scripts/create-vm.txt @@ -5,6 +5,7 @@ az vm create \ --resource-group Testnet \ --name MakeImageVM \ --image Canonical:0001-com-ubuntu-server-focal:20_04-lts-gen2:20.04.202206220 \ + --security-type 'Standard' \ --admin-username obscurouser --admin-password 'PWD' ssh obscurouser@IPADDRESS @@ -18,9 +19,10 @@ exit az vm deallocate --resource-group Testnet --name MakeImageVM az vm generalize --resource-group Testnet --name MakeImageVM +az image delete --resource-group Testnet --name ObscuroConfUbuntu az image create --resource-group Testnet --name ObscuroConfUbuntu --source MakeImageVM --hyper-v-generation V2 az vm delete --resource-group Testnet --name MakeImageVM --yes -az disk delete --resource-group Testnet --name MakeImageVM_OSDisk --yes -az network nic delete --resource-group Testnet --name MakeImageVM_NIC +az disk delete --resource-group Testnet --name MakeImageVM_OsDisk- --yes --no-wait +az network nic delete --resource-group Testnet --name MakeImageVMVMNIC --no-wait