Skip to content

Commit

Permalink
set-arm-platform (#131)
Browse files Browse the repository at this point in the history
* Updated refs

* Fairing the failed workflow

* Fairing the failed workflow

* Corrected version of actions
  • Loading branch information
satr authored Jul 10, 2024
1 parent ed861c4 commit 5b6bca9
Show file tree
Hide file tree
Showing 7 changed files with 202 additions and 219 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
- uses: actions/checkout@v4
if: matrix.target.ref == github.ref

- uses: azure/login@v1
- uses: azure/login@v2
if: matrix.target.ref == github.ref
with:
client-id: ${{matrix.target.client-id}}
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/deploy-database.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,38 +49,38 @@ jobs:
- uses: actions/checkout@v4
if: matrix.target.ref == github.ref

- uses: azure/login@v1
- uses: azure/login@v2
if: matrix.target.ref == github.ref
with:
client-id: ${{matrix.target.client-id}}
tenant-id: "3aa4a235-b6e2-48d5-9195-7fcf05b459b0"
allow-no-subscriptions: true

- uses: azure/sql-action@v2.2.1
- uses: azure/sql-action@v2.3
if: matrix.target.ref == github.ref
with:
connection-string: ${{env.connection}}
path: './azure-infrastructure/preDeployScript.sql'

- uses: azure/sql-action@v2.2.1
- uses: azure/sql-action@v2.3
if: matrix.target.ref == github.ref
with:
connection-string: ${{env.connection}}
path: './azure-infrastructure/createSchema.sql'

- uses: azure/sql-action@v2.2.1
- uses: azure/sql-action@v2.3
if: matrix.target.ref == github.ref
with:
connection-string: ${{env.connection}}
path: './azure-infrastructure/createTables.sql'

- uses: azure/sql-action@v2.2.1
- uses: azure/sql-action@v2.3
if: matrix.target.ref == github.ref
with:
connection-string: ${{env.connection}}
path: './azure-infrastructure/createTypes.sql'

- uses: azure/sql-action@v2.2.1
- uses: azure/sql-action@v2.3
if: matrix.target.ref == github.ref
with:
connection-string: ${{env.connection}}
Expand Down
20 changes: 9 additions & 11 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,18 @@ jobs:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build docker image
env:
REF: ${{ github. sha }}
run: docker build -t radix-cost-allocatation:${REF##*/} .
- uses: actions/checkout@v4
- name: Build docker image
run: docker build .

test:
name: Unit Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.21'
go-version-file: 'go.mod'
- name: Install dependencies
run: go mod download
- name: Run Tests
Expand All @@ -36,8 +34,8 @@ jobs:
fetch-depth: 2
- uses: actions/setup-go@v5
with:
go-version: '1.21'
go-version-file: 'go.mod'
- name: golangci-lint
uses: golangci/golangci-lint-action@v4
uses: golangci/golangci-lint-action@v6
with:
version: v1.55.2
version: v1.58.2
27 changes: 10 additions & 17 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
FROM golang:1.21-alpine3.18 as builder
FROM docker.io/golang:1.22-alpine3.20 as builder
ENV CGO_ENABLED=0 \
GOOS=linux

RUN apk update && \
apk add ca-certificates curl git && \
apk add --no-cache gcc musl-dev

WORKDIR /go/src/github.com/equinor/radix-cost-allocation/
WORKDIR /src

# Install project dependencies
COPY go.mod go.sum ./
Expand All @@ -13,16 +11,11 @@ RUN go mod download
# Copy project code
COPY . .

# Build
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags "-s -w" -a -installsuffix cgo -o ./rootfs/radix-cost-allocation
RUN addgroup -S -g 1000 radix-cost-allocation
RUN adduser -S -u 1000 -G radix-cost-allocation radix-cost-allocation
RUN go build -ldflags="-s -w" -o /build/radix-cost-allocation

# Run operator
FROM scratch
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder /etc/passwd /etc/passwd
COPY --from=builder /go/src/github.com/equinor/radix-cost-allocation/rootfs/radix-cost-allocation /usr/local/bin/radix-cost-allocation
# Final stage, ref https://github.com/GoogleContainerTools/distroless/blob/main/base/README.md for distroless
FROM gcr.io/distroless/static
WORKDIR /app
COPY --from=builder /build/radix-cost-allocation .
USER 1000

ENTRYPOINT ["/usr/local/bin/radix-cost-allocation"]
ENTRYPOINT ["/app/radix-cost-allocation"]
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ mocks: bootstrap
mockgen -source ./pkg/listers/nodebulkdto.go -destination ./pkg/listers/mock/nodebulkdto.go -package mock



HAS_GOLANGCI_LINT := $(shell command -v golangci-lint;)
HAS_MOCKGEN := $(shell command -v mockgen;)

Expand Down
85 changes: 50 additions & 35 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,75 +1,90 @@
module github.com/equinor/radix-cost-allocation

go 1.21
go 1.22.0

toolchain go1.21.0
toolchain go1.22.5

require (
github.com/equinor/radix-operator v1.48.0
github.com/equinor/radix-operator v1.57.1
github.com/golang/mock v1.6.0
github.com/microsoft/go-mssqldb v1.4.0
github.com/microsoft/go-mssqldb v1.7.2
github.com/pkg/errors v0.9.1
github.com/robfig/cron/v3 v3.0.1
github.com/rs/zerolog v1.32.0
github.com/rs/zerolog v1.33.0
github.com/stretchr/testify v1.9.0
github.com/vrischmann/envconfig v1.3.0
golang.org/x/sync v0.5.0
k8s.io/api v0.29.0
k8s.io/apimachinery v0.29.0
k8s.io/client-go v0.29.0
golang.org/x/sync v0.7.0
k8s.io/api v0.30.1
k8s.io/apimachinery v0.30.1
k8s.io/client-go v0.30.1
)

require (
dario.cat/mergo v1.0.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.3.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 // indirect
github.com/AzureAD/microsoft-authentication-library-for-go v1.0.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.1 // indirect
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.5.1 // indirect
github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.1 // indirect
github.com/AzureAD/microsoft-authentication-library-for-go v1.2.1 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
github.com/equinor/radix-common v1.7.1 // indirect
github.com/go-logr/logr v1.3.0 // indirect
github.com/go-openapi/jsonpointer v0.20.0 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/swag v0.22.4 // indirect
github.com/emicklei/go-restful/v3 v3.11.2 // indirect
github.com/equinor/radix-common v1.9.2 // indirect
github.com/evanphx/json-patch v5.8.1+incompatible // indirect
github.com/evanphx/json-patch/v5 v5.9.0 // indirect
github.com/expr-lang/expr v1.15.8 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-openapi/jsonpointer v0.20.2 // indirect
github.com/go-openapi/jsonreference v0.20.4 // indirect
github.com/go-openapi/swag v0.22.7 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang-jwt/jwt/v4 v4.5.0 // indirect
github.com/golang-jwt/jwt/v5 v5.2.0 // indirect
github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 // indirect
github.com/golang-sql/sqlexp v0.1.0 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/gnostic-models v0.6.8 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/uuid v1.5.0 // indirect
github.com/imdario/mergo v0.3.13 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/imdario/mergo v0.3.16 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/kedacore/keda/v2 v2.13.1 // indirect
github.com/kylelemons/godebug v1.1.0 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/prometheus/client_golang v1.19.0 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.53.0 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
golang.org/x/crypto v0.21.0 // indirect
golang.org/x/net v0.23.0 // indirect
golang.org/x/oauth2 v0.15.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/term v0.18.0 // indirect
golang.org/x/crypto v0.22.0 // indirect
golang.org/x/exp v0.0.0-20240112132812-db7319d0e0e3 // indirect
golang.org/x/net v0.24.0 // indirect
golang.org/x/oauth2 v0.19.0 // indirect
golang.org/x/sys v0.19.0 // indirect
golang.org/x/term v0.19.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/time v0.5.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/klog/v2 v2.110.1 // indirect
k8s.io/kube-openapi v0.0.0-20231129212854-f0671cc7e66a // indirect
k8s.io/utils v0.0.0-20231127182322-b307cd553661 // indirect
k8s.io/apiextensions-apiserver v0.30.1 // indirect
k8s.io/klog/v2 v2.120.1 // indirect
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 // indirect
k8s.io/utils v0.0.0-20240310230437-4693a0247e57 // indirect
knative.dev/pkg v0.0.0-20240116073220-b488e7be5902 // indirect
sigs.k8s.io/controller-runtime v0.18.2 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/secrets-store-csi-driver v1.4.0 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
Expand Down
Loading

0 comments on commit 5b6bca9

Please sign in to comment.