From 8f2dd1b0f95dd462ffea0db820b43443f0536cb8 Mon Sep 17 00:00:00 2001 From: Thomas Vachuska Date: Tue, 7 Apr 2020 19:36:44 -0700 Subject: [PATCH] Removing debug targets and debug images; need different solution (#16) --- Makefile | 11 ++------ build/onos-control-debug/Dockerfile | 43 ----------------------------- 2 files changed, 2 insertions(+), 52 deletions(-) delete mode 100644 build/onos-control-debug/Dockerfile diff --git a/Makefile b/Makefile index e430abf..af576f5 100644 --- a/Makefile +++ b/Makefile @@ -4,13 +4,11 @@ export GO111MODULE=on .PHONY: build ONOS_CONTROL_VERSION := latest -ONOS_CONTROL_DEBUG_VERSION := debug ONOS_BUILD_VERSION := stable build: # @HELP build the Go binaries and run all validations (default) build: CGO_ENABLED=1 go build -o build/_output/onos-control ./cmd/onos - CGO_ENABLED=1 go build -gcflags "all=-N -l" -o build/_output/onos-control-debug ./cmd/onos-control go build -o build/_output/onos ./cmd/onos test: # @HELP run the unit tests and source code validation @@ -52,11 +50,6 @@ onos-control-docker: onos-control-base-docker # @HELP build onos-control Docker --build-arg ONOS_CONTROL_BASE_VERSION=${ONOS_CONTROL_VERSION} \ -t onosproject/onos-control:${ONOS_CONTROL_VERSION} -onos-control-debug-docker: onos-control-base-docker # @HELP build onos-control Docker debug image - docker build . -f build/onos-control-debug/Dockerfile \ - --build-arg ONOS_CONTROL_BASE_VERSION=${ONOS_CONTROL_VERSION} \ - -t onosproject/onos-control:${ONOS_CONTROL_DEBUG_VERSION} - onos-cli-docker: onos-control-base-docker # @HELP build onos-cli Docker image docker build . -f build/onos-cli/Dockerfile \ --build-arg ONOS_CONTROL_BASE_VERSION=${ONOS_CONTROL_VERSION} \ @@ -76,12 +69,12 @@ integration: kind images: # @HELP build all Docker images -images: build onos-control-docker onos-control-debug-docker +images: build onos-control-docker kind: # @HELP build Docker images and add them to the currently configured kind cluster kind: images @if [ "`kind get clusters`" = '' ]; then echo "no kind cluster found" && exit 1; fi - kind load docker-image onosproject/onos-config:${ONOS_CONTROL_DEBUG_VERSION} + kind load docker-image onosproject/onos-config:${ONOS_CONTROL_VERSION} all: build images diff --git a/build/onos-control-debug/Dockerfile b/build/onos-control-debug/Dockerfile deleted file mode 100644 index dda884e..0000000 --- a/build/onos-control-debug/Dockerfile +++ /dev/null @@ -1,43 +0,0 @@ -ARG ONOS_CONTROL_BASE_VERSION=latest - -FROM onosproject/onos-control-base:$ONOS_CONTROL_BASE_VERSION as base - -FROM golang:1.12.6-alpine3.9 as debugBuilder - -RUN apk upgrade --update --no-cache && apk add git && \ - go get -u github.com/go-delve/delve/cmd/dlv && \ - go get -u github.com/atomix/atomix-cli/cmd/atomix - -FROM alpine:3.9 - -RUN apk upgrade --update --no-cache && apk add bash bash-completion libc6-compat - -COPY --from=base /go/src/github.com/onosproject/onos-control/build/_output/onos /usr/local/bin/onos -COPY --from=base /go/src/github.com/onosproject/onos-control/build/_output/onos-control-debug /usr/local/bin/onos-control -COPY --from=debugBuilder /go/bin/dlv /usr/local/bin/dlv -COPY --from=debugBuilder /go/bin/atomix /usr/local/bin/atomix - -RUN echo "#!/bin/sh" >> /usr/local/bin/onos-control-debug && \ - echo "atomix controller set \$ATOMIX_CONTROLLER" >> /usr/local/bin/onos-control-debug && \ - echo "atomix config set namespace \$ATOMIX_NAMESPACE" >> /usr/local/bin/onos-control-debug && \ - echo "atomix config set app \$ATOMIX_APP" >> /usr/local/bin/onos-control-debug && \ - echo "dlv --listen=:40000 --headless=true --accept-multiclient=true --api-version=2 exec /usr/local/bin/onos-control -- \"\$@\"" >> /usr/local/bin/onos-control-debug && \ - chmod +x /usr/local/bin/onos-control-debug - -RUN addgroup -S onos-control && adduser -S -G onos-control onos-control -USER onos-control -WORKDIR /home/onos-control - -ENV ATOMIX_CONTROLLER=atomix-controller.kube-system.svc.cluster.local:5679 -ENV ATOMIX_NAMESPACE=default - -RUN onos init && \ - cp /etc/profile /home/onos-control/.bashrc && \ - onos completion bash > /home/onos-control/.onos/bash_completion.sh && \ - echo "source /home/onos-control/.onos/bash_completion.sh" >> /home/onos-control/.bashrc && \ - onos config set address 127.0.0.1:5150 && \ - atomix init && \ - atomix completion bash > /home/onos-control/.atomix/bash_completion.sh && \ - echo "source /home/onos-control/.atomix/bash_completion.sh" >> /home/onos-control/.bashrc - -ENTRYPOINT ["onos-control-debug"]