Skip to content

Commit

Permalink
Support context (#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
liranbg authored Aug 30, 2022
1 parent 7d414a3 commit c6dccca
Show file tree
Hide file tree
Showing 14 changed files with 756 additions and 262 deletions.
36 changes: 21 additions & 15 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,17 @@ jobs:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: actions/setup-go@v2
- uses: actions/setup-go@v3
with:
go-version: "1.14"
go-version: "1.17"

- uses: actions/cache@v2
- uses: actions/cache@v3
with:
path: ~/go/pkg/mod
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
Expand All @@ -27,15 +29,17 @@ jobs:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: actions/setup-go@v2
- uses: actions/setup-go@v3
with:
go-version: "1.14"
go-version: "1.17"

- uses: actions/cache@v2
- uses: actions/cache@v3
with:
path: ~/go/pkg/mod
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
Expand All @@ -47,15 +51,17 @@ jobs:
name: Build docker images
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: actions/setup-go@v2
- uses: actions/setup-go@v3
with:
go-version: "1.14"
go-version: "1.17"

- uses: actions/cache@v2
- uses: actions/cache@v3
with:
path: ~/go/pkg/mod
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
Expand Down
12 changes: 7 additions & 5 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,17 @@ jobs:
run: |
echo "SCALER_LABEL=${{ steps.release_info.outputs.REF_TAG }}" >> $GITHUB_ENV
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: actions/setup-go@v2
- uses: actions/setup-go@v3
with:
go-version: "1.14"
go-version: "1.17"

- uses: actions/cache@v2
- uses: actions/cache@v3
with:
path: ~/go/pkg/mod
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
Expand Down
12 changes: 2 additions & 10 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ linters:
- deadcode
- goconst
- gofmt
- golint
- revive
- gosimple
- ineffassign
- interfacer
- misspell
- staticcheck
- unconvert
Expand All @@ -16,8 +15,8 @@ linters:
- vetshadow
- errcheck
- govet
- structcheck
- typecheck
- gocritic

run:

Expand All @@ -31,10 +30,3 @@ issues:
- "comment on"
- "error should be the last"
- "should have comment"

exclude-rules:

# list of excluded linters applied on test files
- path: _test\.go
linters:
- goconst
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ lint: modules
| tr -d \" \
| wget -O $(GOPATH)/bin/impi -qi -
@test -e $(GOPATH)/bin/golangci-lint || \
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOPATH)/bin v1.24.0
(curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOPATH)/bin v1.41.1)

@echo Verifying imports...
chmod +x $(GOPATH)/bin/impi && $(GOPATH)/bin/impi \
Expand Down
4 changes: 2 additions & 2 deletions cmd/autoscaler/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.14.3-alpine3.11 AS builder
FROM gcr.io/iguazio/golang:1.17-alpine3.15 AS builder

RUN apk --update --no-cache add \
git \
Expand All @@ -15,6 +15,6 @@ COPY . .

RUN GOOS=linux GOARCH=amd64 go build -a -installsuffix cgo -ldflags="-s -w" -o autoscaler cmd/autoscaler/main.go

FROM alpine:3.11
FROM gcr.io/iguazio/alpine:3.16

COPY --from=builder /autoscaler/autoscaler /home/v3io/bin/autoscaler
4 changes: 2 additions & 2 deletions cmd/dlx/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.14.3-alpine3.11 AS builder
FROM gcr.io/iguazio/golang:1.17-alpine3.15 AS builder

RUN apk --update --no-cache add \
git \
Expand All @@ -15,6 +15,6 @@ COPY . .

RUN GOOS=linux GOARCH=amd64 go build -a -installsuffix cgo -ldflags="-s -w" -o dlx cmd/dlx/main.go

FROM alpine:3.11
FROM gcr.io/iguazio/alpine:3.16

COPY --from=builder /dlx/dlx /home/v3io/bin/dlx
70 changes: 44 additions & 26 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,34 +1,52 @@
module github.com/v3io/scaler

go 1.14
go 1.17

require (
github.com/gogo/protobuf v1.1.1 // indirect
github.com/golang/protobuf v1.3.3 // indirect
github.com/google/go-cmp v0.4.0 // indirect
github.com/imdario/mergo v0.3.7 // indirect
github.com/json-iterator/go v1.1.7 // indirect
github.com/kr/pretty v0.1.0 // indirect
github.com/mattn/go-colorable v0.1.1 // indirect
github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b // indirect
github.com/nuclio/errors v0.0.3
github.com/nuclio/logger v0.0.1
github.com/nuclio/zap v0.0.3
github.com/pavius/zap v1.4.2-0.20180228181622-8d52692529b8 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/spf13/pflag v1.0.3 // indirect
github.com/nuclio/zap v0.1.2
github.com/stretchr/testify v1.7.0
github.com/v3io/scaler-types v1.8.0
k8s.io/apimachinery v0.23.8
k8s.io/client-go v0.23.8
k8s.io/metrics v0.23.8
)

require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/go-logr/logr v1.2.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/go-cmp v0.5.5 // indirect
github.com/google/gofuzz v1.1.0 // indirect
github.com/googleapis/gnostic v0.5.5 // indirect
github.com/imdario/mergo v0.3.7 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/liranbg/uberzap v1.20.0-nuclio.1 // indirect
github.com/logrusorgru/aurora/v3 v3.0.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/stretchr/objx v0.2.0 // indirect
github.com/stretchr/testify v1.5.1
github.com/v3io/scaler-types v1.7.0
go.uber.org/atomic v1.3.2 // indirect
go.uber.org/multierr v1.1.0 // indirect
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 // indirect
golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e // indirect
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d // indirect
golang.org/x/time v0.0.0-20191024005414-555d28b269f0 // indirect
google.golang.org/appengine v1.6.5 // indirect
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect
k8s.io/apimachinery v0.15.12
k8s.io/client-go v0.15.12
k8s.io/metrics v0.15.12
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
golang.org/x/net v0.0.0-20211209124913-491a49abca63 // indirect
golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f // indirect
golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e // indirect
golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect
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.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
k8s.io/api v0.23.8 // indirect
k8s.io/klog/v2 v2.30.0 // indirect
k8s.io/utils v0.0.0-20211116205334-6203023598ed // indirect
sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect
sigs.k8s.io/yaml v1.2.0 // indirect
)
Loading

0 comments on commit c6dccca

Please sign in to comment.