Skip to content

Commit

Permalink
Pre-release of v0.8.0
Browse files Browse the repository at this point in the history
1. host images on dockerhub now
  • Loading branch information
yuzhi.wx committed Dec 5, 2023
1 parent 8d7aac8 commit cf2df7a
Show file tree
Hide file tree
Showing 13 changed files with 65 additions and 45 deletions.
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
FROM golang:1.18 AS builder
FROM --platform=linux/amd64 golang:1.18 AS builder

WORKDIR /go/src/github.com/alibaba/open-local
COPY . .
RUN make build && chmod +x bin/open-local

FROM sting2me/open-local-base:latest
FROM --platform=linux/amd64 openlocal/open-local-base:latest
LABEL maintainers="Alibaba Cloud Authors"
LABEL description="open-local is a local disk management system"
COPY --from=builder /go/src/github.com/alibaba/open-local/bin/open-local /bin/open-local
COPY --from=thebeatles1994/open-local:tools /usr/local/bin/restic-amd64 /usr/local/bin/restic
COPY --from=openlocal/open-local-tools:latest /usr/local/bin/restic-amd64 /usr/local/bin/restic
ENTRYPOINT ["open-local"]
5 changes: 2 additions & 3 deletions Dockerfile.arm64
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ WORKDIR /go/src/github.com/alibaba/open-local
COPY . .
RUN make build && chmod +x bin/open-local

FROM alpine:3.9@sha256:f920ccc826134587fffcf1ddc6b2a554947e0f1a5ae5264bbf3435da5b2e8e61
FROM --platform=linux/arm64 openlocal/open-local-base:latest
LABEL maintainers="Alibaba Cloud Authors"
LABEL description="open-local is a local disk management system"
RUN apk update && apk upgrade && apk add util-linux coreutils e2fsprogs e2fsprogs-extra xfsprogs xfsprogs-extra blkid file open-iscsi jq
COPY --from=builder /go/src/github.com/alibaba/open-local/bin/open-local /bin/open-local
COPY --from=thebeatles1994/open-local:tools /usr/local/bin/restic-arm64 /usr/local/bin/restic
COPY --from=openlocal/open-local-tools:latest /usr/local/bin/restic-arm64 /usr/local/bin/restic
ENTRYPOINT ["open-local"]
5 changes: 5 additions & 0 deletions Dockerfile.base
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM alpine:3.14
LABEL open-local-base="v0.1.0"
LABEL maintainers="Alibaba Cloud Authors"
LABEL description="open-local is a local disk management system"
RUN apk update && apk upgrade && apk add util-linux coreutils e2fsprogs e2fsprogs-extra xfsprogs xfsprogs-extra blkid file open-iscsi jq
2 changes: 1 addition & 1 deletion Dockerfile.tools
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM alpine:3.9
FROM alpine:3.14

# run ./hack/download-restic.sh first

Expand Down
17 changes: 6 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@ GO_PACKAGE=github.com/alibaba/open-local
# build info
NAME=open-local
OUTPUT_DIR=./bin
IMAGE_NAME_FOR_ACR=ack-agility-registry.cn-shanghai.cr.aliyuncs.com/ecp_builder/${NAME}
IMAGE_NAME_FOR_DOCKERHUB=thebeatles1994/${NAME}
IMAGE_NAME_FOR_ACR=openlocal/${NAME}
MAIN_FILE=./cmd/main.go
LD_FLAGS=-ldflags "-X '${GO_PACKAGE}/pkg/version.GitCommit=$(GIT_COMMIT)' -X '${GO_PACKAGE}/pkg/version.Version=$(VERSION)' -X 'main.VERSION=$(VERSION)' -X 'main.COMMITID=$(GIT_COMMIT)'"
GIT_COMMIT=$(shell git rev-parse HEAD)
VERSION=v0.7.1
VERSION=v0.8.0-alpha

