Skip to content

Commit

Permalink
Remove nodeclarity
Browse files Browse the repository at this point in the history
Remove the nodeclarity container related code and ui_builder parameter no longer needed when build clarity

Signed-off-by: Qian Deng <dengq@vmware.com>
  • Loading branch information
ninjadq committed Sep 8, 2018
1 parent 8c26f78 commit ac6c9d7
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 256 deletions.
42 changes: 1 addition & 41 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,6 @@ DEVFLAG=true
NOTARYFLAG=false
CLAIRFLAG=false
HTTPPROXY=
REBUILDCLARITYFLAG=false
NEWCLARITYVERSION=
BUILDBIN=false
MIGRATORFLAG=false
# enable/disable chart repo supporting
Expand All @@ -104,15 +102,10 @@ CLAIRVERSION=v2.0.5
CLAIRDBVERSION=$(VERSIONTAG)
MIGRATORVERSION=$(VERSIONTAG)
REDISVERSION=$(VERSIONTAG)

# version of chartmuseum
CHARTMUSEUMVERSION=v0.7.1

#clarity parameters
CLARITYIMAGE=goharbor/harbor-clarity-ui-builder[:tag]
CLARITYSEEDPATH=/harbor_src
CLARITYUTPATH=${CLARITYSEEDPATH}/portal/lib
CLARITYBUILDSCRIPT=/entrypoint.sh

# docker parameters
DOCKERCMD=$(shell which docker)
DOCKERBUILD=$(DOCKERCMD) build
Expand Down Expand Up @@ -179,7 +172,6 @@ MAKEFILEPATH_PHOTON=$(MAKEPATH)/photon

# common dockerfile
DOCKERFILEPATH_COMMON=$(MAKEPATH)/common
DOCKERFILE_CLARITY=$(MAKEPATH)/dev/nodeclarity/Dockerfile

# docker image name
DOCKERIMAGENAME_ADMINSERVER=goharbor/harbor-adminserver
Expand All @@ -188,7 +180,6 @@ DOCKERIMAGENAME_UI=goharbor/harbor-ui
DOCKERIMAGENAME_JOBSERVICE=goharbor/harbor-jobservice
DOCKERIMAGENAME_LOG=goharbor/harbor-log
DOCKERIMAGENAME_DB=goharbor/harbor-db
DOCKERIMAGENAME_CLARITY=goharbor/harbor-clarity-ui-builder
DOCKERIMAGENAME_CHART_SERVER=goharbor/chartmuseum-photon
DOCKERIMAGENAME_REGCTL=goharbor/harbor-registryctl

Expand Down Expand Up @@ -273,15 +264,6 @@ version:
check_environment:
@$(MAKEPATH)/$(CHECKENVCMD)

compile_clarity:
@echo "compiling binary for clarity ui..."
@if [ "$(HTTPPROXY)" != "" ] ; then \
$(DOCKERCMD) run --rm -v $(BUILDPATH)/src:$(CLARITYSEEDPATH) $(CLARITYIMAGE) $(SHELL) $(CLARITYBUILDSCRIPT) -p $(HTTPPROXY); \
else \
$(DOCKERCMD) run --rm -v $(BUILDPATH)/src:$(CLARITYSEEDPATH) $(CLARITYIMAGE) $(SHELL) $(CLARITYBUILDSCRIPT); \
fi
@echo "Done."

compile_adminserver:
@echo "compiling binary for adminserver (golang image)..."
@echo $(GOBASEPATH)
Expand Down Expand Up @@ -384,28 +366,6 @@ package_offline: compile version build modify_sourcefiles modify_composefile
@rm -rf $(HARBORPKG)
@echo "Done."

refresh_clarity_builder:
@if [ "$(REBUILDCLIATRYFLAG)" = "true" ] ; then \
echo "set http proxy.."; \
if [ "$(HTTPPROXY)" != "" ] ; then \
$(SEDCMD) -i 's/__proxy__/--proxy $(HTTPPROXY)/g' $(DOCKERFILE_CLARITY) ; \
else \
$(SEDCMD) -i 's/__proxy__/ /g' $(DOCKERFILE_CLARITY) ; \
fi ; \
echo "build new clarity image.."; \
$(DOCKERBUILD) -f $(DOCKERFILE_CLARITY) -t $(DOCKERIMAGENAME_CLARITY):$(NEWCLARITYVERSION) . ; \
echo "push clarity image.."; \
$(DOCKERTAG) $(DOCKERIMAGENAME_CLARITY):$(NEWCLARITYVERSION) $(DOCKERIMAGENAME_CLARITY):$(NEWCLARITYVERSION); \
$(PUSHSCRIPTPATH)/$(PUSHSCRIPTNAME) $(REGISTRYSERVER)$(DOCKERIMAGENAME_CLARITY):$(NEWCLARITYVERSION) \
$(REGISTRYUSER) $(REGISTRYPASSWORD) $(REGISTRYSERVER); \
echo "remove local clarity image.."; \
$(DOCKERRMIMAGE) $(REGISTRYSERVER)$(DOCKERIMAGENAME_ADMINSERVER):$(NEWCLARITYVERSION); \
fi

run_clarity_ut:
@echo "run clarity ut ..."
@$(DOCKERCMD) run --rm -v $(UINGPATH):$(CLARITYSEEDPATH) -v $(BUILDPATH)/tests:$(CLARITYSEEDPATH)/tests $(CLARITYIMAGE) $(SHELL) $(CLARITYSEEDPATH)/tests/run-clarity-ut.sh

