Skip to content

Commit c68c376

Browse files
committed
Merge pull request #2951 from carmstrong/store-admin
feat(store): add store-admin container
2 parents 614da27 + 6d339f3 commit c68c376

5 files changed

Lines changed: 45 additions & 1 deletion

File tree

deisctl/cmd/cmd.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -653,6 +653,7 @@ Options:
653653
"deis-publisher.service",
654654
"deis-registry.service",
655655
"deis-router.service",
656+
"deis-store-admin.service",
656657
"deis-store-daemon.service",
657658
"deis-store-gateway.service",
658659
"deis-store-metadata.service",
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[Unit]
2+
Description=deis-store-admin
3+
4+
[Service]
5+
EnvironmentFile=/etc/environment
6+
TimeoutStartSec=20m
7+
ExecStartPre=/bin/sh -c "IMAGE=`/run/deis/bin/get_image /deis/store-admin` && docker history $IMAGE >/dev/null 2>&1 || docker pull $IMAGE"
8+
ExecStartPre=/bin/sh -c "docker inspect deis-store-admin >/dev/null 2>&1 && docker rm -f deis-store-admin >/dev/null 2>&1 || true"
9+
ExecStart=/bin/sh -c "IMAGE=`/run/deis/bin/get_image /deis/store-admin` && docker run --name deis-store-admin --rm --volumes-from=deis-store-daemon-data --volumes-from=deis-store-monitor-data -e HOST=$COREOS_PRIVATE_IPV4 $IMAGE"
10+
ExecStopPost=-/usr/bin/docker rm -f deis-store-admin
11+
Restart=on-failure
12+
RestartSec=5
13+
14+
[Install]
15+
WantedBy=multi-user.target
16+
17+
[X-Fleet]
18+
Global=true

store/Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
include ../includes.mk
22

3-
TEMPLATE_IMAGES=daemon gateway metadata monitor
3+
TEMPLATE_IMAGES=admin daemon gateway metadata monitor
44
BUILT_IMAGES=base $(TEMPLATE_IMAGES)
55

6+
ADMIN_IMAGE = $(IMAGE_PREFIX)store-admin:$(BUILD_TAG)
7+
ADMIN_DEV_IMAGE = $(DEV_REGISTRY)/$(ADMIN_IMAGE)
68
DAEMON_IMAGE = $(IMAGE_PREFIX)store-daemon:$(BUILD_TAG)
79
DAEMON_DEV_IMAGE = $(DEV_REGISTRY)/$(DAEMON_IMAGE)
810
GATEWAY_IMAGE = $(IMAGE_PREFIX)store-gateway:$(BUILD_TAG)
@@ -68,6 +70,8 @@ run: install start
6870
dev-release: push set-image
6971

7072
push: check-registry
73+
docker tag $(ADMIN_IMAGE) $(ADMIN_DEV_IMAGE)
74+
docker push $(ADMIN_DEV_IMAGE)
7175
docker tag $(DAEMON_IMAGE) $(DAEMON_DEV_IMAGE)
7276
docker push $(DAEMON_DEV_IMAGE)
7377
docker tag $(GATEWAY_IMAGE) $(GATEWAY_DEV_IMAGE)
@@ -78,12 +82,14 @@ push: check-registry
7882
docker push $(MONITOR_DEV_IMAGE)
7983

8084
set-image: check-deisctl
85+
deisctl config store-admin set image=$(ADMIN_DEV_IMAGE)
8186
deisctl config store-daemon set image=$(DAEMON_DEV_IMAGE)
8287
deisctl config store-gateway set image=$(GATEWAY_DEV_IMAGE)
8388
deisctl config store-metadata set image=$(METADATA_DEV_IMAGE)
8489
deisctl config store-monitor set image=$(MONITOR_DEV_IMAGE)
8590

8691
release:
92+
docker push $(ADMIN_IMAGE)
8793
docker push $(DAEMON_IMAGE)
8894
docker push $(GATEWAY_IMAGE)
8995
docker push $(METADATA_IMAGE)

store/admin/Dockerfile.template

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#FROM is generated dynamically by the Makefile
2+
3+
WORKDIR /app
4+
CMD ["/app/bin/boot"]
5+
ADD bin/boot /app/bin/boot

store/admin/bin/boot

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
#
3+
# This script is designed to be run inside the container
4+
#
5+
6+
ETCD_PORT=${ETCD_PORT:-4001}
7+
ETCD="$HOST:$ETCD_PORT"
8+
9+
confd -node $ETCD -config-file /app/confd.toml &
10+
11+
# loop forever until the container is stopped
12+
while true; do
13+
sleep 1
14+
done

0 commit comments

Comments
 (0)