CRD_OPTIONS ?= "crd:trivialVersions=true"
CRD_VERSION=v1alpha1
Expand All @@ -34,25 +33,21 @@ build:
develop:
GOARCH=amd64 GOOS=linux CGO_ENABLED=0 $(GO_BUILD) $(LD_FLAGS) -v -o $(OUTPUT_DIR)/$(NAME) $(MAIN_FILE)
chmod +x $(OUTPUT_DIR)/$(NAME)
docker build . -t ${IMAGE_NAME_FOR_DOCKERHUB}:${VERSION} -f ./Dockerfile.dev
docker tag ${IMAGE_NAME_FOR_DOCKERHUB}:${VERSION} ${IMAGE_NAME_FOR_ACR}:${VERSION}
docker build . -t ${IMAGE_NAME_FOR_ACR}:${VERSION} -f ./Dockerfile.dev

# build image
.PHONY: image
image:
docker build . -t ${IMAGE_NAME_FOR_DOCKERHUB}:${VERSION} -f ./Dockerfile
docker tag ${IMAGE_NAME_FOR_DOCKERHUB}:${VERSION} ${IMAGE_NAME_FOR_ACR}:${VERSION}
docker build . -t ${IMAGE_NAME_FOR_ACR}:${VERSION} -f ./Dockerfile

# build image for arm64
.PHONY: image-arm64
image-arm64:
docker build . -t ${IMAGE_NAME_FOR_DOCKERHUB}:${VERSION}-arm64 -f ./Dockerfile.arm64
docker tag ${IMAGE_NAME_FOR_DOCKERHUB}:${VERSION}-arm64 ${IMAGE_NAME_FOR_ACR}:${VERSION}-arm64
docker build . -t ${IMAGE_NAME_FOR_ACR}:${VERSION}-arm64 -f ./Dockerfile.arm64

.PHONY: image-tools
image-tools:
docker build . -t ${IMAGE_NAME_FOR_DOCKERHUB}:tools -f ./Dockerfile.tools
docker tag ${IMAGE_NAME_FOR_DOCKERHUB}:tools ${IMAGE_NAME_FOR_ACR}:tools
docker build . -t ${IMAGE_NAME_FOR_ACR}-tools:latest -f ./Dockerfile.tools

# generate manifests e.g. CRD, RBAC etc.
manifests: controller-gen
Expand Down
21 changes: 21 additions & 0 deletions hack/multiarch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# create linux arm64 and amd64 environment named mybuilder
docker buildx create --name mybuilder --platform linux/arm64,linux/amd64 --use
mybuilder
# open-local-base image build multiarch image with mybuilder
docker buildx build --platform=linux/arm64/v8,linux/amd64 --builder mybuilder --push --tag openlocal/open-local-base:latest -f Dockerfile.base .
# open-local-tools image build multiarch image with mybuilder
docker buildx build --platform=linux/arm64/v8,linux/amd64 --builder mybuilder --push --tag openlocal/open-local-tools:latest -f Dockerfile.tools .

# open-local main image

make image && make image-arm64
# tag=v0.8.0-alpha
docker tag openlocal/open-local:$tag openlocal/open-local:$tag-amd
docker push openlocal/open-local:$tag-amd
docker tag openlocal/open-local:$tag-arm64 openlocal/open-local:$tag-arm64
docker push openlocal/open-local:$tag-arm64
docker manifest create openlocal/open-local:$tag --amend openlocal/open-local:$tag-arm64 --amend openlocal/open-local:$tag-amd
docker manifest push openlocal/open-local:$tag



