Skip to content

Commit 3e31131

Browse files
committed
Merge remote-tracking branch 'upstream/main' into introduce-docker-api-proxy-service
2 parents 1b4ac15 + b2b4d6a commit 3e31131

File tree

86 files changed

+1223
-1629
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+1223
-1629
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
- [ ] Service has placement constraints or is global
1919
- [ ] Service is restartable
2020
- [ ] Service restart is zero-downtime
21-
- [ ] Service is monitored (by OPS services)
21+
- [ ] Service is monitored (via prometheus and grafana)
2222
- [ ] Service is not bound to one specific node (e.g. via files or volumes)
2323
- [ ] Relevant OPS E2E Test are added
24-
- [ ] Service's Public URL is included in maintenance mode -->
24+
- [ ] Service's Public URL is included in maintenance mode
25+
- [ ] Service's Public URL is included in testing mode -->

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ docs/_build
129129
/services/monitoring/pgsql_query_exporter_config.yaml
130130
/services/monitoring/docker-compose.yml
131131
/services/monitoring/smokeping_prober_config.yaml
132-
132+
services/monitoring/tempo_config.yaml
133133

134134
# Simcore: Contains location of repo.config file on the machine and of the whole config directory
135135
.config.location

.pre-commit-config.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@ repos:
7979
hooks:
8080
- id: shellcheck
8181
name: Shell scripts conform to shellcheck
82+
- repo: https://github.com/antonbabenko/pre-commit-terraform
83+
rev: v1.89.1 # Get the latest from: https://github.com/antonbabenko/pre-commit-terraform/releases
84+
hooks:
85+
- id: terraform_fmt
8286
- repo: local
8387
hooks:
8488
- id: run-pylint

Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ down-maintenance: ## Stop the maintenance mode
7171
fi \
7272
,)
7373

74-
7574
# Misc: info & clean
7675
.PHONY: info info-vars info-local
7776
info: ## Displays some important info

scripts/common.Makefile

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ IS_WIN := $(strip $(if $(or $(IS_LINUX),$(IS_OSX),$(IS_WSL)),,$(OS)))
1616
$(if $(IS_WSL2),,$(if $(IS_WSL),$(error WSL1 is not supported in all recipes. Use WSL2 instead. Follow instructions in README.md),))
1717

1818
# Check that a valid location to a config file is set.
19-
REPO_BASE_DIR := $(shell git rev-parse --show-toplevel)
19+
REPO_BASE_DIR := $(abspath $(dir $(abspath $(lastword $(MAKEFILE_LIST))))..)
2020
export REPO_CONFIG_LOCATION := $(shell cat $(REPO_BASE_DIR)/.config.location)
2121
$(if $(REPO_CONFIG_LOCATION),,$(error The location of the repo.config file given in .config.location is invalid. Aborting))
2222
$(if $(shell cat $(REPO_CONFIG_LOCATION)),,$(error The location of the repo.config file given in .config.location is invalid. Aborting))
@@ -274,7 +274,7 @@ $(REPO_BASE_DIR)/.venv/bin/activate:
274274
$(REPO_BASE_DIR)/.venv/bin/pip3 install --upgrade pip wheel setuptools
275275
$(REPO_BASE_DIR)/.venv/bin/pip3 install jinja2 j2cli[yaml] typer
276276
@echo "To activate the venv, execute 'source $(REPO_BASE_DIR)/.venv/bin/activate'"
277-
PHONY: .venv
277+
.PHONY: .venv
278278
.venv: $(REPO_BASE_DIR)/.venv/bin/activate ## Creates a python virtual environment with dev tools (pip, pylint, ...)
279279
.PHONY: venv
280280
venv: $(REPO_BASE_DIR)/.venv/bin/activate ## Creates a python virtual environment with dev tools (pip, pylint, ...)
@@ -297,6 +297,18 @@ endef
297297
298298
endif
299299
300+
# Check that given variables are set and all have non-empty values,
301+
# die with an error otherwise.
302+
#
303+
# Params:
304+
# 1. Variable name(s) to test.
305+
# 2. (optional) Error message to print.
306+
guard-%:
307+
@ if [ "${${*}}" = "" ]; then \
308+
echo "Argument '$*' is missing. TIP: make <rule> $*=<value>"; \
309+
exit 1; \
310+
fi
311+
300312
# Gracefully use defaults and potentially overwrite them, via https://stackoverflow.com/a/49804748
301313
%: %-default
302314
@ true

