My pipeline initializes a database (elasticsearch) and has several different containers import data into that db. Once the importers finished, I can export from the cache.
This works great! 1/2 the time...
The other 1/2 the time I hit a no such host from one of the import containers. I've just been re-running the job until it succeeds, but some of the individual importers are many hours long, so it's a painful debug loop.
Is there something more I need to do to make the service reliably accessible?
The full code is here: https://github.com/headwaymaps/headway/blob/fc9e62b5bdbd75c814901b49c4b37b0d79baae66/dagger/main.go#L596
But the synopsis is here:
elasticsearchService := dag.Container().
From("pelias/elasticsearch:8.12.2-beta").
WithMountedCache("/usr/share/elasticsearch/data", elasticsearchCache, opts).
WithExposedPort(9200).
AsService()
importerContainer1.WithServiceBinding("pelias-elasticsearch", elasticsearchService).
WithExec("import-some-stuff").
Sync(ctx)
importerContainer2.WithServiceBinding("pelias-elasticsearch", elasticsearchService).
WithExec("import-some-other-stuff").
Sync(ctx)
...