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

Add structured logging via zap #64

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 13 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
2 changes: 1 addition & 1 deletion .github/workflows/golang-ci-workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ jobs:
name: golang-ci
runs-on: ubuntu-latest
env:
GO_VERSION: "1.17"
COVERAGE_PROFILE_OUTPUT_LOCATION: "./profile.cov"
steps:
- name: Checkout code / lint code / install dependencies for goveralls / run tests
uses: uc-cdis/.github/.github/actions/golang-ci@master
with:
GO_VERSION: "1.20"
COVERAGE_PROFILE_OUTPUT_LOCATION: ${{ env.COVERAGE_PROFILE_OUTPUT_LOCATION }}
- name: Send coverage to coveralls using goveralls
env:
Expand Down
4 changes: 2 additions & 2 deletions .secrets.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"files": "go.sum|^.secrets.baseline$",
"lines": null
},
"generated_at": "2023-04-07T16:22:23Z",
"generated_at": "2023-05-04T21:28:41Z",
"plugins_used": [
{
"name": "AWSKeyDetector"
Expand Down Expand Up @@ -99,7 +99,7 @@
"hashed_secret": "96e77458817d8486fab4c56c8d4c51b83f85c79d",
"is_secret": false,
"is_verified": false,
"line_number": 391,
"line_number": 465,
"type": "Secret Keyword"
}
],
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM quay.io/cdis/golang:1.17-bullseye as build-deps
FROM quay.io/cdis/golang:1.20-bullseye as build-deps

ENV CGO_ENABLED=0
ENV GOOS=linux
Expand Down
7 changes: 5 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
module github.com/uc-cdis/hatchery

go 1.17
go 1.20

require (
github.com/apparentlymart/go-cidr v1.1.0
github.com/aws/aws-sdk-go v1.43.28
go.uber.org/zap v1.24.0
gopkg.in/DataDog/dd-trace-go.v1 v1.33.0
gopkg.in/yaml.v2 v2.4.0
k8s.io/api v0.22.3
Expand Down Expand Up @@ -43,6 +44,8 @@ require (
github.com/prometheus/procfs v0.6.0 // indirect
github.com/sirupsen/logrus v1.8.1 // indirect
github.com/tinylib/msgp v1.1.6 // indirect
go.uber.org/atomic v1.11.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd // indirect
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect
Expand All @@ -53,7 +56,7 @@ require (
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.27.1 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/klog/v2 v2.30.0 // indirect
k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.0 // indirect
Expand Down
15 changes: 12 additions & 3 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:l
github.com/aws/aws-sdk-go v1.43.28 h1:HrBUf2pYEMRB3GDkSa/bZ2lkZIe8gSUOz/IEupG1Te0=
github.com/aws/aws-sdk-go v1.43.28/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo=
github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM=
github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8=
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
Expand All @@ -80,7 +81,6 @@ github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kB
github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84=
github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko=
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY=
github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
Expand Down Expand Up @@ -334,6 +334,7 @@ github.com/philhofer/fwd v1.1.1 h1:GdGcTjf5RNAxwS4QLsiMzJYj5KEvPJD3Abr261yRQXQ=
github.com/philhofer/fwd v1.1.1/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU=
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
Expand Down Expand Up @@ -398,8 +399,8 @@ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UV
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk=
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
github.com/tinylib/msgp v1.1.2/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE=
github.com/tinylib/msgp v1.1.6 h1:i+SbKraHhnrf9M5MYmvQhFnbLhAXSDWF8WWsuyRdocw=
Expand Down Expand Up @@ -430,10 +431,17 @@ go.opentelemetry.io/otel/trace v0.20.0/go.mod h1:6GjCW8zgDjwGHGa6GkyeB8+/5vjT16g
go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI=
go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE=
go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0=
go.uber.org/goleak v1.1.11 h1:wy28qYRKZgnJTxGxvye5/wgWr1EKjmUDGYox5mGlRlI=
go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0=
go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU=
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo=
go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60=
go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg=
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
Expand Down Expand Up @@ -772,8 +780,9 @@ gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo=
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk=
gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
Expand Down
29 changes: 22 additions & 7 deletions hatchery/alb.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,19 @@ func (creds *CREDS) createTargetGroup(userName string, vpcId string, svc *elbv2.
case elbv2.ErrCodeTooManyTagsException:
fmt.Println(elbv2.ErrCodeTooManyTagsException, aerr.Error())
default:
fmt.Println(aerr.Error())
Config.Logger.Errorw("Error creating target group",
"error", aerr.Error(),
"code", aerr.Code(),
"message", aerr.Message(),
"user", userName,
)
return nil, err
}
} else {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
Config.Logger.Errorw("Error creating target group",
"error", err.Error(),
"user", userName,
jawadqur marked this conversation as resolved.
Show resolved Hide resolved
)
return nil, err
}
return nil, err
Expand Down Expand Up @@ -223,7 +229,10 @@ func (creds *CREDS) terminateLoadBalancerTargetGroup(userName string) error {
Region: aws.String("us-east-1"),
})))
tgName := truncateString(strings.ReplaceAll(os.Getenv("GEN3_ENDPOINT"), ".", "-")+userToResourceName(userName, "service")+"tg", 32)
Config.Logger.Printf("Deleting target group: %s", tgName)
Config.Logger.Debug("Deleting target group",
"target-group", tgName,
"username", userName,
)
paulineribeyre marked this conversation as resolved.
Show resolved Hide resolved
tgArn, err := svc.DescribeTargetGroups(&elbv2.DescribeTargetGroupsInput{
Names: []*string{aws.String(tgName)},
})
Expand All @@ -235,7 +244,10 @@ func (creds *CREDS) terminateLoadBalancerTargetGroup(userName string) error {
return nil
}
} else {
Config.Logger.Printf("Error describing target group: %s", err.Error())
Config.Logger.Errorw("Error describing target group",
"error", err.Error(),
"username", userName,
)
return err
}
}
Expand All @@ -252,7 +264,10 @@ func (creds *CREDS) terminateLoadBalancerTargetGroup(userName string) error {
return nil
}
} else {
Config.Logger.Printf("Error deleting target group: %s", err.Error())
Config.Logger.Errorw("Error deleting target group",
"error", err.Error(),
"username", userName,
)
}
}
return nil
Expand Down
12 changes: 9 additions & 3 deletions hatchery/cloudwatch.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/aws/aws-sdk-go/service/cloudwatchlogs"
)

