Files
michael hohn df89b81a6e Add hepc-serve-global and stabilize container startup
- Introduce hepc-serve-global to serve global MRVA values from
  hohnlab.org/mrva/values without local DB provisioning.
- Keep schema initialization symmetric across server and agent, while
  serializing PostgreSQL DDL via a global advisory lock to prevent
  concurrent CREATE TABLE races.
- Pin RabbitMQ image to rabbitmq:3.13.7-management to avoid credential
  incompatibilities introduced by upstream image changes.
- Remove pre-hashed RabbitMQ credentials and return to deterministic
  user/password initialization.
- Eliminate reliance on implicit container state to ensure reproducible
  startup.

The primary purpose of this change is integration of global MRVA values;
the remaining fixes are required to make the new startup path reliable.
2026-01-08 16:17:34 -08:00
..

HEPC Container Image Build

Follow the Usage Sample in mrvahepc to set up the repository and data there. Then:

Build container

  cd ~/work-gh/mrva/mrva-docker/containers/hepc # this directory
  rm -fR ./mrvahepc && cp -r  ../../../mrvahepc .

  # Usual build
  docker build -t mrva-hepc-container:0.4.0 -f Dockerfile .

  # Build with full output, e.g. RUN ls 
  docker build --progress=plain --no-cache -t mrva-hepc-container:0.4.0 -f Dockerfile .

  # tag it
  cd ~/work-gh/mrva/mrva-docker/containers/hepc &&\
      docker tag mrva-hepc-container:0.4.0 \
             ghcr.io/hohn/mrva-hepc-container:0.4.0

  # Run standalone
  docker run -p 8070:8070 -ti mrva-hepc-container:0.4.0

  # shell in  hepc
  docker run -ti mrva-hepc-container:0.4.0 /bin/bash

  # Test server from host.  From container, change url to http://hepc:8070/
  curl 127.0.0.1:8070/index -o - 2>/dev/null | wc -l

  curl 127.0.0.1:8070/api/v1/latest_results/codeql-all \
       -o - 2>/dev/null | wc -l

  url=$(curl 127.0.0.1:8070/api/v1/latest_results/codeql-all \
             -o - 2>/dev/null | head -1 | jq -r .result_url)
  echo $url
  # http://hepc/db/db-collection.tmp/aircrack-ng-aircrack-ng-ctsj-41ebbe.zip

  wget $(echo $url|sed 's|http://hepc|http://127.0.0.1:8070|g;')

Access this container

from host, when run by docker-compose

  cd ~/work-gh/mrva/mrva-docker/containers/hepc
  docker exec -it mrva-hepc bash

from another

  # Enter container
  docker exec -it mrva-docker-client-ghmrva-1 bash

  # Request index 
  curl hepc:8070/index

Push this container

  # Push container
  docker tag mrva-hepc-container:0.4.0 ghcr.io/hohn/mrva-hepc-container:0.4.0
  docker push ghcr.io/hohn/mrva-hepc-container:0.4.0

Test the registry image

  # Test pushed container
  docker pull ghcr.io/hohn/mrva-hepc-container:0.4.0

  docker run                                              \
         -p 8070:8070                                     \
         --name test-mrva-hepc-container                  \
         --rm -it ghcr.io/hohn/mrva-hepc-container:0.4.0


  curl 127.0.0.1:8070/index -o - 2>/dev/null | wc -l