Skip to content

Commit

Permalink
Cleanup & build system updates (#7537)
Browse files Browse the repository at this point in the history
* Cleanup go deps and ignore go.work.sum file

* Fix unit test

* Remove unused dockerfile

* Update ignore file

* Tidy deps and remove ignored file

* Cleanup

* Update i18n

* Remove --platform from dockerfile and add compose param

* Update docker compose for multi arch build
  • Loading branch information
floreks authored Nov 18, 2022
1 parent b2933e9 commit 497f6dc
Show file tree
Hide file tree
Showing 20 changed files with 400 additions and 1,655 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
.idea/
.vscode/
.DS_Store
.fleet/

# Build, deps and cache
.angular
Expand Down
39 changes: 0 additions & 39 deletions hack/docker/Dockerfile

This file was deleted.

10 changes: 5 additions & 5 deletions hack/docker/docker.compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ services:
context: ../..
dockerfile: modules/web/Dockerfile
args:
- BUILDPLATFORM=${OS:?}/${ARCH:?}
- BUILDARCH=${ARCH:?}
- TARGETOS=${OS:?}
- TARGETARCH=${ARCH:?}
command:
--locale-config=/public/locale_conf.json
--auto-generate-certificates
Expand All @@ -33,8 +33,8 @@ services:
context: ../..
dockerfile: modules/api/Dockerfile
args:
- BUILDPLATFORM=${OS:?}/${ARCH:?}
- BUILDARCH=${ARCH:?}
- TARGETOS=${OS:?}
- TARGETARCH=${ARCH:?}
command:
--kubeconfig=${KUBECONFIG:?}
--auto-generate-certificates
Expand All @@ -50,8 +50,8 @@ services:
scraper:
image: kubernetesui/metrics-scraper:v1.0.8
command:
# TODO: move metrics args to some overridable env variables
--kubeconfig=${KUBECONFIG:?}
# TODO: move this to some overridable env variables
--metric-resolution=5s
--metric-duration=10m
volumes:
Expand Down
4 changes: 2 additions & 2 deletions hack/include/config.mk
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
### Common application/container details
PROJECT_NAME := dashboard
# Supported architectures
ARCHITECTURES := linux/amd64 linux/arm64 linux/arm linux/ppc64le linux/s390x darwin/amd64 darwin/arm64
BUILDX_ARCHITECTURES := linux/amd64,linux/arm64,linux/arm,linux/ppc64le,linux/s390x,darwin/amd64,darwin/arm64
ARCHITECTURES := linux/amd64 linux/arm64 linux/arm linux/ppc64le linux/s390x # darwin/amd64 darwin/arm64 <- TODO: enable once it is natively supported by docker
BUILDX_ARCHITECTURES := linux/amd64,linux/arm64,linux/arm,linux/ppc64le,linux/s390x # ,darwin/amd64,darwin/arm64
# Container registry details
IMAGE_REGISTRIES := docker.io
IMAGE_REPOSITORY := kubernetesui
Expand Down
16 changes: 16 additions & 0 deletions modules/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright 2017 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

go.work.sum
4 changes: 2 additions & 2 deletions modules/api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM --platform=$BUILDPLATFORM ubuntu:20.04 as builder
FROM ubuntu:20.04 as builder

# Create a nonroot user for final image
RUN useradd -u 10001 nonroot

# Scratch can be used as the base image because the backend is compiled to include all
# its dependencies.
FROM --platform=$BUILDPLATFORM scratch as final
FROM scratch as final
ARG TARGETARCH
ARG TARGETOS

Expand Down
46 changes: 24 additions & 22 deletions modules/api/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@ go 1.19
require (
github.com/docker/distribution v2.8.1+incompatible
github.com/emicklei/go-restful/v3 v3.10.0
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/prometheus/client_golang v1.14.0
github.com/spf13/pflag v1.0.5
golang.org/x/net v0.0.0-20220921203646-d300de134e69
golang.org/x/text v0.3.7 // indirect
golang.org/x/net v0.1.0
gopkg.in/igm/sockjs-go.v2 v2.1.0
gopkg.in/square/go-jose.v2 v2.6.0
gopkg.in/yaml.v2 v2.4.0
Expand All @@ -21,47 +19,51 @@ require (
)

require (
github.com/PuerkitoBio/purell v1.1.1 // indirect
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/evanphx/json-patch v5.6.0+incompatible // indirect
github.com/evanphx/json-patch v4.12.0+incompatible // indirect
github.com/go-logr/logr v1.2.3 // indirect
github.com/go-openapi/jsonpointer v0.19.5 // indirect
github.com/go-openapi/jsonreference v0.20.0 // indirect
github.com/go-openapi/swag v0.22.3 // indirect
github.com/go-openapi/jsonreference v0.19.5 // indirect
github.com/go-openapi/swag v0.19.14 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/gnostic v0.6.9 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/imdario/mergo v0.3.13 // indirect
github.com/google/gnostic v0.5.7-v3refs // indirect
github.com/google/gofuzz v1.1.0 // indirect
github.com/gorilla/websocket v1.4.2 // indirect
github.com/imdario/mergo v0.3.6 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
github.com/mailru/easyjson v0.7.6 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/moby/spdystream v0.2.0 // 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/opencontainers/go-digest v1.0.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus/client_model v0.3.0 // indirect
github.com/prometheus/common v0.37.0 // indirect
github.com/prometheus/procfs v0.8.0 // indirect
golang.org/x/crypto v0.0.0-20220919173607-35f4265a4bc0 // indirect
golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1 // indirect
golang.org/x/sys v0.0.0-20220919091848-fb04ddd9f9c8 // indirect
golang.org/x/term v0.0.0-20220919170432-7a66f970e087 // indirect
golang.org/x/time v0.0.0-20220922220347-f3bd1da661af // indirect
golang.org/x/crypto v0.0.0-20220315160706-3147a52a75dd // indirect
golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b // indirect
golang.org/x/sys v0.1.0 // indirect
golang.org/x/term v0.1.0 // indirect
golang.org/x/text v0.4.0 // indirect
golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.28.1 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/klog/v2 v2.80.1 // indirect
k8s.io/kube-openapi v0.0.0-20220803164354-a70c9af30aea // indirect
k8s.io/utils v0.0.0-20220922133306-665eaaec4324 // indirect
k8s.io/klog/v2 v2.70.1 // indirect
k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1 // indirect
k8s.io/utils v0.0.0-20220728103510-ee6ede2d64ed // indirect
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
sigs.k8s.io/yaml v1.2.0 // indirect
)

replace k8s.io/dashboard/certificates => ./../common/certificates
replace k8s.io/dashboard/certificates => ../common/certificates
Loading

0 comments on commit 497f6dc

Please sign in to comment.