Skip to content

Commit

Permalink
Configure qa for arm64 (#646)
Browse files Browse the repository at this point in the history
  • Loading branch information
nilsgstrabo authored Jul 1, 2024
1 parent 7c04ce0 commit f26a1be
Show file tree
Hide file tree
Showing 5 changed files with 157 additions and 156 deletions.
24 changes: 15 additions & 9 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
with:
go-version-file: 'go.mod'
- name: golangci-lint
uses: golangci/golangci-lint-action@v4
uses: golangci/golangci-lint-action@v6
with:
version: v1.58.2

Expand Down Expand Up @@ -54,21 +54,15 @@ jobs:
- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
# - name: Install dependencies
# run: go mod download
- name: Install Swagger
run: go install github.com/go-swagger/go-swagger/cmd/swagger@v0.31.0
# - name: Generate Swagger
# run: swagger generate spec -o ./swagger.json --scan-models --exclude-deps
# - name: Validate no changes
# run: diff swagger.json ./swaggerui/html/swagger.json
- name: Check breaking changes
if: always()
id: breaking
continue-on-error: true
run: swagger diff --break <(git show master:swaggerui/html/swagger.json) swagger.json > /tmp/swagger_breaking_changes.txt
run: swagger diff --break <(git show master:swaggerui/html/swagger.json) swaggerui/html/swagger.json > /tmp/swagger_breaking_changes.txt
- name: Add comment
if: failure() && steps.breaking.outcome == 'failure'
if: steps.breaking.outcome == 'failure'
uses: mshick/add-pr-comment@v2
with:
message-id: breaking-comment
Expand All @@ -82,3 +76,15 @@ jobs:
- uses: actions/checkout@v4
- name: Build docker image
run: docker build .

validate-radixconfig:
name: Test RadixConfig
runs-on: ubuntu-latest
steps:
- name: 'Fake TOKEN FOR RADIX CLI'
run: echo "APP_SERVICE_ACCOUNT_TOKEN=dummy" >> $GITHUB_ENV
- uses: actions/checkout@v4
- name: 'Validate'
uses: equinor/radix-github-actions@v1
with:
args: validate radix-config --config-file radixconfig.yaml
37 changes: 11 additions & 26 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,31 +1,16 @@
FROM golang:1.22-alpine3.19 as builder
ENV GO111MODULE=on

RUN apk update && \
apk add bash jq alpine-sdk sed gawk git ca-certificates curl && \
apk add --no-cache gcc musl-dev

WORKDIR /go/src/github.com/equinor/radix-api/

# get dependencies
# Build stage
FROM docker.io/golang:1.22-alpine3.20 as builder
ENV CGO_ENABLED=0 \
GOOS=linux
WORKDIR /src
COPY go.mod go.sum ./
RUN go mod download

# copy api code
COPY . .
RUN go build -ldflags="-s -w" -o /build/radix-api

# Build radix api go project
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags "-s -w" -a -installsuffix cgo -o /usr/local/bin/radix-api

RUN addgroup -S -g 1000 api-user
RUN adduser -S -u 1000 -G api-user api-user

FROM scratch

COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder /etc/passwd /etc/passwd
COPY --from=builder /usr/local/bin/radix-api /usr/local/bin/radix-api

EXPOSE 3001
# 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-api .
USER 1000
ENTRYPOINT ["/usr/local/bin/radix-api"]
ENTRYPOINT ["/app/radix-api"]
67 changes: 33 additions & 34 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.22.0
toolchain go1.22.1

require (
github.com/cert-manager/cert-manager v1.14.5
github.com/cert-manager/cert-manager v1.15.1
github.com/equinor/radix-common v1.9.2
github.com/equinor/radix-job-scheduler v1.9.2
github.com/equinor/radix-operator v1.56.1
Expand All @@ -17,20 +17,20 @@ require (
github.com/kedacore/keda/v2 v2.13.1
github.com/marstr/guid v1.1.0
github.com/mitchellh/mapstructure v1.5.0
github.com/prometheus-operator/prometheus-operator/pkg/client v0.74.0
github.com/prometheus-operator/prometheus-operator/pkg/client v0.75.0
github.com/prometheus/client_golang v1.19.1
github.com/rs/cors v1.11.0
github.com/rs/xid v1.5.0
github.com/rs/zerolog v1.32.0
github.com/rs/zerolog v1.33.0
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.18.2
github.com/spf13/viper v1.19.0
github.com/stretchr/testify v1.9.0
github.com/tektoncd/pipeline v0.55.0
github.com/urfave/negroni/v3 v3.1.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
k8s.io/api v0.30.2
k8s.io/apimachinery v0.30.2
k8s.io/client-go v0.30.2
knative.dev/pkg v0.0.0-20240116073220-b488e7be5902
sigs.k8s.io/secrets-store-csi-driver v1.4.0
)
Expand All @@ -43,16 +43,16 @@ require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/blendle/zapdriver v1.3.1 // indirect
github.com/census-instrumentation/opencensus-proto v0.4.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/elnormous/contenttype v1.0.4 // indirect
github.com/emicklei/go-restful/v3 v3.12.0 // indirect
github.com/emicklei/go-restful/v3 v3.12.1 // indirect
github.com/evanphx/json-patch v5.9.0+incompatible // indirect
github.com/expr-lang/expr v1.15.8 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/go-kit/log v0.2.1 // indirect
github.com/go-logfmt/logfmt v0.5.1 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-openapi/jsonpointer v0.21.0 // indirect
github.com/go-openapi/jsonreference v0.21.0 // indirect
github.com/go-openapi/swag v0.23.0 // indirect
Expand All @@ -66,7 +66,7 @@ require (
github.com/google/go-containerregistry v0.16.1 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/hcl v1.0.1-vault-5 // indirect
Expand All @@ -81,13 +81,13 @@ require (
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/pelletier/go-toml/v2 v2.1.1 // indirect
github.com/pelletier/go-toml/v2 v2.2.2 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.74.0 // indirect
github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.75.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/prometheus/procfs v0.15.0 // indirect
github.com/prometheus/statsd_exporter v0.22.7 // indirect
github.com/robfig/cron/v3 v3.0.1 // indirect
github.com/sagikazarmark/locafero v0.4.0 // indirect
Expand All @@ -99,32 +99,31 @@ require (
github.com/subosito/gotenv v1.6.0 // indirect
go.opencensus.io v0.24.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.26.0 // indirect
golang.org/x/crypto v0.23.0 // indirect
golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect
golang.org/x/net v0.25.0 // indirect
golang.org/x/oauth2 v0.20.0 // indirect
golang.org/x/sys v0.20.0 // indirect
golang.org/x/term v0.20.0 // indirect
golang.org/x/text v0.15.0 // indirect
go.uber.org/zap v1.27.0 // indirect
golang.org/x/crypto v0.24.0 // indirect
golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect
golang.org/x/net v0.26.0 // indirect
golang.org/x/oauth2 v0.21.0 // indirect
golang.org/x/sys v0.21.0 // indirect
golang.org/x/term v0.21.0 // indirect
golang.org/x/text v0.16.0 // indirect
golang.org/x/time v0.5.0 // indirect
golang.org/x/tools v0.21.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
google.golang.org/api v0.156.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240116215550-a9fa1716bcac // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240116215550-a9fa1716bcac // indirect
google.golang.org/grpc v1.60.1 // indirect
google.golang.org/protobuf v1.33.0 // indirect
google.golang.org/api v0.181.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240515191416-fc5f0ca64291 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240515191416-fc5f0ca64291 // indirect
google.golang.org/grpc v1.64.0 // indirect
google.golang.org/protobuf v1.34.2 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/apiextensions-apiserver v0.30.1 // indirect
k8s.io/klog/v2 v2.120.1 // indirect
k8s.io/kube-openapi v0.0.0-20240322212309-b815d8309940 // indirect
k8s.io/utils v0.0.0-20240310230437-4693a0247e57 // indirect
sigs.k8s.io/controller-runtime v0.18.2 // indirect
sigs.k8s.io/gateway-api v1.0.0 // indirect
k8s.io/apiextensions-apiserver v0.30.2 // indirect
k8s.io/klog/v2 v2.130.1 // indirect
k8s.io/kube-openapi v0.0.0-20240620174524-b456828f718b // indirect
k8s.io/utils v0.0.0-20240502163921-fe8a2dddb1d0 // indirect
sigs.k8s.io/controller-runtime v0.18.4 // indirect
sigs.k8s.io/gateway-api v1.1.0 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
sigs.k8s.io/yaml v1.4.0 // indirect
Expand Down
Loading

0 comments on commit f26a1be

Please sign in to comment.