-
Notifications
You must be signed in to change notification settings - Fork 72
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
Bootstrapping docker container for sample datasets #803
base: development
Are you sure you want to change the base?
Bootstrapping docker container for sample datasets #803
Conversation
PR Review ChecklistDo not edit the content of this comment. The PR reviewer should simply update this comment by ticking each review item below, as they get completed. Trivial Change
Code
Architecture
|
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.
self review
sleep 30 | ||
docker exec test-typedb-samples-container typedb console --command="database list" && export TEST_SUCCESS=0 || export TEST_SUCCESS=1 | ||
docker stop test-typedb-samples-container; docker rm test-typedb-samples-container | ||
exit $TEST_SUCCESS |
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.
How often would we want to run this test?
It shouldn't be significantly longer than testing it against a local installation of TypeDB, which is the alternative.
The test has run successfully in CI: https://factory.vaticle.com/krishnangovindraj/typedb-docs/1168c68815d9f9fa01580dbc4f8a9233607d677a/build/1/correctness/1/test-sample-bootstrapper/1
@@ -0,0 +1,12 @@ | |||
# Track version for breaking changes. | |||
bootstrapper-version: 1.0.0 |
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.
A bootstrapper-version
for if/when we have to make breaking changes.
COPY typedb-samples-docker/bootstrapper.py /typedb-samples | ||
|
||
# We need the 'exec' before typedb server, or the SIGTERM from `docker stop` will not forwarded to it | ||
CMD python3 -u bootstrapper.py && exec typedb server |
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.
The lack of exec on the first also means we can't interrupt the container bootstrap
VERBOSE = os.environ.get("BOOTSTRAPPER_VERBOSE", "false").lower() != "false" | ||
# Overrides for testing with local files | ||
CONFIG_OVERRIDE = os.environ.get("BOOTSTRAPPER_CONFIG", None) | ||
DATASET_ROOT_OVERRIDE = os.environ.get("BOOTSTRAPPER_DATASET_ROOT", None) |
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.
Overrides for testing with local files. This can be used to test against a local typedb instance, or in a locally built docker container as the CI test does.
What is the goal of this PR?
Introduces a docker image which downloads a config file from GitHub and loads the datasets into a typedb version specified in the config.
What are the changes implemented in this PR?
Adds
boostrapper.py
: Python script which sets up theReasons for 'do not merge'
jameswhiteside/development
. We can edit this out / Add a sample instead.1.0.0
of the docker image to dockerhub.We should not need to release a new version unless the bootstrapping process (or something hardcoded in it) changes.