Skip to content

Commit

Permalink
Modify docker compose file template and make file to enable new job s…
Browse files Browse the repository at this point in the history
…ervice

Fix typo in Makefile under photon

Fix version tag issue of redis container

Assign container name for redis container

Update docker compose template to enable network for redis

Remove exposed ports of redis from compose yaml tpl
  • Loading branch information
steven-zou committed Mar 30, 2018
1 parent 4e3a0b5 commit 2503603
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 4 deletions.
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ MARIADBVERSION=$(VERSIONTAG)
CLAIRVERSION=v2.0.1
CLAIRDBVERSION=$(VERSIONTAG)
MIGRATORVERSION=1.4
REDISVERSION=$(VERSIONTAG)

#clarity parameters
CLARITYIMAGE=vmware/harbor-clarity-ui-builder[:tag]
Expand Down Expand Up @@ -282,7 +283,7 @@ build:
make -f $(MAKEFILEPATH_PHOTON)/Makefile build -e DEVFLAG=$(DEVFLAG) -e MARIADBVERSION=$(MARIADBVERSION) \
-e REGISTRYVERSION=$(REGISTRYVERSION) -e NGINXVERSION=$(NGINXVERSION) -e NOTARYVERSION=$(NOTARYVERSION) \
-e CLAIRVERSION=$(CLAIRVERSION) -e CLAIRDBVERSION=$(CLAIRDBVERSION) -e VERSIONTAG=$(VERSIONTAG) \
-e BUILDBIN=$(BUILDBIN)
-e BUILDBIN=$(BUILDBIN) -e REDISVERSION=$(REDISVERSION)

modify_composefile: modify_composefile_notary modify_composefile_clair
@echo "preparing docker-compose file..."
Expand All @@ -294,6 +295,7 @@ modify_composefile: modify_composefile_notary modify_composefile_clair
@$(SEDCMD) -i 's/__reg_version__/$(REGISTRYVERSION)-$(VERSIONTAG)/g' $(DOCKERCOMPOSEFILEPATH)/ha/$(DOCKERCOMPOSEFILENAME)
@$(SEDCMD) -i 's/__nginx_version__/$(NGINXVERSION)/g' $(DOCKERCOMPOSEFILEPATH)/$(DOCKERCOMPOSEFILENAME)
@$(SEDCMD) -i 's/__nginx_version__/$(NGINXVERSION)/g' $(DOCKERCOMPOSEFILEPATH)/ha/$(DOCKERCOMPOSEFILENAME)
@$(SEDCMD) -i 's/__redis_version__/$(REDISVERSION)/g' $(DOCKERCOMPOSEFILEPATH)/$(DOCKERCOMPOSEFILENAME)

modify_composefile_notary:
@echo "preparing docker-compose notary file..."
Expand Down
4 changes: 2 additions & 2 deletions make/common/templates/jobservice/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ worker_pool:
#Additional config if use 'redis' backend
#TODO: switch to internal redis endpoint and namespace.
redis_pool:
host: "redis_host"
host: "redis"
port: 6379
namespace: "namespace"
namespace: "harbor_job_service_namespace"
#Logger for job
logger:
path: "/var/log/jobs"
Expand Down
9 changes: 9 additions & 0 deletions make/docker-compose.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,22 @@ services:
networks:
- harbor
depends_on:
- redis
- ui
- adminserver
logging:
driver: "syslog"
options:
syslog-address: "tcp://127.0.0.1:1514"
tag: "jobservice"
redis:
image: vmware/redis-photon:__redis_version__
container_name: redis
restart: always
volumes:
- /data/redis:/data
networks:
- harbor
proxy:
image: vmware/nginx-photon:__nginx_version__
container_name: nginx
Expand Down
11 changes: 10 additions & 1 deletion make/photon/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ DOCKERIMAGENAME_NOTARYSIGNER=vmware/notary-signer-photon
DOCKERFILENAME_NOTARYSERVER=server.Dockerfile
DOCKERIMAGENAME_NOTARYSERVER=vmware/notary-server-photon

DOCKERFILEPATH_REDIS=$(DOCKERFILEPATH)/redis
DOCKERFILENAME_REDIS=Dockerfile
DOCKERIMAGENAME_REDIS=vmware/redis-photon

_build_db: _build_mariadb
@echo "modify the db dockerfile..."
@$(SEDCMD) -i 's/__version__/$(MARIADBVERSION)/g' $(DOCKERFILEPATH_DB)/$(DOCKERFILENAME_DB)
Expand Down Expand Up @@ -167,11 +171,16 @@ _build_mariadb:
@cd $(DOCKERFILEPATH_MARIADB) && $(DOCKERBUILD) -f $(DOCKERFILEPATH_MARIADB)/$(DOCKERFILENAME_MARIADB) -t $(DOCKERIMAGENAME_MARIADB):$(MARIADBVERSION) .
@echo "Done."

_build_redis:
@echo "building redis container for photon..."
@cd $(DOCKERFILEPATH_REDIS) && $(DOCKERBUILD) -f $(DOCKERFILEPATH_REDIS)/$(DOCKERFILENAME_REDIS) -t $(DOCKERIMAGENAME_REDIS):$(REDISVERSION) .
@echo "Done."

define _get_binary
$(WGET) --timeout 30 --no-check-certificate $1 -O $2
endef

build: _build_postgresql _build_db _build_adminiserver _build_ui _build_jobservice _build_log _build_nginx _build_registry _build_notary _build_clair
build: _build_postgresql _build_db _build_adminiserver _build_ui _build_jobservice _build_log _build_nginx _build_registry _build_notary _build_clair _build_redis

cleanimage:
@echo "cleaning image for photon..."
Expand Down
Binary file removed src/jobservice/main
Binary file not shown.

0 comments on commit 2503603

Please sign in to comment.