4 changes: 2 additions & 2 deletions helm/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v1
description: cloud-native local storage management system
name: open-local
version: v0.7.1
appVersion: v0.7.1
version: v0.8.0-alpha
appVersion: v0.8.0-alpha
14 changes: 7 additions & 7 deletions helm/values-acka.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@ driver: yodaplugin.csi.alibabacloud.com
customLabels: {}
images:
local:
image: ecp_builder/open-local
tag: v0.7.1
image: openlocal/open-local
tag: v0.8.0-alpha
registrar:
image: ecp_builder/csi-node-driver-registrar
image: openlocal/csi-node-driver-registrar
tag: v2.3.0
provisioner:
image: ecp_builder/csi-provisioner
image: openlocal/csi-provisioner
tag: v2.2.2
resizer:
image: ecp_builder/csi-resizer
image: openlocal/csi-resizer
tag: v1.3.0
snapshotter:
image: ecp_builder/csi-snapshotter
image: openlocal/csi-snapshotter
tag: v4.2.1
snapshot_controller:
image: ecp_builder/snapshot-controller
image: openlocal/snapshot-controller
tag: v4.2.1
agent:
name: yoda-agent
Expand Down
16 changes: 8 additions & 8 deletions helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@ driver: local.csi.aliyun.com
customLabels: {}
images:
local:
image: ecp_builder/open-local
tag: v0.7.1
image: openlocal/open-local
tag: v0.8.0-alpha
registrar:
image: ecp_builder/csi-node-driver-registrar
image: openlocal/csi-node-driver-registrar
tag: v2.3.0
provisioner:
image: ecp_builder/csi-provisioner
image: openlocal/csi-provisioner
tag: v2.2.2
resizer:
image: ecp_builder/csi-resizer
image: openlocal/csi-resizer
tag: v1.3.0
snapshotter:
image: ecp_builder/csi-snapshotter
image: openlocal/csi-snapshotter
tag: v4.2.1
snapshot_controller:
image: ecp_builder/snapshot-controller
image: openlocal/snapshot-controller
tag: v4.2.1
agent:
name: open-local-agent
Expand Down Expand Up @@ -104,5 +104,5 @@ monitor:
# grafana namespace
namespace: monitoring
global:
RegistryURL: ack-agility-registry.cn-shanghai.cr.aliyuncs.com
RegistryURL: docker.io
ImagePullPolicy: Always
4 changes: 2 additions & 2 deletions pkg/csi/client/konnectivity.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ type GrpcProxyClientOptions struct {

type proxyFunc func(ctx context.Context, addr string) (net.Conn, error)

func getKonnectivityUDSDialer(ctx context.Context, address string,o GrpcProxyClientOptions) (func(ctx context.Context, addr string) (net.Conn, error), error) {
func getKonnectivityUDSDialer(ctx context.Context, address string, o GrpcProxyClientOptions) (func(ctx context.Context, addr string) (net.Conn, error), error) {
log.Infof("using konnectivity UDS dialer")

var proxyConn net.Conn
Expand All @@ -63,7 +63,7 @@ func getKonnectivityUDSDialer(ctx context.Context, address string,o GrpcProxyCli
return c, err
})
tunnel, err := client.CreateSingleUseGrpcTunnelWithContext(
ctx,// create context should follow grpc timeout configuration
ctx, // create context should follow grpc timeout configuration
context.TODO(), // tunnel context use context.TODO()
o.ProxyUDSName,
dialOption,
Expand Down
12 changes: 6 additions & 6 deletions pkg/csi/controllerserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -784,13 +784,13 @@ func (cs *controllerServer) getNodeConn(nodeSelected string) (client.Connection,
var proxyOpts client.GrpcProxyClientOptions
if cs.options.konnectivityProxyHost != "" || cs.options.konnectivityUDS != "" {
proxyOpts = client.GrpcProxyClientOptions{
Mode: cs.options.konnectivityProxyMode,
ProxyHost: cs.options.konnectivityProxyHost,
ProxyPort: cs.options.konnectivityProxyPort,
Mode: cs.options.konnectivityProxyMode,
ProxyHost: cs.options.konnectivityProxyHost,
ProxyPort: cs.options.konnectivityProxyPort,
ProxyUDSName: cs.options.konnectivityUDS,
ClientCert: cs.options.konnectivityClientCert,
ClientKey: cs.options.konnectivityClientKey,
CACert: cs.options.konnectivityCACert,
ClientCert: cs.options.konnectivityClientCert,
ClientKey: cs.options.konnectivityClientKey,
CACert: cs.options.konnectivityCACert,
}
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/csi/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ var defaultDriverOptions = driverOptions{
konnectivityProxyHost: "",
konnectivityProxyPort: 0,
konnectivityProxyMode: "",
konnectivityClientCert: "",
konnectivityClientCert: "",
konnectivityClientKey: "",
konnectivityCACert: "",
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/utils/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -947,4 +947,4 @@ func GetFuncName(funcName interface{}, full bool) string {
return funcs[0]
}
return origin
}
}

0 comments on commit cf2df7a

Please sign in to comment.