a8f5b3c828
Pipeline ejecutable que orquesta: crear red Docker, pull de imágenes, iniciar Postgres con volume persistente, health check con retry exponencial (pg_isready), e iniciar Metabase conectado via red interna. Configurable con flags: --project, --metabase-port, --pg-user, etc. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2.2 KiB
2.2 KiB
name, kind, lang, domain, version, purity, signature, description, tags, uses_functions, uses_types, returns, returns_optional, error_type, imports, tested, tests, test_file_path, file_path
| name | kind | lang | domain | version | purity | signature | description | tags | uses_functions | uses_types | returns | returns_optional | error_type | imports | tested | tests | test_file_path | file_path | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| init_metabase | pipeline | go | infra | 1.0.0 | impure | func main() — Despliega stack Metabase + Postgres en Docker | Pipeline que inicializa un contenedor Metabase con su base de datos Postgres. Crea red Docker, pull de imágenes, inicia Postgres con volume persistente, espera health check y lanza Metabase conectado. |
|
|
|
false | error_go_core |
|
false | functions/pipelines/init_metabase/main.go |
Ejemplo
go run functions/pipelines/init_metabase/main.go \
--project analytics \
--metabase-port 3000 \
--pg-port 5432 \
--pg-user metabase \
--pg-password metabase \
--pg-database metabase
Salida JSON:
{
"network_id": "abc123...",
"postgres_id": "def456...",
"metabase_id": "ghi789...",
"network_name": "analytics-net",
"postgres_name": "analytics-postgres",
"metabase_name": "analytics-metabase",
"metabase_url": "http://localhost:3000"
}
Notas
El pipeline orquesta 5 pasos secuenciales:
- Red Docker — crea
{project}-netcon driver bridge - Pull — descarga
postgres:16ymetabase/metabase:latest - Postgres — inicia con volume persistente (named volume por defecto o bind mount con
--pg-volume) - Health check — retry exponencial (hasta ~34 min) con
pg_isreadydentro del contenedor - Metabase — conecta a Postgres via red interna, expone en puerto configurable
Reutiliza conceptualmente docker_create_network, docker_pull_image, docker_run_container, docker_inspect_container y retry_with_backoff, reimplementadas inline por ser un ejecutable independiente.
Para destruir el stack:
docker stop analytics-metabase analytics-postgres
docker rm analytics-metabase analytics-postgres
docker network rm analytics-net