Linting the schemas in this container worked without a problem but pushing it to the iglu-repo results in the following error:
No usable value for read
Did not find value which can be converted into java.lang.String
For our iglu-server we use the following config:
repo-server {
interface = "0.0.0.0"
port = 8080
pool = "cached"
}
# 'postgres' contains configuration options for the postgre instance the server is using
# 'dummy' is in-memory only storage
database {
type = "postgres"
host = "postgres"
port = 5432
dbname = "igludb"
username = "postgres"
password = "iglusecret"
driver = "org.postgresql.Driver"
maxPoolSize = 5
pool = {
}
}
# Enable additional debug endpoint to output all internal state
debug = true
And the iglu-server has an interface at:
[2020-07-29T08:15:26.313Z] [ioapp-pool-1-thread-1] INFO org.http4s.server.blaze.BlazeServerBuilder - http4s v0.20.19 on blaze v0.14.11 started at http://0.0.0.0:8080/
Maybe our approach of setting up snowplow-micro is too complicated but it would be good to know whether we use the igluctl static push command correctly or whether something about our iglu-server config is incorrect.
You don’t need to have a new image to run igluctl subcommands or iglu server. I’d recommend using official docker images of iglu server and igluctl, which allows using subcommands as if you’re using the executable.
Please have a look at a sample run. In your scenario, you need the following to start with:
$ docker run snowplow-docker-registry.bintray.io/snowplow/igluctl:0.6.0 lint
It’ll show you expected parameters and flags with their meaning.
Please also check
$ docker run snowplow-docker-registry.bintray.io/snowplow/igluctl:0.6.0 static push
to see usage, options and flags with their meanings.
To run Iglu Server with Postgres, please have a look at our example running Iglu Server and Postgres together in a docker-compose example where README shows how to push your schemas to Iglu Server.
I believe using official images will ease your workflow. Please let us know how it goes!
The suggestion I made above (July 2020) does not work with the latest versions of snowplow-micro (since September 2020). Briefly, it is because the new micro uses a newer version of iglu client, which is more strict about uri format.
I have two alternative suggestions for how test and validate schemas during development:
This one is easiest to describe using a docker-compose file. In this example I use halverneus/static-file-server to serve the schemas - but there are plenty of alternative static file servers. Notice that I use 2 docker containers - and therefore it is simpler than the original suggestion in this thread, which required 4 docker containers.
My micro directory is mounted into the micro docker container. This directory has the micro.conf and iglu.json files. My iglu.json file is configured to point to the local iglu server on port 8080, plus iglu central
I’ve tried this with a very simple custom schema, but the record always ends up in micro’s ‘bad’ bucket.
Is there a way I can check if snowplow is able to see my local iglu server?