//Create CloudWatch LogGroup for hatchery containers
// Create CloudWatch LogGroup for hatchery containers
func (sess *CREDS) CreateLogGroup(LogGroupName string, creds *credentials.Credentials) (string, error) {
c := cloudwatchlogs.New(session.Must(session.NewSession(&aws.Config{
Credentials: creds,
Expand All @@ -20,7 +20,10 @@ func (sess *CREDS) CreateLogGroup(LogGroupName string, creds *credentials.Creden

logGroup, err := c.DescribeLogGroups(describeLogGroupIn)
if err != nil {
Config.Logger.Printf("Error in DescribeLogGroup: %s", err)
Config.Logger.Errorw("Error in DescribeLogGroup",
"error", err,
"logGroupNamePrefix", LogGroupName,
paulineribeyre marked this conversation as resolved.
Show resolved Hide resolved
)
return "", err
}
if len(logGroup.LogGroups) == 0 {
Expand All @@ -29,7 +32,10 @@ func (sess *CREDS) CreateLogGroup(LogGroupName string, creds *credentials.Creden
}
newLogGroup, err := c.CreateLogGroup(createLogGroupIn)
if err != nil {
Config.Logger.Printf("Error in CreateLogGroup: %s, %s", err, newLogGroup)
Config.Logger.Errorw("Error in CreateLogGroup",
"error", err,
"newLogGroup", newLogGroup,
)
return "", err
}
return newLogGroup.String(), nil
Expand Down
53 changes: 39 additions & 14 deletions hatchery/config.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
package hatchery

import (
"go.uber.org/zap"
k8sv1 "k8s.io/api/core/v1"

"crypto/md5"
"encoding/json"
"fmt"
"io/ioutil"
"log"
"os"
)

Expand Down Expand Up @@ -102,27 +101,36 @@ type FullHatcheryConfig struct {
Config HatcheryConfig
ContainersMap map[string]Container
PayModelMap map[string]PayModel
Logger *log.Logger
Logger *zap.SugaredLogger
}

// LoadConfig from a json file
func LoadConfig(configFilePath string, loggerIn *log.Logger) (config *FullHatcheryConfig, err error) {
func LoadConfig(configFilePath string, loggerIn *zap.SugaredLogger) (config *FullHatcheryConfig, err error) {
logger := loggerIn
if nil == loggerIn {
logger = log.New(os.Stdout, "", log.LstdFlags)
zapLogger, _ := zap.NewProduction()
logger = zapLogger.Sugar()
}
plan, err := ioutil.ReadFile(configFilePath)
plan, err := os.ReadFile(configFilePath)

data := &FullHatcheryConfig{
Logger: logger,
}

if nil != err {
cwd, _ := os.Getwd()
data.Logger.Printf("failed to load %v from cwd %v got - %v", configFilePath, cwd, err)
// data.Logger.Printf("failed to load %v from cwd %v got - %v", configFilePath, cwd, err)
paulineribeyre marked this conversation as resolved.
Show resolved Hide resolved
data.Logger.Errorw("Failed to load config file.",
"configFilePath", configFilePath,
"cwd", cwd,
"error", err,
)
return data, err
}
data.Logger.Printf("loaded config: %v", string(plan))
// data.Logger.Printf("loaded config: %v", string(plan))
data.Logger.Debug("Loaded config.",
"config", string(plan),
)
data.ContainersMap = make(map[string]Container)
data.PayModelMap = make(map[string]PayModel)
_ = json.Unmarshal(plan, &data.Config)
Expand All @@ -132,22 +140,38 @@ func LoadConfig(configFilePath string, loggerIn *log.Logger) (config *FullHatche
if info.Name == "" {
return nil, fmt.Errorf("Empty name for more-configs app at: %v", info.Path)
}
data.Logger.Printf("loading config from %v", info.Path)
// data.Logger.Printf("loading config from %v", info.Path)
data.Logger.Debug("Loading config.",
"path", info.Path,
)
composeModel, err := DockstoreComposeFromFile(info.Path)
if nil != err {
data.Logger.Printf("failed to load config from %v, got: %v", info.Path, err)
// data.Logger.Printf("failed to load config from %v, got: %v", info.Path, err)
data.Logger.Errorw("Failed to load config.",
"path", info.Path,
"error", err,
)
return nil, err
}
data.Logger.Printf("%v", composeModel)
// data.Logger.Printf("%v", composeModel)
data.Logger.Debug("Loaded config.",
"composeModel", composeModel,
)
hatchApp, err := composeModel.BuildHatchApp()
hatchApp.Name = info.Name
if nil != err {
data.Logger.Printf("failed to translate app, got: %v", err)
// data.Logger.Printf("failed to translate app, got: %v", err)
data.Logger.Errorw("Failed to translate app.",
"error", err,
)
return nil, err
}
data.Config.Containers = append(data.Config.Containers, *hatchApp)
} else {
data.Logger.Printf("ignoring config of unsupported type: %v", info.AppType)
// data.Logger.Printf("ignoring config of unsupported type: %v", info.AppType)
data.Logger.Warnw("Ignoring config of unsupported type.",
"appType", info.AppType,
)
}
}
}
Expand All @@ -158,7 +182,8 @@ func LoadConfig(configFilePath string, loggerIn *log.Logger) (config *FullHatche
}

if data.Config.PayModelsDynamodbTable == "" {
data.Logger.Printf("Warning: no 'pay-models-dynamodb-table' in configuration: will be unable to query pay model data in DynamoDB")
// data.Logger.Printf("Warning: no 'pay-models-dynamodb-table' in configuration: will be unable to query pay model data in DynamoDB")
data.Logger.Warnw("No 'pay-models-dynamodb-table' in configuration: will be unable to query pay model data in DynamoDB")
}

for _, payModel := range data.Config.PayModels {
Expand Down
8 changes: 6 additions & 2 deletions hatchery/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@ package hatchery
import (
"encoding/json"
"testing"

"go.uber.org/zap"
)

func TestLoadConfig(t *testing.T) {
config, err := LoadConfig("../testData/testConfig.json", nil)
zapLogger, _ := zap.NewProduction()
logger := zapLogger.Sugar()
config, err := LoadConfig("../testData/testConfig.json", logger)
if nil != err {
t.Errorf("failed to load config, got: %v", err)
return
Expand All @@ -29,5 +33,5 @@ func TestLoadConfig(t *testing.T) {
if config.Config.Containers[numContainers-1].Name != "DockstoreTest" {
t.Errorf("unexpected more-info app name - expected DockstoreTest, got: %v", config.Config.Containers[numContainers-1].Name)
}
config.Logger.Printf("config_test marshalled config: %v", string(jsBytes))
config.Logger.Infow("config_test marshalled config", "config", string(jsBytes))
}
3 changes: 1 addition & 2 deletions hatchery/dockstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package hatchery

import (
"fmt"
"io/ioutil"
"log"
"os"
"strconv"
Expand Down Expand Up @@ -78,7 +77,7 @@ const magicPort = "${SERVICE_PORT}" // make it easy to test locally
// DockstoreComposeFromFile loads a hatchery application (container)
// config from a compose.yaml file
func DockstoreComposeFromFile(filePath string) (model *ComposeFull, err error) {
fileBytes, err := ioutil.ReadFile(filePath)
fileBytes, err := os.ReadFile(filePath)

if nil != err {
return nil, err
Expand Down
8 changes: 7 additions & 1 deletion hatchery/ec2.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,13 @@ func (creds *CREDS) describeWorkspaceNetwork(userName string) (*NetworkInfo, err
if err != nil {
return nil, err
}
Config.Logger.Printf("Create Security Group: %s", *newSecurityGroup.GroupId)
Config.Logger.Infow("Creating security group",
"security_group_id", *newSecurityGroup.GroupId,
"security_group_name", createSecurityGroupInput.GroupName,
"vpc_id", createSecurityGroupInput.VpcId,
"description", createSecurityGroupInput.Description,
"username", userName,
)

ingressRules := ec2.AuthorizeSecurityGroupIngressInput{
GroupId: newSecurityGroup.GroupId,
Expand Down
Loading