-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
upgrading dockest to 2.1.0 #94
Merged
Merged
Changes from 6 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
f4b52fa
upgrading dockest
dskatz22 e76f3f0
Merge branch 'master' into upgrade-dockest
dskatz22 59f26aa
Increasing total wait time to 35s like before
dskatz22 737ae1a
add to timeout
dskatz22 08eaf6e
Sleeping more
dskatz22 e0a02aa
Adding back Avro tools to pull ahead of time
dskatz22 b4602a1
Merge branch 'master' into upgrade-dockest
dskatz22 66d3bf8
Merge branch 'master' into upgrade-dockest
dskatz22 424281e
Merge branch 'master' into upgrade-dockest
dskatz22 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,3 +27,7 @@ release | |
# website | ||
# | ||
build | ||
|
||
# test | ||
docker-compose.dockest-generated.yml | ||
dockest-error.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,30 @@ | ||
import { default as Dockest, runners, logLevel } from 'dockest' | ||
import { Dockest, sleepWithLog, logLevel } from 'dockest' | ||
import { DockestService } from 'dockest/dist/@types' | ||
|
||
const { ZooKeeperRunner, SimpleRunner, KafkaRunner } = runners | ||
|
||
const zooKeeperRunner = new ZooKeeperRunner({ | ||
service: 'zooKeeper', | ||
ports: { | ||
[ZooKeeperRunner.DEFAULT_PORT]: ZooKeeperRunner.DEFAULT_PORT, | ||
}, | ||
}) | ||
|
||
/** | ||
* Debug SchemaRegistry with CURL: https://docs.confluent.io/2.0.0/schema-registry/docs/intro.html | ||
*/ | ||
const schemaRegistryRunner = new SimpleRunner({ | ||
service: 'schemaRegistry', | ||
image: 'confluentinc/cp-schema-registry:5.3.0', | ||
ports: { | ||
'8982': '8081', | ||
}, | ||
environment: { | ||
SCHEMA_REGISTRY_KAFKASTORE_CONNECTION_URL: `${zooKeeperRunner.runnerConfig.service}:${ZooKeeperRunner.DEFAULT_PORT}`, | ||
SCHEMA_REGISTRY_HOST_NAME: 'localhost', | ||
}, | ||
}) | ||
|
||
const kafkaRunner = new KafkaRunner({ | ||
service: 'kafka', | ||
image: 'confluentinc/cp-kafka:5.2.2', | ||
dependsOn: [zooKeeperRunner], | ||
ports: { | ||
[KafkaRunner.DEFAULT_PORT_PLAINTEXT]: KafkaRunner.DEFAULT_PORT_PLAINTEXT, | ||
const dockest = new Dockest({ | ||
composeFile: 'docker-compose.yml', | ||
dumpErrors: true, | ||
jestLib: require('jest'), | ||
jestOpts: { | ||
updateSnapshot: true, | ||
}, | ||
logLevel: logLevel.DEBUG, | ||
}) | ||
|
||
const dockest = new Dockest({ | ||
runners: [kafkaRunner, schemaRegistryRunner], | ||
jest: { | ||
lib: require('jest'), | ||
verbose: true, | ||
const dockestServices: DockestService[] = [ | ||
{ | ||
serviceName: 'zooKeeper', | ||
dependents: [ | ||
{ | ||
serviceName: 'kafka', | ||
readinessCheck: () => sleepWithLog(10, `Sleeping for Kafka`), | ||
}, | ||
], | ||
}, | ||
opts: { | ||
logLevel: logLevel.DEBUG, | ||
afterSetupSleep: 35, | ||
dev: { | ||
debug: process.argv[2] === 'debug' || process.argv[2] === 'dev', | ||
}, | ||
{ | ||
serviceName: 'schemaRegistry', | ||
readinessCheck: () => sleepWithLog(35, `Sleeping for Schema Registry`), | ||
}, | ||
}) | ||
] | ||
|
||
dockest.run() | ||
dockest.run(dockestServices) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to expose this port for avro-tools?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a bug in dockest I believe where the docker-compose must define a port. I'll look into the root cause and see if there is a workaround that doesn't require this hack.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@erikengervall is this something I should address in dockest, or is there a known workaround?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey! There's even a version 3.0.0 of Dockest in the making which will include a number of improvements. Can't tell exactly what the ETA is, but there's a few PRs queued to be merged and some beta testing required before we can release.
I'd say this port-hack is okay for now, I could circle back to this piece of code once Dockest v3 is out and this has been addressed 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good, ill take a look as well.