scripts/deployments/prepare_simcore_stack.bash

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,14 @@ scripts/deployments/compose_stack_yml.bash
4848
log_info "Ensuring dask secrets are relative to the stack file"
4949
# Check if the dask_tls_cert secret exists and update its file path if it does.
5050
if ./yq eval '.secrets.dask_tls_cert' stack.yml >/dev/null; then
51-
./yq eval --inplace '.secrets.dask_tls_cert.file = "./dask-sidecar/.dask-certificates/dask-cert.pem"' stack.yml
51+
./yq eval --inplace '.secrets.dask_tls_cert.file = "./assets/dask-certificates/dask-cert.pem"' stack.yml
5252
else
5353
log_warning "The 'dask_tls_cert' secret does not exist. Skipping this step."
5454
fi
5555

5656
# Check if the dask_tls_key secret exists and update its file path if it does.
5757
if ./yq eval '.secrets.dask_tls_key' stack.yml >/dev/null; then
58-
./yq eval --inplace '.secrets.dask_tls_key.file = "./dask-sidecar/.dask-certificates/dask-key.pem"' stack.yml
58+
./yq eval --inplace '.secrets.dask_tls_key.file = "./assets/dask-certificates/dask-key.pem"' stack.yml
5959
else
6060
log_warning "The 'dask_tls_key' secret does not exist. Skipping this step."
6161
fi

services/admin-panels/Makefile

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,42 +13,42 @@ include ${REPO_BASE_DIR}/scripts/common.Makefile
1313

1414
# Helpers --------------------------------------------------
1515
define custom-jinja
16-
@${REPO_BASE_DIR}/.venv/bin/j2 --format=json $(1) $(2) -o $(3)
16+
@${REPO_BASE_DIR}/.venv/bin/j2 --format=json $(1) $(2) -o $(3) \
17+
--filters $(REPO_BASE_DIR)/scripts/j2cli_global_filters.py
1718
endef
1819

1920
.PHONY: .data.json
2021
.data.json:
2122
@$(_tree) -J ${PWD}/data | jq ".[0]" > .data.json
2223

23-
2424
.PHONY: docker-compose.yml
25-
docker-compose.yml: docker-compose.yml.j2 .venv .data.json
25+
docker-compose.yml: docker-compose.yml.j2 .venv .data.json .env jupyter_server_config.py
2626
$(call custom-jinja, $<, .data.json, tmp.yml)
2727
@${REPO_BASE_DIR}/scripts/docker-stack-config.bash tmp.yml > $@
2828
@rm tmp.yml
2929

3030
.PHONY: up
31-
up: .init .env jupyter_server_config.py ${TEMP_COMPOSE} ## Deploys jaeger stack
31+
up: .init ${TEMP_COMPOSE} prune-docker-stack-configs ## Deploys jaeger stack
3232
@docker stack deploy --with-registry-auth --prune --compose-file ${TEMP_COMPOSE} ${STACK_NAME}
3333

3434
.PHONY: up-letsencrypt-http
35-
up-letsencrypt-http: .init .env jupyter_server_config.py ${TEMP_COMPOSE}-letsencrypt-http ## Deploys jaeger stack using let's encrypt http challenge
35+
up-letsencrypt-http: .init ${TEMP_COMPOSE}-letsencrypt-http prune-docker-stack-configs ## Deploys jaeger stack using let's encrypt http challenge
3636
@docker stack deploy --with-registry-auth --prune --compose-file ${TEMP_COMPOSE}-letsencrypt-http ${STACK_NAME}
3737