gosec:
#go get github.com/securego/gosec/cmd/gosec
#go get github.com/dghubble/sling
Expand Down
9 changes: 4 additions & 5 deletions docs/compile_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,19 @@ You can compile the code by one of the three approaches:
* Build, install and bring up Harbor without Notary:

```sh
$ make install GOBUILDIMAGE=golang:1.9.2 COMPILETAG=compile_golangimage CLARITYIMAGE=goharbor/harbor-clarity-ui-builder:1.6.0
$ make install GOBUILDIMAGE=golang:1.9.2 COMPILETAG=compile_golangimage
```

* Build, install and bring up Harbor with Notary:

```sh
$ make install GOBUILDIMAGE=golang:1.9.2 COMPILETAG=compile_golangimage CLARITYIMAGE=goharbor/harbor-clarity-ui-builder:1.6.0 NOTARYFLAG=true
$ make install GOBUILDIMAGE=golang:1.9.2 COMPILETAG=compile_golangimage NOTARYFLAG=true
```

* Build, install and bring up Harbor with Clair:

```sh
$ make install GOBUILDIMAGE=golang:1.9.2 COMPILETAG=compile_golangimage CLARITYIMAGE=goharbor/harbor-clarity-ui-builder:1.6.0 CLAIRFLAG=true
$ make install GOBUILDIMAGE=golang:1.9.2 COMPILETAG=compile_golangimage CLAIRFLAG=true
```

#### II. Compile code with your own Golang environment, then build Harbor
Expand Down Expand Up @@ -108,7 +108,6 @@ The `Makefile` contains these configurable parameters:
Variable | Description
-------------------|-------------
BASEIMAGE | Container base image, default: photon
CLARITYIMAGE | Clarity UI builder image, default: harbor-clarity-ui-builder
DEVFLAG | Build model flag, default: dev
COMPILETAG | Compile model flag, default: compile_normal (local golang build)
NOTARYFLAG | Notary mode flag, default: false
Expand All @@ -128,9 +127,9 @@ Target | Description
all | prepare env, compile binaries, build images and install images
prepare | prepare env
compile | compile ui and jobservice code
compile_portal | compile portal code
compile_ui | compile ui binary
compile_jobservice | compile jobservice binary
compile_clarity | compile Clarity binary
build | build Harbor docker images (default: using build_photon)
build_photon | build Harbor docker images from Photon OS base image
install | compile binaries, build images, prepare specific version of compose file and startup Harbor instance
Expand Down
8 changes: 3 additions & 5 deletions docs/use_make.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,18 @@ BASEIMAGE | Container base image, default: photon
DEVFLAG | Build model flag, default: dev
COMPILETAG | Compile model flag, default: compile_normal (local golang build)
GOBUILDIMAGE | Golang image to compile harbor go source code.
CLARITYIMAGE | Clarity image that based on Node to compile UI.
NOTARYFLAG | Whether to enable notary in harbor, default:false
HTTPPROXY | Clarity proxy to build UI.


### Targets
Target | Description
--------------------|-------------
all | prepare env, compile binaries, build images and install images
prepare | prepare env
compile | compile ui and jobservice code
compile_portal | compile portal code
compile_ui | compile ui binary
compile_jobservice | compile jobservice binary
compile_clarity | compile clarity ui binary
compile_adminserver | compile admin server binary
build | build Harbor docker images (default: using build_photon)
build_photon | build Harbor docker images from Photon OS base image
Expand All @@ -39,10 +37,10 @@ version | set harbor version
#### EXAMPLE:

#### Build and run harbor from source code.
make install GOBUILDIMAGE=golang:1.7.3 COMPILETAG=compile_golangimage CLARITYIMAGE=goharbor/harbor-clarity-ui-builder:1.6.0 NOTARYFLAG=true HTTPPROXY=
make install GOBUILDIMAGE=golang:1.7.3 COMPILETAG=compile_golangimage NOTARYFLAG=true

### Package offline installer
make package_offline GOBUILDIMAGE=golang:1.7.3 COMPILETAG=compile_golangimage CLARITYIMAGE=goharbor/harbor-clarity-ui-builder:1.6.0 NOTARYFLAG=true HTTPPROXY=
make package_offline GOBUILDIMAGE=golang:1.7.3 COMPILETAG=compile_golangimage NOTARYFLAG=true

### Start harbor with notary
make -e NOTARYFLAG=true start
Expand Down
32 changes: 0 additions & 32 deletions make/dev/nodeclarity/Dockerfile

This file was deleted.

70 changes: 0 additions & 70 deletions make/dev/nodeclarity/angular-cli.json

This file was deleted.

64 changes: 0 additions & 64 deletions make/dev/nodeclarity/entrypoint.sh

This file was deleted.

13 changes: 0 additions & 13 deletions make/dev/nodeclarity/index.html

This file was deleted.

14 changes: 0 additions & 14 deletions src/portal/src/main-aot.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/portal/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
},
"files": [
"src/app/app.module.ts",
"src/main-aot.ts"
],
"angularCompilerOptions": {
"skipTemplateCodegen": true,
Expand Down

0 comments on commit ac6c9d7

Please sign in to comment.