Skip to content

Commit

Permalink
Cleaner compose pull on ethd update (eth-educators#1327)
Browse files Browse the repository at this point in the history
  • Loading branch information
yorickdowne authored Apr 23, 2023
1 parent 7d79340 commit 284af28
Show file tree
Hide file tree
Showing 19 changed files with 164 additions and 75 deletions.
19 changes: 12 additions & 7 deletions ethd
Original file line number Diff line number Diff line change
Expand Up @@ -394,14 +394,19 @@ update() {
fi

dodocker system prune --force
# exec 3>&1
# exec 4>&2
# exec 1> /dev/null
# exec 2> /dev/null
if [ ${__old_compose} -eq 1 ]; then
docompose --profile tools pull --ignore-pull-failures || true
else
docompose --profile tools pull --ignore-buildable
fi
# docompose --profile tools pull
# exec 1>&3
# exec 2>&4
docompose --profile tools build --pull
exec 3>&1
exec 4>&2
exec 1> /dev/null
exec 2> /dev/null
docompose --profile tools pull --ignore-pull-failures || true
exec 1>&3
exec 2>&4

echo
if ! cmp -s "${ENV_FILE}" "${ENV_FILE}".source; then
Expand Down
4 changes: 2 additions & 2 deletions grafana-cloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ services:
<<: *logging

node-exporter:
image: quay.io/prometheus/node-exporter:latest
image: prom/node-exporter:latest
command:
- '--path.rootfs=/host'
- '--path.procfs=/host/proc'
Expand Down Expand Up @@ -82,7 +82,7 @@ services:

json-exporter:
restart: "unless-stopped"
image: quay.io/prometheuscommunity/json-exporter
image: prometheuscommunity/json-exporter:latest
volumes:
- ./prometheus/json.yml:/config/json.yml
- /etc/localtime:/etc/localtime:ro
Expand Down
2 changes: 1 addition & 1 deletion grafana-rootless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ services:

json-exporter:
restart: "unless-stopped"
image: quay.io/prometheuscommunity/json-exporter
image: prometheuscommunity/json-exporter:latest
volumes:
- ./prometheus/json.yml:/config/json.yml
- /etc/localtime:/etc/localtime:ro
Expand Down
4 changes: 2 additions & 2 deletions grafana.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ services:
<<: *logging

node-exporter:
image: quay.io/prometheus/node-exporter:latest
image: prom/node-exporter:latest
command:
- '--path.rootfs=/host'
- '--path.procfs=/host/proc'
Expand Down Expand Up @@ -72,7 +72,7 @@ services:

json-exporter:
restart: "unless-stopped"
image: quay.io/prometheuscommunity/json-exporter
image: prometheuscommunity/json-exporter:latest
volumes:
- ./prometheus/json.yml:/config/json.yml
- /etc/localtime:/etc/localtime:ro
Expand Down
13 changes: 8 additions & 5 deletions lighthouse-cl-only.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,18 @@ x-logging: &logging
max-file: "3"
tag: '{{.ImageName}}|{{.Name}}|{{.ImageFullID}}|{{.FullID}}'

x-build: &lh-build
context: ./lighthouse
dockerfile: ${LH_DOCKERFILE}
args:
- BUILD_TARGET=${LH_SRC_BUILD_TARGET}
- DOCKER_TAG=${LH_DOCKER_TAG}

services:
consensus:
restart: "unless-stopped"
build:
context: ./lighthouse
dockerfile: ${LH_DOCKERFILE}
args:
- BUILD_TARGET=${LH_SRC_BUILD_TARGET}
- DOCKER_TAG=${LH_DOCKER_TAG}
<<: *lh-build
image: lighthouse:local
user: lhconsensus
stop_grace_period: 1m
Expand Down
15 changes: 10 additions & 5 deletions lighthouse-vc-only.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,18 @@ x-logging: &logging
max-file: "3"
tag: '{{.ImageName}}|{{.Name}}|{{.ImageFullID}}|{{.FullID}}'

x-build: &lh-build
context: ./lighthouse
dockerfile: ${LH_DOCKERFILE}
args:
- BUILD_TARGET=${LH_SRC_BUILD_TARGET}
- DOCKER_TAG=${LH_DOCKER_TAG}

services:
validator:
restart: "unless-stopped"
build:
context: ./lighthouse
dockerfile: ${LH_DOCKERFILE}
args:
- BUILD_TARGET=${LH_SRC_BUILD_TARGET}
- DOCKER_TAG=${LH_DOCKER_TAG}
<<: *lh-build
image: lighthouse:local
user: lhvalidator
environment:
Expand Down Expand Up @@ -59,6 +62,8 @@ services:
validator-exit:
profiles: ["tools"]
restart: "no"
build:
<<: *lh-build
image: lighthouse:local
user: root
volumes:
Expand Down
18 changes: 13 additions & 5 deletions lighthouse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,19 @@ x-logging: &logging
max-file: "3"
tag: '{{.ImageName}}|{{.Name}}|{{.ImageFullID}}|{{.FullID}}'


x-build: &lh-build
context: ./lighthouse
dockerfile: ${LH_DOCKERFILE}
args:
- BUILD_TARGET=${LH_SRC_BUILD_TARGET}
- DOCKER_TAG=${LH_DOCKER_TAG}

services:
consensus:
restart: "unless-stopped"
build:
context: ./lighthouse
dockerfile: ${LH_DOCKERFILE}
args:
- BUILD_TARGET=${LH_SRC_BUILD_TARGET}
- DOCKER_TAG=${LH_DOCKER_TAG}
<<: *lh-build
image: lighthouse:local
user: lhconsensus
stop_grace_period: 1m
Expand Down Expand Up @@ -74,6 +78,8 @@ services:

validator:
restart: "unless-stopped"
build:
<<: *lh-build
image: lighthouse:local
user: lhvalidator
environment:
Expand Down Expand Up @@ -119,6 +125,8 @@ services:
validator-exit:
profiles: ["tools"]
restart: "no"
build:
<<: *lh-build
image: lighthouse:local
# Keys have 440 permissions. Root copies and chowns them,
# then switches to user lhvalidator
Expand Down
13 changes: 8 additions & 5 deletions lodestar-cl-only.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,18 @@ x-logging: &logging
max-file: "3"
tag: '{{.ImageName}}|{{.Name}}|{{.ImageFullID}}|{{.FullID}}'

x-build: &ls-build
context: ./lodestar
dockerfile: ${LS_DOCKERFILE}
args:
- BUILD_TARGET=${LS_SRC_BUILD_TARGET}
- DOCKER_TAG=${LS_DOCKER_TAG}

services:
consensus:
restart: "unless-stopped"
build:
context: ./lodestar
dockerfile: ${LS_DOCKERFILE}
args:
- BUILD_TARGET=${LS_SRC_BUILD_TARGET}
- DOCKER_TAG=${LS_DOCKER_TAG}
<<: *ls-build
image: lodestar:local
user: lsconsensus
stop_grace_period: 1m
Expand Down
11 changes: 11 additions & 0 deletions lodestar-vc-only.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,18 @@ x-logging: &logging
max-file: "3"
tag: '{{.ImageName}}|{{.Name}}|{{.ImageFullID}}|{{.FullID}}'

x-build: &ls-build
context: ./lodestar
dockerfile: ${LS_DOCKERFILE}
args:
- BUILD_TARGET=${LS_SRC_BUILD_TARGET}
- DOCKER_TAG=${LS_DOCKER_TAG}

services:
validator:
restart: "unless-stopped"
build:
<<: *ls-build
image: lodestar:local
user: lsvalidator
environment:
Expand Down Expand Up @@ -55,6 +64,8 @@ services:
validator-exit:
profiles: ["tools"]
restart: "no"
build:
<<: *ls-build
image: lodestar:local
user: lsvalidator
volumes:
Expand Down
17 changes: 12 additions & 5 deletions lodestar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,18 @@ x-logging: &logging
max-file: "3"
tag: '{{.ImageName}}|{{.Name}}|{{.ImageFullID}}|{{.FullID}}'

x-build: &ls-build
context: ./lodestar
dockerfile: ${LS_DOCKERFILE}
args:
- BUILD_TARGET=${LS_SRC_BUILD_TARGET}
- DOCKER_TAG=${LS_DOCKER_TAG}

services:
consensus:
restart: "unless-stopped"
build:
context: ./lodestar
dockerfile: ${LS_DOCKERFILE}
args:
- BUILD_TARGET=${LS_SRC_BUILD_TARGET}
- DOCKER_TAG=${LS_DOCKER_TAG}
<<: *ls-build
image: lodestar:local
user: lsconsensus
stop_grace_period: 1m
Expand Down Expand Up @@ -71,6 +74,8 @@ services:

validator:
restart: "unless-stopped"
build:
<<: *ls-build
image: lodestar:local
user: lsvalidator
environment:
Expand Down Expand Up @@ -118,6 +123,8 @@ services:
validator-exit:
profiles: ["tools"]
restart: "no"
build:
<<: *ls-build
image: lodestar:local
user: lsvalidator
volumes:
Expand Down
19 changes: 13 additions & 6 deletions nimbus-cl-only.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,20 @@ x-logging: &logging
max-file: "3"
tag: '{{.ImageName}}|{{.Name}}|{{.ImageFullID}}|{{.FullID}}'

x-build: &nimbus-build
context: ./nimbus
dockerfile: ${NIM_DOCKERFILE}
args:
- BUILD_TARGET=${NIM_SRC_BUILD_TARGET}
- DOCKER_TAG=${NIM_DOCKER_TAG}
- DOCKER_VC_TAG=${NIM_DOCKER_VC_TAG}

services:
consensus:
restart: "unless-stopped"
build:
target: consensus
context: ./nimbus
args:
- BUILD_TARGET=${NIM_SRC_BUILD_TARGET}
- DOCKER_TAG=${NIM_DOCKER_TAG}
- DOCKER_VC_TAG=${NIM_DOCKER_VC_TAG}
dockerfile: ${NIM_DOCKERFILE}
<<: *nimbus-build
image: nimbus:local
user: user
stop_grace_period: 1m
Expand Down Expand Up @@ -79,9 +82,13 @@ services:
- traefik.http.routers.${CL_HOST:-cl}lb.tls.certresolver=letsencrypt
- traefik.http.services.${CL_HOST:-cl}.loadbalancer.server.port=${CL_REST_PORT:-5052}

# Uses keystore-m file and CL, so does belong here
validator-exit:
profiles: ["tools"]
restart: "no"
build:
target: consensus
<<: *nimbus-build
image: nimbus:local
user: root
volumes:
Expand Down
15 changes: 9 additions & 6 deletions nimbus-vc-only.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,20 @@ x-logging: &logging
max-file: "3"
tag: '{{.ImageName}}|{{.Name}}|{{.ImageFullID}}|{{.FullID}}'

x-build: &nimbus-build
context: ./nimbus
dockerfile: ${NIM_DOCKERFILE}
args:
- BUILD_TARGET=${NIM_SRC_BUILD_TARGET}
- DOCKER_TAG=${NIM_DOCKER_TAG}
- DOCKER_VC_TAG=${NIM_DOCKER_VC_TAG}

services:
validator:
restart: "unless-stopped"
build:
target: validator
context: ./nimbus
args:
- BUILD_TARGET=${NIM_SRC_BUILD_TARGET}
- DOCKER_TAG=${NIM_DOCKER_TAG}
- DOCKER_VC_TAG=${NIM_DOCKER_VC_TAG}
dockerfile: ${NIM_DOCKERFILE}
<<: *nimbus-build
image: nimbus-validator:local
user: user
volumes:
Expand Down
18 changes: 12 additions & 6 deletions nimbus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,20 @@ x-logging: &logging
max-file: "3"
tag: '{{.ImageName}}|{{.Name}}|{{.ImageFullID}}|{{.FullID}}'

x-build: &nimbus-build
context: ./nimbus
dockerfile: ${NIM_DOCKERFILE}
args:
- BUILD_TARGET=${NIM_SRC_BUILD_TARGET}
- DOCKER_TAG=${NIM_DOCKER_TAG}
- DOCKER_VC_TAG=${NIM_DOCKER_VC_TAG}

services:
consensus:
restart: "unless-stopped"
build:
target: consensus
context: ./nimbus
args:
- BUILD_TARGET=${NIM_SRC_BUILD_TARGET}
- DOCKER_TAG=${NIM_DOCKER_TAG}
- DOCKER_VC_TAG=${NIM_DOCKER_VC_TAG}
dockerfile: ${NIM_DOCKERFILE}
<<: *nimbus-build
image: nimbus:local
user: user
stop_grace_period: 1m
Expand Down Expand Up @@ -89,6 +92,9 @@ services:
validator-exit:
profiles: ["tools"]
restart: "no"
build:
target: consensus
<<: *nimbus-build
image: nimbus:local
user: root
volumes:
Expand Down
2 changes: 1 addition & 1 deletion prometheus/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM prom/prometheus
FROM prom/prometheus:latest

COPY ./*-prom.yml /etc/prometheus/
COPY ./global.yml /etc/prometheus
Expand Down
Loading

0 comments on commit 284af28

Please sign in to comment.