3838
.PHONY: up-letsencrypt-dns
39-
up-letsencrypt-dns: .init .env jupyter_server_config.py ${TEMP_COMPOSE}-letsencrypt-dns ## Deploys jaeger stack using let's encrypt dns challenge
39+
up-letsencrypt-dns: .init ${TEMP_COMPOSE}-letsencrypt-dns prune-docker-stack-configs ## Deploys jaeger stack using let's encrypt dns challenge
4040
@docker stack deploy --with-registry-auth --prune --compose-file ${TEMP_COMPOSE}-letsencrypt-dns ${STACK_NAME}
4141

4242
.PHONY: up-dalco ## Deploys jaeger stack for Dalco Cluster
43-
up-dalco: .init .env jupyter_server_config.py ${TEMP_COMPOSE}-dalco
43+
up-dalco: .init ${TEMP_COMPOSE}-dalco prune-docker-stack-configs
4444
@docker stack deploy --with-registry-auth --prune --compose-file ${TEMP_COMPOSE}-dalco ${STACK_NAME}
4545

4646
.PHONY: up-aws
47-
up-aws: .init .env jupyter_server_config.py ${TEMP_COMPOSE}-aws ## Deploys jaeger stack in aws
47+
up-aws: .init ${TEMP_COMPOSE}-aws prune-docker-stack-configs ## Deploys jaeger stack in aws
4848
@docker stack deploy --with-registry-auth --prune --compose-file ${TEMP_COMPOSE}-aws ${STACK_NAME}
4949

5050
.PHONY: up-master
51-
up-master: .init .env jupyter_server_config.py ${TEMP_COMPOSE}-master
51+
up-master: .init ${TEMP_COMPOSE}-master prune-docker-stack-configs
5252
@docker stack deploy --with-registry-auth --prune --compose-file ${TEMP_COMPOSE}-master ${STACK_NAME}
5353

5454
.PHONY: up-local
@@ -85,7 +85,6 @@ ${TEMP_COMPOSE}-aws: docker-compose.yml docker-compose.aws.yml .env
8585
${TEMP_COMPOSE}: docker-compose.yml .env
8686
@${REPO_BASE_DIR}/scripts/docker-stack-config.bash -e .env $< > $@
8787

88-
8988
.PHONY: jupyter_server_config.py
9089
jupyter_server_config.py: jupyter_server_config.py.template
9190
@set -o allexport; \

services/admin-panels/docker-compose.aws.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ version: '3.7'
22
services:
33
adminpanels:
44
dns: # Add this always for AWS, otherwise we get "No such image: " for docker services
5-
9.9.9.9
5+
8.8.8.8

services/admin-panels/docker-compose.yml.j2

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
version: "3.7"
22
configs:
33
adminpanel-jupyter-server-config:
4+
name: ${STACK_NAME}_adminpanel-jupyter-server-config_{{ "./jupyter_server_config.py" | sha256file | substring(0,10) }}
45
file: ./jupyter_server_config.py
56
{% for item in contents %}
67
{{ item.name }}:
8+
name: {% raw %}${STACK_NAME}{% endraw %}_{{item.name}}_{{ ("./data/" ~ item.name) | sha256file | substring(0,10) }}
79
file: ./data/{{ item.name }}{% endfor %}
810
services:
911
adminpanels:
10-
image: jupyter/base-notebook:18b10e7f732d
12+
image: jupyter/base-notebook:notebook-7.0.6
1113
user: root
1214
networks:
1315
- public

services/admin-panels/template.env

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# This contains all relevant secrets so that the admin panels may use them to access the services
2+
STACK_NAME=${STACK_NAME}
3+
24
MONITORING_DOMAIN=${MONITORING_DOMAIN}
35
ADMINPANELS_DOMAIN=${ADMINPANELS_DOMAIN}
46
DEPLOYMENT_FQDNS=${DEPLOYMENT_FQDNS}

0 commit comments

Comments
 (0)