diff --git a/docker-compose.yml b/docker-compose.yml index e144b7c74..bf4e1fdcf 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -39,7 +39,7 @@ services: start_period: 5s depends_on: plc: - condition: service_started + condition: service_healthy networks: [tngl] init-accounts: @@ -96,6 +96,12 @@ services: PORT: "8080" DB_CREDS_JSON: &DB_CREDS_JSON '{"username":"tnglr","password":"tnglr","host":"postgres","port":5432}' DB_MIGRATE_CREDS_JSON: *DB_CREDS_JSON + healthcheck: + test: ["CMD", "wget", "-qO-", "http://localhost:8080/_health"] + interval: 2s + timeout: 2s + retries: 60 + start_period: 10s depends_on: [postgres] networks: [tngl] diff --git a/localinfra/bobbin.Dockerfile b/localinfra/bobbin.Dockerfile index fde109904..c156dfa46 100644 --- a/localinfra/bobbin.Dockerfile +++ b/localinfra/bobbin.Dockerfile @@ -5,6 +5,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ ca-certificates pkg-config perl make cmake clang mold git curl wget \ && rm -rf /var/lib/apt/lists/* +RUN rustup component add rustfmt clippy \ + && rustup target add wasm32-unknown-unknown + ENV RUSTFLAGS="-C linker=clang -C link-arg=-fuse-ld=mold" ENV CARGO_HOME=/cargo ENV CARGO_TARGET_DIR=/target diff --git a/localinfra/scripts/warm-caches.sh b/localinfra/scripts/warm-caches.sh index 5406d019a..668437219 100755 --- a/localinfra/scripts/warm-caches.sh +++ b/localinfra/scripts/warm-caches.sh @@ -14,6 +14,15 @@ PROJECT="$(printf '%s' "$RAW_PROJECT" | tr '[:upper:]' '[:lower:]' | tr -cd 'a-z printf 'addressing volumes and images as %s, which is what compose normalizes %s to.\n' \ "$PROJECT" "$RAW_PROJECT" >&2 +# podman-compose and docker-compose disagree on built-image names +img() { + local n + for n in "${PROJECT}-$1:latest" "localhost/${PROJECT}_$1:latest"; do + if podman image exists "$n"; then printf '%s' "$n"; return; fi + done + printf '%s-%s:latest' "$PROJECT" "$1" +} + failed=() warm() { @@ -25,14 +34,14 @@ warm() { warm appview podman run --rm -v "$REPO_ROOT:/src" -w /src \ -v "${PROJECT}_go-cache:/go/cache" -v "${PROJECT}_go-mod-cache:/go/mod" \ -e CGO_ENABLED=1 -e GOCACHE=/go/cache -e GOMODCACHE=/go/mod \ - --entrypoint sh "localhost/${PROJECT}_appview:latest" \ - -c 'go mod download && go build ./cmd/appview' + --entrypoint sh "$(img appview)" \ + -c 'go mod download && go build -o /dev/null ./cmd/appview' while read -r svc dir vol; do warm "$svc" podman run --rm -v "$REPO_ROOT/$svc:/src" -w /src \ -v "${PROJECT}_${svc}-node-modules:/src/node_modules" \ -v "${PROJECT}_${vol}:/src/${dir}" \ - --entrypoint sh "localhost/${PROJECT}_${svc}:latest" \ + --entrypoint sh "$(img "$svc")" \ -c 'corepack pnpm install --frozen-lockfile --store-dir /src/node_modules/.pnpm-store'