Closed blackheaven closed 4 years ago
Thank you Gautier! This is looking great!
Regarding release on hackage, do you have a sense of what still needs to happen for a 0.1 release? Here are a few random things that come to mind
Let me know if you have suggestions and/or want to spend time on anything so that we can divide the workload.
Also thanks again for the PR much appreciated!
Cool, yes, nice ideas, I will have few more:
docker inspect
Makes sense! Also I think it makes sense to add a WaitUntilReady that blocks until the container listens on some defined port. That should eliminate your threadDelay usage.
Hey @blackheaven, I addressed all the points. Do you mind taking a look at the master branch and see if there is anything obviously missing?
Great, two last points:
id
to containerId
IMO you are good to publish it on hackage.
- rename id to containerId
Do you think I should prefix every field of Container
with container
or just id
?
- have a log-based wait strategy
FWIW we have waitForLogLine
:
wairForLogLine Stdout (" completed with " `LazyText.isInfixOf`)
Your example would boil down to something like
containers :: MonadDocker m => m (Channel, Channel)
containers = do
let (login, password) = ("guest", "guest")
container <- run $ containerRequest (fromTag "rabbitmq:3.8.4")
& setExpose [5672]
& setWaitingFor (waitForLogLine (" completed with " `LazyText.isInfixOf`))
connection <- liftIO $ openConnection (containerIp container) (containerPort container 5672) "/" login password
(,)
<$> liftIO (openChannel connection)
<*> liftIO (openChannel connection)
Do you think I should prefix every field of
Container
withcontainer
or justid
?
every field
FWIW we have
waitForLogLine
:
I have missed it, that's awesome!
A last set of remarks:
lens
seems a bit heavy for your usecasedependencies bounds does not match to any stable stack stable release
What does that mean? How would I check against those?
relying on lens seems a bit heavy for your usecase
I agree. It made for such beatiful traversal of the JSON stuff.
dependencies bounds does not match to any stable stack stable release
What does that mean? How would I check against those?
Just configure stack with lts-16.8
you'll get:
In the dependencies for testcontainers-0.1.0.0:
lens-4.18.1 from stack configuration does not match >=4.19.2 && <5 (latest matching version
is 4.19.2)
network-3.1.1.1 from stack configuration does not match >=2.8.0 && <2.9 (latest matching
version is 2.8.0.1)
unliftio-core-0.1.2.0 from stack configuration does not match >=0.2.0 && <0.3 (latest
matching version is 0.2.0.1)
needed due to amqp-streamly-0.2.0 -> testcontainers-0.1.0.0
Some different approaches to resolving this:
* Set 'allow-newer: true'
in /home/black/.stack/config.yaml to ignore all version constraints and build anyway.
* Recommended action: try adding the following to your extra-deps
in /home/black/programmation/haskell/amqp-streamly/stack.yaml:
- lens-4.19.2@sha256:f0570ca0e4624d9daa57256f00f514e87be155401583fa1665faba47376c63a7,16053
- network-2.8.0.1@sha256:0f165dffa752d8cde30c2bde86f80609c4f1dc5eeb3182d593041f97839c5b3b,3011
- unliftio-core-0.2.0.1@sha256:9b3e44ea9aacacbfc35b3b54015af450091916ac3618a41868ebf6546977659a,1082
Plan construction failed.
relying on lens seems a bit heavy for your usecase
I agree. It made for such beatiful traversal of the JSON stuff.
I thought there were a optics-aeson
library :/
Are you able to provide better bounds? I don't have stack installed and all. If you know how to get to it it would be cool if you provided them. I will look at it eow else.
Oh, optics-aeson sounds promising. Will switch to that, thanks!
Yes and yes, I am on it (better bounds and optics-aeson
)
Hello,
I have seen your project during ZuriHac, and I have been quite busy in the mean time, I have finally find some for another project of mine and I make use of it.
This PR packs up few improvements:
stack
I also take the opportunity to do some suggestions:
hpack
Do not hesitate to ask for changes.