-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #101 from yzewei/main
add dashboard-metrics-scraper 1.0.8
- Loading branch information
Showing
2 changed files
with
98 additions
and
0 deletions.
There are no files selected for viewing
71 changes: 71 additions & 0 deletions
71
kubernetes/dashboard-metrics-scrape/1.0.8/0001-add-loong64-support.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
diff --git a/Dockerfile b/Dockerfile | ||
index 41cf8dd..2020b9c 100644 | ||
--- a/Dockerfile | ||
+++ b/Dockerfile | ||
@@ -2,10 +2,11 @@ | ||
ARG GO_VERSION=1.18 | ||
|
||
# First stage: build the executable. | ||
-FROM golang:${GO_VERSION}-stretch AS builder | ||
+#FROM golang:${GO_VERSION}-stretch AS builder | ||
+FROM lcr.loongnix.cn/library/golang:1.19 AS builder | ||
|
||
# What arch is it? | ||
-ARG GOARCH=amd64 | ||
+ARG GOARCH=loong64 | ||
ARG GOOS=linux | ||
|
||
# Install the Certificate-Authority certificates for the app to be able to make | ||
@@ -19,6 +20,8 @@ WORKDIR /src | ||
# Import the code from the context. | ||
COPY ./ ./ | ||
|
||
+ENV GOPROXY=https://goproxy.cn | ||
+ | ||
# Build the executable to `/app`. Mark the build as statically linked. | ||
RUN echo "Building for $GOARCH" \ | ||
&& mkdir -p ${GOPATH}/src/github.com/kubernetes-sigs \ | ||
diff --git a/hack/deploy.sh b/hack/deploy.sh | ||
index c09d497..b177061 100755 | ||
--- a/hack/deploy.sh | ||
+++ b/hack/deploy.sh | ||
@@ -1,6 +1,6 @@ | ||
#!/bin/bash | ||
|
||
-arch_list="amd64 arm arm64 ppc64le s390x" | ||
+arch_list="loong64" | ||
manifest="kubernetesui/metrics-scraper"; | ||
manifest_list=""; | ||
|
||
@@ -8,10 +8,10 @@ manifest_list=""; | ||
for i in ${arch_list}; do | ||
# If it's a tagged release, use the tag | ||
# Otherwise, assume it's HEAD and push to latest | ||
- container="${manifest}-${i}:${TRAVIS_TAG:="latest"}" | ||
+ container="lcr.loongnix.cn/${manifest}:1.0.8" | ||
|
||
- echo "--- docker build --no-cache --build-arg GOARCH=${i} -t ${container} ."; | ||
- docker build --no-cache --build-arg GOARCH=${i} -t ${container} . | ||
+ echo "--- docker build --no-cache --build-arg http_proxy=http://10.2.10.197:7890 --build-arg GOARCH=${i} -t ${container} ."; | ||
+ docker build --build-arg GOARCH=${i} -t ${container} . | ||
|
||
echo "--- docker push ${container}" | ||
docker push ${container} | ||
@@ -20,14 +20,14 @@ for i in ${arch_list}; do | ||
done; | ||
|
||
echo "--- docker manifest create --amend ${manifest}:${TRAVIS_TAG:="latest"} ${manifest_list}" | ||
-docker manifest create --amend ${manifest}:${TRAVIS_TAG:="latest"} ${manifest_list} | ||
+#docker manifest create --amend ${manifest}:${TRAVIS_TAG:="latest"} ${manifest_list} | ||
|
||
for i in ${arch_list}; do | ||
container="${manifest}-${i}:${TRAVIS_TAG:="latest"}" | ||
|
||
echo "--- docker manifest annotate ${manifest}:${TRAVIS_TAG:="latest"} ${container} --os linux --arch ${i}" | ||
- docker manifest annotate ${manifest}:${TRAVIS_TAG:="latest"} ${container} --os linux --arch ${i} | ||
+# docker manifest annotate ${manifest}:${TRAVIS_TAG:="latest"} ${container} --os linux --arch ${i} | ||
done; | ||
|
||
echo "--- docker manifest push ${manifest}:${TRAVIS_TAG:="latest"}" | ||
-docker manifest push ${manifest}:${TRAVIS_TAG:="latest"} | ||
+#docker manifest push ${manifest}:${TRAVIS_TAG:="latest"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# This file is generated by the template. | ||
|
||
REGISTRY ?=lcr.loongnix.cn | ||
ORGANIZATION ?=kubernetesui | ||
REPOSITORY ?=metrics-scraper | ||
TAG ?=1.0.8 | ||
LATEST ?=true | ||
|
||
IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) | ||
LATEST_IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):latest | ||
|
||
default: image | ||
|
||
src: | ||
git clone --depth 1 -b v1.0.8 https://github.com/kubernetes-sigs/dashboard-metrics-scraper && cd dashboard-metrics-scraper && git apply ../0001-add-loong64-support.patch | ||
|
||
image: src | ||
cd dashboard-metrics-scraper && bash hack/deploy.sh | ||
|
||
push: | ||
docker push $(IMAGE) | ||
#latest image | ||
@if [ $(LATEST) = "true" ]; \ | ||
then \ | ||
docker tag $(IMAGE) $(LATEST_IMAGE); \ | ||
docker push $(LATEST_IMAGE); \ | ||
fi |