-
Notifications
You must be signed in to change notification settings - Fork 7
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
Update universal/scalardl module to use schema loader image for Cassandra #185
Conversation
@@ -13,6 +16,7 @@ resource "null_resource" "scalardl_image" { | |||
|
|||
triggers = { | |||
scalar_tag = var.scalardl_image_tag | |||
triggers = join(",", var.triggers) |
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 add triggers
here ? Do we need to rebuild the image locally due to changes in bastion or Cassandra?
@@ -27,7 +31,6 @@ resource "null_resource" "scalardl_image_push" { | |||
|
|||
triggers = { | |||
docker_image = null_resource.scalardl_image[0].id | |||
triggers = join(",", var.triggers) |
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.
Is it related to this PR?
Maybe this is necessary, because if the bastion is replaced, we need to upload again to bastion.
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 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.
Thanks! I understand that this is an improvement on the triggers. 👍
@@ -148,7 +191,7 @@ resource "null_resource" "scalardl_schema" { | |||
|
|||
provisioner "remote-exec" { | |||
inline = [ | |||
"docker run -e CASSANDRA_REPLICATION_FACTOR=${var.replication_factor} --rm ${local.scalar_image} dockerize -template create_schema.cql.tmpl:create_schema.cql -wait tcp://${local.scalar_cassandra_host}:9042 -timeout 30s cqlsh --cqlversion=3.4.4 ${local.scalar_cassandra_host} -u '${var.cassandra_username}' -p '${var.cassandra_password}' -f create_schema.cql" | |||
"docker run -e CASSANDRA_HOST='${local.scalar_cassandra_host}' -e CASSANDRA_USERNAME='${var.cassandra_username}' -e CASSANDRA_PASSWORD='${var.cassandra_password}' -e CASSANDRA_REPLICATION_FACTOR=${var.replication_factor} --rm ${local.schema_loader_cassandra_image}" |
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 use single quotes? for escaping?
I'm a little concerned when the password contains single quotes.
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.
It seems that single quotations are used because they are surrounded by double quotations. The problem is the same as before. I will check if it fails if the username or password contains any single quotation, and report it as a bug 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.
Thanks!
It's an existing problem, and I think it's fine to consider it separately.
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.
LGTM !
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.
LGTM! 👍
https://scalar-labs.atlassian.net/browse/DLT-6879
This PR changes
universal/scalardl
module to use scalardl-schama-loader-cassandra for the initial schema creation. The image is needed to be transferred to one of the scalardl hosts in the same way as thescalar-ledger
image.The
cqlsh
andcreate_schema.cql
script in scalar-ledger image is no longer used. (They are going to be removed in the next version of scalar-ledger.)