Skip to content

Commit

Permalink
Merge pull request #29 from crunchycookie/emulate-elia-trace
Browse files Browse the repository at this point in the history
Add renewable emulation
  • Loading branch information
tharindu-b-hewage authored Jan 21, 2024
2 parents c687e9f + c82f432 commit 6a39698
Show file tree
Hide file tree
Showing 7 changed files with 3,537 additions and 8 deletions.
21 changes: 21 additions & 0 deletions deployment/extensions/gc-emulator-service/Service.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,18 @@ import (
"fmt"
"github.com/gin-gonic/gin"
"github.com/openstack-gc/extensions/gc-emulator-service/internal"
"log"
"os"
)

func main() {

err := configureLogFile()
if err != nil {
fmt.Println("Unable to setup log file", err)
return
}

configs, err := internal.NewConfigParser(os.Args[1])
if err != nil {
fmt.Println("Unable to start the gc-emulator service", err)
Expand All @@ -30,3 +37,17 @@ func main() {

manager.Status = false
}

func configureLogFile() error {
// O_APPEND = Append data to the file when writing.
// O_CREATE = Create a new file if none exists.
// O_WRONLY = Open the file write-only.
flags := os.O_APPEND | os.O_CREATE | os.O_WRONLY
file, err := os.OpenFile("gc-emulation-service.log", flags, 0666)
if err != nil {
log.Fatal(err)
}
// Redirecting logs to the file
log.SetOutput(file)
return err
}
2 changes: 2 additions & 0 deletions deployment/extensions/gc-emulator-service/internal/actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package internal

import (
"fmt"
"log"
"slices"
"strconv"
"strings"
Expand Down Expand Up @@ -35,6 +36,7 @@ func (o *GreenCoreMgt) evictVMsOnGreenCores() error {
return err
}
for _, server := range servers {
log.Printf("vm evicted: %s\n", server.Name)
err := RunThirdPartyClient[any](nil, "openstack-shelve-offload-server.sh", server.Id)
if err != nil {
return err
Expand Down
3 changes: 2 additions & 1 deletion deployment/extensions/gc-emulator-service/internal/models.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package internal

type osServerModel struct {
Id string `json:"ID"`
Id string `json:"ID"`
Name string `json:"Name"`
}

type domainsVirshModel struct {
Expand Down
11 changes: 10 additions & 1 deletion experiment/experiment-design.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,13 @@ result is reduced trace.
when pre-process script ran, initially it prits max values. so percentile can be adjusted by guessing for the size of the
inventory we have.

ex: for 26 cores inventory, maybe 4 requests max at a time suits. then 70th percentile is better.
ex: for 26 cores inventory, maybe 4 requests max at a time suits. then 70th percentile is better.

#### Integration test

1. run the trace generator file. its responsibility to create vms and delete them after end of life. also, it switches green core status by calling external api.
2. gc-emulation-service prints a log when a vm is evicted. this entry includes full vm name with regular or evictable type information.
3. power monitoring screen sessions are active in the physical node. it captures all power metrics throughout.
4. green score polling script also keeps polling and dumps green score locally.

Once test ends, we can get power information, eviction information, and green score.
Loading

0 comments on commit 6a39698

Please sign in to comment.