Skip to content
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

Register 'default' domain during auto-setup image startup #6619

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
tested example domain registration
  • Loading branch information
samkitshah1262 committed Jan 28, 2025
commit 4cb5fc31f013016f39955bcd523b468ae1e95509
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ COPY config/dynamicconfig /etc/cadence/config/dynamicconfig
COPY config/credentials /etc/cadence/config/credentials
COPY docker/config_template.yaml /etc/cadence/config
COPY docker/start-cadence.sh /start-cadence.sh
COPY docker/domain /domain
COPY docker/domain /etc/cadence/domain

WORKDIR /etc/cadence

Expand Down
10 changes: 5 additions & 5 deletions docker/domain/cassandra.cql
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ INSERT INTO domains (
123e4567-e89b-12d3-a456-426614174000, -- Replace with your UUID
{
id: 123e4567-e89b-12d3-a456-426614174000, -- Replace with your UUID
name: 'example-domain',
name: 'samkit_domain',
status: 0, -- Registered
description: 'This is an example domain.',
data: {'key1': 'value1', 'key2': 'value2'},
Expand All @@ -28,10 +28,10 @@ INSERT INTO domains_by_name_v2 (
notification_version
) VALUES (
0,
'example-domain',
'default',
{
id: 123e4567-e89b-12d3-a456-426614174000, -- Replace with your UUID
name: 'example-domain',
name: 'default',
status: 0, -- Registered
description: 'This is an example domain.',
data: {'key1': 'value1', 'key2': 'value2'},
Expand All @@ -44,8 +44,8 @@ INSERT INTO domains_by_name_v2 (
visibility_archival_status: 0 -- Default to disabled
},
{
active_cluster_name: 'active-cluster',
clusters: [{cluster_name: 'active-cluster'}, {cluster_name: 'standby-cluster'}]
active_cluster_name: 'cluster0',
clusters: [{cluster_name: 'cluster0'}]
},
True, -- is_global_domain
1, -- config_version
Expand Down
2 changes: 1 addition & 1 deletion docker/domain/mysql.sql
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ INSERT INTO domains (
) VALUES (
54321, -- Default shard_id
UNHEX(REPLACE(UUID(), '-', '')), -- Generate a 16-byte UUID
'example-domain', -- Domain name
'default', -- Domain name
'{"key1":"value1","key2":"value2"}', -- Example data as JSON
'json', -- Encoding type
1 -- Set to 1 for a global domain
Expand Down
2 changes: 1 addition & 1 deletion docker/domain/postgres.sql
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ INSERT INTO domains (
) VALUES (
54321, -- Default shard_id
gen_random_uuid(), -- Generate a UUID for the domain ID
'example-domain', -- Domain name
'default', -- Domain name
'{"key1":"value1","key2":"value2"}', -- Example JSON data
'json', -- Encoding type
TRUE -- Set to TRUE for a global domain
Expand Down
2 changes: 1 addition & 1 deletion docker/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ setup_mysql_schema() {
cadence-sql-tool --ep $MYSQL_SEEDS -u $MYSQL_USER --pw $MYSQL_PWD --db $VISIBILITY_DBNAME $CONNECT_ATTR setup-schema -v 0.0
cadence-sql-tool --ep $MYSQL_SEEDS -u $MYSQL_USER --pw $MYSQL_PWD --db $VISIBILITY_DBNAME $CONNECT_ATTR update-schema -d $VISIBILITY_SCHEMA_DIR
echo "Registering domain for MySQL..."
mysql -h $MYSQL_HOST -u $MYSQL_USER -p$MYSQL_PASSWORD $MYSQL_DATABASE < /etc/cadence/domain/mysql.sql
mysql -h $MYSQL_HOST -u $MYSQL_USER -p $MYSQL_PASSWORD $MYSQL_DATABASE < /etc/cadence/domain/mysql.sql
}

setup_postgres_schema() {
Expand Down