Skip to content

Commit e175ee6

Browse files
committed
Add vendor stack
1 parent 9390ab0 commit e175ee6

File tree

3 files changed

+76
-0
lines changed

3 files changed

+76
-0
lines changed

services/vendors/Makefile

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
.DEFAULT_GOAL := help
2+
3+
# Internal VARIABLES ------------------------------------------------
4+
# STACK_NAME defaults to name of the current directory. Should not to be changed if you follow GitOps operating procedures.
5+
STACK_NAME = $(notdir $(shell pwd))
6+
TEMP_COMPOSE=.stack.${STACK_NAME}.yaml
7+
REPO_BASE_DIR := $(shell git rev-parse --show-toplevel)
8+
9+
# TARGETS --------------------------------------------------
10+
include ${REPO_BASE_DIR}/scripts/common.Makefile
11+
12+
.PHONY: up ## Deploys registry stack
13+
up: ${TEMP_COMPOSE} .init .env
14+
docker stack deploy --with-registry-auth --prune --compose-file $< ${STACK_NAME}
15+
16+
.PHONY: up-dalco ## Deploys registry stack for Dalco Cluster
17+
up-dalco: up
18+
19+
.PHONY: up-aws
20+
up-aws: up
21+
22+
.PHONY: up-master ## Deploys registry on master cluster
23+
up-master: up
24+
25+
.PHONY: up-public ## Deploys registry on public cluster
26+
up-public: up
27+
28+
.PHONY: up-local ## Deploys registry on local deployment
29+
up-local: up
30+
31+
# Helpers -------------------------------------------------
32+
33+
.PHONY: ${TEMP_COMPOSE}
34+
${TEMP_COMPOSE}: docker-compose.yml .env
35+
${REPO_BASE_DIR}/scripts/docker-stack-config.bash -e .env $< > $@
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
2+
# NOTE: this stack is only for development and testing of vendor services.
3+
# the actualy code is deployed inside the ops repository.
4+
5+
services:
6+
7+
manual:
8+
image: containous/whoami
9+
init: true
10+
hostname: "{{.Node.Hostname}}-{{.Task.Slot}}"
11+
deploy:
12+
replicas: ${VENDOR_MANUAL_REPLICAS}
13+
labels:
14+
- traefik.enable=true
15+
- traefik.docker.network=${PUBLIC_NETWORK}
16+
# auth: https://doc.traefik.io/traefik/middlewares/http/forwardauth
17+
- traefik.http.middlewares.vendor_manual_auth.forwardauth.address=http://${WEBSERVER_HOST}:${WEBSERVER_PORT}/v0/auth:check
18+
- traefik.http.middlewares.vendor_manual_auth.forwardauth.trustForwardHeader=true
19+
- traefik.http.middlewares.vendor_manual_auth.forwardauth.authResponseHeaders=Set-Cookie,osparc-sc2
20+
# routing
21+
- traefik.http.services.vendor_manual.loadbalancer.server.port=80
22+
- traefik.http.routers.vendor_manual.entrypoints=https
23+
- traefik.http.routers.vendor_manual.rule=Host(`${VENDOR_MANUAL_DOMAIN}`)
24+
- traefik.http.routers.vendor_manual.middlewares=ops_gzip@swarm, vendor_manual_auth
25+
networks:
26+
- simcore_default
27+
- public
28+
29+
networks:
30+
simcore_default:
31+
name: ${SIMCORE_NETWORK}
32+
external: true
33+
public:
34+
external: true
35+
name: ${PUBLIC_NETWORK}

services/vendors/template.env

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
VENDOR_MANUAL_REPLICAS=${VENDOR_MANUAL_REPLICAS}
2+
VENDOR_MANUAL_DOMAIN=${VENDOR_MANUAL_DOMAIN}
3+
PUBLIC_NETWORK=${PUBLIC_NETWORK}
4+
WEBSERVER_HOST=${WEBSERVER_HOST}
5+
WEBSERVER_PORT=${WEBSERVER_PORT}
6+
SIMCORE_NETWORK=${SIMCORE_NETWORK}

0 commit comments

Comments
 (0)