Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,19 @@
## Related PR/s

## Checklist

- [ ] I tested and it works

<!-- Extra checks based on use case -->

<!-- New Stack Introduction
- [ ] The Stack has been included in CI Workflow
-->

<!-- New Service Introduction
- [ ] Service has resource limits and reservations
- [ ] Service has placement constraints or is global
- [ ] Service is restartable
- [ ] The restart is zero-downtime
- [ ] Service is not bound to one specific node (e.g. via files or volumes)
- [ ] Relevant OPS E2E Test for this stack were added
-->
6 changes: 5 additions & 1 deletion services/traefik/docker-compose.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,11 @@ services:
- traefik.http.middlewares.ops_ratelimit.ratelimit.average=${TRAEFIK_RATELIMIT_AVG}
- traefik.http.middlewares.ops_ratelimit.ratelimit.burst=${TRAEFIK_RATELIMIT_BURST}
- traefik.http.middlewares.ops_ratelimit.ratelimit.sourcecriterion.ipstrategy.depth=1

# Platform user auth: Use this middleware to enforce only authenticated users
# https://doc.traefik.io/traefik/middlewares/http/forwardauth
- traefik.http.middlewares.authenticated_platform_user.forwardauth.address=http://${WEBSERVER_HOST}:${WEBSERVER_PORT}/v0/auth:check
- traefik.http.middlewares.authenticated_platform_user.forwardauth.trustForwardHeader=true
- traefik.http.middlewares.authenticated_platform_user.forwardauth.authResponseHeaders=Set-Cookie,osparc-sc2
networks:
public: null
monitored: null
Expand Down
3 changes: 3 additions & 0 deletions services/traefik/template.env
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,6 @@ OPS_TRAEFIK_LOGLEVEL=${OPS_TRAEFIK_LOGLEVEL}

PUBLIC_NETWORK=${PUBLIC_NETWORK}
MONITORED_NETWORK=${MONITORED_NETWORK}

WEBSERVER_HOST=${WEBSERVER_HOST}
WEBSERVER_PORT=${WEBSERVER_PORT}
35 changes: 35 additions & 0 deletions services/vendors/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
.DEFAULT_GOAL := help

# Internal VARIABLES ------------------------------------------------
# STACK_NAME defaults to name of the current directory. Should not to be changed if you follow GitOps operating procedures.
STACK_NAME = $(notdir $(shell pwd))
TEMP_COMPOSE=.stack.${STACK_NAME}.yaml
REPO_BASE_DIR := $(shell git rev-parse --show-toplevel)

# TARGETS --------------------------------------------------
include ${REPO_BASE_DIR}/scripts/common.Makefile

.PHONY: up ## Deploys stack
up: ${TEMP_COMPOSE} .init .env
docker stack deploy --with-registry-auth --prune --compose-file $< ${STACK_NAME}

.PHONY: up-dalco ## Deploys stack for Dalco Cluster
up-dalco: up

.PHONY: up-aws
up-aws: up

.PHONY: up-master ## Deploys stack on master cluster
up-master: up

.PHONY: up-public ## Deploys stack on public cluster
up-public: up

.PHONY: up-local ## Deploys stack on local deployment
up-local: up

# Helpers -------------------------------------------------

.PHONY: ${TEMP_COMPOSE}
${TEMP_COMPOSE}: docker-compose.yml .env
${REPO_BASE_DIR}/scripts/docker-stack-config.bash -e .env $< > $@
39 changes: 39 additions & 0 deletions services/vendors/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
version: "3.7"

services:
manual:
image: ${VENDOR_MANUAL_IMAGE}
init: true
hostname: "{{.Node.Hostname}}-{{.Task.Slot}}"
deploy:
replicas: ${VENDOR_MANUAL_REPLICAS}
placement:
constraints:
- node.labels.simcore==true
resources:
limits:
cpus: "1"
memory: 2G
reservations:
cpus: "0.5"
memory: 1G
update_config:
parallelism: 1
order: start-first
failure_action: continue
delay: 10s
labels:
- traefik.enable=true
- traefik.docker.network=${PUBLIC_NETWORK}
- traefik.http.services.vendor_manual.loadbalancer.server.port=${VENDOR_MANUAL_PORT}
- traefik.http.routers.vendor_manual.entrypoints=https
- traefik.http.routers.vendor_manual.tls=true
- traefik.http.routers.vendor_manual.rule=Host(`${VENDOR_MANUAL_DOMAIN}`)
- traefik.http.routers.vendor_manual.middlewares=ops_gzip@swarm, authenticated_platform_user@swarm
networks:
- public

networks:
public:
external: true
name: ${PUBLIC_NETWORK}
5 changes: 5 additions & 0 deletions services/vendors/template.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
VENDOR_MANUAL_IMAGE=${VENDOR_MANUAL_IMAGE}
VENDOR_MANUAL_REPLICAS=${VENDOR_MANUAL_REPLICAS}
VENDOR_MANUAL_DOMAIN=${VENDOR_MANUAL_DOMAIN}
VENDOR_MANUAL_PORT=${VENDOR_MANUAL_PORT}
PUBLIC_NETWORK=${PUBLIC_NETWORK}
Loading